Index: /branches/eam_branch_20071222/Ohana/src/kapa2/.cvsignore
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/.cvsignore	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/.cvsignore	(revision 15879)
@@ -0,0 +1,1 @@
+bin
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/Makefile	(revision 15879)
@@ -0,0 +1,91 @@
+default: kapa
+help:
+	@echo "make options: kapa (default)"
+
+include ../../Makefile.System
+HOME 	=	$(ROOT)/src/kapa2
+LIB	=	$(HOME)/lib
+BIN	=	$(HOME)/bin
+LIB	=	$(HOME)/lib
+SRC	=	$(HOME)/src
+INC	=	$(HOME)/include
+include ../../Makefile.Common
+
+# programs may add their own internal requirements here
+FULL_CFLAGS   = $(BASE_CFLAGS)
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = -lkapa -ldvo -lFITS -lohana $(BASE_LDFLAGS)
+
+LDDEPS  = $(DESTLIB)/libkapa.a $(DESTLIB)/libdvo.a $(DESTLIB)/libFITS.a $(DESTLIB)/libohana.a
+INDEPS  = $(DESTINC)/kapa.h $(DESTINC)/dvo.h $(DESTINC)/gfitsio.h $(DESTINC)/ohana.h
+
+kapa: $(BIN)/kapa.$(ARCH)
+install: $(DESTBIN)/kapa
+
+KAPA = \
+$(SRC)/kapa.$(ARCH).o                     $(SRC)/args.$(ARCH).o               \
+$(SRC)/SetUpGraphic.$(ARCH).o             $(SRC)/NameWindow.$(ARCH).o         \
+$(SRC)/CheckColors.$(ARCH).o              $(SRC)/MakeGC.$(ARCH).o             \
+$(SRC)/CheckDisplayName.$(ARCH).o  	  $(SRC)/MapWindow.$(ARCH).o          \
+$(SRC)/CheckGeometry.$(ARCH).o     	  $(SRC)/OpenDisplay.$(ARCH).o        \
+$(SRC)/CloseDisplay.$(ARCH).o      	  $(SRC)/QuitX.$(ARCH).o              \
+$(SRC)/CreateWindow.$(ARCH).o      	  $(SRC)/SetNormalHints.$(ARCH).o     \
+$(SRC)/GetColor.$(ARCH).o          	  $(SRC)/SetWMHints.$(ARCH).o         \
+$(SRC)/LoadFont.$(ARCH).o          	  $(SRC)/TopWindow.$(ARCH).o          \
+$(SRC)/MakeCursor.$(ARCH).o		  $(SRC)/FlushDisplay.$(ARCH).o       \
+$(SRC)/LoadObject.$(ARCH).o		  $(SRC)/LoadFrame.$(ARCH).o	      \
+$(SRC)/LoadTextlines.$(ARCH).o		  $(SRC)/LoadLabels.$(ARCH).o         \
+$(SRC)/DrawObjects.$(ARCH).o              $(SRC)/DrawFrame.$(ARCH).o          \
+$(SRC)/DrawTextlines.$(ARCH).o		  $(SRC)/DrawLabels.$(ARCH).o         \
+$(SRC)/PSObjects.$(ARCH).o		  $(SRC)/PSFrame.$(ARCH).o            \
+$(SRC)/PSLabels.$(ARCH).o		  $(SRC)/PSTextlines.$(ARCH).o        \
+$(SRC)/bDrawObjects.$(ARCH).o	  	  $(SRC)/bDrawFrame.$(ARCH).o         \
+$(SRC)/bDrawLabels.$(ARCH).o              $(SRC)/bDrawIt.$(ARCH).o            \
+$(SRC)/PNGit.$(ARCH).o                    $(SRC)/PPMit.$(ARCH).o	      \
+$(SRC)/PSit.$(ARCH).o                     $(SRC)/CrossHairs.$(ARCH).o         \
+$(SRC)/CheckPipe.$(ARCH).o                $(SRC)/EventLoop.$(ARCH).o          \
+$(SRC)/Reconfig.$(ARCH).o                 $(SRC)/Refresh.$(ARCH).o            \
+$(SRC)/Layout.$(ARCH).o		  	  $(SRC)/Sections.$(ARCH).o	      \
+$(SRC)/Graphs.$(ARCH).o                   $(SRC)/SetGraphSize.$(ARCH).o       \
+$(SRC)/Resize.$(ARCH).o                   $(SRC)/ErasePlots.$(ARCH).o         \
+$(SRC)/EraseImage.$(ARCH).o         	  $(SRC)/SetToolbox.$(ARCH).o         \
+$(SRC)/EraseCurrentPlot.$(ARCH).o         $(SRC)/EraseSections.$(ARCH).o      \
+$(SRC)/SetSection.$(ARCH).o		  $(SRC)/DefineSection.$(ARCH).o      \
+$(SRC)/SetLimits.$(ARCH).o                $(SRC)/SetFont.$(ARCH).o            \
+$(SRC)/Center.$(ARCH).o                   $(SRC)/Remap.$(ARCH).o              \
+$(SRC)/Remap8.$(ARCH).o                   $(SRC)/Remap16.$(ARCH).o            \
+$(SRC)/Remap24.$(ARCH).o                  $(SRC)/Remap32.$(ARCH).o            \
+$(SRC)/LoadPicture.$(ARCH).o              $(SRC)/Image.$(ARCH).o              \
+$(SRC)/SetImageSize.$(ARCH).o             $(SRC)/GetPixelCount.$(ARCH).o      \
+$(SRC)/StatusBox.$(ARCH).o                $(SRC)/UpdateStatusBox.$(ARCH).o    \
+$(SRC)/DrawButton.$(ARCH).o               $(SRC)/DrawBitmap.$(ARCH).o         \
+$(SRC)/hh_hms.$(ARCH).o	                  $(SRC)/CreateZoom.$(ARCH).o         \
+$(SRC)/CreateZoom8.$(ARCH).o              $(SRC)/CreateZoom16.$(ARCH).o       \
+$(SRC)/CreateZoom24.$(ARCH).o             $(SRC)/CreateZoom32.$(ARCH).o       \
+$(SRC)/CreatePicture.$(ARCH).o            $(SRC)/CreateColorbar.$(ARCH).o     \
+$(SRC)/MakeColormap.$(ARCH).o		  $(SRC)/SetColormap.$(ARCH).o        \
+$(SRC)/PaintOverlay.$(ARCH).o		  $(SRC)/SetGraphData.$(ARCH).o       \
+$(SRC)/LoadOverlay.$(ARCH).o		  $(SRC)/EraseOverlay.$(ARCH).o       \
+$(SRC)/SaveOverlay.$(ARCH).o              $(SRC)/SetImageData.$(ARCH).o       \
+$(SRC)/CSaveOverlay.$(ARCH).o		  $(SRC)/EraseOverlay.$(ARCH).o       \
+$(SRC)/CheckVisual.$(ARCH).o              $(SRC)/CursorOps.$(ARCH).o          \
+$(SRC)/InterpretKeys.$(ARCH).o            $(SRC)/InterpretPresses.$(ARCH).o   \
+$(SRC)/DragColorbar.$(ARCH).o             $(SRC)/Reorient.$(ARCH).o           \
+$(SRC)/InButton.$(ARCH).o                 $(SRC)/InPicture.$(ARCH).o          \
+$(SRC)/CheckButtons.$(ARCH).o             $(SRC)/InvertButton.$(ARCH).o       \
+$(SRC)/UpdatePointer.$(ARCH).o            $(SRC)/JPEGit24.$(ARCH).o           \
+$(SRC)/bDrawOverlay.$(ARCH).o             $(SRC)/ButtonFunctions.$(ARCH).o    \
+$(SRC)/PSimage.$(ARCH).o                  $(SRC)/PSPixmap.$(ARCH).o           \
+$(SRC)/PSOverlay.$(ARCH).o
+
+OBJ  =  $(KAPA)
+
+# dependancy rules for include files ########################
+$(OBJ): $(INC)/Ximage.h \
+	$(INC)/constants.h \
+	$(INC)/structures.h \
+	$(INC)/prototypes.h
+
+$(OBJ): $(INDEPS) $(LDDEPS)
+
+$(BIN)/kapa.$(ARCH): $(OBJ)
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/doc/UpgradeConcepts.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/doc/UpgradeConcepts.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/doc/UpgradeConcepts.txt	(revision 15879)
@@ -0,0 +1,54 @@
+
+2007.05.08
+
+  User Commands:
+  * Add a section (position, type, name)
+  * Add a section element (add graph, add image)
+  * Del a section (by name)
+  * Del a section element (del graph, del image)
+  * Resize window (resizes each section)
+  * Set active section
+  * Get active section
+
+2007.05.06
+
+I am examining plans to upgrade the Kapa / Kii programs.  I have several ideas on this topic:
+
+* Completely merge the code base.  There are many common features, and
+  the merge will be easy.  The biggest difference between them from a
+  programming point of view is that Kapa uses global variables for the
+  layout and graphic (and other minor data), while Kii passes around
+  the Graphic / Layout elements.
+
+  The more object-oriented way to do this is to have private static
+  data for these concepts and to provide accessor functions to operate
+  on or retreive these pointers.  
+
+* Allow an arbitrary number of the graph / image widgets.  The image
+  widget should be considered a single item, which includes the main
+  image window, the zoom box, the status box, the buttons, etc.  The
+  positioning of the multiple graph / image elements in a single
+  window could be equivalent to the 'section' command for the graph
+  sub-boxes.  An image or a graph could be place at any X,Y,dX,dY
+  position with X,Y having a range of 0-1.  In addition, a graph
+  could be optionally tied to a specific image, with the location
+  determined by the image window location (ie, outer box of the image
+  window matched to bounding box of the graph).
+
+* Event parsing would need to go through the list of graph / image
+  elements to determine if the corresond to any of them.  
+
+* Drawing should be done in the order: images first, graphs second.
+  The sequence for the images and / or graphs should be adjustable.
+
+* create an equivalent to the zoom box which is a wide full-view of
+  the current image.
+
+* add the image flipping; this may be easiest using multiple versions
+  of the code with the correct sign flips...
+
+* carry the image data as a full 32 bit buffer
+
+* (optionally?) listed on an IP socket?
+
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/Ximage.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/Ximage.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/Ximage.h	(revision 15879)
@@ -0,0 +1,7 @@
+# include <Xohana.h>
+# include <dvo.h>
+# include <kapa.h>
+# include "constants.h"
+# include "structures.h"
+# include "prototypes.h"
+# include "globals.h"
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/alphabet.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/alphabet.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/alphabet.h	(revision 15879)
@@ -0,0 +1,53 @@
+# include "../rotfont/times8.h"
+# include "../rotfont/times12.h"
+# include "../rotfont/times14.h"
+# include "../rotfont/times18.h"
+# include "../rotfont/times24.h"
+
+# include "../rotfont/courier8.h"
+# include "../rotfont/courier12.h"
+# include "../rotfont/courier14.h"
+# include "../rotfont/courier18.h"
+# include "../rotfont/courier24.h"
+
+# include "../rotfont/helvetica8.h"
+# include "../rotfont/helvetica12.h"
+# include "../rotfont/helvetica14.h"
+# include "../rotfont/helvetica18.h"
+# include "../rotfont/helvetica24.h"
+
+# include "../rotfont/symbol8.h"
+# include "../rotfont/symbol12.h"
+# include "../rotfont/symbol14.h"
+# include "../rotfont/symbol18.h"
+# include "../rotfont/symbol24.h"
+
+# define DEFFONT 1
+static FontSet HardwiredFonts[] = {
+  {times8font,  "times", 8},
+  {times12font, "times", 12},
+  {times14font, "times", 14},
+  {times18font, "times", 18},
+  {times24font, "times", 24},
+  
+  {courier8font,  "courier", 8},
+  {courier12font, "courier", 12},
+  {courier14font, "courier", 14},
+  {courier18font, "courier", 18},
+  {courier24font, "courier", 24},
+  
+  {helvetica8font,  "helvetica", 8},
+  {helvetica12font, "helvetica", 12},
+  {helvetica14font, "helvetica", 14},
+  {helvetica18font, "helvetica", 18},
+  {helvetica24font, "helvetica", 24},
+  
+  {symbol8font,  "symbol", 8},
+  {symbol12font, "symbol", 12},
+  {symbol14font, "symbol", 14},
+  {symbol18font, "symbol", 18},
+  {symbol24font, "symbol", 24}
+};
+
+/* put these as static in RotFont.c with accessor functions */
+# define NROT 256
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/buttons.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/buttons.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/buttons.h	(revision 15879)
@@ -0,0 +1,120 @@
+#define PS_width 25
+#define PS_height 25
+static char PS_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x81, 0x3f, 0x00,
+   0x82, 0x67, 0x60, 0x00, 0x02, 0x26, 0x40, 0x00, 0x02, 0x24, 0x40, 0x00,
+   0x02, 0x24, 0x00, 0x00, 0x02, 0x24, 0x00, 0x00, 0x02, 0x24, 0x00, 0x00,
+   0x02, 0x24, 0x00, 0x00, 0x02, 0x64, 0x00, 0x00, 0x02, 0xc6, 0x00, 0x00,
+   0x82, 0x07, 0x07, 0x00, 0xfe, 0x01, 0x0c, 0x00, 0x02, 0x00, 0x18, 0x00,
+   0x02, 0x00, 0x20, 0x00, 0x02, 0x00, 0x60, 0x00, 0x02, 0x00, 0x40, 0x00,
+   0x02, 0x00, 0xc0, 0x00, 0x02, 0x10, 0x80, 0x00, 0x02, 0x10, 0xc0, 0x00,
+   0x02, 0x60, 0x60, 0x00, 0x02, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00}; 
+#define grey_width 25
+#define grey_height 25
+static char grey_bits[] = {
+   0x90, 0x40, 0xf7, 0x01, 0x04, 0xaa, 0xad, 0x01, 0x68, 0xd5, 0xfe, 0x01,
+   0x82, 0x28, 0xdb, 0x01, 0x10, 0xd2, 0x75, 0x01, 0x40, 0xad, 0xee, 0x01,
+   0xac, 0x50, 0xbf, 0x01, 0x00, 0xaa, 0xf9, 0x01, 0x52, 0xd5, 0xd6, 0x01,
+   0x80, 0x28, 0x6f, 0x01, 0x28, 0xd2, 0xfd, 0x01, 0x44, 0xad, 0xba, 0x01,
+   0x90, 0x50, 0xf7, 0x01, 0x02, 0xaa, 0xcd, 0x01, 0x68, 0xd5, 0x7e, 0x01,
+   0x80, 0x28, 0xfb, 0x01, 0x14, 0xd2, 0xb5, 0x01, 0x40, 0xad, 0xee, 0x01,
+   0xaa, 0x50, 0xdf, 0x01, 0x00, 0xaa, 0x79, 0x01, 0x50, 0xd5, 0xf6, 0x01,
+   0x84, 0x28, 0xaf, 0x01, 0x28, 0xd2, 0xfd, 0x01, 0x40, 0xad, 0xda, 0x01,
+   0x90, 0x50, 0x77, 0x01};
+#define rainbow_width 25
+#define rainbow_height 25
+static char rainbow_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x80, 0xff, 0x00, 0x00, 0x70, 0x00, 0x01, 0x00, 0x0c, 0x7f, 0x00,
+   0x00, 0xe3, 0x80, 0x01, 0xc0, 0x9c, 0xff, 0x00, 0x20, 0x62, 0x00, 0x01,
+   0x90, 0x99, 0xff, 0x00, 0x48, 0x76, 0x00, 0x01, 0x24, 0x09, 0x00, 0x00,
+   0x94, 0x06, 0x00, 0x00, 0x52, 0x01, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00,
+   0xa5, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
+   0x2a, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00,
+   0x15, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00,
+   0x15, 0x00, 0x00, 0x00};
+#define recenter_width 25
+#define recenter_height 25
+static char recenter_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00,
+   0x80, 0xef, 0x03, 0x00, 0xe0, 0x00, 0x0e, 0x00, 0x30, 0x00, 0x18, 0x00,
+   0x10, 0x00, 0x10, 0x00, 0x18, 0x00, 0x30, 0x00, 0x08, 0x00, 0x20, 0x00,
+   0x0c, 0x00, 0x60, 0x00, 0x0c, 0x38, 0x60, 0x00, 0x0c, 0x7c, 0x60, 0x00,
+   0x04, 0x7c, 0x40, 0x00, 0x0c, 0x7c, 0x60, 0x00, 0x0c, 0x38, 0x60, 0x00,
+   0x0c, 0x00, 0x60, 0x00, 0x08, 0x00, 0x20, 0x00, 0x18, 0x00, 0x30, 0x00,
+   0x10, 0x00, 0x10, 0x00, 0x30, 0x00, 0x18, 0x00, 0xe0, 0x00, 0x0e, 0x00,
+   0x80, 0xef, 0x03, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00};
+#define puns_width 25
+#define puns_height 25
+static char puns_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0xd8, 0x01,
+   0x00, 0x0c, 0x37, 0x00, 0xf8, 0xc9, 0x6f, 0x00, 0x0c, 0xde, 0xf0, 0x00,
+   0x06, 0x5b, 0x1f, 0x00, 0x7b, 0xd9, 0x0c, 0x00, 0xc9, 0x70, 0x06, 0x00,
+   0x81, 0x71, 0x03, 0x00, 0x78, 0xb9, 0x39, 0x00, 0xc8, 0xdb, 0x0f, 0x00,
+   0x84, 0xf7, 0x7f, 0x00, 0x04, 0xff, 0xc3, 0x00, 0xe6, 0xfe, 0x8e, 0x00,
+   0x9a, 0x7d, 0x0b, 0x00, 0x08, 0xbc, 0x01, 0x00, 0x08, 0xfc, 0x3f, 0x00,
+   0x0c, 0xff, 0x78, 0x00, 0x84, 0x39, 0x60, 0x00, 0x40, 0x38, 0x40, 0x00,
+   0x60, 0x38, 0x40, 0x00, 0x20, 0x38, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00,
+   0x00, 0xd6, 0x00, 0x00};
+#define red_width 25
+#define red_height 25
+static char red_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xfc, 0x03, 0x00,
+   0x20, 0x07, 0x06, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x08, 0x00,
+   0x20, 0x00, 0x08, 0x00, 0x20, 0x00, 0x08, 0x00, 0x20, 0x00, 0x08, 0x00,
+   0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x06, 0x00, 0x20, 0x80, 0x01, 0x00,
+   0x20, 0xe0, 0x00, 0x00, 0x20, 0x7e, 0x00, 0x00, 0xe0, 0xc3, 0x00, 0x00,
+   0x20, 0xc0, 0x00, 0x00, 0x20, 0x80, 0x00, 0x00, 0x20, 0x80, 0x01, 0x00,
+   0x20, 0x00, 0x01, 0x00, 0x20, 0x00, 0x01, 0x00, 0x20, 0x00, 0x03, 0x00,
+   0x20, 0x00, 0x06, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x20, 0x00, 0x18, 0x00,
+   0x00, 0x00, 0x00, 0x00};
+#define green_width 25
+#define green_height 25
+static char green_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x07, 0x00,
+   0x00, 0x06, 0x04, 0x00, 0x80, 0x03, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
+   0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+   0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
+   0x40, 0x00, 0x00, 0x00, 0x40, 0x80, 0x0f, 0x00, 0x40, 0xc0, 0x30, 0x00,
+   0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00,
+   0x40, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x08, 0x00,
+   0x00, 0x03, 0x08, 0x00, 0x00, 0x7e, 0x0e, 0x00, 0x00, 0xc0, 0x03, 0x00,
+   0x00, 0x00, 0x00, 0x00};
+#define blue_width 25
+#define blue_height 25
+static char blue_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xfe, 0x00, 0x00,
+   0xc0, 0x83, 0x07, 0x00, 0xc0, 0x00, 0x0c, 0x00, 0x40, 0x00, 0x08, 0x00,
+   0x40, 0x00, 0x08, 0x00, 0x40, 0x00, 0x08, 0x00, 0x40, 0x00, 0x08, 0x00,
+   0x40, 0x00, 0x0c, 0x00, 0x40, 0x00, 0x04, 0x00, 0x40, 0x00, 0x02, 0x00,
+   0x40, 0x80, 0x07, 0x00, 0x40, 0xe0, 0x0c, 0x00, 0xc0, 0x3f, 0x08, 0x00,
+   0x40, 0x00, 0x08, 0x00, 0x40, 0x00, 0x08, 0x00, 0x40, 0x00, 0x08, 0x00,
+   0x40, 0x00, 0x0c, 0x00, 0x40, 0x00, 0x06, 0x00, 0x40, 0x00, 0x02, 0x00,
+   0xc0, 0x80, 0x03, 0x00, 0x40, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00};
+#define yellow_width 25
+#define yellow_height 25
+static char yellow_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x18, 0x00,
+   0x80, 0x01, 0x0c, 0x00, 0x00, 0x03, 0x06, 0x00, 0x00, 0x02, 0x02, 0x00,
+   0x00, 0x84, 0x01, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00,
+   0x00, 0x30, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
+   0x00, 0x10, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
+   0x00, 0x20, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00,
+   0x00, 0x30, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
+   0x00, 0x30, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x00};
+#define hms_width 25
+#define hms_height 25
+static char hms_bits[] = {
+   0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
+   0x02, 0x00, 0x00, 0x00, 0x02, 0x01, 0xf0, 0x00, 0x1e, 0xef, 0x89, 0x00,
+   0x22, 0x11, 0x09, 0x00, 0x22, 0x11, 0x71, 0x00, 0x22, 0x11, 0x81, 0x00,
+   0x22, 0x11, 0x89, 0x00, 0x22, 0x01, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x1e, 0xc7, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x80, 0x00,
+   0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00, 0x40, 0x80, 0x80, 0x00,
+   0x40, 0x80, 0x80, 0x00, 0x5c, 0xb8, 0xb8, 0x00, 0x62, 0xc4, 0xc4, 0x00,
+   0x42, 0x84, 0x84, 0x00, 0x42, 0x84, 0x84, 0x00, 0x62, 0xc4, 0xc4, 0x00,
+   0x5c, 0xb9, 0xb8, 0x00};
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/constants.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/constants.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/constants.h	(revision 15879)
@@ -0,0 +1,66 @@
+/* hardwired values for some window parameters */
+
+# define EVENT_MASK (long) \
+(ButtonPressMask \
+ | ClientMessage \
+ | ButtonReleaseMask \
+ | KeyPressMask \
+ | ExposureMask \
+ | StructureNotifyMask \
+ | PointerMotionMask)
+
+# define PAD1  3
+# define PAD2  5
+# define TEXTPAD 25
+# define COLORPAD 10
+# define TEXT_Y 15
+# define ZOOM_X 152
+# define ZOOM_Y 152
+# define NOVERLAYS 4
+# define BUTTON_WIDTH 28
+# define BUTTON_HEIGHT 28
+
+# define DEFAULT_CURSOR XC_crosshair
+# define BORDER_WIDTH 2
+# define MIN_WIDTH 50
+# define MIN_HEIGHT 50
+# define LABEL_MAXLEN 128
+
+/* label names */
+# define LABELX0 0
+# define LABELY0 1
+# define LABELX1 2
+# define LABELY1 3
+# define LABELUL 4
+# define LABELUR 5
+# define LABELLL 6
+# define LABELLR 7
+
+/* EVENT_MASK consists of:
+
+ExposureMask        : Expose
+StructureNotifyMask : CirculateNotify | 
+                      ConfigureNotify | 
+                      DestroyNotify   | 
+		      GravityNotify   | 
+		      MapNotify       |
+		      ReparentNotify  |
+		      UnmapNotify
+ButtonPressMask     : ButtonPress
+ButtonReleaseMask   : ButtonRelease
+KeyPressMask        : KeyPress
+PointerMotionMask   : MotionNotify
+(always)            : ClientMessage 
+(always)            : MappingNotify
+
+*/
+
+# define NOVERLAYS 4
+/* number of overlays is defined here.
+   the number is also crucial in the following files:
+   PositionPictures.c
+   MakeColormap.c
+   prototypes.h
+*/
+
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/globals.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/globals.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/globals.h	(revision 15879)
@@ -0,0 +1,28 @@
+
+int   ACTIVE_CURSOR;
+int   HAVE_BACKING;
+int   DEBUG;
+int   USE_XWINDOW;
+int   MAP_WINDOW;
+int   FOREGROUND;
+char *NAME_WINDOW;
+
+/* these should be absorbed into KapaImageWidget 
+int OVERLAY[NOVERLAYS];
+int MOVE_POINTER;
+int DECIMAL_DEG;
+*/
+
+/* file descriptor for socket connection to mana */
+// int sock; 
+
+/* each layout / section defines one of the active portions of the graphics window
+   there may be an arbitrary number of sections, and each section may fill an arbitrary
+   rectangle in the X window.  The startup configuration assumes 1 section filling the 
+   entire X window. */
+
+// Layout *section;
+// int    Nsection, TheSection;
+
+/* graphic defines the basic details of the X window */
+// Graphic graphic;
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/icons.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/icons.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/icons.h	(revision 15879)
@@ -0,0 +1,43 @@
+
+#define icon_width 29
+#define icon_height 29
+static unsigned char icon_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xff, 0xff, 0x07,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04,
+   0x04, 0x41, 0x10, 0x04, 0x04, 0x41, 0x10, 0x04, 0xfc, 0xff, 0xff, 0x07,
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+/* *** icons for buttons, not used ***
+#define arrow_width 6
+#define arrow_height 9
+static char arrow_bits[] = {
+   0x00, 0x02, 0x06, 0x0e, 0x1e, 0x0e, 0x06, 0x02, 0x00};
+#define back_width 16
+#define back_height 16
+static char back_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x3c, 0x00, 0x3f, 0xc0, 0x3f,
+   0xf0, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xf0, 0x3f, 0xc0, 0x3f, 0x00, 0x3f,
+   0x00, 0x3c, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00};
+#define down_width 9
+#define down_height 6
+static char down_bits[] = {
+   0x00, 0x00, 0xfe, 0x00, 0x7c, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00};
+#define fore_width 16
+#define fore_height 16
+static char fore_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x3c, 0x00, 0xfc, 0x00, 0xfc, 0x03,
+   0xfc, 0x0f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x0f, 0xfc, 0x03, 0xfc, 0x00,
+   0x3c, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00};
+#define stop_width 16
+#define stop_height 16
+static char stop_bits[] = {
+   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f,
+   0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf8, 0x1f,
+   0xf8, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+*/
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/kii.proto.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/kii.proto.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/kii.proto.h	(revision 15879)
@@ -0,0 +1,124 @@
+
+/* top-level program */
+int           args                PROTO((int *argc, char **argv));
+void          SetUpDisplay        PROTO((Graphic *, int *, char **));
+void          SetUpWindow         PROTO((Graphic *, int *, char **));
+void          DefineLayout        PROTO((Layout *, Graphic *, int, char **));
+int           EventLoop           PROTO((Graphic *, Layout *));
+void          CloseDisplay        PROTO((Graphic *));
+
+/* SetUpDisplay */
+void          CheckDisplayName    PROTO((int *, char **, char *));
+Display      *OpenDisplay         PROTO((char *, int *));
+void	      CheckVisual	  PROTO((Graphic *graphic, int *argc, char **argv));
+void          CheckColors         PROTO((Graphic *, int *, char **));
+
+/* SetUpWindow */
+void          CheckGeometry       PROTO((int *, char **, Graphic *));
+void          TopWindow           PROTO((Graphic *, Icon *));
+void           CreateWindow       PROTO((Graphic *, Window, int, long));
+void           MakeGC             PROTO((Graphic *));
+void           MakeCursor         PROTO((Graphic *, unsigned int));
+void          LoadFont            PROTO((Graphic *, int *, char **, char *));
+void           CheckFontName      PROTO((int *, char **, char *));
+void          SetNormalHints      PROTO((Graphic *));
+void          SetWMHints          PROTO((Graphic *, Icon *));
+void          NameWindow          PROTO((Graphic *, char *));
+void          MapWindow           PROTO((Graphic *));
+
+/* DefineLayout - fns below may be called if layout is changed? */
+void          PositionPictures    PROTO((Layout *, Graphic *));
+
+void          MakeColormap        PROTO((Graphic *, Layout *, int, char **));
+int	      SetColormap	  PROTO((Graphic *graphic, Layout *layout, char *name));
+void          CreateColorbar      PROTO((Layout *, Graphic *));
+void          CreatePicture       PROTO((Layout *, Graphic *));
+
+/* EventLoop */
+int           CheckPipe           PROTO((Graphic *, Layout *));
+int           Reconfig            PROTO((Graphic *, Layout *, XEvent *));
+void          Refresh             PROTO((Graphic *, Layout *, int));
+int           UpdatePointer       PROTO((Graphic *, Layout *, XMotionEvent *));
+int           InterpretKeys       PROTO((Graphic *, Layout *, XEvent *));
+int           InterpretPresses    PROTO((Graphic *, Layout *, XButtonEvent *));
+
+/* CheckPipe */
+int           NewPicture          PROTO((Graphic *, Layout *));
+int           EraseOverlay        PROTO((Graphic *, Layout *));
+int           LoadOverlay         PROTO((Graphic *, Layout *));
+int	      LoadTickmarks	  PROTO((Graphic *graphic, Layout *layout));
+int           SaveOverlay         PROTO((Graphic *, Layout *));
+int           CSaveOverlay        PROTO((Graphic *, Layout *));
+int	      PSit		  PROTO((Graphic *graphic, Layout *layout, int Raw));
+int	      JPEGit		  PROTO((Graphic *graphic, Layout *layout));
+int	      JPEGit24		  PROTO((Graphic *graphic, Layout *layout));
+int	      Resize		  PROTO((Graphic *graphic, Layout *layout));
+int	      Center		  PROTO((Graphic *graphic, Layout *layout));
+
+/* imagezoom functions */
+void          CreateZoom          PROTO((Layout *, Graphic *, double, double));
+void	      CreateZoom8	  PROTO((Layout *layout, Graphic *graphic, double x, double y));
+void	      CreateZoom16	  PROTO((Layout *layout, Graphic *graphic, double x, double y));
+void	      CreateZoom24	  PROTO((Layout *layout, Graphic *graphic, double x, double y));
+void	      CreateZoom32	  PROTO((Layout *layout, Graphic *graphic, double x, double y));
+void	      UpdateStatusBox	  PROTO((Graphic *graphic, Layout *layout, double x, double y, double z, int mode));
+void          CrossHairs          PROTO((Graphic *, Layout *));
+
+/* X image drawing functions */
+void          Reorient            PROTO((Graphic *, Layout *, double, double, int));
+void          ReorientOnButton    PROTO((Graphic *, Layout *, XButtonEvent *));
+int	      Recenter		  PROTO((Graphic *graphic, Layout *layout));
+void          PaintOverlay        PROTO((Graphic *, Layout *, int));
+void	      PaintTickmarks	  PROTO((Graphic *graphic, Layout *layout));
+void          Remap               PROTO((Graphic *, Layout *, Matrix  *));
+void	      Remap8		  PROTO((Graphic *graphic, Layout *layout, Matrix *matrix));
+void	      Remap16		  PROTO((Graphic *graphic, Layout *layout, Matrix *matrix));
+void	      Remap24		  PROTO((Graphic *graphic, Layout *layout, Matrix *matrix));
+void	      Remap32		  PROTO((Graphic *graphic, Layout *layout, Matrix *matrix));
+
+/* PS image drawing functions */
+void	      ConvertPixmap8	  PROTO((Layout *layout, FILE *f));
+void	      ConvertPixmap16	  PROTO((Layout *layout, FILE *f));
+void	      ConvertPixmap24	  PROTO((Layout *layout, FILE *f));
+void	      ConvertPixmap32	  PROTO((Layout *layout, FILE *f));
+void	      DrawOverlay	  PROTO((Graphic *graphic, Layout *layout, int N, FILE *f, int extra));
+
+/* JPEG image drawing functions */
+void	      bDrawOverlay	  PROTO((Layout *layout, int N));
+
+/***** Prototypes for image ***************/
+void          StatusBox           PROTO((Graphic *, Layout *));
+
+/***** Prototypes for action ***************/
+int           InPicture           PROTO((XButtonEvent *, Picture *));
+int           Stop                PROTO((Graphic *, Layout *));
+void          DragColorbar        PROTO((Graphic *, Layout *, XButtonEvent *));
+void          ResetColorbar       PROTO((Graphic *, Layout *, double, double));
+
+/***** Prototypes for button ***************/
+Button       *CheckButtons        PROTO((XButtonEvent *, Layout *));
+void          DrawButton          PROTO((Graphic *, Button *));
+void          FlashButton         PROTO((Graphic *, Button *));
+int           InButton            PROTO((XButtonEvent *, Button *));
+void          InvertButton        PROTO((Graphic *, Button *));
+int           greycolors          PROTO((Graphic *, Layout *));
+int           rainbow             PROTO((Graphic *, Layout *));
+int           puns                PROTO((Graphic *, Layout *));
+int           Recenter            PROTO((Graphic *, Layout *));
+int           RecenterRescale     PROTO((Graphic *, Layout *));
+int           Rescale             PROTO((Graphic *, Layout *));
+int           ToggleDEG           PROTO((Graphic *, Layout *));
+int           Overlay0            PROTO((Graphic *, Layout *));
+int           Overlay1            PROTO((Graphic *, Layout *));
+int           Overlay2            PROTO((Graphic *, Layout *));
+int           Overlay3            PROTO((Graphic *, Layout *));
+
+/***** Prototypes for xtools ***************/
+void	      Screen_to_Image     PROTO((double *x1, double *y1, double x2, double y2, Layout *layout));
+void	      Image_to_Screen	  PROTO((double *x1, double *y1, double x2, double y2, Layout *layout));
+unsigned long GetColor            PROTO((Display *, char *, Colormap, unsigned long));
+void          QuitX               PROTO((Display *, char *, char *));
+void          hh_hms              PROTO((char *, double, double, char));
+void          DrawBitmap          PROTO((Graphic *, int, int, int, int, char *, int));
+int	      cursor		  PROTO((Graphic *graphic, Layout *layout));
+void	      FlushDisplay	  PROTO((Display *display));
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/kii.struct.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/kii.struct.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/kii.struct.h	(revision 15879)
@@ -0,0 +1,129 @@
+
+/**************** Graphic carries X info around ****************/
+typedef struct {
+  Display       *display;
+  int            screen;
+  int            depth;
+  Window         window;
+  Visual        *visual;
+  int            visualclass;
+  GC             gc;
+  XFontStruct   *font;
+  Cursor         cursor;
+  int            x,  y;
+  int            dx, dy;
+  Colormap       colormap;
+  unsigned long  Npixels, pixels[256];
+  int            Nbits;
+  /*
+  unsigned long  fore;
+  unsigned long  back;
+  */
+  unsigned long  black, white;
+} Graphic;
+
+/**************** X related "widget" structures ****************/
+typedef struct {
+  int      x, y, dx, dy;      /* position and size */
+  int      text;              /* does this have a picture or text? */
+  int      width, height;
+  char    *bitmap;          /* picture on button */
+  int    (*function_1) ();  /* mouse_button 1 function */
+  int    (*function_2) ();  /* mouse_button 2 function */
+  int    (*function_3) ();  /* mouse_button 3 function */
+} Button;
+
+typedef struct {
+  int      x, y, dx, dy;   /* position and size */
+  char    *label;          /* label on TextLine */
+  char     text[1024];     /* words of TextLine */
+  char     old_text[1024]; /* words of TextLine */
+  int      outline;        /* draw an outline?  */ 
+  int      cursor;         /* location of cursor (if selected) */
+  int    (*function) ();   /* textline function */
+} TextLine;
+
+typedef char STRING[1024];
+
+typedef struct {
+  int      x, y, dx, dy;   /* position and size */
+  STRING  *text;           /* words of TextLine */
+  int      Nlines;
+  int      outline;        /* draw an outline?  */ 
+  int      cursor_line;    /* cursor line */
+  int      cursor_x;       /* location of cursor (if selected) */
+  int      cursor_y;       /* location of cursor (if selected) */
+  int    (*function) ();   /* textline function */
+} TextBox;
+
+/**************** general structures ****************/
+typedef struct {
+  Pixmap pixmap;
+  int    width;
+  int    height;
+  char  *bits;
+} Icon;
+
+typedef struct {
+  int      dx, dy, x, y;
+  XImage  *pix;
+  char *data;
+} Picture;
+
+typedef struct {
+  char type[10];
+  double x, y;
+  double dx, dy;
+  double angle;
+  char  *text;
+} Object;
+
+typedef struct {
+  int Nobjects;
+  unsigned long color;
+  Object *objects;
+} Overlay;
+  
+/******** Here we define the Layout struct specific to this program  *******/
+typedef struct {
+  /* objects on the mana window */
+  Picture  picture;
+  Picture  cmapbar;
+  Picture  zoom;
+  Button   PS_button;
+  Button   recenter_button;
+  Button   hms_button; /* toggle HMS/DECIMAL mode (DECIMAL_DEG macro) */
+  Button   grey_button;
+  Button   rainbow_button;
+  Button   puns_button;
+  Button   overlay_button[NOVERLAYS];
+  Overlay  overlay[NOVERLAYS];
+  Overlay  tickmarks;
+  int      text_x, text_y;
+
+  /* file descriptor for socket connection to mana */
+  int Ximage; 
+
+  /* data mana needs */
+  Matrix   matrix;         /* data for picture */
+  double   X, Y;           /* image pixel at screen center */
+  int      expand;         /* zoomscale */
+  double   zero, range;    /* zero, range for picture to cmap */
+  double   max, min;       /* zero, range for data to z-value */
+  double   start, slope;   /* zero, range for cmap to pixels */
+  double   x, y, z;        /* last pointer coords */
+  Coords   coords;
+  char     file[1024];     /* name of file */
+  char     buffer_name[1024];  /* name of buffer */
+
+  /* fundamental pieces */
+  unsigned long  black;
+  unsigned long  white;
+  XColor   cmap[256];
+  int      Npixels;
+
+} Layout;
+
+/* this routine is independent of the number of overlays */
+
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/prototypes.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/prototypes.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/prototypes.h	(revision 15879)
@@ -0,0 +1,220 @@
+
+/* top-level program */
+int	      args		  PROTO((int *argc, char **argv));
+void          SetUpGraphic        PROTO((int *argc, char **argv));
+void          DefineLayout        PROTO((int, char **));
+int	      EventLoop		  PROTO(());
+void	      CloseDisplay	  PROTO(());
+
+/* SetUpGraphic */
+char         *CheckDisplayName    PROTO((int *argc, char **argv));
+Display      *OpenDisplay         PROTO((char *name, int *screen));
+void          CheckColors         PROTO((Graphic *graphic, int *argc, char **argv));
+
+/* SetUpWindow */
+void          CheckGeometry       PROTO((Graphic *graphic, int *argc, char **argv));
+void          TopWindow           PROTO((Graphic *graphic, Icon *icon));
+void           CreateWindow       PROTO((Graphic *graphic, Window parent, int border, long events));
+void	       MakeGC		  PROTO((Graphic *graphic));
+void           MakeCursor         PROTO((Graphic *graphic, unsigned int cursor));
+void          LoadFont            PROTO((Graphic *graphic, int *argc, char **argv, char *default_name));
+void          SetNormalHints      PROTO((Graphic *graphic));
+void          SetWMHints          PROTO((Graphic *graphic, Icon *icon));
+void          NameWindow          PROTO((Graphic *graphic, char *name));
+void          MapWindow           PROTO((Graphic *graphic));
+void CheckVisual (Graphic *graphic, int *argc, char **argv);
+
+/* X drawing utilities */
+void	      DrawFrame		  PROTO((KapaGraphWidget *graph));
+int           DrawObjects         PROTO((KapaGraphWidget *graph));
+void          DrawLabels          PROTO((KapaGraphWidget *graph));
+void	      DrawTextlines	  PROTO((KapaGraphWidget *graph));
+void          DrawConnect         PROTO((KapaGraphWidget *graph, Gobjects *objects));
+void          DrawHistogram       PROTO((KapaGraphWidget *graph, Gobjects *objects));
+int           DrawObjectN         PROTO((KapaGraphWidget *graph, Gobjects *objects));
+void          DrawPoints          PROTO((KapaGraphWidget *graph, Gobjects *objects));
+void          DrawXErrors         PROTO((KapaGraphWidget *graph, Gobjects *objects));
+void          DrawYErrors         PROTO((KapaGraphWidget *graph, Gobjects *objects));
+void	      DrawTick		  PROTO((int fx, int fy, int dfx, int dfy, int P, double min, double max, double value, int mode, int naxis));
+void	      AxisTickScale	  PROTO((Axis *axis, double *major, double *minor));
+
+/* EventLoop */
+int           PScommand           PROTO((int sock));
+int           CheckPipe           PROTO(());
+int           Reconfig            PROTO((XEvent *event));
+void          Refresh             PROTO(());
+
+/* CheckPipe */
+int           PNGit               PROTO((int sock));
+int           PPMit               PROTO((int sock));
+int           LoadFrame           PROTO((int sock));
+int           LoadObject          PROTO((int sock));
+int           LoadLabels          PROTO((int sock));
+int           LoadTextlines       PROTO((int sock));
+int           Resize              PROTO((int sock));
+int           GetLimits           PROTO((int sock));
+int           SetLimits           PROTO((int sock));
+int           SetSection          PROTO((int sock));
+int           ListSection         PROTO((int sock));
+int           MoveSection         PROTO((int sock));
+int           DefineSection       PROTO((int sock));
+int           SetFont             PROTO((int sock));
+int           EraseCurrentPlot    PROTO((void));
+int           ErasePlots          PROTO((void));
+int           EraseSections       PROTO((void));
+int           EraseImage          PROTO((void));
+int           SetGraphData        PROTO((int sock));
+int           GetGraphData        PROTO((int sock));
+int           SetImageData        PROTO((int sock));
+int           GetImageData        PROTO((int sock));
+int           SetImageCoords      PROTO((int sock));
+int           GetImageCoords      PROTO((int sock));
+int           GetImageRange       PROTO((int sock));
+
+int           LoadVectorData      PROTO((int sock, KapaGraphWidget *graph, int N, char *type));
+
+/* Section Utilities */
+Section      *InitSection	  PROTO(());
+void          FreeSection	  PROTO((Section *section));
+void          FreeSections	  PROTO(());
+Section      *AddSection	  PROTO((char *name, float x, float y, float dx, float dy));
+int           DelSection	  PROTO((char *name));
+int           GetSectionByName	  PROTO((char *name));
+int           GetNumberOfSections PROTO(());
+Section      *GetSectionByNumber  PROTO((int N));
+Section      *GetActiveSection	  PROTO(());
+int           SetActiveSectionByNumber PROTO((int N));
+int           ListSection         PROTO((int sock));
+void SetSectionSizes (Section *section);
+
+KapaGraphWidget *InitGraph        PROTO(());
+void          DrawGraph           PROTO((KapaGraphWidget *graph));
+void          SetGraphSize        PROTO((Section *section));
+void          FreeGraph           PROTO((KapaGraphWidget *graph));
+
+void          InitLayout          PROTO((int argc, char **argv));
+
+/* PS drawing utilities */
+int           PSit                PROTO((char *filename, char *pagename, int scaleMode, int pageMode));
+int           PSFrame             PROTO((KapaGraphWidget *graph, FILE *f));
+int           PSObjects           PROTO((KapaGraphWidget *graph, FILE *f));
+void          PSLabels            PROTO((KapaGraphWidget *graph, FILE *f));
+void	      PSTextlines	  PROTO((KapaGraphWidget *graph, FILE *f));
+void          PSConnect           PROTO((KapaGraphWidget *graph, Gobjects *objects, FILE *f));
+void          PSHistogram         PROTO((KapaGraphWidget *graph, Gobjects *objects, FILE *f));
+void          PSPoints            PROTO((KapaGraphWidget *graph, Gobjects *objects, FILE *f));
+void          PSXErrors           PROTO((KapaGraphWidget *graph, Gobjects *objects, FILE *f));
+void          PSYErrors           PROTO((KapaGraphWidget *graph, Gobjects *objects, FILE *f));
+void	      PSTick		  PROTO((FILE *f, double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis));
+void          ClipLinePS          PROTO((double x0, double y0, double x1, double y1, double X0, double Y1, double X1, double Y0, FILE *f));
+int           PSimage    	  PROTO((KapaImageWidget *image, FILE *f));
+void 	      PSOverlay  	  PROTO((KapaImageWidget *image, int N, FILE *f, int extra));
+void 	      PSPixmap8  	  PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f));
+void 	      PSPixmap16 	  PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f));
+void 	      PSPixmap24 	  PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f));
+void 	      PSPixmap32 	  PROTO((Graphic *graphic, KapaImageWidget *image, FILE *f));
+
+/* kapa bDraw Functions */
+int	      bDrawFrame	  PROTO((KapaGraphWidget *graph));
+int	      bDrawObjects	  PROTO((KapaGraphWidget *graph));
+void	      bDrawLabels	  PROTO((KapaGraphWidget *graph));
+void	      bDrawTextlines	  PROTO((KapaGraphWidget *graph));
+void	      bDrawConnect	  PROTO((KapaGraphWidget *graph, Gobjects *object));
+void	      bDrawHistogram	  PROTO((KapaGraphWidget *graph, Gobjects *object));
+void	      bDrawPoints	  PROTO((KapaGraphWidget *graph, Gobjects *object));
+void	      bDrawXErrors	  PROTO((KapaGraphWidget *graph, Gobjects *object));
+void	      bDrawYErrors	  PROTO((KapaGraphWidget *graph, Gobjects *object));
+void	      bDrawTick		  PROTO((double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis));
+void	      bDrawClipLine	  PROTO((double x0, double y0, double x1, double y1, double X0, double Y1, double X1, double Y0));
+bDrawBuffer  *bDrawIt		  PROTO(());
+void          bDrawGraph          PROTO((KapaGraphWidget *graph));
+
+/* misc support */
+int           LastEvent           PROTO((Display *display, int type, XEvent *event));
+void	      FreeObjectData	  PROTO((Gobjects *object));
+void	      FlushDisplay	  PROTO(());
+unsigned long GetColor            PROTO((Display *display, char *name, Colormap colormap, unsigned long default_color));
+void          QuitX               PROTO((Display *display, char *message));
+Graphic      *GetGraphic          PROTO(());
+int           GetPixelCount       PROTO((int sock));
+
+int           Center              PROTO(());
+void          Remap               PROTO((Graphic *graphic, KapaImageWidget *image, Matrix *matrix));
+void          Remap8              PROTO((Graphic *graphic, KapaImageWidget *image, Matrix *matrix));
+void          Remap16             PROTO((Graphic *graphic, KapaImageWidget *image, Matrix *matrix));
+void          Remap24             PROTO((Graphic *graphic, KapaImageWidget *image, Matrix *matrix));
+void          Remap32             PROTO((Graphic *graphic, KapaImageWidget *image, Matrix *matrix));
+int           LoadPicture         PROTO((int sock));
+
+KapaImageWidget *InitImage        PROTO(());
+void          FreeImage           PROTO((KapaImageWidget *image));
+void          SetImageSize        PROTO((Section *section));
+
+void          InitButtonSize      PROTO((Button *button, int width, int height, char *bitmap));
+void          InitButtonFunc      PROTO((Button *button, int (*function)()));
+void          DrawImage           PROTO((KapaImageWidget *image));
+void          DrawButton          PROTO((Graphic *graphic, Button *button));
+void          DrawBitmap          PROTO((Graphic *graphic, int x, int y, int dx, int dy, char *bitmap, int mode));
+void          CrossHairs          PROTO((Graphic *graphic, KapaImageWidget *image));
+void          hh_hms              PROTO((char *line, double ra, double dec, char sep));
+
+int           SetColormap         PROTO((char *name));
+void          MakeColormap        PROTO((int argc, char **argv));
+
+void          PaintOverlay        PROTO((Graphic *graphic, KapaImageWidget *image, int N));
+void          PaintTickmarks      PROTO((Graphic *graphic, KapaImageWidget *image));
+
+void          Screen_to_Image     PROTO((double *x1, double *y1, double x2, double y2, KapaImageWidget *image));
+void          Image_to_Screen     PROTO((double *x1, double *y1, double x2, double y2, KapaImageWidget *image));
+
+void          DragColorbar        PROTO((Graphic *graphic, KapaImageWidget *image, XButtonEvent *mouse_event));
+void          ResetColorbar       PROTO((Graphic *graphic, double start, double slope));
+void          ReorientOnButton    PROTO((Graphic *graphic, KapaImageWidget *image, XButtonEvent *mouse_event));
+void          Reorient            PROTO((Graphic *graphic, KapaImageWidget *image, double X, double Y, int mode));
+
+Button       *CheckButtons        PROTO((XButtonEvent *event, KapaImageWidget *image));
+int           InButton            PROTO((XButtonEvent *event, Button *button));
+int           InPicture           PROTO((XButtonEvent *event, Picture *picture));
+
+/* Button Functions */
+int           greycolors	  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      puns		  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      rainbow		  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      Recenter		  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      Rescale		  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      RecenterRescale	  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      ToggleDEG		  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      Overlay0		  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      Overlay1		  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      Overlay2		  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      Overlay3		  PROTO((Graphic *graphic, KapaImageWidget *image));
+int	      PSfunction	  PROTO((Graphic *graphic, KapaImageWidget *image));
+
+/* misc functions */
+void SetToolbox (int sock);
+int EraseOverlay (int sock);
+int LoadOverlay (int sock);
+int SaveOverlay (int sock);
+int CSaveOverlay (int sock);
+int JPEGit24 (int sock);
+
+int UpdatePointer (Graphic *graphic, XMotionEvent *event);
+int InterpretPresses (Graphic *graphic, XButtonEvent *event);
+int InterpretKeys (Graphic *graphic, XKeyEvent *event);
+void InitPipe (char *namedSocket);
+void EraseGraph (KapaGraphWidget *graph);
+void StatusBox (Graphic *graphic, KapaImageWidget *image);
+
+void CreatePicture (KapaImageWidget *image, Graphic *graphic);
+void CreateColorbar (KapaImageWidget *image, Graphic *graphic);
+void CreateZoom (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void UpdateStatusBox (Graphic *graphic, KapaImageWidget *image, double x, double y, double z, int mode);
+
+void CreateZoom8  (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void CreateZoom16 (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void CreateZoom24 (KapaImageWidget *image, Graphic *graphic, double x, double y);
+void CreateZoom32 (KapaImageWidget *image, Graphic *graphic, double x, double y);
+
+int GetActiveSocket ();
+void InvertButton (Graphic *graphic, Button *button);
+void bDrawOverlay (KapaImageWidget *image, int N);
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/structures.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/structures.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/structures.h	(revision 15879)
@@ -0,0 +1,172 @@
+
+/**************** Graphic carries X info around ****************/
+typedef struct {
+  Display       *display;
+  int            screen;
+  int            depth;
+  Window         window;
+  Visual        *visual;
+  int            visualclass;
+  int            Nbits;
+  GC             gc;
+  XFontStruct   *font;
+  Cursor         cursor;
+  int            x,  y;
+  unsigned int   dx, dy;
+  XColor         cmap[256];
+  Colormap       colormap;
+  unsigned long  fore;
+  unsigned long  back;
+  unsigned long  *color;
+  unsigned long  pixels[256];
+  unsigned long  overlay_color[NOVERLAYS];
+  int Npixels;
+  int Ncolors;
+} Graphic;
+
+/**************** X related "widget" structures ****************/
+typedef struct {
+  int      x, y, dx, dy;      /* position and size */
+  int      width, height;     /* size of the bitmap */
+  char    *bitmap;            /* picture on button */
+  int    (*function_1) ();    /* mouse_button 1 function */
+  int    (*function_2) ();    /* mouse_button 2 function */
+  int    (*function_3) ();    /* mouse_button 3 function */
+} Button;
+
+typedef struct {
+  int      x, y, dx, dy;   /* position and size */
+  char    *label;          /* label on TextLine */
+  char     text[1024];     /* words of TextLine */
+  char     old_text[1024]; /* words of TextLine */
+  int      outline;        /* draw an outline?  */ 
+  int      cursor;         /* location of cursor (if selected) */
+  int    (*function) ();   /* textline function */
+} TextLine;
+
+typedef char STRING[1024];
+
+typedef struct {
+  int      x, y, dx, dy;   /* position and size */
+  STRING  *text;           /* words of TextLine */
+  int      Nlines;
+  int      outline;        /* draw an outline?  */ 
+  int      cursor_line;    /* cursor line */
+  int      cursor_x;       /* location of cursor (if selected) */
+  int      cursor_y;       /* location of cursor (if selected) */
+  int    (*function) ();   /* textline function */
+} TextBox;
+
+/**************** general structures ****************/
+typedef struct {
+  Pixmap pixmap;
+  int    width;
+  int    height;
+  unsigned char *bits;
+} Icon;
+
+typedef struct {
+  int      dx, dy, x, y;
+  XImage  *pix;
+  char    *data;
+} Picture;
+
+// objects associated with a KiiImage
+// XXX rename thi
+typedef struct {
+  char type[10];
+  double x, y;
+  double dx, dy;
+  double angle;
+  char  *text;
+} Object;
+
+typedef struct {
+  int x, y;
+  int dx, dy;
+  double angle;
+  int  size;
+  char font[64]; 
+  char text[LABEL_MAXLEN];
+} Label;
+
+typedef struct {
+  int active;
+  int Nobjects;
+  unsigned long color;
+  KiiOverlay *objects;
+} Overlay;
+  
+typedef struct {
+  float *x, *y, *z, *dxp, *dxm, *dyp, *dym;
+  int Npts;
+  int style, ptype, ltype, color, etype, ebar;
+  double lweight, size;
+  double x0, x1, y0, y1;  /* limits for this object */
+} Gobjects;
+
+typedef struct {
+  double min, max;
+  char isaxis, areticks, islabel, islog;
+  double fx, dfx, fy, dfy;  /* axis location on graphic */
+} Axis;
+
+// a single graph in the display window
+typedef struct {
+  Axis      axis[4];    /* coordinate axes */
+  Label     label[8];   /* fixed axis labels */
+  Graphdata data;       /* current graph data */
+
+  Gobjects *objects;    /* graphic objects */    
+  int      Nobjects;    
+
+  Label    *textline;      /* placed text labels */
+  int      Ntextline;      
+} KapaGraphWidget;
+
+// a single image in the display window
+typedef struct {
+  // picture components of the image element
+  Picture  picture;	      // the primary view of the image
+  Picture  zoom;	      // the zoom window
+  Picture  wide;	      // the wide-view window
+  Picture  cmapbar;	      // the colormap bar
+
+  // the control buttons
+  Button   PS_button;
+  Button   recenter_button;
+  Button   hms_button; /* toggle HMS/DECIMAL mode (DECIMAL_DEG macro) */
+  Button   grey_button;
+  Button   rainbow_button;
+  Button    puns_button;
+  Button   overlay_button[NOVERLAYS];
+
+  // location of the status box
+  int      text_x, text_y;
+  int      text_dx, text_dy, text_dyo;
+  int      location;	      // position of the zoom/status widgets (0 = none, 1-4 = bottom,left,top,right)
+  int      MovePointer;
+  int      DecimalDegrees;
+
+  // data associated with this image element
+  Overlay  overlay[NOVERLAYS];
+  Overlay  tickmarks;
+  Matrix   matrix;         /* data for picture */
+  double   X, Y;           /* image pixel at screen center */
+  int      expand;         /* zoomscale */
+  double   zero, range;    /* zero, range for picture to cmap */
+  double   max, min;       /* zero, range for data to z-value */
+  double   start, slope;   /* zero, range for cmap to pixels */
+  double   x, y, z;        /* last pointer coords */
+  Coords   coords;
+  char     file[1024];     /* name of file */
+  char     name[1024];  /* name of buffer */
+} KapaImageWidget;
+
+typedef struct {
+  KapaGraphWidget *graph;
+  KapaImageWidget *image;
+  float  x,  y;
+  float dx, dy;
+  char *name;
+} Section;
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/ButtonFunctions.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/ButtonFunctions.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/ButtonFunctions.c	(revision 15879)
@@ -0,0 +1,134 @@
+# include "Ximage.h"
+
+static char *GREY = "greyscale";
+static char *PUNS = "Puns";
+static char *RAINBOW = "Rainbow";
+
+int PSfunction (Graphic *graphic, KapaImageWidget *image) {
+
+  int status;
+
+  status = PSit ("kapa.ps", "default", TRUE, KAPA_PS_NEWPLOT);
+  return (status);
+}
+
+int greycolors (Graphic *graphic, KapaImageWidget *image) {
+  char *name;
+  name = GREY;
+  SetColormap (name);
+  CreateColorbar (image, graphic);
+  Remap (graphic, image, &image[0].matrix);
+  CreateZoom (image, graphic, 0, 0); 
+  Refresh ();
+  XFlush (graphic[0].display);
+  return (TRUE);
+}
+
+int puns (Graphic *graphic, KapaImageWidget *image) {
+  char *name;
+  name = PUNS;
+  SetColormap (name);
+  CreateColorbar (image, graphic);
+  Remap (graphic, image, &image[0].matrix);
+  CreateZoom (image, graphic, 0, 0); 
+  Refresh ();
+  XFlush (graphic[0].display);
+  return (TRUE);
+}
+
+int rainbow (Graphic *graphic, KapaImageWidget *image) {
+  char *name;
+  name = RAINBOW;
+  SetColormap (name);
+  CreateColorbar (image, graphic);
+  Remap (graphic, image, &image[0].matrix);
+  CreateZoom (image, graphic, 0, 0); 
+  Refresh ();
+  XFlush (graphic[0].display);
+  return (TRUE);
+}
+
+int Recenter (Graphic *graphic, KapaImageWidget *image) {
+
+  image[0].X = 0;
+  image[0].Y = 0;
+ 
+  Remap (graphic, image, &image[0].matrix);
+  Refresh ();
+  FlushDisplay (graphic[0].display);
+  return (TRUE);
+
+}
+
+int Rescale (Graphic *graphic, KapaImageWidget *image) {
+
+  image[0].expand = 1;
+  Remap (graphic, image, &image[0].matrix);
+  Refresh ();
+  FlushDisplay (graphic[0].display);
+  return (TRUE);
+
+}
+
+int RecenterRescale (Graphic *graphic, KapaImageWidget *image) {
+
+  image[0].X = 0;
+  image[0].Y = 0;
+  image[0].expand = 1;
+ 
+  Remap (graphic, image, &image[0].matrix);
+  Refresh ();
+  FlushDisplay (graphic[0].display);
+  return (TRUE);
+
+}
+
+int ToggleDEG (Graphic *graphic, KapaImageWidget *image) {
+
+  image[0].DecimalDegrees = image[0].DecimalDegrees ^ TRUE;
+  StatusBox (graphic, image);
+  FlushDisplay (graphic[0].display);
+  return (TRUE);
+
+}
+
+/*********** overlay_button functions ************/
+int Overlay0 (Graphic *graphic, KapaImageWidget *image) {
+
+  image[0].overlay[0].active = image[0].overlay[0].active ^ TRUE;
+  Refresh ();
+  FlushDisplay (graphic[0].display);
+  return (TRUE);
+
+}
+
+int Overlay1 (Graphic *graphic, KapaImageWidget *image) {
+
+  image[0].overlay[1].active = image[0].overlay[1].active ^ TRUE;
+  Refresh ();
+  FlushDisplay (graphic[0].display);
+  return (TRUE);
+
+}
+
+int Overlay2 (Graphic *graphic, KapaImageWidget *image) {
+
+  image[0].overlay[2].active = image[0].overlay[2].active ^ TRUE;
+  Refresh ();
+  FlushDisplay (graphic[0].display);
+  return (TRUE);
+
+}
+
+int Overlay3 (Graphic *graphic, KapaImageWidget *image) {
+
+  image[0].overlay[3].active = image[0].overlay[3].active ^ TRUE;
+  Refresh ();
+  FlushDisplay (graphic[0].display);
+  return (TRUE);
+
+}
+
+/* this routine is NOT independent of the number of overlays */
+
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CSaveOverlay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CSaveOverlay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CSaveOverlay.c	(revision 15879)
@@ -0,0 +1,49 @@
+# include "Ximage.h"
+
+int CSaveOverlay (int sock) {
+
+  char filename[256], *type;
+  int i, N;
+  double ra, dec, ra1, dec1, x1, y1, dra, ddec;
+  FILE *f;
+  Section *section;
+  KapaImageWidget *image;
+
+  KiiScanMessage (sock, "%*s %d %s", &N, filename);
+  
+  section = GetActiveSection();
+  image   = section->image;
+  if (image == NULL) return (TRUE);
+
+  f = fopen (filename, "w");
+  if (f == NULL) {
+    fprintf (stderr, "could not open %s\n", filename);
+    return (TRUE);
+  }
+
+  for (i = 0; i < image[0].overlay[N].Nobjects; i++) {
+    if (image[0].overlay[N].objects[i].type == KII_OVERLAY_LINE) {
+      XY_to_RD (&ra, &dec, image[0].overlay[N].objects[i].x, image[0].overlay[N].objects[i].y, &image[0].coords);
+      x1 = image[0].overlay[N].objects[i].x + image[0].overlay[N].objects[i].dx;
+      y1 = image[0].overlay[N].objects[i].y + image[0].overlay[N].objects[i].dy;
+      XY_to_RD (&ra1, &dec1, x1, y1, &image[0].coords);
+      dra = (ra1 - ra);
+      ddec = (dec1 - dec);
+    } else {
+      XY_to_RD (&ra, &dec, image[0].overlay[N].objects[i].x, image[0].overlay[N].objects[i].y, &image[0].coords);
+      x1 = image[0].overlay[N].objects[i].x;
+      y1 = image[0].overlay[N].objects[i].y + image[0].overlay[N].objects[i].dy;
+      XY_to_RD (&ra1, &dec1, x1, y1, &image[0].coords);
+      ddec = fabs (dec1 - dec);
+      x1 = image[0].overlay[N].objects[i].x + image[0].overlay[N].objects[i].dx;
+      y1 = image[0].overlay[N].objects[i].y;
+      XY_to_RD (&ra1, &dec1, x1, y1, &image[0].coords);
+      dra = cos (dec*RAD_DEG) * fabs (ra1 - ra);
+    }
+    type = KiiOverlayTypeByNumber (image[0].overlay[N].objects[i].type);
+    if (type == NULL) continue;
+    fprintf (f, "%s %lf %lf %lf %lf\n", type, ra, dec, dra, ddec);
+   }
+  fclose (f);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Center.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Center.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Center.c	(revision 15879)
@@ -0,0 +1,32 @@
+# include "Ximage.h"
+
+int Center (int sock) {
+
+  int zoom;
+  double X, Y;
+  Graphic *graphic;
+  Section *section;
+  KapaImageWidget *image;
+
+  KiiScanMessage (sock, "%lf %lf %d", &X,  &Y, &zoom);
+
+  graphic = GetGraphic();
+  section = GetActiveSection();
+  image = section->image;
+  if (image == NULL) return (TRUE);
+
+  image[0].X = 0.5*image[0].matrix.Naxis[0] - X;
+  image[0].Y = 0.5*image[0].matrix.Naxis[1] - Y;
+  if ((zoom != 0) && (zoom != -1)) {
+    image[0].expand = zoom;
+  }
+
+  if (USE_XWINDOW) {
+    Remap (graphic, image, &image[0].matrix);
+    Refresh ();
+    XFlush (graphic[0].display);
+  }
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckButtons.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckButtons.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckButtons.c	(revision 15879)
@@ -0,0 +1,53 @@
+# include "Ximage.h"
+# define PAD_X 10
+# define PAD_Y 10
+# define NPLANES 1
+# define NPIXELS 255
+
+/******** Here we test the Buttons specific to this program  *******/
+Button *CheckButtons (XButtonEvent  *event, KapaImageWidget *image) {
+
+  int i;
+  Button *button;
+  button = (Button *) NULL;
+
+  if (InButton (event, &image[0].recenter_button)) 
+    button = &image[0].recenter_button;
+
+  if (InButton (event, &image[0].grey_button)) 
+    button = &image[0].grey_button;
+
+  if (InButton (event, &image[0].rainbow_button)) 
+    button = &image[0].rainbow_button;
+
+  if (InButton (event, &image[0].puns_button)) 
+    button = &image[0].puns_button;
+
+  if (InButton (event, &image[0].PS_button)) 
+    button = &image[0].PS_button;
+
+  if (InButton (event, &image[0].hms_button)) 
+    button = &image[0].hms_button;
+
+  for (i = 0; i < NOVERLAYS; i++) {
+    if (InButton (event, &image[0].overlay_button[i])) 
+      button = &image[0].overlay_button[i];
+  }
+
+  return (button);
+
+}
+
+
+/* To define a button, you must:
+
+   0) add the button to the Image structure in structures.h
+   1) place the info about the button in PositionPicture.c
+   2) (make any bitmaps needed and put them in buttons.h
+   3) place an entry in CheckButtons.c
+   4) Add the button to Refresh.c
+   5) create the button's function
+   6) add it to the Makefile
+   7) add it to the prototypes
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckColors.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckColors.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckColors.c	(revision 15879)
@@ -0,0 +1,44 @@
+# include "Ximage.h"
+
+/************** CheckColors *************/
+void CheckColors (Graphic *graphic, int *argc, char **argv) {
+
+  char *temp_name;
+  int N;
+
+  graphic->fore = BlackPixel (graphic->display, graphic->screen);
+  temp_name = XGetDefault (graphic->display, argv[0], "Foreground");
+  if ((N = get_argument (*argc, argv, "-fg"))) {
+    if (*argc <= N + 1) {
+      fprintf (stderr, "error: usage is -fg color\n");
+      exit (0);
+    }
+    remove_argument (N, argc, argv);
+    temp_name = argv[N];
+    remove_argument (N, argc, argv);
+  } 
+  if (temp_name != NULL) {
+    graphic->fore = GetColor (graphic->display, temp_name, graphic->colormap, graphic->fore);
+  }
+
+  graphic->back = WhitePixel (graphic->display, graphic->screen);
+  temp_name = XGetDefault (graphic->display, argv[0], "Background");
+  if ((N = get_argument (*argc, argv, "-bg"))) {
+    if (*argc <= N + 1) {
+      fprintf (stderr, "error: usage is -bg color\n");
+      exit (0);
+    }
+    remove_argument (N, argc, argv);
+    temp_name = argv[N];
+    remove_argument (N, argc, argv);
+  } 
+  if (temp_name != NULL) {
+    graphic->back = GetColor (graphic->display, temp_name, graphic->colormap, graphic->back);
+  }
+  return;
+}
+
+  /* here we define the values for foreground and background
+     if -fg, or -bg exist, or if Foreground or Background are set in .Xdefaults, 
+     use those.  foreground defaults to black, background defaults to white. */
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckDisplayName.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckDisplayName.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckDisplayName.c	(revision 15879)
@@ -0,0 +1,31 @@
+# include "Ximage.h"
+
+/************** CheckDisplayName *************/
+char *CheckDisplayName (int *argc, char **argv) {
+
+  char *name = NULL;
+  int N;
+
+  if ((N = get_argument (*argc, argv, "-d"))) {
+    if (*argc <= N + 1) {
+      fprintf (stderr, "error: usage is [-display/-d] DisplayName\n");
+      exit (0);
+    }
+    remove_argument(N, argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument(N, argc, argv);
+    return (name);
+  }
+
+  if ((N = get_argument (*argc, argv, "-display"))) {
+    if (*argc <= N + 1) {
+      fprintf (stderr, "error: usage is [-display/-d] DisplayName\n");
+      exit (0);
+    }
+    remove_argument(N, argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument(N, argc, argv);
+    return (name);
+  }
+  return (NULL);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckGeometry.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckGeometry.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckGeometry.c	(revision 15879)
@@ -0,0 +1,26 @@
+# include "Ximage.h"
+
+/************** CheckGeometry *************/
+void CheckGeometry (Graphic *graphic, int *argc, char **argv) {
+
+  int status, N;
+  char *temp_name;
+  
+  temp_name = XGetDefault (graphic->display, argv[0], "geometry");
+  if ((N = get_argument (*argc, argv, "-geom"))) {
+    if (*argc <= N + 1) {
+      fprintf (stderr, "error: usage is -geom DisplayName\n");
+      exit (0);
+    }
+    remove_argument (N, argc, argv);
+    temp_name = argv[N];
+    remove_argument (N, argc, argv);
+  }
+  if (temp_name == NULL) return;
+
+  status = XParseGeometry (temp_name, &graphic->x, &graphic->y, &graphic->dx, &graphic->dy);
+  if (status & XNegative) graphic->x += DisplayWidth  (graphic->display, graphic->screen) - graphic->dx;
+  if (status & YNegative) graphic->y += DisplayHeight (graphic->display, graphic->screen) - graphic->dy;
+
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckPipe.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckPipe.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckPipe.c	(revision 15879)
@@ -0,0 +1,303 @@
+# include "Ximage.h"
+# define STRCONST(A) ((int)(0x1000000*A[0] + 0x10000*A[1] + 0x100*A[2] + 0x1*A[3]))
+
+static KapaSockAddress Address;
+static int InitSocket = -1;
+static int sock = -1;
+
+// we can supply a port here, with only small changes
+void InitPipe (char *namedSocket) {
+
+  if (namedSocket == NULL) {
+    InitSocket = KapaServerInit (&Address);
+  } else {
+    sock = KapaWaitNamedSocket (namedSocket);
+  }
+  return;
+}
+
+int GetActiveSocket () {
+  return (sock);
+}
+
+// after we have processed the command, we unblock the socket
+# define FINISHED(A) { fcntl (sock, F_SETFL, O_NONBLOCK); return (A); }
+
+int CheckPipe () {
+
+  int status;
+  char word[5];
+
+  // check if we have a valid connection. if not, see if we can get one
+  if (sock == -1) {
+    sock = KapaServerWait (InitSocket, &Address);
+    if (sock == -1) return (TRUE);
+    close (InitSocket); /* stop listening for new connections */
+    fcntl (sock, F_SETFL, O_NONBLOCK);  
+  }
+
+  /***** read (4 byte) message word from socket ****/
+  status = read (sock, word, 4);
+  word[4] = 0;
+  switch (status) {
+  case -1:                          /* no input from pipe: continue */
+    return (TRUE);
+    break;
+
+  case 0:
+    fprintf (stderr, "pipe has died!\n");
+    return (FALSE);
+    break;
+
+  case 4:
+    break;
+
+  default:
+    fprintf (stderr, "weird signal: too many or few bytes!  %d\n", status);
+    return (TRUE);
+    break;
+  }
+  
+  /* once we get a command, we block to ensure we get complete messages */
+  fcntl (sock, F_SETFL, !O_NONBLOCK);  
+
+  /***** handle different messages ****/
+  if (ACTIVE_CURSOR) {
+    if (strcmp (word, "NCUR")) {
+      fprintf (stderr, "wrong end message %s\n", word);
+      KiiSendCommand (sock, 4, "DONE");
+      FINISHED (TRUE);
+    }
+    ACTIVE_CURSOR = FALSE;
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  } 
+
+  if (!strcmp (word, "QUIT")) FINISHED (FALSE);
+  
+  if (!strcmp (word, "CURS")) {
+    ACTIVE_CURSOR = TRUE;
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "PSIT")) {
+    status = PScommand (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+  
+  if (!strcmp (word, "PNGF")) {
+    status = PNGit (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+  
+  if (!strcmp (word, "PPMF")) {
+    status = PPMit (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+  
+  if (!strcmp (word, "DBOX")) {
+    status = LoadFrame (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+  
+  if (!strcmp (word, "PLOT")) {
+    status = LoadObject (sock);
+    // LoadObject sends its own handshake
+    // KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+  
+  if (!strcmp (word, "LABL")) {
+    status = LoadLabels (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "PTXT")) {
+    status = LoadTextlines (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "RSIZ")) {
+    status = Resize (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+
+  if (!strcmp (word, "GLIM")) {
+    GetLimits (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "SLIM")) {
+    status = SetLimits (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "GSTY")) {
+    GetGraphData (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "SSTY")) {
+    status = SetGraphData (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "SIMC")) {
+    SetImageCoords (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "GIMC")) {
+    GetImageCoords (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "GIMR")) {
+    GetImageRange (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "GIMD")) {
+    GetImageData (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "SIMD")) {
+    status = SetImageData (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "TOOL")) {
+    SetToolbox (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "SSEC")) {
+    status = SetSection (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "LSEC")) {
+    status = ListSection (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "DSEC")) {
+    status = DefineSection (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "MSEC")) {
+    status = MoveSection (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  if (!strcmp (word, "FONT")) {
+    status = SetFont (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+  
+  /* Erase Section */
+  if (!strcmp (word, "ERSC")) {
+    status = EraseCurrentPlot ();
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+  
+  /* Erase Plots */
+  if (!strcmp (word, "ERSP")) {
+    status = ErasePlots ();
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+  
+  /* Erase Sections */
+  if (!strcmp (word, "ERSS")) {
+    status = EraseSections ();
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+
+  /* Erase Image */
+  if (!strcmp (word, "ERSI")) {
+    status = EraseImage ();
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+
+  /* Erase Overlay for this section */
+  if (!strcmp (word, "ERSO")) {
+    status = EraseOverlay (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+
+  if (!strcmp (word, "READ")) {
+    status = LoadPicture (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+
+  if (!strcmp (word, "LOAD")) {
+    status = LoadOverlay (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+
+  if (!strcmp (word, "SAVE")) {
+    status = SaveOverlay (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+
+  if (!strcmp (word, "CSVE")) {
+    status = CSaveOverlay (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+
+  if (!strcmp (word, "JPEG")) {
+    status = JPEGit24 (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+
+  if (!strcmp (word, "CENT")) {
+    status = Center (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (status);
+  }
+
+  if (!strcmp (word, "NPIX")) {
+    GetPixelCount (sock);
+    KiiSendCommand (sock, 4, "DONE");
+    FINISHED (TRUE);
+  }
+
+  fprintf (stderr, "unknown signal %s\n", word);
+  KiiSendCommand (sock, 4, "DONE");
+  FINISHED (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckVisual.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckVisual.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckVisual.c	(revision 15879)
@@ -0,0 +1,196 @@
+# include "Ximage.h"
+# define NPIXELS 64
+
+/* DirectColor doesn't seem to work, even though it is available:
+   I cannot use XAllocColorCells to get pixels under DirectColor
+*/
+
+/* static int try_visual[] = {5, 3, 1, 4, 2, 0}; */
+
+void CheckVisual (Graphic *graphic, int *argc, char **argv) {
+
+  int i, Nfound, N;
+  int col, def, dyn;
+  XVisualInfo *visual_list, visual_temp;
+  unsigned long planes[3];
+  XPixmapFormatValues *pixmaps;
+  int Npixmaps;
+
+  if (DEBUG) {
+    fprintf (stderr, "DirectColor: %d\n", DirectColor);
+    fprintf (stderr, "PseudoColor: %d\n", PseudoColor);
+    fprintf (stderr, "TrueColor: %d\n", TrueColor);
+    fprintf (stderr, "GrayScale: %d\n", GrayScale);
+    fprintf (stderr, "StaticColor: %d\n", StaticColor);
+    fprintf (stderr, "StaticGray: %d\n", StaticGray);
+  }
+
+  visual_temp.screen = graphic[0].screen;
+  
+  /* find available visuals */
+  visual_list = XGetVisualInfo (graphic[0].display, VisualScreenMask, &visual_temp, &Nfound);
+  if (Nfound == 0) {
+    fprintf (stderr, "error finding useful visual\n");
+    exit (0);
+  }
+  
+  /* check default visual first */ 
+  for (i = 0; (i < Nfound) && (graphic[0].visual != visual_list[i].visual); i++);
+  if (i == Nfound) {
+    fprintf (stderr, "default visual not found??\n");
+    exit (0);
+  }
+
+  col = def = dyn = FALSE;
+  if (DEBUG) fprintf (stderr, "default visual class is %d\n", visual_list[i].class);
+  switch (visual_list[i].class) {
+  case PseudoColor:
+    col = def = dyn = TRUE;
+    graphic[0].visual = visual_list[i].visual;
+    graphic[0].visualclass = TRUE;
+    goto test_pixels;
+    break;
+  default:
+    break;
+  }
+
+  for (i = 0; i < Nfound; i++) {
+    switch (visual_list[i].class) {
+    case PseudoColor:
+      if (DEBUG) fprintf (stderr, "selected visual class is %d\n", visual_list[i].class);
+      col = dyn = TRUE;
+      if (graphic[0].visual == visual_list[i].visual) {
+	def = TRUE;
+      } else {
+	graphic[0].visual = visual_list[i].visual;
+      }
+      graphic[0].visualclass = TRUE;
+      goto test_pixels;
+      break;
+    default:
+      break;
+    }
+  }
+
+  for (i = 0; i < Nfound; i++) {
+    switch (visual_list[i].class) {
+    case GrayScale:
+      if (DEBUG) fprintf (stderr, "selected visual class is %d\n", visual_list[i].class);
+      dyn = TRUE;
+      if (graphic[0].visual == visual_list[i].visual) {
+	def = TRUE;
+      } else {
+	graphic[0].visual = visual_list[i].visual;
+      }
+      graphic[0].visualclass = TRUE;
+      goto test_pixels;
+      break;
+    default:
+      break;
+    }
+  }
+
+  for (i = 0; (i < Nfound) && (visual_list[i].class != TrueColor); i++);
+  if (i != Nfound) {
+    col = TRUE;
+    if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class);
+    if (graphic[0].visual == visual_list[i].visual) {
+      def = TRUE;
+    } else {
+      graphic[0].visual = visual_list[i].visual;
+    }
+    graphic[0].visualclass = FALSE;
+    goto test_pixels;
+  }
+
+  for (i = 0; (i < Nfound) && (visual_list[i].class != StaticColor); i++);
+  if (i != Nfound) {
+    if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class);
+    if (graphic[0].visual == visual_list[i].visual) {
+      def = TRUE;
+    } else {
+      graphic[0].visual = visual_list[i].visual;
+    }
+    graphic[0].visualclass = FALSE;
+    goto test_pixels;
+  }
+
+  for (i = 0; (i < Nfound) && (visual_list[i].class != StaticGray); i++);
+  if (i != Nfound) {
+    if (DEBUG) fprintf (stderr, "visual class is %d\n", visual_list[i].class);
+    if (graphic[0].visual == visual_list[i].visual) {
+      def = TRUE;
+    } else {
+      graphic[0].visual = visual_list[i].visual;
+    }
+    graphic[0].visualclass = FALSE;
+    goto test_pixels;
+  }
+
+  test_pixels:
+
+  /* need to make a colormap if 
+     1) the selected visual is not the default 
+     2) there are not enough colors available */
+
+  /* NEED TO ADD A COUPLE LINES DEFINING THE VARIOUS HARD COLORS (BLACK, WHITE, AND THE OVERLAYS) */
+
+  if ((N = get_argument (*argc, argv, "-private"))) {
+    remove_argument(N, argc, argv);
+    def = FALSE;
+  } 
+
+  if (!def) {
+    if (DEBUG) fprintf (stderr, "allocated private colormap\n");
+    graphic[0].colormap = XCreateColormap (graphic[0].display, RootWindow (graphic[0].display, graphic[0].screen), graphic[0].visual, AllocNone);
+  }
+
+  if (dyn) {
+    /* allocate color cells  */
+    for (graphic[0].Npixels = NPIXELS;
+	 ((graphic[0].Npixels >= 16) && 
+	  !XAllocColorCells (graphic[0].display, graphic[0].colormap, FALSE, planes, 1, graphic[0].pixels, graphic[0].Npixels));
+	 graphic[0].Npixels -= 4) {
+      if (DEBUG) fprintf (stderr, "trying %d colors\n", (int) graphic[0].Npixels);
+    }
+
+
+    /* make private colormap  */
+    if (graphic[0].Npixels < 16) {
+      // fprintf (stderr, "can't allocate enough cells, using private colormap\n");
+      graphic[0].colormap = XCreateColormap (graphic[0].display, RootWindow (graphic[0].display, graphic[0].screen), graphic[0].visual, AllocNone);
+      for (graphic[0].Npixels = NPIXELS;
+	   ((graphic[0].Npixels >= 16) && 
+	    !XAllocColorCells (graphic[0].display, graphic[0].colormap, FALSE, planes, 1, graphic[0].pixels, graphic[0].Npixels));
+	   graphic[0].Npixels -= 4);
+
+      if ((N = get_argument (*argc, argv, "-colorcount"))) {
+	fprintf (stderr, "kii can grab %d colors\n", (int) graphic[0].Npixels);
+	exit (0);
+      } 
+      if (graphic[0].Npixels < 16) {
+	fprintf (stderr, "can't even allocate enough cells in private colormap\n");
+	exit (0);
+      }
+    }
+  }
+
+  if (!dyn) {
+    graphic[0].Npixels = 256;
+    // fprintf (stderr, "can't use dynamic colors, color scrollbar inactive\n");
+    // fprintf (stderr, " this can be avoided by using a dynamic visual class\n");
+    // fprintf (stderr, " (see Kii help page for details)\n");
+  }
+
+  if ((N = get_argument (*argc, argv, "-colorcount"))) {
+    fprintf (stderr, "kii can grab %d colors\n", (int) graphic[0].Npixels);
+    exit (0);
+  } 
+  
+  pixmaps = XListPixmapFormats (graphic[0].display, &Npixmaps);
+  for (i = 0; i < Npixmaps; i++) {
+    if (pixmaps[i].depth == graphic[0].depth) {
+      graphic[0].Nbits = pixmaps[i].bits_per_pixel;
+    }
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CloseDisplay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CloseDisplay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CloseDisplay.c	(revision 15879)
@@ -0,0 +1,17 @@
+# include "Ximage.h"
+
+/************** CloseDisplay *************/
+void CloseDisplay () {
+
+  Graphic *graphic;
+
+  if (!USE_XWINDOW) return;
+
+  graphic = GetGraphic();
+  XFreeFont (graphic->display, graphic->font); 
+  XFreeGC (graphic->display, graphic->gc);
+  XDestroySubwindows (graphic->display, graphic->window);
+  XDestroyWindow (graphic->display, graphic->window);
+  XFlush (graphic->display);
+  XCloseDisplay (graphic->display);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateColorbar.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateColorbar.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateColorbar.c	(revision 15879)
@@ -0,0 +1,73 @@
+# include "Ximage.h"
+
+void CreateColorbar (KapaImageWidget *image, Graphic *graphic) {
+
+  int i, j, dx, dy, extra, start;
+  unsigned long  pixvalue;
+  unsigned int  *out24;
+  unsigned char *out8;
+
+  dx = image[0].cmapbar.dx;
+  dy = image[0].cmapbar.dy;
+
+  /* create the cmap scale */
+  switch (graphic[0].Nbits) {
+  case 8:
+    REALLOCATE (image[0].cmapbar.data, char, dx*dy);
+    out8 = (unsigned char *) image[0].cmapbar.data;
+    for (i = 0; i < dx; i++) {
+      pixvalue = graphic[0].cmap[(int)(i*graphic[0].Npixels/dx)].pixel;
+      for (j = 0; j < dy; j++) {
+	out8[j*dx + i] = pixvalue;
+      }
+    }
+    image[0].cmapbar.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					  image[0].cmapbar.data, dx, dy, 8, 0);
+    break;
+
+  case 16:
+    REALLOCATE (image[0].cmapbar.data, char, 2*dy*dx);
+    out8 = (unsigned char *) image[0].cmapbar.data;
+    for (i = 0; i < dx; i++) {
+      pixvalue = graphic[0].cmap[(int)(i*graphic[0].Npixels/dx)].pixel;
+      for (j = 0; j < dy; j++) {
+	start = 2*j*dx + 2*i;
+	out8[start + 0] = 0x0000ff & pixvalue;
+	out8[start + 1] = 0x0000ff & (pixvalue >> 8);
+      }
+    }
+    image[0].cmapbar.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					  image[0].cmapbar.data, dx, dy, 16, 0);
+    break;
+
+  case 24:
+    extra = 4 - (dx * 3) % 4;
+    REALLOCATE (image[0].cmapbar.data, char, dy*(3*dx + extra));
+    out8 = (unsigned char *) image[0].cmapbar.data;
+    for (i = 0; i < dx; i++) {
+      pixvalue = graphic[0].cmap[(int)(i*graphic[0].Npixels/dx)].pixel;
+      for (j = 0; j < dy; j++) {
+	start = j*(3*dx+extra) + 3*i;
+	out8[start + 0] = 0x0000ff & pixvalue;
+	out8[start + 1] = 0x0000ff & (pixvalue >> 8);
+	out8[start + 2] = 0x0000ff & (pixvalue >> 16);
+      }
+    }
+    image[0].cmapbar.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					  image[0].cmapbar.data, dx, dy, 32, 0);
+    break;
+
+  case 32:
+    REALLOCATE (image[0].cmapbar.data, char, 4*dx*dy);
+    out24 = (unsigned int *) image[0].cmapbar.data;
+    for (i = 0; i < dx; i++) {
+      pixvalue = graphic[0].cmap[(int)(i*graphic[0].Npixels/dx)].pixel;
+      for (j = 0; j < dy; j++) {
+	out24[j*dx + i] = pixvalue;
+      }
+    }
+    image[0].cmapbar.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					 image[0].cmapbar.data, dx, dy, 32, 0);
+    break;
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreatePicture.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreatePicture.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreatePicture.c	(revision 15879)
@@ -0,0 +1,67 @@
+# include "Ximage.h"
+
+void CreatePicture (KapaImageWidget *image, Graphic *graphic) {
+
+  int i, j, extra;
+  unsigned char *c;
+  unsigned int *l;
+  unsigned int start, start1, start2, start3;
+
+  start = graphic[0].back;
+
+  switch (graphic[0].Nbits) {
+  case 8:
+    REALLOCATE (image[0].picture.data, char, image[0].picture.dx*image[0].picture.dy);
+    c = (unsigned char *) image[0].picture.data;
+    for (i = 0; i < (image[0].picture.dx*image[0].picture.dy); i++, c++)
+      *c = start;
+    image[0].picture.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					  image[0].picture.data, image[0].picture.dx, image[0].picture.dy, 8, 0);
+    break;
+
+  case 16:
+    REALLOCATE (image[0].picture.data, char, 2*image[0].picture.dy*image[0].picture.dx);
+    c = (unsigned char *) image[0].picture.data;
+    start1 = 0x0000ff & (start);
+    start2 = 0x0000ff & (start >> 8);
+    for (i = 0; i < image[0].picture.dy; i++) {
+      for (j = 0; j < image[0].picture.dx; j++, c+=2) {
+	c[0] = start1;
+	c[1] = start2;
+      }
+    }
+    image[0].picture.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					  image[0].picture.data, image[0].picture.dx, image[0].picture.dy, 16, 0);
+    break;
+
+  case 24:
+    extra = 4 - (image[0].picture.dx * 3) % 4;
+    REALLOCATE (image[0].picture.data, char, image[0].picture.dy*(3*image[0].picture.dx+extra));
+    c = (unsigned char *) image[0].picture.data;
+    start1 = 0x0000ff & (start);
+    start2 = 0x0000ff & (start >> 8);
+    start3 = 0x0000ff & (start >> 16);
+    for (i = 0; i < image[0].picture.dy; i++) {
+      for (j = 0; j < image[0].picture.dx; j++, c+=3) {
+	c[0] = start1;
+	c[1] = start2;
+	c[2] = start3;
+      }
+      c+=extra;
+    }
+    image[0].picture.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					  image[0].picture.data, image[0].picture.dx, image[0].picture.dy, 24, 0);
+    break;
+
+  case 32:
+    REALLOCATE (image[0].picture.data, char, (4*image[0].picture.dx*image[0].picture.dy + 32));
+    memset (image[0].picture.data, 0xbd, 4*image[0].picture.dx*image[0].picture.dy + 30);
+    l = (unsigned int *) image[0].picture.data;
+    for (i = 0; i < (image[0].picture.dx*image[0].picture.dy); i++, l++)
+      *l = start;
+    image[0].picture.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					  image[0].picture.data, image[0].picture.dx, image[0].picture.dy, 32, 0);
+    break;
+  }
+    
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateWindow.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateWindow.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateWindow.c	(revision 15879)
@@ -0,0 +1,34 @@
+# include "Ximage.h"
+
+/************** CreateWindow *************/
+void CreateWindow (Graphic *graphic, Window parent, int border, long events) {
+
+  XSetWindowAttributes attributes;
+  unsigned long attribute_mask;
+  Visual *visual = CopyFromParent;
+
+  HAVE_BACKING = (DoesBackingStore (ScreenOfDisplay(graphic->display, graphic->screen)) == Always);
+
+  if (HAVE_BACKING) {
+    attributes.backing_store = Always;
+    attribute_mask = CWBackingStore | CWBackPixel | CWBorderPixel | CWEventMask;
+  } else {
+    attribute_mask = CWBackPixel | CWBorderPixel | CWEventMask;
+  }
+
+  attributes.background_pixel = graphic->back;
+  attributes.border_pixel     = graphic->fore;
+  attributes.event_mask       = events;
+
+  graphic->window = XCreateWindow (graphic->display, parent, 
+				     graphic->x, graphic->y, 
+				     graphic->dx, graphic->dy, 
+				     border, CopyFromParent,
+				     InputOutput, visual, 
+				     attribute_mask, &attributes);
+
+  if (graphic->window == (Window) None)
+    QuitX (graphic->display, "error: could not open window");
+
+  XSelectInput (graphic->display, graphic->window, events);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom.c	(revision 15879)
@@ -0,0 +1,23 @@
+# include "Ximage.h"
+
+void CreateZoom (KapaImageWidget *image, Graphic *graphic, double x, double y) {
+
+  switch (graphic[0].Nbits) {
+  case 8:
+    CreateZoom8 (image, graphic, x, y);
+    break;
+
+  case 16:
+    CreateZoom16 (image, graphic, x, y);
+    break;
+
+  case 24:
+    CreateZoom24 (image, graphic, x, y);
+    break;
+
+  case 32:
+    CreateZoom32 (image, graphic, x, y);
+    break;
+  }    
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom16.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom16.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom16.c	(revision 15879)
@@ -0,0 +1,154 @@
+# include "Ximage.h"
+# define FRAC(a) ((a) - (int)(a))
+
+static float slope = 1.0;
+static float start = 0.0;
+static int MaxValue = 255;
+
+// XXX inline this if needed
+static int PixelLookup(float value) {
+  int out;
+  out = MIN (MAX (slope * value - start, 0), MaxValue);
+  return (out);
+}
+
+void CreateZoom16 (KapaImageWidget *image, Graphic *graphic, double x, double y) {
+
+  int i, j, ii, jj;
+  int i_start, i_end, j_start, j_end;
+  int dropback;  /* this is a bit of a kludge... */
+  int dx, dy, DX, DY, pixelN;
+  double expand, zoomscale, Rx, Ry;
+  int expand_in, expand_out;
+  unsigned char *out_pix, *out_pix2, *data;
+  float *imdata, *in_pix,  *in_pix2;
+  unsigned char pixel1[256], pixel2[256];
+  unsigned char pixvalue1, pixvalue2;
+  unsigned long back;
+  unsigned char back1, back2;
+
+  dx = image[0].zoom.dx;
+  dy = image[0].zoom.dy;
+
+  if (image[0].matrix.size == 0) {  /* create a test pattern */
+    REALLOCATE (image[0].zoom.data, char, 2*dy*dx);
+    bzero (image[0].zoom.data, image[0].zoom.dx*image[0].zoom.dy);
+    image[0].zoom.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+				       image[0].zoom.data, image[0].zoom.dx, image[0].zoom.dy, 16, 0);
+    return;
+  }
+
+  for (i = 0; i < 256; i++) { /* set up pixel array */
+    pixel1[i] = 0x0000ff &  graphic[0].cmap[i].pixel;
+    pixel2[i] = 0x0000ff & (graphic[0].cmap[i].pixel >> 8);
+  }
+  back = graphic[0].back;
+  back1 = 0x0000ff & back;
+  back2 = 0x0000ff & (back >> 8);
+  // define the color transform parameters
+  MaxValue = graphic[0].Npixels - 1;
+  if (image[0].range != 0.0) {
+    slope = graphic[0].Npixels / image[0].range;
+    start = graphic[0].Npixels * image[0].zero / image[0].range;
+  } else {
+    slope = 1.0;
+    start = image[0].zero;
+  }
+
+  zoomscale = MAX (5, image[0].expand + 5);
+  expand = 1 / zoomscale;
+  expand_out = (int) zoomscale;
+  expand_in  = 1;
+
+  DX = image[0].matrix.Naxis[0];
+  DY = image[0].matrix.Naxis[1];
+  Rx = x - expand*(int)(0.5*(dx + 1)) + 1;
+  Ry = y - expand*(int)(0.5*(dy + 1)) + 1;
+
+  i_start = MIN (MAX (-Rx / expand, (1 - FRAC(Rx)) / expand), dx - expand_out + 1);
+  j_start = MIN (MAX (-Ry / expand, (1 - FRAC(Ry)) / expand), dy - expand_out + 1);
+  i_end   = MAX (MIN ((DX-Rx) / expand, dx - expand_out + 1), 0);
+  j_end   = MAX (MIN ((DY-Ry) / expand, dy - expand_out + 1), 0);
+  dropback = expand_out - (i_end - i_start) % expand_out;
+  if ((i_end - i_start) % expand_out == 0) dropback = 0;
+
+  data = out_pix = (unsigned char *) image[0].zoom.data;
+  imdata  = (float *) image[0].matrix.buffer;
+  in_pix  = &imdata[DX*(int)MAX(Ry,0) + (int)MAX(Rx,0)];
+
+  /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/
+
+  if ((i_end < i_start) || (j_end < j_start)) {
+    for (j = 0; j < dx*dy; j++, out_pix++) 
+      *out_pix = back;
+    return;
+  } 
+  
+  /**** fill in bottom area ****/
+  for (j = 0; j < j_start; j++) {
+    for (i = 0; i < dx; i++, out_pix+=2) {
+      out_pix[0] = back1;
+      out_pix[1] = back2;
+    }
+  }
+
+  for (j = j_start; j < j_end; j+= expand_out, in_pix += expand_in*DX) {
+    out_pix = &data[2*j*dx];
+
+    /**** fill in area to the left of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) { 
+      out_pix2 = out_pix + 2*jj*dx;
+      for (i = 0; i < i_start; i++, out_pix2+=2) {
+	out_pix2[0] = back1;
+	out_pix2[1] = back2;
+      }
+    }
+    out_pix += 2*i_start;
+    
+    /*** fill in the picture region ***/
+    in_pix2 = in_pix;
+    if (expand_out == 1) {
+      for (i = i_start; i < i_end; i++, in_pix2+= expand_in, out_pix+=2) {
+	pixelN = PixelLookup(*in_pix2);
+	out_pix[0] = pixel1[pixelN];
+	out_pix[1] = pixel2[pixelN];
+      }
+    } else {
+      for (i = i_start; i < i_end; i+= expand_out, in_pix2++, out_pix+= 2*expand_out) { 
+	pixelN = PixelLookup(*in_pix2);
+	pixvalue1 = pixel1[pixelN];
+	pixvalue2 = pixel2[pixelN];
+	out_pix2 = out_pix;
+	for (jj = 0; jj < expand_out; jj++, out_pix2+=2*(dx-expand_out)) {
+	  for (ii = 0; ii < expand_out; ii++, out_pix2+=2) {
+	    out_pix2[0] = pixvalue1; 
+	    out_pix2[1] = pixvalue2; 
+	  }
+	}
+      }
+    }
+    out_pix -= 2*dropback;
+    
+    /**** fill in area to the right of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) {
+      out_pix2 = out_pix + 2*jj*dx;
+      for (i = i_end; i < dx; i++, out_pix2+=2) {
+	out_pix2[0] = back1;
+	out_pix2[1] = back2;
+      }
+    }
+  } 
+  
+  out_pix = &data[2*j_end*dx];
+  /**** fill in top area ****/
+  for (j = 0; j < (dy - j_end); j++) {
+    for (i = 0; i < dx; i++, out_pix+=2) { 
+      out_pix[0] = back1;
+      out_pix[1] = back2;
+    }
+  }
+
+  image[0].zoom.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					image[0].zoom.data, image[0].zoom.dx, image[0].zoom.dy, 16, 0);
+  
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom24.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom24.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom24.c	(revision 15879)
@@ -0,0 +1,188 @@
+# include "Ximage.h"
+# define FRAC(a) ((a) - (int)(a))
+
+static float slope = 1.0;
+static float start = 0.0;
+static int MaxValue = 255;
+
+// XXX inline this if needed
+static int PixelLookup(float value) {
+  int out;
+  out = MIN (MAX (slope * value - start, 0), MaxValue);
+  return (out);
+}
+
+void CreateZoom24 (KapaImageWidget *image, Graphic *graphic, double x, double y) {
+
+  int i, j, ii, jj, extra;
+  int i_start, i_end, j_start, j_end;
+  int dropback;  /* this is a bit of a kludge... */
+  int dx, dy, DX, DY, pixelN;
+  double expand, zoomscale, Rx, Ry;
+  int expand_in, expand_out;
+  unsigned char *out_pix, *out_pix2, *data;
+  float *imdata, *in_pix, *in_pix2;
+  unsigned char pixel1[256], pixel2[256], pixel3[256];
+  unsigned char pixvalue1, pixvalue2, pixvalue3;
+  unsigned long back;
+  unsigned char back1, back2, back3;
+
+  dx = image[0].zoom.dx;
+  dy = image[0].zoom.dy;
+  extra = 4 - (dx * 3) % 4;
+
+  if (image[0].matrix.size == 0) {  /* create a test pattern */
+    REALLOCATE (image[0].zoom.data, char, dy*(3*dx+extra));
+    bzero (image[0].zoom.data, image[0].zoom.dx*image[0].zoom.dy);
+    image[0].zoom.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+				       image[0].zoom.data, image[0].zoom.dx, image[0].zoom.dy, 32, 0);
+    return;
+  }
+
+  for (i = 0; i < 256; i++) { /* set up pixel array */
+    pixel1[i] = 0x0000ff &  graphic[0].cmap[i].pixel;
+    pixel2[i] = 0x0000ff & (graphic[0].cmap[i].pixel >> 8);
+    pixel3[i] = 0x0000ff & (graphic[0].cmap[i].pixel >> 16);
+  }
+  back = graphic[0].back;
+  back1 = 0x0000ff & back;
+  back2 = 0x0000ff & (back >> 8);
+  back3 = 0x0000ff & (back >> 16);
+
+  // define the color transform parameters
+  MaxValue = graphic[0].Npixels - 1;
+  if (image[0].range != 0.0) {
+    slope = graphic[0].Npixels / image[0].range;
+    start = graphic[0].Npixels * image[0].zero / image[0].range;
+  } else {
+    slope = 1.0;
+    start = image[0].zero;
+  }
+
+  zoomscale = MAX (5, image[0].expand + 5);
+  expand = 1 / zoomscale;
+  expand_out = (int) zoomscale;
+  expand_in  = 1;
+
+  DX = image[0].matrix.Naxis[0];
+  DY = image[0].matrix.Naxis[1];
+  Rx = x - expand*(int)(0.5*(dx + 1)) + 1;
+  Ry = y - expand*(int)(0.5*(dy + 1)) + 1;
+
+  i_start = MIN (MAX (-Rx / expand, (1 - FRAC(Rx)) / expand), dx - expand_out + 1);
+  j_start = MIN (MAX (-Ry / expand, (1 - FRAC(Ry)) / expand), dy - expand_out + 1);
+  i_end   = MAX (MIN ((DX-Rx) / expand, dx - expand_out + 1), 0);
+  j_end   = MAX (MIN ((DY-Ry) / expand, dy - expand_out + 1), 0);
+  dropback = expand_out - (i_end - i_start) % expand_out;
+  if ((i_end - i_start) % expand_out == 0) dropback = 0;
+
+  data = out_pix = (unsigned char *) image[0].zoom.data;
+  imdata  = (float *) image[0].matrix.buffer;
+  in_pix  = &imdata[DX*(int)MAX(Ry,0) + (int)MAX(Rx,0)];
+
+  /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/
+
+  if ((i_end < i_start) || (j_end < j_start)) {
+    for (j = 0; j < dx*dy; j++, out_pix++) 
+      *out_pix = back;
+    return;
+  } 
+  
+  /**** fill in bottom area ****/
+  for (j = 0; j < j_start; j++) {
+    for (i = 0; i < dx; i++, out_pix+=3) {
+      out_pix[0] = back1;
+      out_pix[1] = back2;
+      out_pix[2] = back3;
+    }
+    out_pix += extra;
+  }
+
+  for (j = j_start; j < j_end; j+= expand_out, in_pix += expand_in*DX) {
+    out_pix = &data[j*(3*dx+extra)];
+
+    /**** fill in area to the left of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) { 
+      out_pix2 = out_pix + jj*(3*dx + extra);
+      for (i = 0; i < i_start; i++, out_pix2+=3) {
+	out_pix2[0] = back1;
+	out_pix2[1] = back2;
+	out_pix2[2] = back3;
+      }
+    }
+    out_pix += 3*i_start;
+    
+    /*** fill in the picture region ***/
+    in_pix2 = in_pix;
+    if (expand_out == 1) {
+      for (i = i_start; i < i_end; i++, in_pix2+= expand_in, out_pix+=3) {
+	pixelN = PixelLookup(*in_pix2);
+	out_pix[0] = pixel1[pixelN];
+	out_pix[1] = pixel2[pixelN];
+	out_pix[2] = pixel3[pixelN];
+      }
+    } else {
+      for (i = i_start; i < i_end; i+= expand_out, in_pix2++, out_pix+= 3*expand_out) { 
+	pixelN   = PixelLookup(*in_pix2);
+	pixvalue1 = pixel1[pixelN];
+	pixvalue2 = pixel2[pixelN];
+	pixvalue3 = pixel3[pixelN];
+	out_pix2 = out_pix;
+	for (jj = 0; jj < expand_out; jj++, out_pix2+=3*(dx-expand_out)+extra) {
+	  for (ii = 0; ii < expand_out; ii++, out_pix2+=3) {
+	    out_pix2[0] = pixvalue1; 
+	    out_pix2[1] = pixvalue2; 
+	    out_pix2[2] = pixvalue3; 
+	  }
+	}
+      }
+    }
+    out_pix -= 3*dropback;
+    
+    /**** fill in area to the right of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) {
+      out_pix2 = out_pix + jj*(3*dx+extra);
+      for (i = i_end; i < dx; i++, out_pix2+=3) {
+	out_pix2[0] = back1;
+	out_pix2[1] = back2;
+	out_pix2[2] = back3;
+      }
+    }
+  } 
+  
+  /*
+  if ((j_end - j_start) % expand_out > 0)
+    out_pix -= (expand_out - (j_end - j_start) % expand_out);
+  */
+
+  out_pix = &data[j_end*(3*dx+extra)];
+  /**** fill in top area ****/
+  for (j = 0; j < (dy - j_end); j++) {
+    for (i = 0; i < dx; i++, out_pix+=3) { 
+      out_pix[0] = back1;
+      out_pix[1] = back2;
+      out_pix[2] = back3;
+    }
+    out_pix+=extra;
+  }
+
+  /*
+  out_pix = (unsigned char *) image[0].zoom.data;
+  for (i = 0; i < dx*dy; i++) {
+    out_pix[3*i + 0] = back1;
+    out_pix[3*i + 1] = back2;
+    out_pix[3*i + 2] = back3;
+  }
+  for (j = 0; j < dy/2; j++) {
+    for (i = 0; i < dx; i++) {
+      out_pix[j*(extra + 3*dx) + 3*i + 0] = pixel1[10];
+      out_pix[j*(extra + 3*dx) + 3*i + 1] = pixel2[10];
+      out_pix[j*(extra + 3*dx) + 3*i + 2] = pixel3[10];
+    }
+
+  }
+  */
+  image[0].zoom.pix = XCreateImage (graphic[0].display, graphic[0].visual, 24, ZPixmap, 0, 
+					image[0].zoom.data, image[0].zoom.dx, image[0].zoom.dy, 32, 0);
+  
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom32.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom32.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom32.c	(revision 15879)
@@ -0,0 +1,143 @@
+# include "Ximage.h"
+# define FRAC(a) ((a) - (int)(a))
+
+static float slope = 1.0;
+static float start = 0.0;
+static int MaxValue = 255;
+
+// XXX inline this if needed
+static int PixelLookup(float value) {
+  int out;
+  out = MIN (MAX (slope * value - start, 0), MaxValue);
+  return (out);
+}
+
+void CreateZoom32 (KapaImageWidget *image, Graphic *graphic, double x, double y) {
+
+  int i, j, ii, jj;
+  int i_start, i_end, j_start, j_end;
+  int dropback;  /* this is a bit of a kludge... */
+  int dx, dy, DX, DY, pixelN;
+  double expand, zoomscale, Rx, Ry;
+  int expand_in, expand_out;
+  unsigned int *out_pix, *out_pix2;
+  float *imdata, *in_pix, *in_pix2;
+  unsigned long pixel[256], pixvalue;
+  unsigned long back;
+
+  if (image[0].matrix.size == 0) {  /* create a test pattern */
+    REALLOCATE (image[0].zoom.data, char, 4*image[0].zoom.dx*image[0].zoom.dy);
+    image[0].zoom.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+				       image[0].zoom.data, image[0].zoom.dx, image[0].zoom.dy, 32, 0);
+    return;
+  }
+
+  for (i = 0; i < 256; i++) { /* set up pixel array */
+    pixel[i] = graphic[0].cmap[i].pixel;
+  }
+  back = graphic[0].back;
+
+  // define the color transform parameters
+  MaxValue = graphic[0].Npixels - 1;
+  if (image[0].range != 0.0) {
+    slope = graphic[0].Npixels / image[0].range;
+    start = graphic[0].Npixels * image[0].zero / image[0].range;
+  } else {
+    slope = 1.0;
+    start = image[0].zero;
+  }
+
+  zoomscale = MAX (5, image[0].expand + 5);
+  expand = 1 / zoomscale;
+  expand_out = (int) zoomscale;
+  expand_in  = 1;
+
+  dx = image[0].zoom.dx;
+  dy = image[0].zoom.dy;
+  DX = image[0].matrix.Naxis[0];
+  DY = image[0].matrix.Naxis[1];
+  Rx = x - expand*(int)(0.5*(dx + 1)) + 1;
+  Ry = y - expand*(int)(0.5*(dy + 1)) + 1;
+
+  i_start = MIN (MAX (-Rx / expand, (1 - FRAC(Rx)) / expand), dx - expand_out + 1);
+  j_start = MIN (MAX (-Ry / expand, (1 - FRAC(Ry)) / expand), dy - expand_out + 1);
+  i_end   = MAX (MIN ((DX-Rx) / expand, dx - expand_out + 1), 0);
+  j_end   = MAX (MIN ((DY-Ry) / expand, dy - expand_out + 1), 0);
+  dropback = expand_out - (i_end - i_start) % expand_out;
+  if ((i_end - i_start) % expand_out == 0) dropback = 0;
+
+  out_pix = (unsigned int *) image[0].zoom.data;
+  imdata  = (float *) image[0].matrix.buffer;
+  in_pix  = &imdata[DX*(int)MAX(Ry,0) + (int)MAX(Rx,0)];
+
+  /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/
+
+  if ((i_end < i_start) || (j_end < j_start)) {
+    for (j = 0; j < dx*dy; j++, out_pix++) 
+      *out_pix = back;
+    return;
+  } 
+  
+
+  /**** fill in bottom area ****/
+  for (j = 0; j < dx*j_start; j++, out_pix++) {
+    out_pix[0] = back;
+  }
+
+  for (j = j_start; j < j_end; j+= expand_out, out_pix+=(expand_out-1)*dx, in_pix += expand_in*DX) {
+
+    /**** fill in area to the left of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) { 
+      out_pix2 = out_pix + jj*dx;
+      for (i = 0; i < i_start; i++, out_pix2++) {
+	out_pix[0] = back;
+      }
+    }
+    out_pix += i_start;
+    
+    /*** fill in the picture region ***/
+    in_pix2 = in_pix;
+    if (expand_out == 1) {
+      for (i = i_start; i < i_end; i++, in_pix2+= expand_in, out_pix++) {
+	pixelN = PixelLookup(*in_pix2);
+	out_pix[0] = pixel[pixelN];
+      }
+    }
+    else {
+      for (i = i_start; i < i_end; i+= expand_out, in_pix2++, out_pix+= expand_out) { 
+	pixelN   = PixelLookup(*in_pix2);
+	pixvalue = pixel[pixelN];
+	out_pix2 = out_pix;
+	for (jj = 0; jj < expand_out; jj++, out_pix2+=(dx-expand_out)) {
+	  for (ii = 0; ii < expand_out; ii++, out_pix2++) {
+	    out_pix2[0] = pixvalue; 
+	  }
+	}
+      }
+    }
+    out_pix -= dropback;
+
+    
+    /**** fill in area to the right of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) {
+      out_pix2 = out_pix + jj*dx;
+      for (i = i_end; i < dx; i++, out_pix2++) {
+	out_pix2[0] = back;
+      }
+    }
+    out_pix += (dx - i_end);
+  } 
+  
+  if ((j_end - j_start) % expand_out > 0)
+    out_pix -= (expand_out - (j_end - j_start) % expand_out);
+  
+  /**** fill in top area ****/
+  for (j = 0; (j < dx*(dy - j_end)) && (out_pix - (unsigned int *)image[0].zoom.data < dx*dy); j++, out_pix++) { 
+    out_pix[0] = back;
+  }
+
+  out_pix = (unsigned int *)image[0].zoom.data;
+  image[0].zoom.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					image[0].zoom.data, image[0].zoom.dx, image[0].zoom.dy, 32, 0);
+  
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom8.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom8.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CreateZoom8.c	(revision 15879)
@@ -0,0 +1,140 @@
+# include "Ximage.h"
+# define FRAC(a) ((a) - (int)(a))
+
+static float slope = 1.0;
+static float start = 0.0;
+static int MaxValue = 255;
+
+// XXX inline this if needed
+static int PixelLookup(float value) {
+  int out;
+  out = MIN (MAX (slope * value - start, 0), MaxValue);
+  return (out);
+}
+
+void CreateZoom8 (KapaImageWidget *image, Graphic *graphic, double x, double y) {
+
+  int i, j, ii, jj;
+  int i_start, i_end, j_start, j_end;
+  int dropback;  /* this is a bit of a kludge... */
+  int dx, dy, DX, DY, pixelN;
+  double expand, zoomscale, Rx, Ry;
+  int expand_in, expand_out;
+  unsigned char *out_pix, *out_pix2;
+  float *imdata, *in_pix, *in_pix2;
+  unsigned long pixel[256], pixvalue;
+  unsigned long back;
+
+  if (image[0].matrix.size == 0) {  /* create a test pattern */
+    REALLOCATE (image[0].zoom.data, char, image[0].zoom.dx*image[0].zoom.dy);
+    bzero (image[0].zoom.data, image[0].zoom.dx*image[0].zoom.dy);
+    image[0].zoom.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+				       image[0].zoom.data, image[0].zoom.dx, image[0].zoom.dy, 8, 0);
+    return;
+  }
+
+  for (i = 0; i < 256; i++) { /* set up pixel array */
+    pixel[i] = graphic[0].cmap[i].pixel;
+  }
+  back = graphic[0].back;
+
+  // define the color transform parameters
+  MaxValue = graphic[0].Npixels - 1;
+  if (image[0].range != 0.0) {
+    slope = graphic[0].Npixels / image[0].range;
+    start = graphic[0].Npixels * image[0].zero / image[0].range;
+  } else {
+    slope = 1.0;
+    start = image[0].zero;
+  }
+
+  zoomscale = MAX (5, image[0].expand + 5);
+  expand = 1 / zoomscale;
+  expand_out = (int) zoomscale;
+  expand_in  = 1;
+
+  dx = image[0].zoom.dx;
+  dy = image[0].zoom.dy;
+  DX = image[0].matrix.Naxis[0];
+  DY = image[0].matrix.Naxis[1];
+  Rx = x - expand*(int)(0.5*(dx + 1)) + 1;
+  Ry = y - expand*(int)(0.5*(dy + 1)) + 1;
+
+  i_start = MIN (MAX (-Rx / expand, (1 - FRAC(Rx)) / expand), dx - expand_out + 1);
+  j_start = MIN (MAX (-Ry / expand, (1 - FRAC(Ry)) / expand), dy - expand_out + 1);
+  i_end   = MAX (MIN ((DX-Rx) / expand, dx - expand_out + 1), 0);
+  j_end   = MAX (MIN ((DY-Ry) / expand, dy - expand_out + 1), 0);
+  dropback = expand_out - (i_end - i_start) % expand_out;
+  if ((i_end - i_start) % expand_out == 0) dropback = 0;
+
+  out_pix = (unsigned char *) image[0].zoom.data;
+  imdata  = (float *) image[0].matrix.buffer;
+  in_pix  = &imdata[DX*(int)MAX(Ry,0) + (int)MAX(Rx,0)];
+
+  /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/
+
+  if ((i_end < i_start) || (j_end < j_start)) {
+    for (j = 0; j < dx*dy; j++, out_pix++) 
+      *out_pix = back;
+    return;
+  } 
+  
+  /**** fill in bottom area ****/
+  for (j = 0; j < dx*j_start; j++, out_pix++) 
+    *out_pix = back;
+  
+  for (j = j_start; j < j_end; j+= expand_out, out_pix+=(expand_out-1)*dx, in_pix += expand_in*DX) {
+
+    /**** fill in area to the left of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) { 
+      out_pix2 = out_pix + jj*dx;
+      for (i = 0; i < i_start; i++, out_pix2++) {
+	*out_pix2 = back;
+      }
+    }
+    out_pix += i_start;
+    
+    /*** fill in the picture region ***/
+    in_pix2 = in_pix;
+    if (expand_out == 1) {
+      for (i = i_start; i < i_end; i++, in_pix2+= expand_in, out_pix++) {
+	pixelN = PixelLookup(*in_pix2);
+	*out_pix = pixel[pixelN];
+      }
+    } else {
+      for (i = i_start; i < i_end; i+= expand_out, in_pix2++, out_pix+= expand_out) { 
+	pixelN   = PixelLookup(*in_pix2);
+	pixvalue = pixel[pixelN];
+	out_pix2 = out_pix;
+	for (jj = 0; jj < expand_out; jj++, out_pix2+=(dx-expand_out)) {
+	  for (ii = 0; ii < expand_out; ii++, out_pix2++) {
+	    *out_pix2 = pixvalue;
+	  }
+	}
+      }
+    }
+    out_pix -= dropback;
+    
+    /**** fill in area to the right of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) {
+      out_pix2 = out_pix + jj*dx;
+      for (i = i_end; i < dx; i++, out_pix2++) {
+	*out_pix2 = back;
+      }
+    }
+    out_pix += (dx - i_end);
+    
+  } 
+  
+  if ((j_end - j_start) % expand_out > 0)
+    out_pix -= expand_out - (j_end - j_start) % expand_out;
+  
+  /**** fill in top area ****/
+  for (j = 0; (j < dx*(dy - j_end)) && (out_pix - (unsigned char *) image[0].zoom.data < dx*dy); j++, out_pix++) { 
+    *out_pix = back;
+  }
+
+  image[0].zoom.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					image[0].zoom.data, image[0].zoom.dx, image[0].zoom.dy, 8, 0);
+  
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CrossHairs.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CrossHairs.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CrossHairs.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "Ximage.h"
+
+void CrossHairs (Graphic *graphic, KapaImageWidget *image) {
+
+  int x0, x1, x5, x7;
+  int y0, y2, y4, y5;
+  double zoomscale;
+
+  zoomscale = MAX (5, image[0].expand + 5);
+  x0 = (zoomscale) * (0.5 * (ZOOM_X + 1) / zoomscale - 2.5) + image[0].zoom.x;
+  x5 = (zoomscale) * (0.5 * (ZOOM_X + 1) / zoomscale - 0.5) + image[0].zoom.x;
+  x7 = (zoomscale) * (0.5 * (ZOOM_X + 1) / zoomscale + 0.5) + image[0].zoom.x;
+  x1 = (zoomscale) * (0.5 * (ZOOM_X + 1) / zoomscale + 2.5) + image[0].zoom.x;
+						    	 
+  y4 = (zoomscale) * (0.5 * (ZOOM_Y + 1) / zoomscale - 2.5) + image[0].zoom.y;
+  y2 = (zoomscale) * (0.5 * (ZOOM_Y + 1) / zoomscale - 0.5) + image[0].zoom.y;
+  y0 = (zoomscale) * (0.5 * (ZOOM_Y + 1) / zoomscale + 0.5) + image[0].zoom.y;
+  y5 = (zoomscale) * (0.5 * (ZOOM_Y + 1) / zoomscale + 2.5) + image[0].zoom.y;
+
+
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+  
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x0, y0, x5, y0);
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x5, y0, x5, y5);
+
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x7, y5, x7, y0);
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x7, y0, x1, y0);
+
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x0, y2, x5, y2);
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x5, y2, x5, y4);
+
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x7, y4, x7, y2);
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x7, y2, x1, y2);
+
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x0, y0+1, x5-1, y0+1);
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x5-1, y0+1, x5-1, y5);
+
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x7+1, y5, x7+1, y0+1);
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x7+1, y0+1, x1, y0+1);
+
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x0, y2-1, x5-1, y2-1);
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x5-1, y2-1, x5-1, y4);
+
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x7+1, y4, x7+1, y2-1);
+  XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	     x7+1, y2-1, x1, y2-1);
+
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CursorOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CursorOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CursorOps.c	(revision 15879)
@@ -0,0 +1,37 @@
+# include "Ximage.h"
+
+void Screen_to_Image (double *x1, double *y1, double x2, double y2, KapaImageWidget *image) {
+
+  double expand;
+
+  expand = 1.0;
+  if (image[0].expand > 0) {
+    expand = 1 / (1.0*image[0].expand);
+  }
+  if (image[0].expand < 0) {
+    expand = fabs((double)image[0].expand);
+  }
+  
+  *x1 = expand*(x2 - image[0].picture.x - 0.5*image[0].picture.dx) + 0.5*image[0].matrix.Naxis[0] - image[0].X;
+  *y1 = expand*(y2 - image[0].picture.y - 0.5*image[0].picture.dy) + 0.5*image[0].matrix.Naxis[1] - image[0].Y;
+  
+}
+
+void Image_to_Screen (double *x1, double *y1, double x2, double y2, KapaImageWidget *image) {
+
+  double expand;
+
+  /* notice that here, expand is the reciprocal of the expand above */
+  expand = 1.0;
+  if (image[0].expand > 0) {
+    expand = abs(image[0].expand);
+  }
+  if (image[0].expand < 0) {
+    expand = 1 / ((double)abs(image[0].expand));
+  }
+  
+  *x1 = (x2 - 0.5*image[0].matrix.Naxis[0] + image[0].X) * expand + image[0].picture.x + 0.5*image[0].picture.dx;
+  *y1 = (y2 - 0.5*image[0].matrix.Naxis[1] + image[0].Y) * expand + image[0].picture.y + 0.5*image[0].picture.dy;
+  
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/DefineSection.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/DefineSection.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/DefineSection.c	(revision 15879)
@@ -0,0 +1,40 @@
+# include "Ximage.h"
+
+// define the section, but do not create a graph or image 
+int DefineSection (int sock) {
+  
+  int N, MoveSection;
+  char name[128];
+  double x, y, dx, dy;
+  Section *section;
+
+  KiiScanMessage (sock, "%s %lf %lf %lf %lf", name, &x, &y, &dx, &dy);
+
+  MoveSection = FALSE;
+
+  N = GetSectionByName (name);
+  if (N < 0) {
+    section = AddSection (name, x, y, dx, dy);
+    MoveSection = TRUE;
+  } else {
+    section = GetSectionByNumber (N);
+    SetActiveSectionByNumber (N);
+
+    if (section[0].x != x)   MoveSection = TRUE;
+    if (section[0].y != y)   MoveSection = TRUE;
+    if (section[0].dx != dx) MoveSection = TRUE;
+    if (section[0].dy != dy) MoveSection = TRUE;
+
+    section[0].x = x;
+    section[0].y = y;
+    section[0].dx = dx;
+    section[0].dy = dy;
+  }
+
+  if (MoveSection) {
+    SetSectionSizes (section);
+    Refresh (1);
+  }
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/DragColorbar.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/DragColorbar.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/DragColorbar.c	(revision 15879)
@@ -0,0 +1,106 @@
+# include "Ximage.h"
+/* future expansion: warp mouse to the right spot for the current settings */
+
+void DragColorbar (Graphic *graphic, KapaImageWidget *image, XButtonEvent *mouse_event) {
+
+  double          frac_x, oldfrac_x, frac_y, oldfrac_y, start, slope;
+  int             X, Y;
+  XEvent          event;
+  XMotionEvent   *move;
+  int             xstatus, Npix, center;
+
+  if (!graphic[0].visualclass) return;
+
+  X = mouse_event[0].x;
+  Y = mouse_event[0].y;
+  Npix = graphic[0].Npixels;
+  slope = image[0].slope;
+  start = image[0].start;
+  oldfrac_x = oldfrac_y = 10;
+  
+  while (1) {
+    frac_x = X / (1.0*graphic[0].dx);
+    frac_x = MAX (0, frac_x);
+    frac_x = MIN (1, frac_x);
+    frac_y = Y / (1.0*graphic[0].dy);
+    frac_y = MAX (0, frac_y);
+    frac_y = MIN (1, frac_y);
+    switch (mouse_event[0].button) {
+    case 1:
+      center = frac_x*Npix;
+      slope = Npix / (1 + 4*frac_y*frac_y*Npix);
+      start = Npix/2.0 - center*slope;
+      break;
+    case 2:
+      start = 0;
+      slope = 1;
+      break;
+    case 3:
+      center = (Npix/2.0 - start) / slope;
+      slope = Npix / (1 + 4*frac_x*frac_x*Npix);
+      start = Npix/2.0 - center*slope;
+      break;
+    }
+
+    if ((frac_x != oldfrac_x) || (frac_y != oldfrac_y)) {
+      ResetColorbar (graphic, start, slope);
+    }
+    oldfrac_x = frac_x;
+    oldfrac_y = frac_y;
+      
+    if ((xstatus = XCheckMaskEvent (graphic[0].display, EVENT_MASK, &event))) {
+      
+      switch (event.type)  {
+	
+      case MotionNotify:
+	if ((xstatus = XPending (graphic[0].display)) < 2) {
+	  move = (XMotionEvent *) &event;
+	  X = move[0].x;
+	  Y = move[0].y;
+	}
+	break;
+	
+      case ButtonPress:
+      case ButtonRelease:
+	image[0].start = start;	
+	image[0].slope = slope;
+	return;
+	break;
+	
+      }
+    }
+  }
+  
+}
+
+void ResetColorbar (Graphic *graphic, double start, double slope) {
+
+  int i, j;
+  XColor cmap[256];
+
+  if (!graphic[0].visualclass) return;
+
+  for (i = 0; i < graphic[0].Npixels; i++) {
+    cmap[i] = graphic[0].cmap[i];
+    j = start + i * slope;
+    if (j < 0) {
+      cmap[i].red = graphic[0].cmap[0].red;
+      cmap[i].blue = graphic[0].cmap[0].blue;
+      cmap[i].green = graphic[0].cmap[0].green;
+    }
+    else {
+      if (j >= graphic[0].Npixels) {
+	cmap[i].red = graphic[0].cmap[graphic[0].Npixels-1].red;
+	cmap[i].blue = graphic[0].cmap[graphic[0].Npixels-1].blue;
+	cmap[i].green = graphic[0].cmap[graphic[0].Npixels-1].green;
+      }
+      else {
+	cmap[i].red = graphic[0].cmap[j].red;
+	cmap[i].blue = graphic[0].cmap[j].blue;
+	cmap[i].green = graphic[0].cmap[j].green;
+      }
+    }
+  }
+
+  XStoreColors(graphic[0].display, graphic[0].colormap, cmap, graphic[0].Npixels);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawBitmap.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawBitmap.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawBitmap.c	(revision 15879)
@@ -0,0 +1,46 @@
+# include "Ximage.h"
+
+void DrawBitmap (Graphic *graphic, int x, int y, int dx, int dy, char *bitmap, int mode) {
+
+  int i, j, byte_line, byte, bit, flag;
+  unsigned long int fore, back;
+
+  fore = graphic[0].fore;
+  back = graphic[0].back;
+
+  if (mode == 0) {
+    fore = graphic[0].fore;
+    back = graphic[0].back;
+    graphic[0].fore = back;
+    graphic[0].back = back;
+  }
+    
+  if (mode == 2) {
+    fore = graphic[0].fore;
+    back = graphic[0].back;
+    graphic[0].fore = back;
+    graphic[0].back = fore;
+  }
+    
+  
+  byte_line = (int) ((dx + 7) / 8);
+  for (i = 0; i < dy; i++) {
+    for (j = 0; j < dx; j++) {
+      byte = byte_line * i + (j / 8);
+      bit = j % 8;
+      flag = 0x01 & (bitmap[byte] >> bit);
+      if (flag)
+	XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+      else 
+	XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
+      XDrawPoint (graphic[0].display, graphic[0].window, 
+		  graphic[0].gc, x + j, y + i);
+    }
+  }
+  if (mode == 0) {
+    graphic[0].fore = fore;
+    graphic[0].back = back;
+  }
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawButton.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawButton.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawButton.c	(revision 15879)
@@ -0,0 +1,43 @@
+# include "Ximage.h"
+
+void DrawButton (Graphic *graphic, Button *button) {
+  
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
+  XFillRectangle (graphic[0].display, 
+		  graphic[0].window,
+		  graphic[0].gc,
+		  button[0].x,  button[0].y,
+		  button[0].dx, button[0].dy);
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+  XDrawRectangle (graphic[0].display, 
+		  graphic[0].window,
+		  graphic[0].gc,
+		  button[0].x,  button[0].y,
+		  button[0].dx, button[0].dy);
+
+  DrawBitmap (graphic, 
+	      button[0].x + (button[0].dx - button[0].width) / 2 + 1, 
+	      button[0].y + (button[0].dy - button[0].height) / 2 + 1, 
+	      button[0].width, button[0].height, 
+	      button[0].bitmap, 1);
+
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+}
+
+# if (0)
+  if (button[0].text) {
+    dX = XTextWidth (graphic[0].font, button[0].bitmap, strlen(button[0].bitmap));
+    y = button[0].y + (button[0].dy + graphic[0].font[0].ascent)/2;
+    XDrawString (graphic[0].display, 
+		 graphic[0].window, 
+		 graphic[0].gc, 
+		 button[0].x + (button[0].dx - dX) / 2, y,
+		 button[0].bitmap, strlen(button[0].bitmap));
+  } else {
+    DrawBitmap (graphic, 
+		button[0].x + (button[0].dx - button[0].width) / 2 + 1, 
+		button[0].y + (button[0].dy - button[0].height) / 2 + 1, 
+		button[0].width, button[0].height, 
+		button[0].bitmap, 1);
+  }
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawFrame.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawFrame.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawFrame.c	(revision 15879)
@@ -0,0 +1,179 @@
+# include "Ximage.h"
+# define MIN_RANGE 1e-10
+# define DrawLine(X,Y,DX,DY) (XDrawLine (graphic->display, graphic->window, graphic->gc, (int)(X), (int)(Y), (int)(X+DX), (int)(Y+DY)))
+  
+static Graphic *graphic;
+
+void DrawFrame (KapaGraphWidget *graph) {
+  
+  int i, fx, fy, dfx, dfy, P, IsLabel;
+  double range, major, minor, first, next;
+
+  graphic = GetGraphic();
+
+  // XXX why is this called for every redraw?
+  DrawRotTextInit (graphic->display, graphic->window, graphic->gc, graphic->fore, graphic->back);
+
+  /* each axis is drawn independently, but ticks and labels are placed according to
+     perpendicular distance. */
+  for (i = 0; i < 4; i++) {
+    fx = graph[0].axis[i].fx;
+    fy = graph[0].axis[i].fy;
+    dfx = graph[0].axis[i].dfx;
+    dfy = graph[0].axis[i].dfy;
+    P = hypot ((double)graph[0].axis[(i+1)%2].dfx, (double)graph[0].axis[(i+1)%2].dfy);
+
+    if (graph[0].axis[i].isaxis) {
+      DrawLine (fx, fy, dfx, dfy);
+    }
+    
+    if (graph[0].axis[i].areticks) {
+      if (isnan(graph[0].axis[i].min) || isinf(graph[0].axis[i].min)) continue;
+      if (isnan(graph[0].axis[i].max) || isinf(graph[0].axis[i].max)) continue;
+
+      range = graph[0].axis[i].max - graph[0].axis[i].min;
+      if (fabs(range) < MIN_RANGE) continue;
+
+      if (fabs(range) < MIN_RANGE) {
+	range = (range < 0) ? -MIN_RANGE : +MIN_RANGE;
+      }
+
+      AxisTickScale (&graph[0].axis[i], &major, &minor);
+
+      first = minor*((int)(graph[0].axis[i].min/minor));
+      if ((range > 0) && (first < graph[0].axis[i].min)) {
+	first += minor;
+      }
+      if ((range < 0) && (first > graph[0].axis[i].min)) {
+	first -= minor;
+      }
+      for (next = first; ((range > 0) && (next <= graph[0].axis[i].max)) || ((range < 0) && (next >= graph[0].axis[i].max));) {
+	IsLabel = FALSE;
+	if ((fabs((int)(next/major) - (next/major)) < 0.5*(minor/major)) || 
+	    (fabs ((int)((next + 0.5*minor)/major) - (next/major)) < 0.5*(minor/major)) ||
+	    (fabs ((int)((next - 0.5*minor)/major) - (next/major)) < 0.5*(minor/major)))
+	  IsLabel = graph[0].axis[i].islabel;
+	DrawTick (fx, fy, dfx, dfy, P, graph[0].axis[i].min, graph[0].axis[i].max, next, IsLabel, i);
+	if (range > 0) 
+	  next += minor;
+	else 
+	  next -= minor;
+      }
+    }
+  }
+}
+
+void DrawTick (int fx, int fy, int dfx, int dfy, 
+	       int P, double min, double max, 
+	       double value, int mode, int naxis) {
+  
+  int x, y, dx, dy, pos, dir, fontsize;
+  double size, n;
+  char string[64], *fontname;
+
+  if (mode) { 
+    size = MAX (0.02, 7.0 / P); 
+  } else {
+    size = MAX (0.01, 4.0 / P); 
+  }
+  
+  n = P / sqrt ((double)(dfx*dfx + dfy*dfy));
+  x = fx + (value-min)*dfx/(max - min);
+  y = fy + (value-min)*dfy/(max - min);
+
+  dir = +1;
+  if ((naxis == 0) || (naxis == 1)) dir *= -1;
+  dx = dir*size*dfy*n;	
+  dy = dir*size*dfx*n;
+  
+  DrawLine (x, y, dx, dy);
+
+# ifdef IN_AND_OUT_TICKS
+# define GAP 0.03
+# else
+# define GAP 0.01
+# endif
+
+  if (mode == 1) {
+    fontname = GetRotFont (&fontsize);
+    pos = 0;
+    
+    /* temporarily assume rectilinear axes */
+    if (naxis == 0) { dx = 0; dy = -dir*(0.8*fontsize + 1); pos = 1; }
+    if (naxis == 2) { dx = 0; dy = -dir*(0.8*fontsize + 1); pos = 7; }
+
+    if (naxis == 1) { dy = 0; dx = -(0.8*fontsize + 1); pos = 3; }
+    if (naxis == 3) { dy = 0; dx = +(0.8*fontsize + 1); pos = 5; }
+
+    x = fx + (value-min)*dfx/(max - min) + dx;
+    y = fy + (value-min)*dfy/(max - min) + dy;
+    if (fabs(value/(max-min)) < 0.001) { value = 0.0; }
+    sprintf (string, "%4g", value);
+    DrawRotText (x, y, string, pos, 0.0);
+  }
+  
+}
+
+
+void AxisTickScale (Axis *axis, double *major, double *minor) {
+
+  double range, lrange, factor, mantis, fmantis, power;
+
+  range = axis[0].max - axis[0].min;
+  if (fabs(range) < MIN_RANGE) {
+    range = (range < 0) ? -MIN_RANGE : +MIN_RANGE;
+  }
+
+  lrange = log10(MAX(fabs(range), MIN_RANGE));
+  mantis = modf (lrange, &factor);
+  if (mantis < 0.0) {
+    mantis += 1.0;
+    factor -= 1.0;
+  }
+  
+  power = MAX(pow(10.0, factor), MIN_RANGE);
+  fmantis = pow(10.0, mantis);
+  *major = MAX(0.5 * power, MIN_RANGE);
+  *minor = MAX(0.1 * power, MIN_RANGE);
+  
+  if ((fmantis >= 1.0) && (fmantis <  1.999)) {
+    *major = 0.5 * power;
+    *minor = 0.1 * power;
+    if (axis[0].areticks == 1) {
+      *major = 1.0 * power;
+      *minor = 0.2 * power;
+    }	  
+  }
+  if ((fmantis >= 1.999) && (fmantis <  3.999)) {
+    *major = 1.0 * power;
+    *minor = 0.2 * power;
+    if (axis[0].areticks == 1) {
+      *major = 2.0 * power;
+      *minor = 0.5 * power;
+    }	  
+  }
+  if ((fmantis >= 3.999) && (fmantis <  5.999)) {
+    *major = 1.0 * power;
+    *minor = 0.5 * power;
+    if (axis[0].areticks == 1) {
+      *major = 2.0 * power;
+      *minor = 0.5 * power;
+    }	  
+  }
+  if ((fmantis >= 5.999) && (fmantis <   7.999)) {
+    *major = 2.0 * power;
+    *minor = 0.5 * power;
+    if (axis[0].areticks == 1) {
+      *major = 2.5 * power;
+      *minor = 0.5 * power;
+    }	  
+  }
+  if ((fmantis >= 7.999) && (fmantis <  10.000)) {
+    *major = 2.5 * power;
+    *minor = 0.5 * power;
+    if (axis[0].areticks == 1) {
+      *major = 5.0 * power;
+      *minor = 1.0 * power;
+    }	  
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawLabels.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawLabels.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawLabels.c	(revision 15879)
@@ -0,0 +1,60 @@
+# include "Ximage.h"
+  
+void DrawLabels (KapaGraphWidget *graph) {
+  
+  int i, pos, x, y, size;
+  double angle;
+  char *fontname;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  pos = 0;
+  fontname = GetRotFont (&size);
+  XSetForeground (graphic->display, graphic->gc, graphic->fore);
+  DrawRotTextInit (graphic->display, graphic->window, graphic->gc, graphic->fore, graphic->back);
+
+  /* each label is drawn independently */
+  for (i = 0; i < 8; i++) {
+    if (strcmp (graph[0].label[i].text, "")) {
+      angle = 0;
+      switch (i) {
+      case 0: pos = 7; break;
+      case 1: pos = 1; angle = -90; break;
+      case 2: pos = 1; break;
+      case 3: pos = 1; angle =  90; break;
+      case 4: pos = 2; break;
+      case 5: pos = 0; break;
+      case 6: pos = 8; break;
+      case 7: pos = 6; break;
+      }	
+      x = graph[0].label[i].x;
+      y = graph[0].label[i].y;
+      SetRotFont (graph[0].label[i].font, graph[0].label[i].size);
+      DrawRotText (x, y, graph[0].label[i].text, pos, angle);
+    }
+  }
+  SetRotFont (fontname, size);
+}
+
+  /*
+            
+ 4____2___5 
+  |       | 
+  |       | 
+ 1|       |3
+  |       |
+  |       |
+  ---------
+  6   0   7
+          
+ 6____7___8 
+  |       | 
+  |       | 
+ 3|   4   |5
+  |       |
+  |       |
+  ---------
+  0   1   2
+
+  */
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawObjects.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawObjects.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawObjects.c	(revision 15879)
@@ -0,0 +1,624 @@
+# include "Ximage.h"
+# define DrawLine(X1,Y1,X2,Y2) (XDrawLine (graphic->display, graphic->window, graphic->gc, (int)(X1+0.5), (int)(Y1+0.5), (int)(X2+0.5), (int)(Y2+0.5)))
+# define DrawRectangle(X1,Y1,X2,Y2) (XDrawRectangle (graphic->display, graphic->window, graphic->gc, (int)(X1+0.5), (int)(Y1+0.5), (int)(X2+0.5), (int)(Y2+0.5)))
+# define FillRectangle(X1,Y1,X2,Y2) (XFillRectangle (graphic->display, graphic->window, graphic->gc, (int)(X1+0.5), (int)(Y1+0.5), (int)(X2+0.5), (int)(Y2+0.5)))
+# define DrawCircle(X,Y,R) (XDrawArc (graphic->display, graphic->window, graphic->gc, (int)(X-R+0.5), (int)(Y-R+0.5), abs(2*R+0.5), abs(2*R+0.5), 0, 23040))
+
+# define CONNECT 0
+# define HISTOGRAM 1
+# define POINTS 2
+
+static Graphic *graphic;
+
+void ClipLine (double x0, double y0, double x1, double y1, double X0, double Y0, double X1, double Y1);
+
+/* draw all objects for this Graph */
+int DrawObjects (KapaGraphWidget *graph) {
+  
+  int i;
+  
+  for (i = 0; i < graph[0].Nobjects; i++) {
+    if (DEBUG) fprintf (stderr, "object: %d\n", i);
+    if (DEBUG) fprintf (stderr, "Npts: %d\n", graph[0].objects[i].Npts);
+    DrawObjectN (graph, &graph[0].objects[i]);
+  }    
+  return (TRUE);
+}
+
+/* Draw a specific object in the graph */
+int DrawObjectN (KapaGraphWidget *graph, Gobjects *object) {
+  
+  static char dash[2] = {5,10};
+  static char dot[2] = {3,3};
+  int lweight;
+  
+  // this function calls all of the supporting Draw... functions below
+  graphic = GetGraphic();
+
+  lweight = MAX (0, MIN (10, object[0].lweight));
+
+  /* set line type */
+  switch (object[0].ltype) {
+  case 0:
+    XSetLineAttributes (graphic->display, graphic->gc, lweight, LineSolid, CapNotLast, JoinMiter);
+    break;
+  case 1:
+    XSetDashes (graphic->display, graphic->gc, 100, dash, 2);
+    XSetLineAttributes (graphic->display, graphic->gc, lweight, LineOnOffDash, CapNotLast, JoinMiter);
+    break;
+  case 2:
+    XSetDashes (graphic->display, graphic->gc, 10, dot, 2);
+    XSetLineAttributes (graphic->display, graphic->gc, lweight, LineOnOffDash, CapNotLast, JoinMiter);
+    break;
+  default:
+    XSetLineAttributes (graphic->display, graphic->gc, lweight, LineSolid, CapNotLast, JoinMiter);
+    break;
+  }
+
+  XSetForeground (graphic->display, graphic->gc, graphic->color[object[0].color]);
+
+  switch (object[0].style) {
+  case CONNECT: 
+    DrawConnect (graph, object);
+    break;
+  case HISTOGRAM:
+    DrawHistogram (graph, object);
+    break;
+  case POINTS:
+    DrawPoints (graph, object);
+    break;
+  }
+    
+  if (object[0].etype & 0x01) {
+    DrawYErrors (graph, object);
+  }
+  if (object[0].etype & 0x02) {
+    DrawXErrors (graph, object);
+  }
+
+  XSetLineAttributes (graphic->display, graphic->gc, 0, LineSolid, CapNotLast, JoinMiter);
+  XSetForeground (graphic->display, graphic->gc, graphic->fore);
+  return (TRUE);
+}
+
+/******/
+void DrawConnect (KapaGraphWidget *graph, Gobjects *object) {
+  
+  int i;
+  float *x, *y;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1;
+  double X0, X1, Y0, Y1;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  X0 = graph[0].axis[0].fx;
+  X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx;
+  Y0 = graph[0].axis[1].fy;
+  Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+
+  x = object[0].x; y = object[0].y;
+  for (i = 0; (i < object[0].Npts) && !(finite(x[i]) && finite(y[i])); i++);
+  if (i >= object[0].Npts) return;
+  sx0 = x[i]*mxi + y[i]*mxj + bx;
+  sy0 = x[i]*myi + y[i]*myj + by;
+
+  for (i++; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]))) continue;
+    sx1 = x[i]*mxi + y[i]*mxj + bx;
+    sy1 = x[i]*myi + y[i]*myj + by;
+    
+    ClipLine (sx0, sy0, sx1, sy1, X0, Y0, X1, Y1);
+    /* DrawLine (sx0, sy0, sx1, sy1); */
+    sx0 = sx1; sy0 = sy1;
+  }
+  
+}
+
+void ClipLine (double x0, double y0, double x1, double y1, double X0, double Y1, double X1, double Y0) {
+
+  /* skip line segement if both points are beyond box */
+  if ((x0 <= X0) && (x1 <= X0)) return;
+  if ((x0 >= X1) && (x1 >= X1)) return;
+  if ((y0 <= Y0) && (y1 <= Y0)) return;
+  if ((y0 >= Y1) && (y1 >= Y1)) return;
+
+  /* replace x0,y0 if outside box */
+  if ((x0 < X0) && (x1 >= X0)) {
+    y0 = y0 + (X0 - x0)*(y1 - y0)/(x1 - x0);
+    x0 = X0;
+  }
+  if ((x0 > X1) && (x1 <= X1)) {
+    y0 = y0 + (X1 - x0)*(y1 - y0)/(x1 - x0);
+    x0 = X1;
+  }
+  if ((y0 < Y0) && (y1 >= Y0)) {
+    x0 = x0 + (Y0 - y0)*(x1 - x0)/(y1 - y0);
+    y0 = Y0;
+  }
+  if ((y0 > Y1) && (y1 <= Y1)) {
+    x0 = x0 + (Y1 - y0)*(x1 - x0)/(y1 - y0);
+    y0 = Y1;
+  }
+
+  /* skip line segement if both points are beyond box */
+  if ((x0 <= X0) && (x1 <= X0)) return;
+  if ((x0 >= X1) && (x1 >= X1)) return;
+  if ((y0 <= Y0) && (y1 <= Y0)) return;
+  if ((y0 >= Y1) && (y1 >= Y1)) return;
+
+  /* replace x1,y1 if outside box */
+  if ((x1 < X0) && (x0 >= X0)) {
+    y1 = y0 + (X0 - x0)*(y1 - y0)/(x1 - x0);
+    x1 = X0;
+  }
+  if ((x1 > X1) && (x0 <= X1)) {
+    y1 = y0 + (X1 - x0)*(y1 - y0)/(x1 - x0);
+    x1 = X1;
+  }
+  if ((y1 < Y0) && (y0 >= Y0)) {
+    x1 = x0 + (Y0 - y0)*(x1 - x0)/(y1 - y0);
+    y1 = Y0;
+  }
+  if ((y1 > Y1) && (y0 <= Y1)) {
+    x1 = x0 + (Y1 - y0)*(x1 - x0)/(y1 - y0);
+    y1 = Y1;
+  }
+  DrawLine (x0, y0, x1, y1);
+}
+  
+
+/******/
+void DrawHistogram (KapaGraphWidget *graph, Gobjects *object) {
+
+  int i;
+  float *x, *y;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1, sxa;
+  double X0, X1, Y0, Y1;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  X0 = graph[0].axis[0].fx;
+  X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx;
+  Y0 = graph[0].axis[1].fy;
+  Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+
+  /* find the first valid datapoint */
+  x = object[0].x; y = object[0].y;
+  for (i = 0; (i < object[0].Npts) && !(finite(x[i]) && finite(y[i])); i++);
+  if (i >= object[0].Npts) return;
+  sx0 = x[i]*mxi + y[i]*mxj + bx;
+  sy0 = x[i]*myi + y[i]*myj + by;
+  sx0 = MIN (MAX (sx0, X0), X1);
+  sy0 = MAX (MIN (sy0, Y0), Y1);
+  
+  /* continue with rest of points */
+  for (i++; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]))) continue;
+    sx1 = x[i]*mxi + y[i]*mxj + bx;
+    sy1 = x[i]*myi + y[i]*myj + by;
+    sx1 = MIN (MAX (sx1, X0), X1);
+    sy1 = MAX (MIN (sy1, Y0), Y1);
+    sxa = 0.5*(sx0 + sx1);
+    DrawLine (sx0, sy0, sxa, sy0);
+    DrawLine (sxa, sy0, sxa, sy1);
+    DrawLine (sxa, sy1, sx1, sy1);
+    sx0 = sx1; sy0 = sy1;
+  }
+}
+
+/******/
+void DrawPoints (KapaGraphWidget *graph, Gobjects *object) {
+
+  int i;
+  float *x, *y, *z;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx, sy, d, sx1, sy1, sx2, sy2;
+  
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  /**** points are scaled by object.z ***/
+  if (object[0].size < 0) {
+    d = 0.5 * (graphic->dx + graphic->dy) * 0.01;
+    x = object[0].x; y = object[0].y; z = object[0].z;
+    if (object[0].ptype == 0) {	/* filled box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    FillRectangle (sx - d*z[i], sy - d*z[i], 2*d*z[i], 2*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 1) {	/* open box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawRectangle (sx - d*z[i], sy - d*z[i], 2*d*z[i], 2*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 2) { /* cross */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx - d*z[i], sy, sx + d*z[i] + 1, sy);
+	    DrawLine (sx, sy - d*z[i], sx, sy + d*z[i] + 1);
+	  }
+      }
+    }
+    if (object[0].ptype == 3) {	/* x */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx + d*z[i] + 1, sy - d*z[i] - 1, sx - d*z[i], sy + d*z[i]);
+	    DrawLine (sx - d*z[i], sy - d*z[i], sx + d*z[i] + 1, sy + d*z[i] + 1);
+	  }
+      }
+    }
+    if (object[0].ptype == 4) {	/* filled triangle */
+      XPoint points[4];
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    points[0].x = sx - d*z[i];  points[0].y = sy + 0.58*d*z[i];  
+	    points[1].x = sx + d*z[i];  points[1].y = sy + 0.58*d*z[i];  
+	    points[2].x = sx;           points[2].y = sy - 1.15*d*z[i];  
+	    points[3].x = sx - d*z[i];  points[3].y = sy + 0.58*d*z[i];  
+	    XFillPolygon (graphic->display, graphic->window, graphic->gc, points, 4, Convex, CoordModeOrigin);
+	  }
+      }
+    }
+    if (object[0].ptype == 5) {	/* open triangle */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx - d*z[i], sy + 0.58*d*z[i], sx + d*z[i], sy + 0.58*d*z[i]);
+	    DrawLine (sx + d*z[i], sy + 0.58*d*z[i], sx,          sy - 1.15*d*z[i]);
+	    DrawLine (sx,          sy - 1.15*d*z[i], sx - d*z[i], sy + 0.58*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 6) {	/* Y */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx, sy, sx - d*z[i], sy + 0.58*d*z[i]);
+	    DrawLine (sx, sy, sx + d*z[i], sy + 0.58*d*z[i]);
+	    DrawLine (sx, sy, sx,          sy - 1.15*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 7) {	/* 0 */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawCircle (sx, sy, d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 100) {	/* connect a pair of points */
+      for (i = 0; i + 1 < object[0].Npts; i+=2) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx1 = x[i]*mxi + y[i]*mxj + bx;
+	sy1 = x[i]*myi + y[i]*myj + by;
+	if (!(finite(x[i+1]) && finite(y[i+1]))) continue;
+	sx2 = x[i+1]*mxi + y[i+1]*mxj + bx;
+	sy2 = x[i+1]*myi + y[i+1]*myj + by;
+	DrawLine (sx1, sy1, sx2, sy2);
+      }
+    }
+  } 
+  /**** points are not scaled by object.z ***/
+  else {
+    d = object[0].size * 0.5 * (graphic->dx + graphic->dy) * 0.003;
+    x = object[0].x; y = object[0].y;
+    if (object[0].ptype == 0) {	/* filled box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    FillRectangle (sx - d, sy - d, 2*d, 2*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 1) {		/* open box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+   	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawRectangle (sx - d, sy - d, 2*d, 2*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 2) { /* cross */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx - d, sy, sx + d + 1, sy);
+	    DrawLine (sx, sy - d, sx, sy + d + 1);
+	  }
+      }
+    }
+    if (object[0].ptype == 3) {		/* x */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    /* XDrawLine is a little funny, this is needed to fix endpost errors */
+	    DrawLine (sx + d + 1, sy - d - 1, sx - d, sy + d);
+	    DrawLine (sx - d, sy - d, sx + d + 1, sy + d + 1);
+	  }
+      }
+    }
+    if (object[0].ptype == 4) {	/* filled triangle */
+      XPoint points[4];
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    points[0].x = sx - d;  points[0].y = sy + 0.58*d;  
+	    points[1].x = sx + d;  points[1].y = sy + 0.58*d;  
+	    points[2].x = sx;      points[2].y = sy - 1.15*d;  
+	    points[3].x = sx - d;  points[3].y = sy + 0.58*d;  
+	    XFillPolygon (graphic->display, graphic->window, graphic->gc, points, 4, Convex, CoordModeOrigin);
+	  }
+      }
+    }
+    if (object[0].ptype == 5) {	/* open triangle */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx - d, sy + 0.58*d, sx + d, sy + 0.58*d);
+	    DrawLine (sx + d, sy + 0.58*d, sx,     sy - 1.15*d);
+	    DrawLine (sx,     sy - 1.15*d, sx - d, sy + 0.58*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 6) {	/* Y */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx, sy, sx - d, sy + 0.58*d);
+	    DrawLine (sx, sy, sx + d, sy + 0.58*d);
+	    DrawLine (sx, sy, sx,     sy - 1.15*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 7) {	/* 0 */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawCircle (sx, sy, d);
+	  }
+      }
+    }
+    if (object[0].ptype == 100) {	
+      for (i = 0; i + 1 < object[0].Npts; i+=2) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx1 = x[i]*mxi + y[i]*mxj + bx;
+	sy1 = x[i]*myi + y[i]*myj + by;
+	sx2 = x[i+1]*mxi + y[i+1]*mxj + bx;
+	sy2 = x[i+1]*myi + y[i+1]*myj + by;
+	DrawLine (sx1, sy1, sx2, sy2);
+      }
+    }
+  }
+}
+    
+/******/
+void DrawXErrors (KapaGraphWidget *graph, Gobjects *object) {
+  
+  int i, bar;
+  float *x, *y, *dxm, *dxp;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1, sz, sx10, sx11;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  x = object[0].x; y = object[0].y; dxp = object[0].dxp; dxm = object[0].dxm; 
+  bar = object[0].ebar; sz = object[0].size*graph[0].axis[1].dfy*0.03;
+  
+  for (i = 0; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]) && finite(dxp[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = (x[i] + dxp[i])*mxi + y[i]*mxj + bx;
+    sy1 = (x[i] + dxp[i])*myi + y[i]*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy))) 
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sy1 - sz;
+	  sx11 = sy1 + sz;
+	  DrawLine (sx1, sx10, sx1, sx11);
+	}
+      }
+    if (!(finite(x[i]) && finite(y[i]) && finite(dxm[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = (x[i] - dxm[i])*mxi + y[i]*mxj + bx;
+    sy1 = (x[i] - dxm[i])*myi + y[i]*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sy1 - sz;
+	  sx11 = sy1 + sz;
+	  DrawLine (sx1, sx10, sx1, sx11);
+	}
+      }
+  }
+}
+    
+/******/
+void DrawYErrors (KapaGraphWidget *graph, Gobjects *object) {
+
+  int i, bar;
+  float *x, *y, *dym, *dyp;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1, sz, sx10, sx11;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  x = object[0].x; y = object[0].y; dyp = object[0].dyp; dym = object[0].dym; 
+  bar = object[0].ebar; sz = object[0].size*graph[0].axis[0].dfx*0.03;
+  
+  for (i = 0; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]) && finite(dyp[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = sx0 + dyp[i]*mxj;
+    sy1 = sy0 + dyp[i]*myj;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sx1 - sz;
+	  sx11 = sx1 + sz;
+	  DrawLine (sx10, sy1, sx11, sy1);
+	}
+      }
+    if (!(finite(x[i]) && finite(y[i]) && finite(dym[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = x[i]*mxi + (y[i] - dym[i])*mxj + bx;
+    sy1 = x[i]*myi + (y[i] - dym[i])*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sx1 - sz;
+	  sx11 = sx1 + sz;
+	  DrawLine (sx10, sy1, sx11, sy1);
+	}
+      }
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawTextlines.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawTextlines.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/DrawTextlines.c	(revision 15879)
@@ -0,0 +1,39 @@
+# include "Ximage.h"
+  
+void DrawTextlines (KapaGraphWidget *graph) {
+  
+  int i, x, y, size;
+  double angle;
+  char *fontname;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  fontname = GetRotFont (&size);
+  XSetForeground (graphic->display, graphic->gc, graphic->fore);
+  DrawRotTextInit (graphic->display, graphic->window, graphic->gc, graphic->fore, graphic->back);
+
+  for (i = 0; i < graph[0].Ntextline; i++) {
+    if (strcmp (graph[0].textline[i].text, "")) {
+      angle = graph[0].textline[i].angle;
+      x = graph[0].textline[i].x;
+      y = graph[0].textline[i].y;
+      SetRotFont (graph[0].textline[i].font, graph[0].textline[i].size);
+      DrawRotText (x, y, graph[0].textline[i].text, 5, angle);
+    }
+  }
+  SetRotFont (fontname, size);
+}
+
+  /* pos values
+            
+ 4____2___5 
+  |       | 
+  |       | 
+ 1|   8   |3
+  |       |
+  |       |
+  ---------
+  6   0   7
+
+  */
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseCurrentPlot.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseCurrentPlot.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseCurrentPlot.c	(revision 15879)
@@ -0,0 +1,20 @@
+# include "Ximage.h"
+
+// erase just the current plot
+int EraseCurrentPlot () {
+  
+  Graphic *graphic;
+  Section *section;
+
+  graphic = GetGraphic();
+
+  section = GetActiveSection();
+  if (section->graph == NULL) return (TRUE);
+
+  EraseGraph (section->graph);
+  
+  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
+  Refresh (1);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseImage.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseImage.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseImage.c	(revision 15879)
@@ -0,0 +1,19 @@
+# include "Ximage.h"
+
+int EraseImage () {
+
+  Graphic *graphic;
+  Section *section;
+  KapaImageWidget *image;
+
+  graphic = GetGraphic();
+  section = GetActiveSection();
+  image = section->image;
+  if (image == NULL) return (TRUE);
+
+  FreeImage (image);
+  section->image = NULL;
+
+  if (USE_XWINDOW) Refresh ();
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseOverlay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseOverlay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseOverlay.c	(revision 15879)
@@ -0,0 +1,33 @@
+# include "Ximage.h"
+
+int EraseOverlay (int sock) {
+
+  int i, N;
+  Graphic *graphic;
+  Section *section;
+  KapaImageWidget *image;
+
+  graphic = GetGraphic();
+  section = GetActiveSection();
+  image = section->image;
+  if (image == NULL) return (TRUE);
+
+  KiiScanCommand (sock, 16, "%*s %d", &N);
+
+  if (N > NOVERLAYS) {
+    REALLOCATE (image[0].tickmarks.objects, KiiOverlay, 1);
+    image[0].tickmarks.Nobjects = 0;
+  } else {
+    for (i = 0; i < image[0].overlay[N].Nobjects; i++) {
+      if (image[0].overlay[N].objects[i].type == KII_OVERLAY_TEXT) {
+	free (image[0].overlay[N].objects[i].text);
+      }
+    }
+    REALLOCATE (image[0].overlay[N].objects, KiiOverlay, 1);
+    image[0].overlay[N].Nobjects = 0;
+    image[0].overlay[N].active = FALSE;
+  }
+
+  if (USE_XWINDOW) Refresh ();
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/ErasePlots.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/ErasePlots.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/ErasePlots.c	(revision 15879)
@@ -0,0 +1,23 @@
+# include "Ximage.h"
+
+// erase all plots, keep the sections
+int ErasePlots () {
+  
+  int i, Nsection;
+  Graphic *graphic;
+  Section *section;
+
+  graphic = GetGraphic();
+  
+  // reset the sizes for all sections
+  Nsection = GetNumberOfSections ();
+  for (i = 0; i < Nsection; i++) {
+      section = GetSectionByNumber (i);
+      EraseGraph (section->graph);
+  }
+
+  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
+  Refresh (1);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseSections.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseSections.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/EraseSections.c	(revision 15879)
@@ -0,0 +1,16 @@
+# include "Ximage.h"
+
+int EraseSections () {
+  
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+  
+  FreeSections ();
+  AddSection ("default", 0.0, 0.0, 1.0, 1.0);
+
+  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
+  Refresh (1);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/EventLoop.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/EventLoop.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/EventLoop.c	(revision 15879)
@@ -0,0 +1,141 @@
+# include "Ximage.h"
+
+/* list events being selected below, all other masks are ignored */ 
+# define IgnoreMask (long) (~(StructureNotifyMask | SubstructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | PointerMotionMask))
+
+int LastEvent (Display *display, int type, XEvent *event) {
+
+  int found;
+
+  found = FALSE;
+  while (XCheckTypedEvent (display, type, event)) {
+    found = TRUE;
+  }
+  return (found);
+}
+
+int EventLoop () {
+  
+  int      status;
+  XEvent   event;
+  Display *display;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+  display = graphic->display;
+  
+  if (USE_XWINDOW) Refresh (1);
+
+  status = TRUE;
+  while (status) {
+    
+    if (!CheckPipe ()) return (FALSE);
+    
+    if (!USE_XWINDOW) {
+      usleep (50000);
+      continue;
+    }
+
+    if (XEventsQueued (display, QueuedAfterFlush) < 1) {
+      /* fprintf (stderr, "."); */
+      usleep (50000);
+      continue;
+    }
+
+    /* grab the last entry for these events */
+    if (LastEvent (display, ConfigureNotify, &event)) Reconfig (&event);
+    if (LastEvent (display, CirculateNotify, &event)) Reconfig (&event);
+    if (LastEvent (display, Expose,          &event)) Refresh (1);
+    if (LastEvent (display, MappingNotify,   &event)) XRefreshKeyboardMapping ((XMappingEvent *) &event);
+    if (LastEvent (display, MotionNotify,    &event)) UpdatePointer (graphic, (XMotionEvent *) &event);
+    if (LastEvent (display, ButtonPress,     &event)) InterpretPresses (graphic, (XButtonEvent *) &event);
+    if (LastEvent (display, KeyPress,        &event)) InterpretKeys (graphic, (XKeyEvent *) &event);
+
+    /* drop and ignore the following StructureNotifyMask events */
+    LastEvent (display, GravityNotify, &event);
+    LastEvent (display, ReparentNotify, &event);
+    LastEvent (display, MapNotify, &event);
+    LastEvent (display, UnmapNotify, &event);
+
+    /* remove those events we will ignore */
+    while (XCheckMaskEvent (display, IgnoreMask, &event)) continue;
+
+    /* events to remove which have no mask component */
+    while (XCheckTypedEvent (display, MappingNotify, &event)) continue;
+    while (XCheckTypedEvent (display, ClientMessage, &event)) continue;
+    while (XCheckTypedEvent (display, SelectionClear, &event)) continue;
+    while (XCheckTypedEvent (display, SelectionNotify, &event)) continue;
+    while (XCheckTypedEvent (display, SelectionRequest, &event)) continue;
+  }
+  return (status);
+}
+
+# if (0)
+
+/* all masks from X.h for reference: */
+
+#define NoEventMask                     0L
+#define KeyPressMask                    (1L<<0)
+#define KeyReleaseMask                  (1L<<1)
+#define ButtonPressMask                 (1L<<2)
+#define ButtonReleaseMask               (1L<<3)
+#define EnterWindowMask                 (1L<<4)
+#define LeaveWindowMask                 (1L<<5)
+#define PointerMotionMask               (1L<<6)
+#define PointerMotionHintMask           (1L<<7)
+#define Button1MotionMask               (1L<<8)
+#define Button2MotionMask               (1L<<9)
+#define Button3MotionMask               (1L<<10)
+#define Button4MotionMask               (1L<<11)
+#define Button5MotionMask               (1L<<12)
+#define ButtonMotionMask                (1L<<13)
+#define KeymapStateMask                 (1L<<14)
+#define ExposureMask                    (1L<<15)
+#define VisibilityChangeMask            (1L<<16)
+#define StructureNotifyMask             (1L<<17)
+#define ResizeRedirectMask              (1L<<18)
+#define SubstructureNotifyMask          (1L<<19)
+#define SubstructureRedirectMask        (1L<<20)
+#define FocusChangeMask                 (1L<<21)
+#define PropertyChangeMask              (1L<<22)
+#define ColormapChangeMask              (1L<<23)
+#define OwnerGrabButtonMask             (1L<<24)
+
+/* all events from X.h for reference: */
+
+#define KeyPress                2
+#define KeyRelease              3
+#define ButtonPress             4
+#define ButtonRelease           5
+#define MotionNotify            6
+#define EnterNotify             7
+#define LeaveNotify             8
+#define FocusIn                 9
+#define FocusOut                10
+#define KeymapNotify            11
+#define Expose                  12
+#define GraphicsExpose          13
+#define NoExpose                14
+#define VisibilityNotify        15
+#define CreateNotify            16
+#define DestroyNotify           17
+#define UnmapNotify             18
+#define MapNotify               19
+#define MapRequest              20
+#define ReparentNotify          21
+#define ConfigureNotify         22
+#define ConfigureRequest        23
+#define GravityNotify           24
+#define ResizeRequest           25
+#define CirculateNotify         26
+#define CirculateRequest        27
+#define PropertyNotify          28
+#define SelectionClear          29
+#define SelectionRequest        30
+#define SelectionNotify         31
+#define ColormapNotify          32
+#define ClientMessage           33
+#define MappingNotify           34
+#define LASTEvent               35      /* must be bigger than any event # */
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/FlushDisplay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/FlushDisplay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/FlushDisplay.c	(revision 15879)
@@ -0,0 +1,37 @@
+# include "Ximage.h"
+
+static struct timeval reftime; 
+static char reftimeset = FALSE;
+# define DTIME(A,B) ((A.tv_sec - B.tv_sec) + 1e-6*(A.tv_usec - B.tv_usec))
+
+void FlushDisplay () {
+
+  struct timeval now;
+  int flush;
+  double dtime;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  if (!USE_XWINDOW) return;
+
+  flush = FALSE;
+  if (!reftimeset) {
+    flush = TRUE;
+    gettimeofday (&reftime, NULL);
+  } 
+
+  gettimeofday (&now, NULL);
+  dtime = DTIME (now, reftime);
+
+  if (dtime > 0.1) {
+    flush = TRUE;
+  }
+
+  if (flush) {
+    XFlush (graphic->display);
+    reftime = now;
+  }
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/GetColor.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/GetColor.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/GetColor.c	(revision 15879)
@@ -0,0 +1,16 @@
+# include "Ximage.h"
+
+/************** GetColor *************/
+unsigned long GetColor (Display *display, char *name, Colormap colormap, unsigned long default_color) {
+
+  int status;
+  XColor rgbcolor, hardwarecolor;
+
+  status = XLookupColor (display, colormap, name, &rgbcolor, &hardwarecolor);
+  if (!status) return (default_color);
+
+  status = XAllocColor (display, colormap, &hardwarecolor);
+  if (!status) return (default_color);
+
+  return (hardwarecolor.pixel);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/GetPixelCount.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/GetPixelCount.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/GetPixelCount.c	(revision 15879)
@@ -0,0 +1,12 @@
+# include "Ximage.h"
+
+int GetPixelCount (int sock) {
+  
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  KiiSendMessage (sock, "NPIX: %8d", graphic->Npixels);
+  
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Graphs.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Graphs.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Graphs.c	(revision 15879)
@@ -0,0 +1,118 @@
+# include "Ximage.h"
+
+/* initialize graph data */
+KapaGraphWidget *InitGraph () {
+
+  int i;
+  KapaGraphWidget *graph;
+
+  ALLOCATE (graph, KapaGraphWidget, 1);
+
+  /* set up axis positions */
+  for (i = 0; i < 4; i++) {
+    graph[0].axis[i].min = 0.0;
+    graph[0].axis[i].max = 1.0;
+    graph[0].axis[i].isaxis = FALSE;
+    graph[0].axis[i].areticks = FALSE;
+    graph[0].axis[i].islabel = FALSE;
+  }    
+  for (i = 0; i < 8; i++) {
+    strcpy (graph[0].label[i].text, "");
+  }
+
+  graph[0].data.xmin = 0.0;
+  graph[0].data.xmax = 1.0;
+  graph[0].data.ymin = 0.0;
+  graph[0].data.ymax = 1.0;
+
+  graph[0].data.style 	= 2; 		// points
+  graph[0].data.ptype 	= 2;		// + for points
+  graph[0].data.ltype 	= 0;		// solid line
+  graph[0].data.etype 	= 0;		// no error bars
+  graph[0].data.ebar  	= 0;		// no cross bar
+  graph[0].data.color 	= 0;		// black
+  graph[0].data.lweight = 0.5;		// line weight of 0.5
+  graph[0].data.size    = 1.0;		// point size of 1.0
+
+  graph[0].Nobjects = 0;
+  graph[0].Ntextline = 0;
+
+  ALLOCATE (graph[0].objects, Gobjects, 1);  /* allocate so later free will not crash! */
+  ALLOCATE (graph[0].textline, Label, 1);    /* allocate so later free will not crash! */
+
+  graph[0].objects[0].x   = graph[0].objects[0].y   = graph[0].objects[0].z = NULL;
+  graph[0].objects[0].dxm = graph[0].objects[0].dxp = NULL;
+  graph[0].objects[0].dym = graph[0].objects[0].dyp = NULL;
+
+  return (graph);
+}
+
+void DrawGraph (KapaGraphWidget *graph) {
+  if (graph == NULL) return;
+  DrawFrame    (graph);
+  DrawObjects  (graph);
+  DrawLabels   (graph);
+  DrawTextlines(graph);
+}
+
+/* remove objects */
+void EraseGraph (KapaGraphWidget *graph) {
+
+  int i;
+
+  if (graph == NULL) return;
+
+  /* free data objects, then re-alloc those needed */
+  for (i = 0; i < graph[0].Nobjects; i++) {
+    FREE (graph[0].objects[i].x);
+    FREE (graph[0].objects[i].y);
+    FREE (graph[0].objects[i].z);
+    FREE (graph[0].objects[i].dxm);
+    FREE (graph[0].objects[i].dxp);
+    FREE (graph[0].objects[i].dym);
+    FREE (graph[0].objects[i].dyp);
+  }
+    
+  /* reset axes and labels */
+  for (i = 0; i < 4; i++) {
+    graph[0].axis[i].isaxis = FALSE;
+    graph[0].axis[i].islabel = FALSE;
+    graph[0].axis[i].areticks = FALSE;
+  }
+  for (i = 0; i < 8; i++) {
+    strcpy (graph[0].label[i].text, "");
+  }
+    
+  graph[0].Nobjects = 0;
+  graph[0].Ntextline = 0;
+  REALLOCATE (graph[0].objects, Gobjects, 1);
+  REALLOCATE (graph[0].textline, Label, 1);
+
+  graph[0].objects[0].x   = graph[0].objects[0].y   = graph[0].objects[0].z = NULL;
+  graph[0].objects[0].dxm = graph[0].objects[0].dxp = NULL;
+  graph[0].objects[0].dym = graph[0].objects[0].dyp = NULL;
+}
+
+/* remove objects */
+void FreeGraph (KapaGraphWidget *graph) {
+
+  int i;
+
+  if (graph == NULL) return;
+
+  /* free data objects, then re-alloc those needed */
+  for (i = 0; i < graph[0].Nobjects; i++) {
+    FREE (graph[0].objects[i].x);
+    FREE (graph[0].objects[i].y);
+    FREE (graph[0].objects[i].z);
+    FREE (graph[0].objects[i].dxm);
+    FREE (graph[0].objects[i].dxp);
+    FREE (graph[0].objects[i].dym);
+    FREE (graph[0].objects[i].dyp);
+  }
+    
+  FREE (graph[0].objects);
+  FREE (graph[0].textline);
+  free (graph);
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Image.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Image.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Image.c	(revision 15879)
@@ -0,0 +1,160 @@
+# include "Ximage.h"
+# include "buttons.h"
+
+/* initialization for things not specific to X */
+KapaImageWidget *InitImage () {
+
+  int i;
+  KapaImageWidget *image;
+  Graphic *graphic;
+
+  graphic = GetGraphic ();
+
+  ALLOCATE (image, KapaImageWidget, 1);
+  memset (image, 0, sizeof(KapaImageWidget));
+
+  /** set up a bunch of default things **/
+  image[0].X = image[0].Y = 0;
+  image[0].expand = 1;
+  image[0].zero = 0;
+  image[0].range = 1;
+  image[0].start = 0;
+  image[0].slope = 1;
+  image[0].location = 4;
+
+  image[0].coords.Npolyterms = 0;
+  for (i = 0; i < NOVERLAYS; i++) {
+    image[0].overlay[i].Nobjects = 0;
+    ALLOCATE (image[0].overlay[i].objects, KiiOverlay, 1);  /* allocate so later free will not crash! */
+    image[0].overlay[i].active = FALSE;
+    image[0].overlay[i].color = graphic[0].overlay_color[i];
+  }
+  image[0].matrix.size = 0; /* a flag to show there is no data in the matrix */
+
+  image[0].MovePointer = TRUE;
+  image[0].DecimalDegrees  = TRUE;
+  ALLOCATE (image[0].matrix.buffer, char, 1);  /* allocate so later free will not crash! */
+  ALLOCATE (image[0].picture.data, char, 1);   /* allocate so later free will not crash! */
+  ALLOCATE (image[0].cmapbar.data, char, 1);   /* allocate so later free will not crash! */
+  ALLOCATE (image[0].zoom.data, char, 1);      /* allocate so later free will not crash! */
+
+  InitButtonSize (&image[0].PS_button, PS_width, PS_height, PS_bits);
+  InitButtonFunc (&image[0].PS_button, PSfunction);
+
+  InitButtonSize (&image[0].grey_button, grey_width, grey_height, grey_bits);
+  InitButtonFunc (&image[0].grey_button, greycolors);
+
+  InitButtonSize (&image[0].rainbow_button, rainbow_width, rainbow_height, rainbow_bits);
+  InitButtonFunc (&image[0].rainbow_button, rainbow);
+
+  InitButtonSize (&image[0].puns_button, puns_width, puns_height, puns_bits);
+  InitButtonFunc (&image[0].puns_button, puns);
+
+  InitButtonSize (&image[0].recenter_button, recenter_width, recenter_height, recenter_bits);
+  image[0].recenter_button.function_1 = Recenter;
+  image[0].recenter_button.function_2 = RecenterRescale;
+  image[0].recenter_button.function_3 = Rescale;
+
+  InitButtonSize (&image[0].overlay_button[0], red_width, red_height, red_bits);
+  InitButtonFunc (&image[0].overlay_button[0], Overlay0);
+
+  InitButtonSize (&image[0].overlay_button[1], green_width, green_height, green_bits);
+  InitButtonFunc (&image[0].overlay_button[1], Overlay1);
+
+  InitButtonSize (&image[0].overlay_button[2], blue_width, blue_height, blue_bits);
+  InitButtonFunc (&image[0].overlay_button[2], Overlay2);
+
+  InitButtonSize (&image[0].overlay_button[3], yellow_width, yellow_height, yellow_bits);
+  InitButtonFunc (&image[0].overlay_button[3], Overlay3);
+
+  InitButtonSize (&image[0].hms_button, hms_width, hms_height, hms_bits);
+  InitButtonFunc (&image[0].hms_button, ToggleDEG);
+
+  return (image);
+}
+
+void InitButtonSize (Button *button, int width, int height, char *bitmap) {
+  button->dx = BUTTON_WIDTH;
+  button->dy = BUTTON_HEIGHT;
+  button->width = width;
+  button->height = height;
+  button->bitmap = bitmap;
+}
+
+void InitButtonFunc (Button *button, int (*function)()) {
+  button->function_1 = function;
+  button->function_2 = function;
+  button->function_3 = function;
+}
+
+void DrawImage (KapaImageWidget *image) {
+
+  int i;
+  Graphic *graphic;
+
+  if (image == NULL) return;
+
+  graphic = GetGraphic ();
+
+  XSetForeground (graphic[0].display,  graphic[0].gc, graphic[0].fore);
+  XDrawRectangle (graphic[0].display,  graphic[0].window, graphic[0].gc, 
+		  image[0].picture.x,  image[0].picture.y, 
+		  image[0].picture.dx+1, image[0].picture.dy+1);
+  
+  XPutImage (graphic[0].display, graphic[0].window, graphic[0].gc,
+	     image[0].picture.pix, 0, 0, 
+	     image[0].picture.x + 1, image[0].picture.y + 1, 
+	     image[0].picture.dx, image[0].picture.dy);
+
+  for (i = 0; i < NOVERLAYS; i++) {
+    if (image[0].overlay[i].active) {
+      PaintOverlay (graphic, image, i);
+    }
+  }
+
+  if (image[0].location) {
+    XPutImage (graphic[0].display, graphic[0].window, graphic[0].gc,
+	       image[0].cmapbar.pix, 0, 0, 
+	       image[0].cmapbar.x, image[0].cmapbar.y, 
+	       image[0].cmapbar.dx, image[0].cmapbar.dy);
+
+    CrossHairs (graphic, image);
+  
+    /* erase everything below zoom box, then draw */
+    /*
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
+    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc, 
+		    image[0].text_x, image[0].text_x, image[0].text_dx, image[0].text_dy); 
+    */    
+    DrawButton (graphic, &image[0].PS_button);
+    DrawButton (graphic, &image[0].recenter_button);
+    DrawButton (graphic, &image[0].grey_button);
+    DrawButton (graphic, &image[0].rainbow_button);
+    DrawButton (graphic, &image[0].puns_button);
+    DrawButton (graphic, &image[0].hms_button);
+
+    for (i = 0; i < NOVERLAYS; i++) {
+      DrawButton (graphic, &image[0].overlay_button[i]);
+    }
+    StatusBox (graphic, image);
+  }
+
+  FlushDisplay (graphic[0].display);
+}
+
+void FreeImage (KapaImageWidget *image) {
+
+  int i;
+
+  if (image == NULL) return;
+
+  for (i = 0; i < NOVERLAYS; i++) {
+    free (image[0].overlay[i].objects);
+  }
+  free (image[0].matrix.buffer);
+  free (image[0].picture.data);
+  free (image[0].cmapbar.data);
+  free (image[0].zoom.data);
+
+  free (image);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/InButton.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/InButton.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/InButton.c	(revision 15879)
@@ -0,0 +1,18 @@
+# include "Ximage.h"
+
+int InButton (XButtonEvent *button_event, Button *button) {
+
+  int answer;
+  int x, y;
+
+  x = button_event[0].x;
+  y = button_event[0].y;
+  
+  answer = ((x >= button[0].x) && (x <= button[0].x + button[0].dx) &&
+	    (y >= button[0].y) && (y <= button[0].y + button[0].dy));
+
+  return (answer);
+
+}
+
+/*** make this a macro? ***/
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/InPicture.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/InPicture.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/InPicture.c	(revision 15879)
@@ -0,0 +1,16 @@
+# include "Ximage.h"
+
+int InPicture (XButtonEvent *button_event, Picture *picture) {
+
+  int answer;
+  int x, y;
+
+  x = button_event[0].x;
+  y = button_event[0].y;
+  
+  answer = ((x >= picture[0].x) && (x <= picture[0].x + picture[0].dx) &&
+	    (y >= picture[0].y) && (y <= picture[0].y + picture[0].dy));
+
+  return (answer);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretKeys.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretKeys.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretKeys.c	(revision 15879)
@@ -0,0 +1,141 @@
+# include "Ximage.h"
+
+int InterpretKeys (Graphic *graphic, XKeyEvent *event) {
+
+  float           *imdata;
+  double 	   X, Y, Z, R, D, offset;
+  int    	   sock, DX, DY, modstate;
+  char   	  *name, string[16];
+  KeySym           keysym;
+  XComposeStatus   composestatus;
+  Section         *section;
+  KapaImageWidget *image;
+  KapaGraphWidget *graph;
+
+  // XXX select the window element which contains the event
+  section = GetActiveSection();
+  image   = section->image;
+  graph   = section->graph;
+
+  XLookupString (event, string, 9, &keysym, &composestatus);
+  modstate = event[0].state;
+
+  // return graph coords by default, image if graph does not exist
+  // XXX allow user to choose graph or image coords
+  if (ACTIVE_CURSOR) {
+
+    sock = GetActiveSocket ();
+    if (sock == -1) goto skip_cursor;
+
+    name = XKeysymToString (keysym);
+
+    // skip the following keys: 
+    if (name == NULL) goto skip_cursor;
+    if (!strcmp (name, "Shift_L")) goto skip_cursor;
+    if (!strcmp (name, "Shift_R")) goto skip_cursor;
+    if (!strcmp (name, "Control_L")) goto skip_cursor;
+    if (!strcmp (name, "Control_R")) goto skip_cursor;
+    if (!strcmp (name, "Alt_L")) goto skip_cursor;
+    if (!strcmp (name, "Alt_R")) goto skip_cursor;
+    if (!strcmp (name, "Super_L")) goto skip_cursor;
+    if (!strcmp (name, "Super_R")) goto skip_cursor;
+    if (!strcmp (name, "Caps_Lock")) goto skip_cursor;
+    if (!strcmp (name, "Pause")) goto skip_cursor;
+    if (!strcmp (name, "Continue")) goto skip_cursor;
+    if (!strcmp (name, "Num_Lock")) goto skip_cursor;
+    if (!strcmp (name, "Scroll_Lock")) goto skip_cursor;
+    if (!strcmp (name, "Print")) goto skip_cursor;
+    if (!strcmp (name, "(null)")) goto skip_cursor;
+
+    Z = -1;
+
+    if (graph) {
+      X = (event[0].x - graph[0].axis[0].fx)*(graph[0].axis[0].max - graph[0].axis[0].min)/graph[0].axis[0].dfx + graph[0].axis[0].min;
+      Y = (event[0].y - graph[0].axis[1].fy)*(graph[0].axis[1].max - graph[0].axis[1].min)/graph[0].axis[1].dfy + graph[0].axis[1].min;
+      XY_to_RD (&R, &D, X, Y, &graph[0].data.coords);
+    } 
+    if (image && !graph) {
+      if (event[0].x < image[0].picture.x) goto skip_cursor;
+      if (event[0].y < image[0].picture.y) goto skip_cursor;
+      if (event[0].x > image[0].picture.x + image[0].picture.dx) goto skip_cursor;
+      if (event[0].y > image[0].picture.y + image[0].picture.dy) goto skip_cursor;
+      Screen_to_Image (&X, &Y, (double)event[0].x, (double)event[0].y, image);
+      XY_to_RD (&R, &D, X, Y, &image[0].coords);
+
+      DX = image[0].matrix.Naxis[0];
+      DY = image[0].matrix.Naxis[1];
+
+      if (X < 0) goto off_image;
+      if (Y < 0) goto off_image;
+      if (X >= DX) goto off_image;
+      if (Y >= DY) goto off_image;
+      imdata = (float *) image[0].matrix.buffer;
+      Z      = imdata[DX*(int)(Y) + (int)(X)];
+    }
+  off_image:
+    KiiSendMessage (sock, "%12s %12.6f %12.6f %12.6f %12.6f %12.6f", name, X, Y, Z, R, D);
+  }
+
+skip_cursor:
+  if (image == NULL) return (TRUE);
+
+  // offset is in image pixels: 
+  // 0.5 image pixels is 1 screen pixel for expand == +2
+  // 2.0 image pixels is 1 screen pixel for expand == -2
+  if (image[0].expand == 0) image[0].expand = 1;
+  offset = (image[0].expand > 0) ? 1.0 / image[0].expand : -image[0].expand;
+  if (modstate & ControlMask) offset *= 100;
+
+  switch (keysym) {
+
+    case XK_KP_Home:
+    case XK_Home:
+      image[0].expand = 1;
+      Reorient (graphic, image, image[0].X, image[0].Y, 0);
+      break;
+    case XK_KP_End:
+    case XK_End:
+      image[0].expand = 1;
+      Reorient (graphic, image, 0, 0, 0);
+      break;
+    case XK_KP_Enter:
+    case XK_KP_Begin:
+    case XK_Return:
+      Screen_to_Image (&X, &Y, (double)event[0].x, (double)event[0].y, image);
+      X = 0.5*image[0].matrix.Naxis[0] - X;
+      Y = 0.5*image[0].matrix.Naxis[1] - Y;
+      Reorient (graphic, image, X, Y, 0);
+      break;
+    case XK_Prior:
+    case XK_KP_Prior:
+      Reorient (graphic, image, image[0].X, image[0].Y, +1);
+      break;
+    case XK_Next:
+    case XK_KP_Next:
+      Reorient (graphic, image, image[0].X, image[0].Y, -1);
+      break;
+    case XK_Up:
+    case XK_KP_Up:
+      Reorient (graphic, image, image[0].X, image[0].Y + offset, 0);
+      break;
+    case XK_Down:
+    case XK_KP_Down:
+      Reorient (graphic, image, image[0].X, image[0].Y - offset, 0);
+      break;
+    case XK_Left:
+    case XK_KP_Left:
+      Reorient (graphic, image, image[0].X + offset, image[0].Y, 0);
+      break;
+    case XK_Right:
+    case XK_KP_Right:
+      Reorient (graphic, image, image[0].X - offset, image[0].Y, 0);
+      break;
+
+    case XK_Tab:
+      image[0].MovePointer = image[0].MovePointer ^ TRUE;
+      if (image[0].MovePointer) UpdatePointer (graphic, (XMotionEvent *)event);
+      break;
+  }
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretPresses.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretPresses.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretPresses.c	(revision 15879)
@@ -0,0 +1,120 @@
+# include "Ximage.h"
+
+int InterpretPresses (Graphic *graphic, XButtonEvent *event) {
+
+  int              sock, DX, DY, status, done, this_button;
+  char             name[16];
+  double           X, Y, Z, R, D;
+  float           *imdata;
+  Button          *button;
+  Section         *section;
+  KapaImageWidget *image;
+  KapaGraphWidget *graph;
+
+  // XXX select the window element which contains the event
+  section = GetActiveSection();
+  image   = section->image;
+  graph   = section->graph;
+
+  // return graph coords by default, image if graph does not exist
+  // XXX allow user to choose graph or image coords
+  if (ACTIVE_CURSOR) {
+    sock = GetActiveSocket ();
+    if (sock == -1) goto skip_cursor;
+
+    sprintf (name, "Button%d", event[0].button);
+    if (graph) {
+      X = (event[0].x - graph[0].axis[0].fx)*(graph[0].axis[0].max - graph[0].axis[0].min)/graph[0].axis[0].dfx + graph[0].axis[0].min;
+      Y = (event[0].y - graph[0].axis[1].fy)*(graph[0].axis[1].max - graph[0].axis[1].min)/graph[0].axis[1].dfy + graph[0].axis[1].min;
+      XY_to_RD (&R, &D, X, Y, &graph[0].data.coords);
+    } 
+    if (image && !graph) {
+      if (event[0].x < image[0].picture.x) goto skip_cursor;
+      if (event[0].y < image[0].picture.y) goto skip_cursor;
+      if (event[0].x > image[0].picture.x + image[0].picture.dx) goto skip_cursor;
+      if (event[0].y > image[0].picture.y + image[0].picture.dy) goto skip_cursor;
+      Screen_to_Image (&X, &Y, (double)event[0].x, (double)event[0].y, image);
+
+      XY_to_RD (&R, &D, X, Y, &image[0].coords);
+
+      DX = image[0].matrix.Naxis[0];
+      DY = image[0].matrix.Naxis[1];
+
+      if (X < 0) goto off_image;
+      if (Y < 0) goto off_image;
+      if (X >= DX) goto off_image;
+      if (Y >= DY) goto off_image;
+      imdata = (float *) image[0].matrix.buffer;
+      Z      = imdata[DX*(int)(Y) + (int)(X)];
+    }
+  off_image:
+    KiiSendMessage (sock, "%12s %12.6f %12.6f %12.6f %12.6f %12.6f", name, X, Y, Z, R, D);
+  }
+
+skip_cursor:
+  status = TRUE;
+  this_button = event[0].button;
+
+  // XXX add graph buttons here
+  if (image == NULL) return (TRUE);
+  
+  if ((event[0].type == ButtonPress) && InPicture (event, &image[0].picture)) {
+    ReorientOnButton (graphic, image, event);
+  }
+
+  if ((event[0].type == ButtonPress) && InPicture (event, &image[0].cmapbar)) {
+    DragColorbar (graphic, image, event);
+  }
+
+  /* if on an exisiting button, Invert, wait for release, then go (or not) */
+  if ((button = CheckButtons (event, image)) != (Button *) NULL) {
+    InvertButton (graphic, button); 
+    done = FALSE;
+    while (!done) { /* wait for release of this button */
+      XNextEvent (graphic[0].display, (XEvent *) event);
+      if ((event[0].type == ButtonRelease) && (event[0].button == this_button)) {
+	done = TRUE;
+      }
+    }
+    DrawButton (graphic, button);
+    if (InButton (event, button)) {
+      switch (event[0].button) {
+      case 1:
+	status = button[0].function_1(graphic, image);
+	break;
+      case 2:
+	status = button[0].function_2(graphic, image);
+	break;
+      case 3:
+	status = button[0].function_3(graphic, image);
+	break;
+      }
+    } else {
+      return (status);
+    }
+  }
+  return (status);
+}
+
+void ReorientOnButton (Graphic *graphic, KapaImageWidget *image, XButtonEvent *mouse_event) {
+
+  double X, Y;
+
+  Screen_to_Image (&X, &Y, (double)mouse_event[0].x, (double)mouse_event[0].y, image);
+  X = 0.5*image[0].matrix.Naxis[0] - X;
+  Y = 0.5*image[0].matrix.Naxis[1] - Y;
+
+  switch (mouse_event[0].button) {
+    case 1:
+      Reorient (graphic, image, X, Y, 0);
+      break;
+    case 2:
+      Reorient (graphic, image, X, Y, -1);
+      break;
+    case 3:
+      Reorient (graphic, image, X, Y, +1);
+      break;
+    default:
+      break;
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/InvertButton.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/InvertButton.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/InvertButton.c	(revision 15879)
@@ -0,0 +1,19 @@
+# include "Ximage.h"
+
+void InvertButton (Graphic *graphic, Button *button) {
+
+  unsigned long fore, back;
+
+  fore =  graphic[0].fore;
+  back =  graphic[0].back;
+
+  graphic[0].fore = back;
+  graphic[0].back = fore;
+
+  DrawButton (graphic, button);
+  FlushDisplay (graphic[0].display);
+  
+  graphic[0].fore = fore;
+  graphic[0].back = back;
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/JPEGit24.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/JPEGit24.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/JPEGit24.c	(revision 15879)
@@ -0,0 +1,254 @@
+# include "Ximage.h"
+# include "jpeglib.h"
+
+# define WHITE_R 255
+# define WHITE_G 255
+# define WHITE_B 255
+
+static float slope = 1.0;
+static float start = 0.0;
+static int MaxValue = 255;
+
+// XXX inline this if needed
+static int PixelLookup(float value) {
+  int out;
+  out = MIN (MAX (slope * value - start, 0), MaxValue);
+  return (out);
+}
+
+// XXX this currently writes out the jpeg for just the active image
+int JPEGit24 (int sock) {
+
+  struct jpeg_compress_struct cinfo;
+  struct jpeg_error_mgr jerr;
+  JSAMPROW row_pointer[1];	/* pointer to JSAMPLE row[s] */
+  JSAMPLE *image_buffer;	/* Points to data for current line */
+  JSAMPLE *line_buffer;	        /* Points to data for current line */
+  Section *section;
+  Graphic *graphic;
+  KapaImageWidget *image;
+
+  int ii, i, j;
+  int i_start, i_end, j_start, j_end;
+  int dropback;  /* this is a bit of a kludge... */
+  int dx, dy, DX, DY, pixelN;
+  int quality;
+  int expand_in, expand_out;
+  double expand, Rx, Ry, X, Y;
+  unsigned char *out_pix;
+  float *imdata, *in_pix, *in_pix_ref;
+  unsigned char pixel1[256], pixel2[256], pixel3[256];
+  char filename[1024];
+  FILE *f;
+
+  /* expect a line telling the number of bytes and a filename */
+  KiiScanMessage (sock, "%s", filename);
+
+  graphic = GetGraphic();
+  section = GetActiveSection();
+  image   = section->image;
+  if (image == NULL) return (TRUE);
+
+  /***** JPEG init calls */
+  cinfo.err = jpeg_std_error (&jerr);
+  jpeg_create_compress (&cinfo);
+
+  f = fopen (filename, "w");
+  if (f == (FILE *) NULL) {
+    fprintf (stderr, "Kii: failed to open %s for output\n", filename);
+    return (TRUE);
+  }
+  jpeg_stdio_dest(&cinfo, f);
+  
+  quality = 75;
+  cinfo.image_width = image[0].picture.dx; 	/* image width and height, in pixels */
+  cinfo.image_height = image[0].picture.dy;
+# ifdef GREYSCALE
+  cinfo.input_components = 1;		        /* # of color components per pixel */
+  cinfo.in_color_space = JCS_GRAYSCALE; 	/* colorspace of input image */
+# else 
+  cinfo.input_components = 3;		        
+  cinfo.in_color_space = JCS_RGB; 	
+# endif
+  jpeg_set_defaults (&cinfo);
+  jpeg_set_quality (&cinfo, quality, TRUE       /* limit to baseline-JPEG values */);
+  jpeg_start_compress (&cinfo, TRUE);
+
+  /** cmap[i].pixel must be defined even if X is not used **/
+  for (i = 0; i < 256; i++) { /* set up pixel array */
+    pixel1[i] = graphic[0].cmap[i].red >> 8;
+    pixel2[i] = graphic[0].cmap[i].green >> 8;
+    pixel3[i] = graphic[0].cmap[i].blue >> 8;
+  }
+
+  // define the color transform parameters
+  MaxValue = graphic[0].Npixels - 1;
+  if (image[0].range != 0.0) {
+    slope = graphic[0].Npixels / image[0].range;
+    start = graphic[0].Npixels * image[0].zero / image[0].range;
+  } else {
+    slope = 1.0;
+    start = image[0].zero;
+  }
+
+  expand = expand_in = expand_out = 1.0;
+  if (image[0].expand == 0) /* set up expansions */
+    image[0].expand = 1;
+  if (image[0].expand > 0) {
+    expand = 1 / (1.0*image[0].expand);
+    expand_out = image[0].expand;
+    expand_in  = 1;
+  }
+  if (image[0].expand < 0) {
+    expand = fabs((double)image[0].expand);
+    expand_out = 1;
+    expand_in  = -image[0].expand;
+  }
+
+  dx = image[0].picture.dx;
+  dy = image[0].picture.dy;
+  DX = image[0].matrix.Naxis[0];
+  DY = image[0].matrix.Naxis[1];
+
+  /* X,Y are the image coordinates of the first image pixel */
+  X = MAX(0.5*(DX - dx*expand) - image[0].X, 0);
+  if ((int)X != X) 
+    X = (int) X + 1;
+  else 
+    X = (int) X;
+  Y = MAX(0.5*(DY - dy*expand) - image[0].Y, 0);
+  if ((int)Y != Y) 
+    Y = (int) Y + 1;
+  else 
+    Y = (int) Y;
+
+  /* Rx,Ry are the screen coordinates of the first image pixel */
+  Rx = (X + image[0].X - 0.5*DX)/expand + 0.5*dx;
+  Ry = (Y + image[0].Y - 0.5*DY)/expand + 0.5*dy;
+
+  i_start = MIN (MAX (Rx, 0), dx - expand_out + 1);
+  j_start = MIN (MAX (Ry, 0), dy - expand_out + 1);
+  
+  if (image[0].expand > 0) {
+    i_end = MAX (MIN (i_start + ((int)(expand*(dx-i_start)))/expand, expand_out*(DX-X) + Rx), 0);
+    j_end = MAX (MIN (j_start + ((int)(expand*(dy-j_start)))/expand, expand_out*(DY-Y) + Ry), 0);
+  } else {
+    i_end = MAX (MIN (dx, (DX-X)/expand + Rx), 0);
+    j_end = MAX (MIN (dy, (DY-Y)/expand + Ry), 0);
+  }    
+
+  dropback = expand_out - (i_end - i_start) % expand_out;
+  if ((i_end - i_start) % expand_out == 0) dropback = 0;
+
+  /* output line buffer */
+  ALLOCATE (image_buffer, JSAMPLE, 3*dx*dy);
+  ALLOCATE (line_buffer, JSAMPLE, 3*dx);
+
+  imdata = (float *) image[0].matrix.buffer;
+  in_pix_ref = &imdata[DX*(int)MAX(Y,0) + (int)MAX(X,0)];
+
+  /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/
+
+  /**** fill in bottom area ****/
+  out_pix = line_buffer;
+  for (i = 0; i < dx; i++, out_pix+=3) {
+    out_pix[0] = WHITE_R;
+    out_pix[1] = WHITE_G;
+    out_pix[2] = WHITE_B;
+  }
+  for (j = 0; j < j_start; j++) {
+    memcpy (&image_buffer[j*3*dx], line_buffer, 3*dx);
+  }
+  
+  /*** fill in the image data region ***/
+  for (j = j_start; j < j_end; j+= expand_out, in_pix_ref += expand_in*DX) {
+    
+    /* create one output image line */
+    in_pix = in_pix_ref;
+    out_pix = line_buffer;
+
+    /**** fill in area to the left of the picture ****/
+    for (i = 0; i < i_start; i++, out_pix+=3) {
+      out_pix[0] = WHITE_R;
+      out_pix[1] = WHITE_G;
+      out_pix[2] = WHITE_B;
+    }
+    
+    /*** fill in the picture region ***/
+    for (i = i_start; i < i_end; i+=expand_out, in_pix+=expand_in) {
+      pixelN = PixelLookup(*in_pix);
+      for (ii = 0; ii < expand_out; ii++, out_pix+=3) {
+	out_pix[0] = pixel1[pixelN];
+	out_pix[1] = pixel2[pixelN];
+	out_pix[2] = pixel3[pixelN];
+      }
+    }
+    
+    /**** fill in area to the right of the picture ****/
+    for (i = i_end; i < dx; i++, out_pix+=3) {
+      out_pix[0] = WHITE_R;
+      out_pix[1] = WHITE_G;
+      out_pix[2] = WHITE_B;
+    }
+
+    /* write out the image line expand_out times */
+    for (i = 0; i < expand_out; i++) {
+      memcpy (&image_buffer[(j + i)*3*dx], line_buffer, 3*dx);
+    }
+  }
+
+  /**** fill in top area ****/
+  out_pix = line_buffer;
+  for (i = 0; i < dx; i++, out_pix+=3) { 
+    out_pix[0] = WHITE_R;
+    out_pix[1] = WHITE_G;
+    out_pix[2] = WHITE_B;
+  }
+  for (j = j_end; j < dy; j++) {
+    memcpy (&image_buffer[j*3*dx], line_buffer, 3*dx);
+  }
+
+
+  /* I need to write the overlay objects on the jpeg image.
+     if i can write / overwrite data in jpeg buffer, then do it here,
+     otherwise i need to create a temporary image buffer, then write the 
+     scanlines to that buffer */
+
+  {
+    int Npalette;
+    png_color *palette;
+    bDrawColor white, color;
+    bDrawBuffer *buffer;
+
+    palette = KapaPNGPalette (&Npalette);
+
+    buffer = bDrawBufferCreate (dx, dy);
+    bDrawSetBuffer (buffer);
+    for (i = 0; i < NOVERLAYS; i++) {
+      if (image[i].overlay[i].active) bDrawOverlay (image, i);
+    }
+
+    white = KapaColorByName ("white");
+    for (j = 0; j < dy; j++) {
+      for (i = 0; i < dx; i++) {
+	color = buffer[0].pixels[j][i];
+	if (color == white) continue;
+	image_buffer[j*3*dx + 3*i + 0] = palette[color].red;
+	image_buffer[j*3*dx + 3*i + 1] = palette[color].green;
+	image_buffer[j*3*dx + 3*i + 2] = palette[color].blue;
+      }
+    }
+    bDrawBufferFree (buffer);
+  }
+
+  for (i = 0; i < dy; i++) {
+    row_pointer[0] = &image_buffer[i*3*dx];
+    (void) jpeg_write_scanlines (&cinfo, row_pointer, 1);
+  }
+
+  jpeg_finish_compress (&cinfo);
+  fclose (f);
+  jpeg_destroy_compress (&cinfo);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Layout.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Layout.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Layout.c	(revision 15879)
@@ -0,0 +1,46 @@
+# include "Ximage.h"
+static char default_colormap[] = "grayscale";
+
+void InitLayout (int argc, char **argv) {
+
+  int N;
+  Section *section;
+  char *namedSocket = NULL;
+  
+  namedSocket = NULL;
+  if ((N = get_argument (argc, argv, "-socket"))) { 
+    remove_argument (N, &argc, argv);
+    namedSocket = argv[N];
+    remove_argument (N, &argc, argv);
+  }
+
+  // if we specify a named socket, wait until we are contacted
+  // otherwise, open an INET sock and check occasionally for requests
+  InitPipe (namedSocket);
+
+  ACTIVE_CURSOR = FALSE;
+
+  /* get the display colors */
+  if (USE_XWINDOW) {
+    MakeColormap (argc, argv);
+  } else {
+    char *colormap;
+    colormap = default_colormap;
+    if ((N = get_argument (argc, argv, "-cm"))) {
+      remove_argument (N, &argc, argv);
+      colormap = argv[N];
+    }
+    SetColormap (colormap);
+  }
+
+  /* move this out of here... */
+  if (argc != 1) {
+    fprintf (stderr, "USAGE: kapa\n");
+    exit (0);
+  }
+
+  InitRotFonts ();
+
+  /* create basic section, empty of image or graph */
+  section = AddSection ("default", 0.0, 0.0, 1.0, 1.0);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadFont.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadFont.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadFont.c	(revision 15879)
@@ -0,0 +1,46 @@
+# include "Ximage.h"
+
+/************** LoadFont *************/
+void LoadFont (Graphic *graphic, int *argc, char **argv, char *default_name) {
+
+  int N;
+  char *name;
+
+  name = XGetDefault (graphic->display, argv[0], "Font");
+  if (name == NULL) name = default_name;
+
+  /* check for command-line options */
+  if ((N = get_argument (*argc, argv, "-font"))) {
+    if (*argc <= N + 1) {
+      fprintf (stderr, "error: usage is -font fontname\n");
+      exit (0);
+    }
+    remove_argument(N, argc, argv);
+    name = argv[N];
+    remove_argument(N, argc, argv);
+  }   
+  if ((N = get_argument (*argc, argv, "-fn"))) {
+    if (*argc <= N + 1) {
+      fprintf (stderr, "error: usage is -fn fontname\n");
+      exit (0);
+    }
+    remove_argument(N, argc, argv);
+    name = argv[N];
+    remove_argument(N, argc, argv);
+  } 
+
+  graphic->font = XLoadQueryFont (graphic->display, name);
+  if ((graphic->font == NULL) && (name != default_name)) {
+    fprintf (stderr, "Could not load requested font %s, trying %s\n", name, default_name);
+    graphic->font = XLoadQueryFont (graphic->display, default_name);
+  }
+  if (graphic->font == NULL) {
+    fprintf (stderr, "Could not load font %s, using %s\n", default_name, "fixed");
+    graphic->font = XLoadQueryFont (graphic->display, "fixed");
+  }
+  if (graphic->font == NULL) {
+    QuitX (graphic->display, "Error: could not load font");
+  }
+
+  XSetFont (graphic->display, graphic->gc, graphic->font[0].fid);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadFrame.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadFrame.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadFrame.c	(revision 15879)
@@ -0,0 +1,84 @@
+# include "Ximage.h"
+
+int LoadFrame (int sock) {
+  
+  int i;
+  char Axis[16], Labels[16], Ticks[16];
+  Section *section;
+  KapaGraphWidget *graph;
+
+  section = GetActiveSection();
+  if (section->graph == NULL) {
+    section->graph = InitGraph ();
+    SetSectionSizes (section);
+  }
+  graph = section->graph;
+
+  KiiScanMessage (sock, "%lf %lf %lf %lf", 
+		  &graph[0].axis[0].min, &graph[0].axis[0].max, 
+		  &graph[0].axis[1].min, &graph[0].axis[1].max);
+
+  graph[0].axis[3].min = graph[0].axis[1].min;
+  graph[0].axis[3].max = graph[0].axis[1].max;
+  graph[0].axis[2].min = graph[0].axis[0].min;
+  graph[0].axis[2].max = graph[0].axis[0].max;
+  
+  KiiScanMessage (sock, "%s %s %s", Axis, Labels, Ticks);
+
+  for (i = 0; i < 4; i++) {
+    switch (Axis[i]) {
+    case '0':
+      graph[0].axis[i].isaxis = FALSE;
+      break;
+    case '1':
+      graph[0].axis[i].isaxis = TRUE;
+      break;
+    case '2':
+      graph[0].axis[i].isaxis = TRUE;
+      break;
+    }
+    switch (Ticks[i]) {
+    case '0':
+      graph[0].axis[i].areticks = FALSE;
+      break;
+    case '1':
+      graph[0].axis[i].areticks = TRUE;
+      break;
+    case '2':
+      graph[0].axis[i].areticks = 2;
+      break;
+    }
+    switch (Labels[i]) {
+    case '0':
+      graph[0].axis[i].islabel = FALSE;
+      break;
+    case '1':
+      graph[0].axis[i].islabel = TRUE;
+      break;
+    case '2':
+      graph[0].axis[i].islabel = (i < 2);
+      break;
+    }
+  }
+
+  SetSectionSizes (section);
+  if (USE_XWINDOW) DrawFrame (graph);
+  FlushDisplay ();
+
+  /* XXX why did I do this??? */
+# if (0)
+  status = TRUE;
+  if (status) {
+    for (i = 0; i < Nsection; i++) {
+      PositionPicture (&section[i]);
+    }
+    if (USE_XWINDOW) XClearWindow (graphic.display, graphic.window);
+    Refresh (1);
+  } else {
+    FlushDisplay ();
+  } 
+# endif
+
+  return (TRUE);
+  
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadLabels.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadLabels.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadLabels.c	(revision 15879)
@@ -0,0 +1,35 @@
+# include "Ximage.h"
+
+int LoadLabels (int sock) {
+  
+  char *c, *label;
+  int mode, size, Nbytes;
+  Section *section;
+  KapaGraphWidget *graph;
+
+  section = GetActiveSection();
+  if (section->graph == NULL) {
+    section->graph = InitGraph ();
+    SetSectionSizes (section);
+  }
+  graph = section->graph;
+  
+  KiiScanMessage (sock, "%d", &mode);
+  label = KiiRecvData (sock);
+
+  bzero (graph[0].label[mode].text, LABEL_MAXLEN);
+
+  Nbytes = MIN (strlen(label), LABEL_MAXLEN - 1);
+  strncpy (graph[0].label[mode].text, label, Nbytes);
+  label[Nbytes] = 0;
+  
+  c = GetRotFont (&size);
+  graph[0].label[mode].size = size;
+  strcpy (graph[0].label[mode].font, c);
+  if (USE_XWINDOW) DrawLabels (graph);
+  
+  FlushDisplay ();
+  
+  return (TRUE);
+  
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadObject.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadObject.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadObject.c	(revision 15879)
@@ -0,0 +1,231 @@
+# include "Ximage.h"
+# include <errno.h>
+# define DEBUG 0
+
+int LoadObject (int sock) {
+  
+  int N;
+  Section *section;
+  KapaGraphWidget *graph;
+
+  section = GetActiveSection();
+  if (section->graph == NULL) {
+    section->graph = InitGraph ();
+    SetSectionSizes (section);
+  }
+  graph = section->graph;
+  
+  N = graph[0].Nobjects;
+  graph[0].Nobjects ++;
+  REALLOCATE (graph[0].objects, Gobjects, graph[0].Nobjects);
+  graph[0].objects[N].x = graph[0].objects[N].y = graph[0].objects[N].z = (float *) NULL;
+  graph[0].objects[N].dxm = graph[0].objects[N].dxp = (float *) NULL;
+  graph[0].objects[N].dym = graph[0].objects[N].dyp = (float *) NULL;
+  
+  KiiScanMessage (sock, "%d %d %d %d %d %d %d %lf %lf",
+		  &graph[0].objects[N].Npts, &graph[0].objects[N].style, 
+		  &graph[0].objects[N].ptype, &graph[0].objects[N].ltype, 
+		  &graph[0].objects[N].etype, &graph[0].objects[N].ebar, 
+		  &graph[0].objects[N].color, 
+		  &graph[0].objects[N].lweight, &graph[0].objects[N].size);
+  
+  if (DEBUG) fprintf (stderr, "%d %d %d %d %d %d %d %lf %lf\n",
+		      graph[0].objects[N].Npts, graph[0].objects[N].style, 
+		      graph[0].objects[N].ptype, graph[0].objects[N].ltype, 
+		      graph[0].objects[N].etype, graph[0].objects[N].ebar, 
+		      graph[0].objects[N].color, 
+		      graph[0].objects[N].lweight, graph[0].objects[N].size);
+  
+  /* force valid ranges */
+  if ((graph[0].objects[N].color > KapaColormapSize()) || (graph[0].objects[N].color < 0))
+    graph[0].objects[N].color = 0;
+
+  KiiScanMessage (sock, "%lf %lf %lf %lf",
+		  &graph[0].objects[N].x0, &graph[0].objects[N].x1, 
+		  &graph[0].objects[N].y0, &graph[0].objects[N].y1);
+
+  // acknowledge receipt of the metadata
+  KiiSendCommand (sock, 4, "DONE"); 
+  
+  // XXX Currently, I require these in a special order.  The data includes a message defining the
+  // object type.  This could be made more flexible by using the information (though we still need
+  // to know how many items will be sent)
+
+  if (!LoadVectorData (sock, graph, N, "x")) {
+    FreeObjectData (&graph[0].objects[N]);
+    graph[0].Nobjects --;
+    REALLOCATE (graph[0].objects, Gobjects, MAX (1, graph[0].Nobjects));
+  }
+    
+  if (!LoadVectorData (sock, graph, N, "y")) {
+    FreeObjectData (&graph[0].objects[N]);
+    graph[0].Nobjects --;
+    REALLOCATE (graph[0].objects, Gobjects, MAX (1, graph[0].Nobjects));
+  }
+  if (graph[0].objects[N].size < 0.0) {
+    if (!LoadVectorData (sock, graph, N, "z")) {
+      FreeObjectData (&graph[0].objects[N]);
+      graph[0].Nobjects --;
+      REALLOCATE (graph[0].objects, Gobjects, MAX (1, graph[0].Nobjects));
+    }
+  }
+  if (graph[0].objects[N].etype & 0x01) {
+    if (!LoadVectorData (sock, graph, N, "dym")) {
+      FreeObjectData (&graph[0].objects[N]);
+      graph[0].Nobjects --;
+      REALLOCATE (graph[0].objects, Gobjects, MAX (1, graph[0].Nobjects));
+    }
+    if (!LoadVectorData (sock, graph, N, "dyp")) {
+      FreeObjectData (&graph[0].objects[N]);
+      graph[0].Nobjects --;
+      REALLOCATE (graph[0].objects, Gobjects, MAX (1, graph[0].Nobjects));
+    }
+  }
+  if (graph[0].objects[N].etype & 0x02) {
+    if (!LoadVectorData (sock, graph, N, "dxm")) {
+      FreeObjectData (&graph[0].objects[N]);
+      graph[0].Nobjects --;
+      REALLOCATE (graph[0].objects, Gobjects, MAX (1, graph[0].Nobjects));
+    }
+    if (!LoadVectorData (sock, graph, N, "dxp")) {
+      FreeObjectData (&graph[0].objects[N]);
+      graph[0].Nobjects --;
+      REALLOCATE (graph[0].objects, Gobjects, MAX (1, graph[0].Nobjects));
+    }
+  }
+
+  if (DEBUG) fprintf (stderr, "loaded %d objects, using object %d\n", graph[0].objects[N].Npts, N);
+
+  if (USE_XWINDOW) DrawObjectN (graph, &graph[0].objects[graph[0].Nobjects-1]);
+  FlushDisplay ();
+
+  return (TRUE);
+  
+}
+
+int LoadVectorData (int sock, KapaGraphWidget *graph, int N, char *type) {
+  
+  int i, Npts, Ninpts, status, Ntry;
+  int bytes_left;
+  char *byte, *buffer, type_send[16], tmp;
+  int Npts_send, Nbytes_send, swap_client, swap_host;
+
+  buffer = NULL;
+  Npts = graph[0].objects[N].Npts;
+
+  KiiWaitAnswer (sock, "PLOB");
+  KiiScanMessage (sock, "%s %d %d %d", type_send, &Npts_send, &Nbytes_send, &swap_client);
+  if (strcmp (type, type_send)) {
+    fprintf (stderr, "Kapa Communication error: unexpected data type %s vs %s\n", type_send, type);
+  }
+  if (Npts_send != Npts) {
+    fprintf (stderr, "Kapa Communication error: unexpected number of points %d vs %d\n", Npts_send, Npts);
+  }
+  if (Nbytes_send != Npts_send*sizeof(float)) {
+    fprintf (stderr, "Kapa Communication error: unexpected data size %d vs %ld\n", Nbytes_send, Npts_send*sizeof(float));
+  }
+
+  status = 1;
+  if (!strcmp (type, "x")) {
+    ALLOCATE (graph[0].objects[N].x, float, MAX (1, Npts));
+    buffer = (char *) graph[0].objects[N].x;
+  }
+  if (!strcmp (type, "y")) {
+    ALLOCATE (graph[0].objects[N].y, float, MAX (1, Npts));
+    buffer = (char *) graph[0].objects[N].y;
+  }
+  if (!strcmp (type, "z")) {
+    ALLOCATE (graph[0].objects[N].z, float, MAX (1, Npts));
+    buffer = (char *) graph[0].objects[N].z;
+  }
+  if (!strcmp (type, "dxm")) {
+    ALLOCATE (graph[0].objects[N].dxm, float, MAX (1, Npts));
+    buffer = (char *) graph[0].objects[N].dxm;
+  }
+  if (!strcmp (type, "dxp")) {
+    ALLOCATE (graph[0].objects[N].dxp, float, MAX (1, Npts));
+    buffer = (char *) graph[0].objects[N].dxp;
+  }
+  if (!strcmp (type, "dym")) {
+    ALLOCATE (graph[0].objects[N].dym, float, MAX (1, Npts));
+    buffer = (char *) graph[0].objects[N].dym;
+  }
+  if (!strcmp (type, "dyp")) {
+    ALLOCATE (graph[0].objects[N].dyp, float, MAX (1, Npts));
+    buffer = (char *) graph[0].objects[N].dyp;
+  }
+
+  bytes_left = Npts*sizeof (float);
+
+  fcntl (sock, F_SETFL, O_NONBLOCK);  
+
+  // read the vector data as raw binary in client machine byte order (floats)
+  Ntry = 0;
+  if (DEBUG) fprintf (stderr, "starting vector load\n");
+  Ninpts = 0;
+  byte = buffer;
+  while (bytes_left > 0) {
+    status = read (sock, byte, bytes_left);
+    if (DEBUG) fprintf (stderr, "status: %d, %d\n", status, bytes_left);
+    if (status == 0) {  /* No more pipe */
+      fprintf (stderr, "error: pipe closed\n");
+      return (FALSE);
+    }
+    if (status != -1) { /* pipe has data */
+      Ninpts += status;
+      bytes_left -= status;
+      byte = (char *)(byte + status);
+      Ntry = 0;
+      continue;
+    }
+    if (errno == EAGAIN) {
+      Ntry ++;
+      if (Ntry > 100) {
+	fprintf (stderr, "kapa communication error\n");
+	return (FALSE);
+      }
+      usleep (10000);
+      continue;
+    }
+    perror ("kapa load");
+  }
+
+  fcntl (sock, F_SETFL, !O_NONBLOCK);  
+  KiiSendCommand (sock, 4, "DONE"); 
+
+# ifdef BYTE_SWAP
+  swap_host = 1;
+# else 
+  swap_host = 0;
+# endif  
+
+  // if host and client have opposite swap parities, word swap the incoming data
+  // SWAP_WORD is strangely defined... it takes the number of the start byte in a
+  // buffer called 'byte'
+  if ((swap_host && !swap_client) || (!swap_host && swap_client)) {
+    byte = buffer;
+    for (i = 0; i < Nbytes_send; i+=4) {
+      SWAP_WORD (i);
+    }
+  }
+
+  if (Ninpts != Npts*sizeof(float)) {  
+    fprintf (stderr, "error: expected %d bytes, but got only %d\n", Ninpts, (unsigned int)(Npts*sizeof(float)));
+    return (FALSE);
+  }
+  if (DEBUG) fprintf (stderr, "done vector load\n");
+  return (TRUE);
+
+}
+
+void FreeObjectData (Gobjects *object) {
+
+  if (object[0].x != (float *) NULL) free (object[0].x);
+  if (object[0].y != (float *) NULL) free (object[0].y);
+  if (object[0].z != (float *) NULL) free (object[0].z);
+
+  if (object[0].dxm != (float *) NULL) free (object[0].dxm);
+  if (object[0].dxp != (float *) NULL) free (object[0].dxp);
+  if (object[0].dym != (float *) NULL) free (object[0].dym);
+  if (object[0].dyp != (float *) NULL) free (object[0].dyp);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadOverlay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadOverlay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadOverlay.c	(revision 15879)
@@ -0,0 +1,128 @@
+# include "Ximage.h"
+
+int LoadOverlay (int sock) {
+  
+  int i, j, Ntotal, Nbytes, Nread, Nfound, Ntext, Nobjects, overnum;
+  int Noverlay, Ntextdata;
+  char *textdata, *buffer, *p, *q;
+  Section *section;
+  KapaImageWidget *image;
+  Graphic *graphic;
+  KiiOverlayBase *overlay;
+
+  graphic = GetGraphic ();
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image = section->image;
+
+  KiiScanMessage (sock, "%d %d %d %d", &overnum, &Noverlay, &Ntext, &Ntextdata);
+
+  // XXX need to validate overnum 
+  if ((overnum < 0) || (overnum >= NOVERLAYS)) overnum = 0;
+
+  // read the overlay data as binary 
+  Ntotal = 0;
+  Nbytes = Noverlay*sizeof(KiiOverlayBase);
+  fcntl (sock, F_SETFL, O_NONBLOCK);  
+  ALLOCATE (overlay, KiiOverlayBase, Noverlay);
+  buffer = (char *) overlay;
+  while (Nbytes > 0) { 
+    Nread = read (sock, &buffer[Ntotal], Nbytes);
+    // fprintf (stderr, "read: %d of %d remaining, %d so far, %d expected\n", Nread, Nbytes, Ntotal, Noverlay*sizeof(KiiOverlayBase));
+    if (Nread == 0) {  /* No more pipe */
+      fprintf (stderr, "error: pipe closed\n");
+      free (overlay);
+      fcntl (sock, F_SETFL, !O_NONBLOCK);  
+      return (FALSE);
+    }
+    if (Nread != -1) { /* pipe has data */
+      Nbytes -= Nread;
+      Ntotal += Nread;
+    }
+  }
+  fcntl (sock, F_SETFL, !O_NONBLOCK);  
+  KiiSendCommand (sock,  4, "DONE");
+
+  // read the textdata as binary
+  Ntotal = 0;
+  Nbytes = Ntextdata;
+  fcntl (sock, F_SETFL, O_NONBLOCK);  
+  ALLOCATE (textdata, char, Ntextdata);
+  while (Nbytes > 0) { 
+    Nread = read (sock, &textdata[Ntotal], Nbytes);
+    if (Nread == 0) {  /* No more pipe */
+      fprintf (stderr, "error: pipe closed\n");
+      free (textdata);
+      free (overlay);
+      fcntl (sock, F_SETFL, !O_NONBLOCK);  
+      return (FALSE);
+    }
+    if (Nread != -1) { /* pipe has data */
+      Nbytes -= Nread;
+      Ntotal += Nread;
+    }
+  }
+  fcntl (sock, F_SETFL, !O_NONBLOCK);  
+  KiiSendCommand (sock,  4, "DONE");
+
+  // add new overlay objects to existing data
+  Nobjects = image[0].overlay[overnum].Nobjects + Noverlay;
+  REALLOCATE (image[0].overlay[overnum].objects, KiiOverlay, Nobjects);
+
+  j = image[0].overlay[overnum].Nobjects;
+  for (i = 0; i < Noverlay; i++, j++) {
+    image[0].overlay[overnum].objects[j].x     = overlay[i].x;
+    image[0].overlay[overnum].objects[j].y     = overlay[i].y;
+    image[0].overlay[overnum].objects[j].dx    = overlay[i].dx;
+    image[0].overlay[overnum].objects[j].dy    = overlay[i].dy;
+    image[0].overlay[overnum].objects[j].angle = overlay[i].angle;
+    image[0].overlay[overnum].objects[j].type  = overlay[i].type;
+    image[0].overlay[overnum].objects[j].text  = NULL;
+  }
+
+  // parse the text data : text lines are separated by '\n', one per text entry
+  p = textdata;
+  Nfound = 0;
+  for (i = 0; i < Noverlay; i++) {
+    if (overlay[i].type != KII_OVERLAY_TEXT) continue;
+    if (Nfound >= Ntext) {
+      fprintf (stderr, "inconsistent number of text lines\n");
+      break;
+    }
+    if (! *p) {
+      fprintf (stderr, "inconsistent number of text lines\n");
+      break;
+    }
+    q = strchr (p, '\n');
+    if (q == NULL) {
+      fprintf (stderr, "inconsistent text line\n");
+      break;
+    }
+    j = image[0].overlay[overnum].Nobjects + i;
+    image[0].overlay[overnum].objects[j].text = strncreate (p, q-p);
+    p = q + 1;
+    Nfound ++;
+  }
+  if (Nfound != Ntext) {
+    fprintf (stderr, "read %d text lines, expected %d\n", Nfound, Ntext);
+  }
+
+  free (textdata);
+  free (overlay);
+
+  image[0].overlay[overnum].Nobjects = Nobjects;
+  image[0].overlay[overnum].active = TRUE;
+
+  if (USE_XWINDOW) {
+    for (i = 0; i < NOVERLAYS; i++) {
+      if (image[0].overlay[i].active) {
+	PaintOverlay (graphic, image, i);
+      }
+    }
+    XFlush (graphic[0].display);
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadPicture.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadPicture.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadPicture.c	(revision 15879)
@@ -0,0 +1,72 @@
+# include "Ximage.h"
+
+int LoadPicture (int sock) {
+
+  Header header;
+  char *buff;
+  int status, bytes_left;
+  Section *section;
+  KapaImageWidget *image;
+  Graphic *graphic;
+
+  graphic = GetGraphic ();
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image = section->image;
+  
+  KiiSendMessage (sock, "%d", graphic->Npixels);
+
+  gfits_init_header (&header);
+  header.Naxes = 2;
+  KiiScanMessage (sock, "%d %d %d %d %lf %lf", &header.Naxis[0], &header.Naxis[1]);
+  KiiScanMessage (sock, "%d %d %d %d %lf %lf", &header.bitpix, &header.unsign, &header.bzero, &header.bscale);
+  KiiScanMessage (sock, "%lf %lf %s %s",  &image[0].zero, &image[0].range, image[0].name, image[0].file);
+  KiiScanMessage (sock, "%lf %lf %d", &image[0].min,  &image[0].max, &header.size);
+  KiiScanMessage (sock, "%lf %f %f %f %f", &image[0].coords.crval1, &image[0].coords.crpix1, &image[0].coords.cdelt1, &image[0].coords.pc1_1, &image[0].coords.pc1_2);
+  KiiScanMessage (sock, "%lf %f %f %f %f", &image[0].coords.crval2, &image[0].coords.crpix2, &image[0].coords.cdelt2, &image[0].coords.pc2_1, &image[0].coords.pc2_2);
+  KiiScanMessage (sock, "%s", image[0].coords.ctype);
+
+  gfits_free_matrix (&image[0].matrix);
+  gfits_create_matrix (&header, &image[0].matrix);
+
+  fcntl (sock, F_SETFL, O_NONBLOCK);  
+
+  status = 1;
+  buff = image[0].matrix.buffer;
+  bytes_left = header.size;
+  image[0].matrix.size = 0;
+  while (bytes_left > 0) {
+    status = read (sock, buff, bytes_left);
+    if (status == 0) {  /* No more pipe */
+      fprintf (stderr, "error: pipe closed\n");
+      return (FALSE);
+    }
+    if (status != -1) { /* pipe has data */
+      image[0].matrix.size += status;
+      bytes_left -= status;
+      buff = (char *)(buff + status);
+    }
+  }
+
+  fcntl (sock, F_SETFL, !O_NONBLOCK);  
+
+  if (DEBUG) fprintf (stderr, "read %d bytes\n", image[0].matrix.size);
+  /* it it not obvious this condition should kill kii, but ... */
+  if (image[0].matrix.size != header.size) {  
+    fprintf (stderr, "error: expected %d bytes, but got only %d\n", header.size, image[0].matrix.size);
+    return (FALSE);
+  }
+
+  if (!USE_XWINDOW) return (TRUE);
+
+  Remap (graphic, image, &image[0].matrix);
+  if (DEBUG) fprintf (stderr, "remapped image\n");
+  Refresh ();
+  if (DEBUG) fprintf (stderr, "refreshed\n");
+  XFlush (graphic[0].display);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadTextlines.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadTextlines.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadTextlines.c	(revision 15879)
@@ -0,0 +1,49 @@
+# include "Ximage.h"
+
+int LoadTextlines (int sock) {
+  
+  char *string;
+  int N, size;
+  double tX, tY, tT, L;
+  Section *section;
+  KapaGraphWidget *graph;
+
+  section = GetActiveSection();
+  graph = section->graph;
+    if (section->graph == NULL) {
+    section->graph = InitGraph ();
+    SetSectionSizes (section);
+  }
+
+  graph[0].Ntextline = MAX (graph[0].Ntextline, 0);
+  N = graph[0].Ntextline;
+  graph[0].Ntextline++;
+  REALLOCATE (graph[0].textline, Label, graph[0].Ntextline);
+
+  KiiScanMessage (sock, "%lf %lf %lf", &tX, &tY, &tT);
+
+  L = graph[0].axis[0].dfx;
+  graph[0].textline[N].x = L * (tX - graph[0].axis[0].min) / (graph[0].axis[0].max - graph[0].axis[0].min) + graph[0].axis[0].fx;
+
+  L = graph[0].axis[1].dfy;
+  graph[0].textline[N].y = L * (tY - graph[0].axis[1].min) / (graph[0].axis[1].max - graph[0].axis[1].min) + graph[0].axis[1].fy;
+
+  graph[0].textline[N].angle = tT;
+
+  bzero (graph[0].textline[N].text, LABEL_MAXLEN);
+
+  string = KiiRecvData (sock);
+  strcpy (graph[0].textline[N].text, string);
+  free (string);
+  
+  string = GetRotFont (&size);
+  graph[0].textline[N].size = size;
+  strcpy (graph[0].textline[N].font, string);
+
+  if (USE_XWINDOW) DrawTextlines (graph);
+  
+  FlushDisplay ();
+  
+  return (TRUE);
+  
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadTickmarks.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadTickmarks.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/LoadTickmarks.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "Ximage.h"
+
+int LoadTickmarks (int sock) {
+  
+  char line[129], type[16];
+  double x, y, dx, dy;
+  int status, NOBJECTS, Nobjects, done;
+  Section *section;
+  KapaImageWidget *image;
+
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image   = section->image;
+
+  Nobjects = image[0].tickmarks.Nobjects;
+  NOBJECTS = Nobjects + 100;
+  REALLOCATE (image[0].tickmarks.objects, KiiOverlay, NOBJECTS);
+  
+  done = FALSE;
+  while (!done) {
+    status = read (sock, line, 128); 
+    line[128] = 0; 
+
+    if (!strncmp (line, "DONE", 4)) {
+      done = TRUE;
+      break;
+    }
+    
+    sscanf (line, "%s %lf %lf %lf %lf\n", type, &x, &y, &dx, &dy);
+    
+    if (strcmp (type, "TEXT") && strcmp (type, "LINE") && strcmp (type, "BOX") && strcmp (type, "CIRCLE")) {  /* skip */
+      fprintf (stderr, "don't know %s, skipping\n", type);
+      continue;
+    }
+    
+    strcpy (image[0].tickmarks.objects[Nobjects].type, type);
+    image[0].tickmarks.objects[Nobjects].x = x;
+    image[0].tickmarks.objects[Nobjects].y = y;
+    image[0].tickmarks.objects[Nobjects].dx = dx;
+    image[0].tickmarks.objects[Nobjects].dy = dy;
+    
+    if (!strcmp (type, "TEXT")) { /* dx = Nchar, dy = angle (not yet used) */
+      status = read (sock, line, 128); 
+      line[128] = 0; 
+      ALLOCATE (image[0].tickmarks.objects[Nobjects].text, char, (int) dx + 1);
+      strncpy (image[0].tickmarks.objects[Nobjects].text, line, (int) dx);
+      image[0].tickmarks.objects[Nobjects].text[(int)dx] = 0;
+    }      
+    
+    Nobjects++;
+    if (Nobjects >= NOBJECTS) {
+      NOBJECTS = Nobjects + 100;
+      REALLOCATE (image[0].tickmarks.objects, KiiOverlay, NOBJECTS);
+    }
+
+  }
+
+  REALLOCATE (image[0].tickmarks.objects, KiiOverlay, MAX(Nobjects, 1));
+  image[0].tickmarks.Nobjects = Nobjects;
+
+  if (USE_XWINDOW) Refresh ();
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/MakeColormap.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/MakeColormap.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/MakeColormap.c	(revision 15879)
@@ -0,0 +1,53 @@
+# include "Ximage.h"
+# define NPIXELS 64
+
+static char default_cmap[] = "grayscale";
+
+void MakeColormap (int argc, char **argv) {
+
+  int i, N, status;
+  char *temp_name;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  /* hardwired colors - white, black -- for drawing text and overlay graphics */
+  temp_name = XGetDefault (graphic[0].display, argv[0], "ROverlay");
+  graphic[0].overlay_color[0] = GetColor (graphic[0].display, (temp_name == (char *) NULL ? "red"    : temp_name), graphic[0].colormap, graphic[0].fore);
+  temp_name = XGetDefault (graphic[0].display, argv[0], "GOverlay");
+  graphic[0].overlay_color[1] = GetColor (graphic[0].display, (temp_name == (char *) NULL ? "green"  : temp_name), graphic[0].colormap, graphic[0].fore);
+  temp_name = XGetDefault (graphic[0].display, argv[0], "BOverlay");
+  graphic[0].overlay_color[2] = GetColor (graphic[0].display, (temp_name == (char *) NULL ? "blue"   : temp_name), graphic[0].colormap, graphic[0].fore);
+  temp_name = XGetDefault (graphic[0].display, argv[0], "YOverlay");
+  graphic[0].overlay_color[3] = GetColor (graphic[0].display, (temp_name == (char *) NULL ? "yellow" : temp_name), graphic[0].colormap, graphic[0].fore);
+
+  for (i = 0; i < graphic[0].Npixels; i++) {
+    graphic[0].cmap[i].pixel = graphic[0].pixels[i];
+  }
+
+  /* decide on a color map */
+  temp_name = XGetDefault (graphic[0].display, argv[0], "Colormap");
+  if ((N = get_argument (argc, argv, "-cm"))) {
+    if (N + 1 < argc) {
+      temp_name = argv[N+1];
+    } else {
+      fprintf (stderr, "error: usage is -cm ColormapName\n");
+      exit (1);
+    }
+  }
+  if (temp_name == (char *) NULL) temp_name = default_cmap;
+
+  status = SetColormap (temp_name);
+  if (!status) {
+    fprintf (stderr, "invalid colormap, using default %s\n", default_cmap);
+    temp_name = default_cmap;
+    status = SetColormap (temp_name);
+    if (!status) {
+      fprintf (stderr, "problem with default colormap\n");
+      exit (1);
+    }
+  }
+}
+
+/* this routine is NOT independent of the number of overlays */
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/MakeCursor.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/MakeCursor.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/MakeCursor.c	(revision 15879)
@@ -0,0 +1,9 @@
+# include "Ximage.h"
+
+/************** MakeCursor *************/
+void MakeCursor (Graphic *graphic, unsigned int cursor) {
+
+  graphic->cursor = XCreateFontCursor (graphic->display, (unsigned) cursor);
+
+  if (graphic->cursor != (Cursor) None) XDefineCursor (graphic->display, graphic->window, graphic->cursor);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/MakeGC.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/MakeGC.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/MakeGC.c	(revision 15879)
@@ -0,0 +1,14 @@
+# include "Ximage.h"
+
+/************** MakeGC *************/
+void MakeGC (Graphic *graphic) {
+
+  XGCValues gcvalues;
+
+  gcvalues.foreground = graphic->fore;
+  gcvalues.background = graphic->back;
+  graphic->gc = XCreateGC (graphic->display, graphic->window, 
+			     GCForeground | GCBackground, &gcvalues);
+  if (graphic->gc == 0)
+    QuitX (graphic->display, "Error in creating a Graphics Context");
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/MapWindow.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/MapWindow.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/MapWindow.c	(revision 15879)
@@ -0,0 +1,9 @@
+# include "Ximage.h"
+
+/************** MapWindow *************/
+void MapWindow (Graphic *graphic) {
+
+  XMapRaised (graphic->display, graphic->window);
+  XMapSubwindows (graphic->display, graphic->window);
+  FlushDisplay (graphic);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/NameWindow.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/NameWindow.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/NameWindow.c	(revision 15879)
@@ -0,0 +1,29 @@
+# include "Ximage.h"
+
+/************** NameWindow *************/
+void NameWindow (Graphic *graphic, char *Name) {
+
+  char       *name;
+  char       *class_name;
+  char       *class_type;
+  XClassHint *classhints;
+
+  name = strrchr (Name, '/');
+  if (name != NULL) 
+    name ++;
+  else 
+    name = Name;
+
+  class_type = class_name = name;
+  classhints = XAllocClassHint ();
+
+  if (classhints != (XClassHint *) NULL)  {
+    classhints[0].res_name = class_name;
+    classhints[0].res_class = class_type;
+    XSetClassHint (graphic->display, graphic->window, classhints);
+    XFree (classhints);
+  }
+  
+  XStoreName (graphic->display, graphic->window, name);
+  XSetIconName (graphic->display, graphic->window, name);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/OpenDisplay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/OpenDisplay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/OpenDisplay.c	(revision 15879)
@@ -0,0 +1,15 @@
+# include "Ximage.h"
+
+/************** OpenDisplay *************/
+Display *OpenDisplay (char *name, int *screen) {
+
+  Display *display;
+  
+  display = XOpenDisplay (name);
+  if (display == NULL) {
+    fprintf (stderr, "Error could not open X display to %s\n", XDisplayName (name));
+    exit (0);
+  }
+  *screen = DefaultScreen (display);
+  return (display);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PNGit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PNGit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PNGit.c	(revision 15879)
@@ -0,0 +1,76 @@
+# include "Ximage.h"
+
+int PNGit (int sock) {
+
+  FILE *f;
+  png_structp png_ptr;
+  png_infop info_ptr;
+  png_color *palette;
+  int Npalette;
+  char filename[1024];
+  int Nbytes, status;
+  bDrawBuffer *buffer;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  /* expect a line telling the number of bytes and a filename */
+  status = read (sock, filename, 16);
+  filename[16] = 0;
+  sscanf (filename, "%*s %d", &Nbytes);
+  status = read (sock, filename, Nbytes);
+  filename[status] = 0; /* make the string easy to parse */
+
+  f = fopen (filename, "w");
+  if (f == (FILE *) NULL) {
+    fprintf (stderr, "can't open output file %s\n", "Xgraph.png");
+    return (TRUE);  /* true because otherwise it quits kapa! */
+  }
+
+  png_ptr = png_create_write_struct (PNG_LIBPNG_VER_STRING, (png_voidp) NULL, (png_voidp) NULL, (png_voidp) NULL);
+  if (!png_ptr) {
+    fprintf (stderr, "can't get png structure\n");
+    fclose (f);
+    return (TRUE);
+  }
+
+  info_ptr = png_create_info_struct (png_ptr);
+  if (!info_ptr) {
+    fprintf (stderr, "can't get png info structure\n");
+    png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
+    fclose (f);
+    return (TRUE);
+  }
+
+  if (setjmp (png_ptr[0].jmpbuf)) {
+    fprintf (stderr, "can't get png return\n");
+    png_destroy_write_struct (&png_ptr, &info_ptr);
+    fclose (f);
+    return (TRUE);
+  }
+
+  png_init_io (png_ptr, f);
+
+  /* see docs for write-row-callback to provide progress info */
+
+  png_set_IHDR (png_ptr, info_ptr, graphic->dx, graphic->dy, 8, PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); 
+
+  /* png_set_IHDR (png_ptr, info_ptr, graphic->dx, graphic->dy, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); */
+
+  palette = KapaPNGPalette (&Npalette);
+  png_set_PLTE (png_ptr, info_ptr, palette, Npalette); 
+ 
+  png_write_info (png_ptr, info_ptr);
+
+  buffer = bDrawIt ();
+
+  png_write_image (png_ptr, buffer[0].pixels);
+  png_write_end (png_ptr, info_ptr);
+  png_destroy_write_struct (&png_ptr, &info_ptr);
+  
+  bDrawBufferFree (buffer);
+  free (palette);
+  fclose (f);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PPMit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PPMit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PPMit.c	(revision 15879)
@@ -0,0 +1,54 @@
+# include "Ximage.h"
+
+int PPMit (int sock) {
+
+  FILE *f;
+  char *line, filename[1024];
+  int Nbytes, status, dx, dy, i, j, Npalette, color;
+  png_color *palette;
+  bDrawBuffer *buffer;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  /* expect a line telling the number of bytes and a filename */
+  status = read (sock, filename, 16);
+  filename[16] = 0;
+  sscanf (filename, "%*s %d", &Nbytes);
+  status = read (sock, filename, Nbytes);
+  filename[status] = 0; /* make the string easy to parse */
+
+  f = fopen (filename, "w");
+  if (f == (FILE *) NULL) {
+    fprintf (stderr, "can't open output file %s\n", filename);
+    return (TRUE);  /* true because otherwise it quits kapa! */
+  }
+  
+  palette = KapaPNGPalette (&Npalette);
+
+  dx = graphic->dx;
+  dy = graphic->dy;
+  
+  fprintf (f, "P6\n");
+  fprintf (f, "%d %d\n", dx, dy);
+  fprintf (f, "255\n");
+
+  buffer = bDrawIt ();
+
+  ALLOCATE (line, char, 3*dx);
+
+  for (i = 0; i < dy; i++) {
+    for (j = 0; j < dx; j++) {
+      color = buffer[0].pixels[i][j];
+      line[3*j + 0] = palette[color].red;
+      line[3*j + 1] = palette[color].green;
+      line[3*j + 2] = palette[color].blue;
+    }
+    fwrite (line, 3, dx, f);
+  }
+  fclose (f);
+  
+  bDrawBufferFree (buffer);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSFrame.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSFrame.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSFrame.c	(revision 15879)
@@ -0,0 +1,105 @@
+# include "Ximage.h"
+# define DrawLine(X1,Y1,DX,DY) (fprintf (f, " %6.2f %6.2f %6.2f %6.2f L\n", X1, Y1, X1+DX, Y1+DY))
+
+int PSFrame (KapaGraphWidget *graph, FILE *f) {
+  
+  int i, P, IsLabel, fontsize;
+  double fx, fy, dfx, dfy, range, major, minor, first, next;
+  char *fontname;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  /* each axis is drawn independently */
+  fontname = GetRotFont (&fontsize);
+  fprintf (f, "1 setlinewidth\n");
+  for (i = 0; i < 4; i++) {
+    fx = graph[0].axis[i].fx;
+    fy = graphic->dy - graph[0].axis[i].fy;
+    dfx = graph[0].axis[i].dfx;
+    dfy = -graph[0].axis[i].dfy;
+    P = hypot ((double)graph[0].axis[(i+1)%2].dfx, (double)graph[0].axis[(i+1)%2].dfy);
+
+    if (graph[0].axis[i].isaxis) { DrawLine (fx, fy, dfx, dfy); }
+    
+    if (graph[0].axis[i].areticks) {
+      if (isnan(graph[0].axis[i].min) || isinf(graph[0].axis[i].min)) continue;
+      if (isnan(graph[0].axis[i].max) || isinf(graph[0].axis[i].max)) continue;
+
+      range = graph[0].axis[i].max - graph[0].axis[i].min;
+      AxisTickScale (&graph[0].axis[i], &major, &minor);
+
+      first = minor*((int)(graph[0].axis[i].min/minor));
+      if ((range > 0) && (first < graph[0].axis[i].min)) {
+	first += minor;
+      }
+      if ((range < 0) && (first > graph[0].axis[i].min)) {
+	first -= minor;
+      }
+      for (next = first; ((range > 0) && (next <= graph[0].axis[i].max)) || ((range < 0) && (next >= graph[0].axis[i].max));) {
+	IsLabel = FALSE;
+	if ((fabs((int)(next/major) - (next/major)) < 0.5*(minor/major)) || 
+	    (fabs ((int)((next + 0.5*minor)/major) - (next/major)) < 0.5*(minor/major)) ||
+	    (fabs ((int)((next - 0.5*minor)/major) - (next/major)) < 0.5*(minor/major)))
+	  IsLabel = graph[0].axis[i].islabel;
+	PSTick (f, fx, fy, dfx, dfy, P, graph[0].axis[i].min, graph[0].axis[i].max, next, IsLabel, i);
+	if (range > 0) 
+	  next += minor;
+	else 
+	  next -= minor;
+      }
+    }
+  }
+  return (TRUE);
+}
+
+void PSTick (FILE *f, double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis) {
+  
+  int pos, dir, fontsize;
+  double size, n, x, y, dx, dy;
+  char string[64], *fontname;
+
+  pos = size = 0;
+
+  if (mode == 1) { size = MAX (0.02, 7.0 / P); }
+  if (mode == 0) { size = MAX (0.01, 4.0 / P); }
+  
+  n = P / sqrt ((double)(dfx*dfx + dfy*dfy));
+  x = fx + (value-min)*dfx/(max - min);
+  y = fy + (value-min)*dfy/(max - min);
+
+  dir = -1;
+  if ((naxis == 0) || (naxis == 1)) dir *= -1;
+  dx = dir*size*dfy*n;	
+  dy = dir*size*dfx*n;
+  
+  DrawLine (x, y, dx, dy);
+
+  if (mode == 1) {
+    fontname = GetRotFont (&fontsize);
+
+    /* temporarily assume rectilinear axes */
+    if (naxis == 0) { dx = 0; dy = -dir*(0.8*fontsize + 1); pos = 1; }
+    if (naxis == 2) { dx = 0; dy = -dir*(0.8*fontsize + 1); pos = 7; }
+
+    if (naxis == 1) { dy = 0; dx = -(0.8*fontsize + 1); pos = 3; }
+    if (naxis == 3) { dy = 0; dx = +(0.8*fontsize + 1); pos = 5; }
+
+    x = fx + (value-min)*dfx/(max - min) + dx;
+    y = fy + (value-min)*dfy/(max - min) + dy;
+    if (fabs(value) < 1e-14) { value = 0.0; }
+    sprintf (string, "%g", value);
+    PSRotText (f, (int)x, (int)y, string, pos, 0.0);
+  }
+}
+
+  /* 
+  dx = size*dfy*n;	
+  dy = size*dfx*n;
+  DrawLine (x, y, dx, dy);
+  
+  dx = -size*dfy*n;	
+  dy = -size*dfx*n;
+  DrawLine (x, y, dx, dy);
+  */
+  
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSLabels.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSLabels.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSLabels.c	(revision 15879)
@@ -0,0 +1,49 @@
+# include "Ximage.h"
+  
+void PSLabels (KapaGraphWidget *graph, FILE *f) {
+  
+  int i, pos, x, y, size;
+  double angle;
+  char *fontname;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  pos = 0;
+  fontname = GetRotFont (&size);
+  for (i = 0; i < 8; i++) {
+    if (strcmp (graph[0].label[i].text, "")) {
+      angle = 0;
+      switch (i) {
+      case 0: pos = 7; break;
+      case 1: pos = 1; angle = -90; break;
+      case 2: pos = 1; break;
+      case 3: pos = 1; angle =  90; break;
+      case 4: pos = 2; break;
+      case 5: pos = 0; break;
+      case 6: pos = 8; break;
+      case 7: pos = 6; break;
+      }	
+      x = graph[0].label[i].x;
+      y = graphic->dy - graph[0].label[i].y;
+      SetRotFont (graph[0].label[i].font, graph[0].label[i].size); 
+      PSRotText (f, x, y, graph[0].label[i].text, pos, angle);
+    }
+  }
+  SetRotFont (fontname, size);
+}
+
+  /*
+            
+ 4____2___5 
+  |       | 
+  |       | 
+ 1|       |3
+  |       |
+  |       |
+  ---------
+  6   0   7
+
+  */
+
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSObjects.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSObjects.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSObjects.c	(revision 15879)
@@ -0,0 +1,600 @@
+# include "Ximage.h"
+
+# define DrawLine(X1,Y1,X2,Y2) (fprintf (f, " %6.2f %6.2f %6.2f %6.2f L\n", X1, graphic->dy - Y1, X2, graphic->dy - Y2))
+# define DrawCircle(X1,Y1,R) (fprintf (f, " %6.2f %6.2f %6.2f C\n", (X1), (graphic->dy - Y1), (R)))
+# define DrawRectangle(X,Y,dX,dY) (fprintf (f, " %6.2f %6.2f %6.2f %6.2f B\n", (dX), (dY), (X-0.5*dX), (graphic->dy-Y-0.5*dY)))
+# define FillRectangle(X,Y,dX,dY) (fprintf (f, " %6.2f %6.2f %6.2f %6.2f F\n", (dX), (dY), (X-0.5*dX), (graphic->dy-Y-0.5*dY)))
+# define FillTriangle(X1,Y1,X2,Y2, X3, Y3) (fprintf (f, " %6.2f %6.2f %6.2f %6.2f %6.2f %6.2f TF\n", (X1), (graphic->dy-Y1), (X2), (graphic->dy-Y2), (X3), (graphic->dy-Y3)))
+# define CONNECT 0
+# define HISTOGRAM 1
+# define POINTS 2
+
+static Graphic *graphic;
+
+int PSObjects (KapaGraphWidget *graph, FILE *f) {
+  
+  int i;
+  double lweight;
+  static char dash[] = "5";
+  static char dot[] = "3";
+  
+  graphic = GetGraphic();
+
+  for (i = 0; i < graph[0].Nobjects; i++) {
+    switch (graph[0].objects[i].ltype) {
+    case 0:
+      break;
+    case 1:
+      fprintf (f, "[%s] 0 setdash\n", dash);
+      break;
+    case 2:
+      fprintf (f, "[%s] 0 setdash\n", dot);
+      break;
+    default:
+      break;
+    }
+    
+    lweight = MAX (0, MIN (10, graph[0].objects[i].lweight));
+    fprintf (f, "%.1f setlinewidth\n", lweight);
+    fprintf (f, "%s setrgbcolor\n", KapaColorRGBString(graph[0].objects[i].color));
+
+    switch (graph[0].objects[i].style) {
+    case CONNECT: 
+      PSConnect (graph, &graph[0].objects[i], f);
+      break;
+    case HISTOGRAM:
+      PSHistogram (graph, &graph[0].objects[i], f);
+      break;
+    case POINTS:
+      PSPoints (graph, &graph[0].objects[i], f);
+      break;
+    }
+
+    if (graph[0].objects[i].etype & 0x01) {
+      PSYErrors (graph, &graph[0].objects[i], f);
+    }
+    if (graph[0].objects[i].etype & 0x02) {
+      PSXErrors (graph, &graph[0].objects[i], f);
+    }
+    fprintf (f, "[] 0 setdash\n");
+    fprintf (f, "0.00 0.00 0.00 setrgbcolor\n");
+  }
+  return (TRUE);
+}
+
+/*******/
+void PSConnect (KapaGraphWidget *graph, Gobjects *object, FILE *f) {
+  
+  int i;
+  float *x, *y;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1;
+  double X0, X1, Y0, Y1;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0); 
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0); 
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  X0 = graph[0].axis[0].fx;
+  X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx;
+  Y0 = graph[0].axis[1].fy;
+  Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+
+  x = object[0].x; y = object[0].y;
+  for (i = 0; (i < object[0].Npts) && !(finite(x[i]) && finite(y[i])); i++);
+  if (i >= object[0].Npts) return;
+  sx0 = x[i]*mxi + y[i]*mxj + bx;
+  sy0 = x[i]*myi + y[i]*myj + by;
+  
+  for (i++; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]))) continue;
+    sx1 = x[i]*mxi + y[i]*mxj + bx;
+    sy1 = x[i]*myi + y[i]*myj + by;
+    ClipLinePS (sx0, sy0, sx1, sy1, X0, Y0, X1, Y1, f);
+    /* DrawLine (sx0, sy0, sx1, sy1); */
+    sx0 = sx1; sy0 = sy1;
+  }
+}
+
+void ClipLinePS (double x0, double y0, double x1, double y1, double X0, double Y1, double X1, double Y0, FILE *f) {
+
+  /* skip line segement if both points are beyond box */
+  if ((x0 <= X0) && (x1 <= X0)) return;
+  if ((x0 >= X1) && (x1 >= X1)) return;
+  if ((y0 <= Y0) && (y1 <= Y0)) return;
+  if ((y0 >= Y1) && (y1 >= Y1)) return;
+
+  /* replace x0,y0 if outside box */
+  if ((x0 < X0) && (x1 >= X0)) {
+    y0 = y0 + (X0 - x0)*(y1 - y0)/(x1 - x0);
+    x0 = X0;
+  }
+  if ((x0 > X1) && (x1 <= X1)) {
+    y0 = y0 + (X1 - x0)*(y1 - y0)/(x1 - x0);
+    x0 = X1;
+  }
+  if ((y0 < Y0) && (y1 >= Y0)) {
+    x0 = x0 + (Y0 - y0)*(x1 - x0)/(y1 - y0);
+    y0 = Y0;
+  }
+  if ((y0 > Y1) && (y1 <= Y1)) {
+    x0 = x0 + (Y1 - y0)*(x1 - x0)/(y1 - y0);
+    y0 = Y1;
+  }
+
+  /* skip line segement if both points are beyond box */
+  if ((x0 <= X0) && (x1 <= X0)) return;
+  if ((x0 >= X1) && (x1 >= X1)) return;
+  if ((y0 <= Y0) && (y1 <= Y0)) return;
+  if ((y0 >= Y1) && (y1 >= Y1)) return;
+
+  /* replace x1,y1 if outside box */
+  if ((x1 < X0) && (x0 >= X0)) {
+    y1 = y0 + (X0 - x0)*(y1 - y0)/(x1 - x0);
+    x1 = X0;
+  }
+  if ((x1 > X1) && (x0 <= X1)) {
+    y1 = y0 + (X1 - x0)*(y1 - y0)/(x1 - x0);
+    x1 = X1;
+  }
+  if ((y1 < Y0) && (y0 >= Y0)) {
+    x1 = x0 + (Y0 - y0)*(x1 - x0)/(y1 - y0);
+    y1 = Y0;
+  }
+  if ((y1 > Y1) && (y0 <= Y1)) {
+    x1 = x0 + (Y1 - y0)*(x1 - x0)/(y1 - y0);
+    y1 = Y1;
+  }
+  DrawLine (x0, y0, x1, y1);
+}
+
+/*******/
+void PSHistogram (KapaGraphWidget *graph, Gobjects *object, FILE *f) {
+
+  int i;
+  float *x, *y;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1, sxa;
+  double X0, X1, Y0, Y1;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0); 
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0); 
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  X0 = graph[0].axis[0].fx;
+  X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx;
+  Y0 = graph[0].axis[1].fy;
+  Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+
+  /* find the first valid datapoint */
+  x = object[0].x; y = object[0].y;
+  for (i = 0; (i < object[0].Npts) && !(finite(x[i]) && finite(y[i])); i++);
+  if (i >= object[0].Npts) return;
+  sx0 = x[i]*mxi + y[i]*mxj + bx;
+  sy0 = x[i]*myi + y[i]*myj + by;
+  sx0 = MIN (MAX (sx0, X0), X1);
+  sy0 = MAX (MIN (sy0, Y0), Y1);
+  
+  /* continue with rest of points */
+  for (i++; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]))) continue;
+    sx1 = x[i]*mxi + y[i]*mxj + bx;
+    sy1 = x[i]*myi + y[i]*myj + by;
+    sx1 = MIN (MAX (sx1, X0), X1);
+    sy1 = MAX (MIN (sy1, Y0), Y1);
+    sxa = 0.5*(sx0 + sx1);
+    DrawLine (sx0, sy0, sxa, sy0);
+    DrawLine (sxa, sy0, sxa, sy1);
+    DrawLine (sxa, sy1, sx1, sy1);
+    sx0 = sx1; sy0 = sy1;
+  }
+}
+
+/*******/
+void PSPoints (KapaGraphWidget *graph, Gobjects *object, FILE *f) {
+ 
+  int i;
+  float *x, *y, *z;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx, sy, d, sx1, sy1, sx2, sy2;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);  
+ 
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);  
+
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  /* below here, code is identical with DrawObjects */
+  /**** points are scaled by object.z ***/
+  if (object[0].size < 0) {
+    d = 0.5 * (graphic->dx + graphic->dy) * 0.01;
+    x = object[0].x; y = object[0].y; z = object[0].z;
+    if (object[0].ptype == 0) {	/* filled box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    FillRectangle (sx, sy, 2*d*z[i], 2*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 1) {	/* open box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawRectangle (sx, sy, 2*d*z[i], 2*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 2) { /* cross */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx - d*z[i], sy, sx + d*z[i], sy);
+	    DrawLine (sx, sy - d*z[i], sx, sy + d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 3) {	/* x */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx + d*z[i], sy - d*z[i], sx - d*z[i], sy + d*z[i]);
+	    DrawLine (sx - d*z[i], sy - d*z[i], sx + d*z[i], sy + d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 4) {	/* filled triangle */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    FillTriangle (sx - d*z[i], sy - 0.58*d*z[i], sx + d*z[i], sy - 0.58*d*z[i], sx, sy + 1.15*d*z[i]);
+	    /*
+	    DrawLine (sx - d*z[i], sy + 0.58*d*z[i], sx + d*z[i], sy + 0.58*d*z[i]);
+	    DrawLine (sx + d*z[i], sy + 0.58*d*z[i], sx,          sy - 1.15*d*z[i]);
+	    DrawLine (sx,          sy - 1.15*d*z[i], sx - d*z[i], sy + 0.58*d*z[i]);
+	    */
+	  }
+      }
+    }
+    if (object[0].ptype == 5) {	/* open triangle */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx - d*z[i], sy + 0.58*d*z[i], sx + d*z[i], sy + 0.58*d*z[i]);
+	    DrawLine (sx + d*z[i], sy + 0.58*d*z[i], sx,          sy - 1.15*d*z[i]);
+	    DrawLine (sx,          sy - 1.15*d*z[i], sx - d*z[i], sy + 0.58*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 6) {	/* Y */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx, sy, sx - d*z[i], sy + 0.58*d*z[i]);
+	    DrawLine (sx, sy, sx + d*z[i], sy + 0.58*d*z[i]);
+	    DrawLine (sx, sy, sx,          sy - 1.15*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 7) {	/* 0 */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawCircle (sx, sy, d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 100) {	/* connect a pair of points */
+      for (i = 0; i + 1 < object[0].Npts; i+=2) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx1 = x[i]*mxi + y[i]*mxj + bx;
+	sy1 = x[i]*myi + y[i]*myj + by;
+	sx2 = x[i+1]*mxi + y[i+1]*mxj + bx;
+	sy2 = x[i+1]*myi + y[i+1]*myj + by;
+	DrawLine (sx1, sy1, sx2, sy2);
+      }
+    }
+  } else {
+    d = object[0].size * 0.5 * (graphic->dx + graphic->dy) * 0.003;
+    x = object[0].x; y = object[0].y;
+    if (object[0].ptype == 0) {	/* filled box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    FillRectangle (sx, sy, 2*d, 2*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 1) {		/* open box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+   	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawRectangle (sx, sy, 2*d, 2*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 2) { /* cross */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx - d, sy, sx + d, sy);
+	    DrawLine (sx, sy - d, sx, sy + d);
+	  }
+      }
+    }
+    if (object[0].ptype == 3) {		/* x */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx + d, sy - d, sx - d, sy + d);
+	    DrawLine (sx - d, sy - d, sx + d, sy + d);
+	  }
+      }
+    }
+    if (object[0].ptype == 4) {	/* filled triangle */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    /*
+	    DrawLine (sx - d, sy + 0.58*d, sx + d, sy + 0.58*d);
+	    DrawLine (sx + d, sy + 0.58*d, sx,     sy - 1.15*d);
+	    DrawLine (sx,     sy - 1.15*d, sx - d, sy + 0.58*d);
+	    */
+	    FillTriangle (sx - d, sy - 0.58*d, sx + d, sy - 0.58*d, sx, sy + 1.15*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 5) {	/* open triangle */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx - d, sy - 0.58*d, sx + d, sy - 0.58*d);
+	    DrawLine (sx + d, sy - 0.58*d, sx,     sy + 1.15*d);
+	    DrawLine (sx,     sy + 1.15*d, sx - d, sy - 0.58*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 6) {	/* Y */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx, sy, sx - d, sy - 0.58*d);
+	    DrawLine (sx, sy, sx + d, sy - 0.58*d);
+	    DrawLine (sx, sy, sx,     sy + 1.15*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 7) {	/* 0 */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawCircle (sx, sy, d);
+	  }
+      }
+    }
+    if (object[0].ptype == 100) {	
+      for (i = 0; i + 1 < object[0].Npts; i+=2) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx1 = x[i]*mxi + y[i]*mxj + bx;
+	sy1 = x[i]*myi + y[i]*myj + by;
+	sx2 = x[i+1]*mxi + y[i+1]*mxj + bx;
+	sy2 = x[i+1]*myi + y[i+1]*myj + by;
+	DrawLine (sx1, sy1, sx2, sy2);
+      }
+    }
+  }
+}
+    
+/*******/
+void PSXErrors (KapaGraphWidget *graph, Gobjects *object, FILE *f) {
+  
+  int i, bar;
+  float *x, *y, *dxm, *dxp;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1, sz, sx10, sx11;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  x = object[0].x; y = object[0].y; dxp = object[0].dxp; dxm = object[0].dxm; 
+  bar = object[0].ebar; sz = object[0].size*graph[0].axis[1].dfy*0.03;
+   
+  for (i = 0; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]) && finite(dxp[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = (x[i] + dxp[i])*mxi + y[i]*mxj + bx;
+    sy1 = (x[i] + dxp[i])*myi + y[i]*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sy1 - sz;
+	  sx11 = sy1 + sz;
+	  DrawLine (sx1, sx10, sx1, sx11);
+	}
+      }
+    if (!(finite(x[i]) && finite(y[i]) && finite(dxm[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = (x[i] - dxm[i])*mxi + y[i]*mxj + bx;
+    sy1 = (x[i] - dxm[i])*myi + y[i]*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sy1 - sz;
+	  sx11 = sy1 + sz;
+	  DrawLine (sx1, sx10, sx1, sx11);
+	}
+      }
+  }
+}
+
+    
+/*******/
+void PSYErrors (KapaGraphWidget *graph, Gobjects *object, FILE *f) {
+  
+  int i, bar;
+  float *x, *y, *dym, *dyp;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1, sz, sx10, sx11;
+  
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  x = object[0].x; y = object[0].y; dyp = object[0].dyp; dym = object[0].dym; 
+  bar = object[0].ebar; sz = object[0].size*graph[0].axis[0].dfx*0.03;
+  
+  for (i = 0; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]) && finite(dyp[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = x[i]*mxi + (y[i] + dyp[i])*mxj + bx;
+    sy1 = x[i]*myi + (y[i] + dyp[i])*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sx1 - sz;
+	  sx11 = sx1 + sz;
+	  DrawLine (sx10, sy1, sx11, sy1);
+	}
+      }
+    if (!(finite(x[i]) && finite(y[i]) && finite(dym[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = x[i]*mxi + (y[i] - dym[i])*mxj + bx;
+    sy1 = x[i]*myi + (y[i] - dym[i])*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sx1 - sz;
+	  sx11 = sx1 + sz;
+	  DrawLine (sx10, sy1, sx11, sy1);
+	}
+      }
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSOverlay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSOverlay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSOverlay.c	(revision 15879)
@@ -0,0 +1,68 @@
+# include "Ximage.h"
+
+void PSOverlay (KapaImageWidget *image, int N, FILE *f, int extra) {
+
+  int i;
+  double X, Y, dX, dY;
+  int Xmin, Ymin, Xmax, Ymax;
+  double expand, X0, Y0;
+ 
+  expand = 1.0;
+  if (image[0].expand > 0) {
+    expand = 1 / (1.0*image[0].expand);
+  }
+  if (image[0].expand < 0) {
+    expand = fabs((double)image[0].expand);
+  }
+
+  Image_to_Screen (&X0, &Y0, 0.0, 0.0, image);
+  X0 -= image[0].picture.x;
+  Y0 -= image[0].picture.y;
+
+  Xmin = 0;
+  Ymin = 0;
+  Xmax = image[0].picture.dx;
+  Ymax = image[0].picture.dy;
+
+  for (i = 0; i < image[0].overlay[N].Nobjects; i++) {
+    X  = (image[0].overlay[N].objects[i].x)/expand + X0;
+    Y =  Ymax - (image[0].overlay[N].objects[i].y)/expand - Y0;
+    dX = (image[0].overlay[N].objects[i].dx)/expand;
+    dY = (image[0].overlay[N].objects[i].dy)/expand;
+    
+    switch (image[0].overlay[N].objects[i].type) {
+      case KII_OVERLAY_LINE:
+	if (((X < Xmin) && (X + dX < Xmin)) || ((X > Xmax) && (X + dX > Xmax)) ||
+	    ((Y < Ymin) && (Y + dY < Ymin)) || ((Y > Ymax) && (Y + dY > Ymax))) {
+	  break;
+	}
+	fprintf (f, " %6.1f %6.1f %6.1f %6.1f L\n", X + extra, Y + extra, (X+dX + extra), (Y-dY + extra));
+	break;
+      case KII_OVERLAY_TEXT:
+	if (((X < Xmin) && (X + dX < Xmin)) || ((X > Xmax) && (X + dX > Xmax)) ||
+	    ((Y < Ymin) && (Y + dY < Ymin)) || ((Y > Ymax) && (Y + dY > Ymax))) {
+	  break;
+	}
+	fprintf (f, "(%s) %6.1f %6.1f T\n", image[0].overlay[N].objects[i].text, X + extra, Y + extra); 
+	break;
+      case KII_OVERLAY_BOX:
+	if (((X - 0.5*dX < Xmin) && (X + 0.5*dX < Xmin)) || ((X - 0.5*dX > Xmax) && (X + 0.5*dX > Xmax)) ||
+	    ((Y - 0.5*dY < Ymin) && (Y + 0.5*dY < Ymin)) || ((Y - 0.5*dY > Ymax) && (Y + 0.5*dY > Ymax))) {
+	  break;
+	}
+	fprintf (f, " %6.1f %6.1f %6.1f %6.1f B\n", (dX + 2*extra), (dY + 2*extra), (X - 0.5*dX - extra), (Y - 0.5*dY - extra));
+	break;
+      case KII_OVERLAY_CIRCLE:
+	if (((X - dX < Xmin) && (X + dX < Xmin)) || ((X - dX > Xmax) && (X + dX > Xmax)) ||
+	    ((Y - dY < Ymin) && (Y + dY < Ymin)) || ((Y - dY > Ymax) && (Y + dY > Ymax))) {
+	  break;
+	}
+	// XXX add in the rotated ellipse version (rotate in PS space)
+	fprintf (f, " %6.1f %6.1f %6.1f C\n", X, Y, fabs(dX + extra));
+	break;
+      default:
+	fprintf (stderr, "skipping unknown object\n");
+	break;
+    }
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSPixmap.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSPixmap.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSPixmap.c	(revision 15879)
@@ -0,0 +1,144 @@
+# include "Ximage.h"
+
+void PSPixmap8 (Graphic *graphic, KapaImageWidget *image, FILE *f) {
+
+  int i, k, m, val;
+  double Nchar, Npix, start, slope, frac;
+  unsigned char *buff;
+  unsigned long back;
+
+  Nchar = 255.0;
+  Npix = graphic[0].Npixels;
+  frac = Nchar / Npix;
+  /* start at the last line, print lines in decending order */
+  buff = (unsigned char *)image[0].picture.data + image[0].picture.dx*(image[0].picture.dy - 1);
+  slope = image[0].slope;
+  start = image[0].start;
+  back  = graphic[0].back;
+
+  for (i = 0; i < image[0].picture.dy; i++) {
+    for (k = 0; k < image[0].picture.dx; k++, buff++) {
+      if (*buff == back) 
+	val = Nchar;
+      else {
+	for (m = 0; (graphic[0].cmap[m].pixel != *buff) && (m < Npix); m++);
+	val = Nchar - frac * MIN (MAX (start + m * slope, 0), Npix);
+      }
+      fprintf (f, "%02x", val);
+      if (!((k+1) % 40)) fprintf (f, "\n"); 
+    }
+    fprintf (f, "\n");
+    buff -= 2*image[0].picture.dx;
+  }
+  return;
+}
+
+void PSPixmap16 (Graphic *graphic, KapaImageWidget *image, FILE *f) {
+
+  int i, k, m, val;
+  double Nchar, Npix, start, slope, frac;
+  unsigned short *buff;
+  unsigned long back;
+
+  Nchar = 255.0;
+  Npix = graphic[0].Npixels;
+  frac = Nchar / Npix;
+  /* start at the last line, print lines in decending order */
+  buff = (unsigned short *)image[0].picture.data + image[0].picture.dx*(image[0].picture.dy - 1);
+  slope = image[0].slope;
+  start = image[0].start;
+  back  = graphic[0].back;
+
+  for (i = 0; i < image[0].picture.dy; i++) {
+    for (k = 0; k < image[0].picture.dx; k++, buff++) {
+      if (*buff == back) 
+	val = Nchar;
+      else {
+	for (m = 0; (graphic[0].cmap[m].pixel != *buff) && (m < Npix); m++);
+	val = Nchar - frac * MIN (MAX (start + m * slope, 0), Npix);
+      }
+      fprintf (f, "%02x", val);
+      if (!((k+1) % 40)) fprintf (f, "\n"); 
+    }
+    fprintf (f, "\n");
+    buff -= 2*image[0].picture.dx;
+  }
+  return;
+}
+
+void PSPixmap24 (Graphic *graphic, KapaImageWidget *image, FILE *f) {
+
+  int i, k, m, dx, dy, val, extra;
+  unsigned char *buff;
+  unsigned long color, byte;
+  double Nchar, Npix, start, slope, frac;
+  unsigned long back;
+
+  Nchar = 255.0;
+  Npix = graphic[0].Npixels;
+  frac = Nchar / Npix;
+  dx = image[0].picture.dx;
+  dy = image[0].picture.dy;
+  extra = 4 - (dx * 3) % 4;
+  /* start at the last line, print lines in decending order */
+  buff = (unsigned char *)&image[0].picture.data[(dy - 1)*(3*dx + extra)];
+  slope = image[0].slope;
+  start = image[0].start;
+  back  = graphic[0].back;
+
+  for (i = 0; i < dy; i++) {
+    for (k = 0; k < dx; k++, buff+=3) {
+      if (*buff == back) {
+	val = Nchar;
+      } else {
+	color = 0;
+	byte = buff[2];
+	color = (byte << 16);
+	byte = buff[1];
+	color |= (byte << 8);
+	byte = buff[0];
+	color |= byte;
+	for (m = 0; (graphic[0].cmap[m].pixel != color) && (m < Npix); m++);
+	val = Nchar - frac * MIN (MAX (start + m * slope, 0), Npix);
+      }
+      fprintf (f, "%02x", val);
+      if (!((k+1) % 40)) fprintf (f, "\n"); 
+    }
+    fprintf (f, "\n");
+    buff -= 2*3*dx + extra;
+  }
+  return;
+}
+
+void PSPixmap32 (Graphic *graphic, KapaImageWidget *image, FILE *f) {
+
+  int i, k, m, val;
+  double Nchar, Npix, start, slope, frac;
+  unsigned int *buff;
+  unsigned long back;
+
+  Nchar = 255.0;
+  Npix = graphic[0].Npixels;
+  frac = Nchar / Npix;
+  /* start at the last line, print lines in decending order */
+  buff = (unsigned int *)image[0].picture.data + image[0].picture.dx*(image[0].picture.dy - 1);
+  slope = image[0].slope;
+  start = image[0].start;
+  back  = graphic[0].back;
+
+  for (i = 0; i < image[0].picture.dy; i++) {
+    for (k = 0; k < image[0].picture.dx; k++, buff++) {
+      if (*buff == back) 
+	val = Nchar;
+      else {
+	for (m = 0; (graphic[0].cmap[m].pixel != *buff) && (m < Npix); m++);
+	val = Nchar - frac * MIN (MAX (start + m * slope, 0), Npix);
+      }
+      fprintf (f, "%02x", val);
+      if (!((k+1) % 40)) fprintf (f, "\n"); 
+    }
+    fprintf (f, "\n");
+    buff -= 2*image[0].picture.dx;
+  }
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSTextlines.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSTextlines.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSTextlines.c	(revision 15879)
@@ -0,0 +1,36 @@
+# include "Ximage.h"
+  
+void PSTextlines (KapaGraphWidget *graph, FILE *f) {
+
+  int i, x, y, size;
+  double angle;
+  char *fontname;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  fontname = GetRotFont (&size);
+  for (i = 0; i < graph[0].Ntextline; i++) {
+    if (strcmp (graph[0].textline[i].text, "")) {
+      angle = graph[0].textline[i].angle;
+      x = graph[0].textline[i].x;
+      y = graphic->dy - graph[0].textline[i].y;
+      SetRotFont (graph[0].textline[i].font, graph[0].textline[i].size);
+      PSRotText (f, x, y, graph[0].textline[i].text, 5, angle);
+    }
+  }
+  SetRotFont (fontname, size);
+}
+
+  /* pos values
+            
+ 4____2___5 
+  |       | 
+  |       | 
+ 1|   8   |3
+  |       |
+  |       |
+  ---------
+  6   0   7
+
+  */
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSimage.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSimage.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSimage.c	(revision 15879)
@@ -0,0 +1,61 @@
+# include "Ximage.h"
+
+int PSimage (KapaImageWidget *image, FILE *f) {
+  
+  int i;
+  Graphic *graphic;
+
+  if (!USE_XWINDOW) {
+    fprintf (stderr, "PSimage not working yet for no X mode\n");
+    return (TRUE);
+  }
+
+  graphic = GetGraphic();
+
+  fprintf (f, " newpath 0 0 moveto %d 0 lineto %d %d lineto 0 %d lineto closepath clip\n\n", 
+	   image[0].picture.dx, image[0].picture.dx, image[0].picture.dy, image[0].picture.dy);
+  fprintf (f, "gsave %% encloses image\n");
+  fprintf (f, "%d %d 8\n", image[0].picture.dx, image[0].picture.dy);
+  fprintf (f, "[1 0 0 1 0 0]\n");
+  fprintf (f, "{currentfile %d string readhexstring pop} image\n\n", image[0].picture.dx);
+
+  /******** First we draw the picture itself ********/
+  /* in !USE_XWINDOW, we'll have to change this to use the JPEG function */
+  switch (graphic[0].Nbits) {
+  case 8:
+    PSPixmap8 (graphic, image, f);
+    break;
+  case 16:
+    PSPixmap16 (graphic, image, f);
+    break;
+  case 24:
+    PSPixmap24 (graphic, image, f);
+    break;
+  case 32:
+    PSPixmap32 (graphic, image, f);
+    break;
+  }
+
+  fprintf (f, "grestore %% end of image\n");
+  fprintf (f, "stroke\n");
+
+  // should we have a 'gsave / grestore' container here?
+  fprintf (f, "%% plot overlay objects\n");
+  fprintf (f, "1 setgray\n");
+
+  for (i = 0; i < NOVERLAYS; i++) {
+    if (image[0].overlay[i].active) {
+      fprintf (f, "%% overlay %d\n", i);
+      PSOverlay (image, i, f, 0);
+    }
+  }
+  fprintf (f, "0 setgray\n");
+  for (i = 0; i < NOVERLAYS; i++) {
+    if (image[0].overlay[i].active) {
+      fprintf (f, "%% overlay %d\n", i);
+      PSOverlay (image, i, f, 1);
+    }
+  }
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PSit.c	(revision 15879)
@@ -0,0 +1,107 @@
+# include "Ximage.h"
+# define XOFFSET 60
+# define YOFFSET 60
+
+static char *name = "$Name: not supported by cvs2svn $";
+static Graphic *graphic;
+
+int PScommand (int sock) {
+
+  int status, scaleMode, pageMode;
+  char filename[1024], pagename[1024];
+
+  /* expect a line telling the number of bytes and a filename */
+  KiiScanMessage (sock, "%s %s %d %d", filename, pagename, &scaleMode, &pageMode);
+  status = PSit (filename, pagename, scaleMode, pageMode);
+  return (status);
+}
+
+int PSit (char *filename, char *pagename, int scaleMode, int pageMode) {
+
+  int i, Nsection;
+  double scale;
+  FILE *f;
+  char *version;
+  Section *section;
+
+  graphic = GetGraphic();
+
+  if (pageMode == KAPA_PS_NEWPAGE) {
+    f = fopen (filename, "a+");
+  } else {
+    f = fopen (filename, "w");
+  }
+  if (f == NULL) {
+    fprintf (stderr, "can't open output file %s\n", filename);
+    return (TRUE);  /* true because otherwise it quits kapa! */
+  }
+
+  /* two scaling options: expand to fit page / keep absolute size */ 
+  if (scaleMode) {
+    scale = MIN (fabs(500.0 / graphic->dx), fabs (700.0 / graphic->dy));
+  } else {
+    scale = 72.0 / 96.0; /* ratio of screen pixels to points */
+  }
+
+  switch (pageMode) {
+    case KAPA_PS_NEWPLOT:
+      fprintf (f, "%%!PS-Adobe-2.0 EPSF-2.0\n");
+      fprintf (f, "%%%%Title: %s\n", filename);
+      version = strip_version (name);
+      fprintf (f, "%%%%Creator: Kapa (%s)\n", version);
+      free (version);
+      fprintf (f, "%%%%BoundingBox: %d %d %.0f %.0f\n", 
+	       XOFFSET, YOFFSET, XOFFSET + scale*graphic->dx, YOFFSET + scale*graphic->dy);
+      fprintf (f, "%%%%Pages: 1\n");
+      fprintf (f, "%%%%DocumentFonts:\n");
+      fprintf (f, "%%%%EndComments\n");
+      fprintf (f, "%%%%EndProlog\n");
+      fprintf (f, "%%%%Page: %s\n\n", pagename);
+      break;
+
+    case KAPA_PS_NEWPAGE:
+      fprintf (f, "%%%%Page: %s\n\n", pagename);
+      break;
+
+    case KAPA_PS_RAWPAGE:
+      break;
+  } 
+  fprintf (f, "gsave %% encloses picture\n");
+  fprintf (f, "%% local abbreviations\n");
+  fprintf (f, "/Times-Roman findfont 14 scalefont setfont\n");
+  fprintf (f, "/T {moveto show stroke} def\n");
+  fprintf (f, "/B { newpath moveto dup 0 exch rlineto exch dup 0 rlineto exch -1 mul\n");
+  fprintf (f, " 0 exch rlineto -1 mul 0 rlineto closepath stroke } def\n");
+  fprintf (f, "/F { newpath moveto dup 0 exch rlineto exch dup 0 rlineto exch -1 mul\n");
+  fprintf (f, " 0 exch rlineto -1 mul 0 rlineto closepath fill stroke } def\n");
+  fprintf (f, "/C {0 360 arc stroke} def\n");
+  fprintf (f, "/L {newpath moveto lineto stroke} def\n\n");
+  fprintf (f, "/TF {newpath moveto lineto lineto fill stroke} def\n\n");
+
+  if (pageMode != KAPA_PS_RAWPAGE) {
+    fprintf (f, " %d %d translate\n", XOFFSET, YOFFSET);
+    fprintf (f, "  %f  %f scale\n", scale, scale);
+  }
+
+  Nsection = GetNumberOfSections ();
+  for (i = 0; i < Nsection; i++) {
+    section = GetSectionByNumber (i);
+    if (section->graph) {
+      PSFrame (section->graph, f); 
+      PSObjects (section->graph, f);
+      PSLabels (section->graph, f);
+      PSTextlines (section->graph, f);
+    }
+    if (section->image) {
+      PSimage (section->image, f);
+    }
+  }
+  
+  fprintf (f, "grestore %% end of picture\n");
+
+  if (pageMode != KAPA_PS_RAWPAGE) fprintf (f, "showpage\n");
+
+  fclose (f);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PaintOverlay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PaintOverlay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PaintOverlay.c	(revision 15879)
@@ -0,0 +1,84 @@
+# include "Ximage.h"
+
+void PaintOverlay (Graphic *graphic, KapaImageWidget *image, int N) {
+
+  int i;
+  int dX, dY, dx, dy;
+  int x, y, X, Y, Xmin, Ymin, Xmax, Ymax, Xrange, Yrange;
+  double t, expand, X0, Y0;
+ 
+  XSetForeground (graphic[0].display, graphic[0].gc, image[0].overlay[N].color);
+  
+  expand = 1.0;
+  if (image[0].expand > 0) {
+    expand = 1 / (1.0*image[0].expand);
+  }
+  if (image[0].expand < 0) {
+    expand = fabs((double)image[0].expand);
+  }
+
+  Image_to_Screen (&X0, &Y0, 0.0, 0.0, image);
+
+  Xmin = image[0].picture.x;
+  Ymin = image[0].picture.y;
+  Xmax = image[0].picture.x + image[0].picture.dx;
+  Ymax = image[0].picture.y + image[0].picture.dy;
+  Xrange = image[0].picture.dx;
+  Yrange = image[0].picture.dy;
+
+  for (i = 0; i < image[0].overlay[N].Nobjects; i++) {
+    X  = image[0].overlay[N].objects[i].x/expand + X0;
+    Y =  image[0].overlay[N].objects[i].y/expand + Y0;
+    dX = image[0].overlay[N].objects[i].dx/expand;
+    dY = image[0].overlay[N].objects[i].dy/expand;
+    if ((X + dX < Xmin) || (X - dX > Xmax) ||
+	(Y + dY < Ymin) || (Y - dY > Ymax)) {
+      continue;
+    }
+
+    /* for a LINE, (x, y) is the start, (dx, dy) is the distance to end
+       for a CIRCLE (x, y) is the center, (dx, dy) is the radius 
+       for a BOX (x, y) is the center, (dx, dy) is the width */
+
+    switch (image[0].overlay[N].objects[i].type) {
+      case KII_OVERLAY_LINE:
+	// the angle makes no sense for a line...
+	XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, X, Y, (X+dX), (Y+dY));
+	break;
+      case KII_OVERLAY_TEXT:
+	// XXX currently we ignore the rectangle angle
+	XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, X, Y, image[0].overlay[N].objects[i].text, strlen(image[0].overlay[N].objects[i].text));
+	break;
+      case KII_OVERLAY_BOX:
+	dx = MAX (abs(dX),2) / 2;
+	dy = MAX (abs(dY),2) / 2;
+	// XXX currently we ignore the rectangle angle
+	XDrawRectangle (graphic[0].display, graphic[0].window, graphic[0].gc, (X - dx), (Y - dy), 2*dx, 2*dy);
+	break;
+      case KII_OVERLAY_CIRCLE:
+	dx = MAX (abs(dX),2);
+	dy = MAX (abs(dY),2);
+	if (image[0].overlay[N].objects[i].angle == 0.0) {
+	  XDrawArc (graphic[0].display, graphic[0].window, graphic[0].gc, (X - dx), (Y - dy), 2*dx, 2*dy, 0, 23040);
+	} else {
+	  // very stupid rotate ellipse drawing:
+	  double angle = image[0].overlay[N].objects[i].angle * RAD_DEG;
+	  double cs = cos(angle);
+	  double sn = sin(angle);
+	  // XXX dt should be based on the size of the ellipse...
+	  for (t = 0; t < 2*M_PI; t+=0.05) {
+	    x = X + dx*cos(t)*cs + dy*sin(t)*sn;
+	    y = Y - dx*cos(t)*sn + dy*sin(t)*cs;
+	    XDrawPoint (graphic[0].display, graphic[0].window, graphic[0].gc, x, y);
+	  }
+	}
+	break;
+      default:
+	fprintf (stderr, "skipping unknown object\n");
+	break;
+    }
+  }
+  
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/PaintTickmarks.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/PaintTickmarks.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/PaintTickmarks.c	(revision 15879)
@@ -0,0 +1,54 @@
+# include "Ximage.h"
+
+void PaintTickmarks (Graphic *graphic, KapaImageWidget *image) {
+
+  int i;
+  int X, Y, dX, dY;
+  int Xmin, Ymin, Xmax, Ymax, Xrange, Yrange;
+ 
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+
+  Xmin = image[0].picture.x;
+  Ymin = image[0].picture.y;
+  Xmax = image[0].picture.x + image[0].picture.dx;
+  Ymax = image[0].picture.y + image[0].picture.dy;
+  Xrange = image[0].picture.dx;
+  Yrange = image[0].picture.dy;
+
+  for (i = 0; i < image[0].tickmarks.Nobjects; i++) {
+    X  = image[0].tickmarks.objects[i].x * Xrange + Xmin;
+    Y  = image[0].tickmarks.objects[i].y * Yrange + Ymin;
+    dX = image[0].tickmarks.objects[i].dx * Xrange;
+    dY = image[0].tickmarks.objects[i].dy * Yrange;
+
+    switch (image[0].overlay[0].objects[i].type) {
+      case KII_OVERLAY_LINE:
+	XDrawLine (graphic[0].display, graphic[0].window, graphic[0].gc, X, Y, (X+dX), (Y+dY));
+	break;
+      case KII_OVERLAY_TEXT:
+	if (image[0].tickmarks.objects[i].dy == 0) {
+	    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
+	    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc, X, Y-11, 6*strlen(image[0].tickmarks.objects[i].text), 11); 
+	    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+	    XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, X, Y, image[0].tickmarks.objects[i].text, strlen(image[0].tickmarks.objects[i].text));
+	}
+	if (image[0].tickmarks.objects[i].dy == 90) {
+	    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
+	    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc, X, Y-6*strlen(image[0].tickmarks.objects[i].text), 11, 6*strlen(image[0].tickmarks.objects[i].text)); 
+	    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+	    /* XDrawRotString (graphic[0].display, graphic[0].window, graphic[0].gc, X, Y, image[0].tickmarks.objects[i].text, strlen(image[0].tickmarks.objects[i].text)); */
+	}
+	break;
+      case KII_OVERLAY_BOX:
+	XDrawRectangle (graphic[0].display, graphic[0].window, graphic[0].gc, (int)(X - 0.5*dX), (int)(Y - 0.5*dY), abs(dX), abs(dY));
+	break;
+      case KII_OVERLAY_CIRCLE:
+	XDrawArc (graphic[0].display, graphic[0].window, graphic[0].gc, X - dX, Y - dY, abs(2*dX), abs(2*dY), 0, 23040);
+	break;
+      default:
+	fprintf (stderr, "skipping unknown object\n");
+	break;
+    }
+  }
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/QuitX.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/QuitX.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/QuitX.c	(revision 15879)
@@ -0,0 +1,9 @@
+# include "Ximage.h"
+
+/************** QuitX *************/
+void QuitX (Display *display, char *error_message) {
+
+  fprintf (stderr, "Error: %s\n", error_message);
+  XCloseDisplay (display);
+  exit (0);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Reconfig.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Reconfig.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Reconfig.c	(revision 15879)
@@ -0,0 +1,34 @@
+# include "Ximage.h"
+
+// XXX merge this code with Resize
+int Reconfig (XEvent *event) {
+
+  int i, Nsection, NX, NY;
+  Graphic *graphic;
+  Section *section;
+
+  graphic = GetGraphic();
+
+  // XXX keep this min limit (or modify for !USE_XWINDOW)?
+  NX = MAX(event[0].xconfigure.width, MIN_WIDTH); 
+  NY = MAX(event[0].xconfigure.height, MIN_HEIGHT); 
+
+  // if the new size is the same as the old size, do nothing.
+  if ((graphic->dx == NX) && (graphic->dy == NY)) return (TRUE);
+
+  // set the new window size
+  graphic->dx = NX; 
+  graphic->dy = NY; 
+
+  // reset the sizes for all sections
+  Nsection = GetNumberOfSections ();
+  for (i = 0; i < Nsection; i++) {
+      section = GetSectionByNumber (i);
+      SetSectionSizes (section);
+  }
+
+  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
+  Refresh (1);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Refresh.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Refresh.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Refresh.c	(revision 15879)
@@ -0,0 +1,29 @@
+# include "Ximage.h"
+
+void Refresh () {
+
+  int i, Nsection;
+  Graphic *graphic;
+  Section *section;
+
+  if (!USE_XWINDOW) return;
+  if (HAVE_BACKING) return;
+
+  graphic = GetGraphic();
+  
+  /* XClearWindow   (graphic.display, graphic.window); */
+  XSetForeground (graphic->display, graphic->gc, graphic->back);
+  XFillRectangle (graphic->display, graphic->window, graphic->gc, 0, 0, graphic->dx, graphic->dy);
+  XSetForeground (graphic->display, graphic->gc, graphic->fore);
+  
+  // reset the sizes for all sections
+  Nsection = GetNumberOfSections ();
+  for (i = 0; i < Nsection; i++) {
+      section = GetSectionByNumber (i);
+      DrawImage (section->image);
+      DrawGraph (section->graph);
+  }
+
+  FlushDisplay ();
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap.c	(revision 15879)
@@ -0,0 +1,21 @@
+# include "Ximage.h"
+
+void Remap (Graphic *graphic, KapaImageWidget *image, Matrix *matrix) {
+
+  switch (graphic[0].Nbits) {
+  case 8:
+    Remap8 (graphic, image, matrix);
+    break;
+  case 16:
+    Remap16 (graphic, image, matrix);
+    break;
+  case 24:
+    Remap24 (graphic, image, matrix);
+    break;
+  case 32:
+    Remap32 (graphic, image, matrix);
+    break;
+  }
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap16.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap16.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap16.c	(revision 15879)
@@ -0,0 +1,178 @@
+# include "Ximage.h"
+
+static float slope = 1.0;
+static float start = 0.0;
+static int MaxValue = 255;
+
+// XXX inline this if needed
+static int PixelLookup(float value) {
+  int out;
+  out = MIN (MAX (slope * value - start, 0), MaxValue);
+  return (out);
+}
+
+void Remap16 (Graphic *graphic, KapaImageWidget *image, Matrix *matrix) {
+
+  int i, j, ii, jj;
+  int i_start, i_end, j_start, j_end;
+  int dropback;  /* this is a bit of a kludge... */
+  int dx, dy, DX, DY, pixelN;
+  double expand, Rx, Ry, X, Y;
+  int expand_in, expand_out;
+  unsigned char *out_pix, *out_pix2, *data;
+  float *imdata, *in_pix, *in_pix2;
+  unsigned char pixel1[256], pixel2[256];
+  unsigned char pixvalue1, pixvalue2;
+  unsigned long back;
+  unsigned char back1, back2;
+
+  // local array for pixel values (is this working??)
+  for (i = 0; i < 256; i++) { /* set up pixel array */
+    pixel1[i] = 0x00ff &  graphic[0].cmap[i].pixel;
+    pixel2[i] = 0x00ff & (graphic[0].cmap[i].pixel >> 8);
+  }
+  back = graphic[0].back;
+  back1 = 0x00ff & back;
+  back2 = 0x00ff & (back >> 8);
+
+  // define the color transform parameters
+  MaxValue = graphic[0].Npixels - 1;
+  if (image[0].range != 0.0) {
+    slope = graphic[0].Npixels / image[0].range;
+    start = graphic[0].Npixels * image[0].zero / image[0].range;
+  } else {
+    slope = 1.0;
+    start = image[0].zero;
+  }
+
+  // set up expansions
+  expand = expand_in = expand_out = 1.0;
+  if (image[0].expand == 0) /* set up expansions */
+    image[0].expand = 1;
+  if (image[0].expand > 0) {
+    expand = 1 / (1.0*image[0].expand);
+    expand_out = image[0].expand;
+    expand_in  = 1;
+  }
+  if (image[0].expand < 0) {
+    expand = fabs((double)image[0].expand);
+    expand_out = 1;
+    expand_in  = -image[0].expand;
+  }
+
+  // define the image boundaries
+  dx = image[0].picture.dx;
+  dy = image[0].picture.dy;
+  DX = matrix[0].Naxis[0];
+  DY = matrix[0].Naxis[1];
+
+  /* X,Y are the image coordinates of the first image pixel */
+  X = MAX(0.5*(DX - dx*expand) - image[0].X, 0);
+  if ((int)X != X) 
+    X = (int) X + 1;
+  else 
+    X = (int) X;
+  Y = MAX(0.5*(DY - dy*expand) - image[0].Y, 0);
+  if ((int)Y != Y) 
+    Y = (int) Y + 1;
+  else 
+    Y = (int) Y;
+
+  /* Rx,Ry are the screen coordinates of the first image pixel */
+  Rx = (X + image[0].X - 0.5*DX)/expand + 0.5*dx;
+  Ry = (Y + image[0].Y - 0.5*DY)/expand + 0.5*dy;
+
+  i_start = MIN (MAX (Rx, 0), dx - expand_out + 1);
+  j_start = MIN (MAX (Ry, 0), dy - expand_out + 1);
+  
+  if (image[0].expand > 0) {
+    i_end = MAX (MIN (i_start + ((int)(expand*(dx-i_start)))/expand, expand_out*(DX-X) + Rx), 0);
+    j_end = MAX (MIN (j_start + ((int)(expand*(dy-j_start)))/expand, expand_out*(DY-Y) + Ry), 0);
+  } else {
+    i_end = MAX (MIN (dx, (DX-X)/expand + Rx), 0);
+    j_end = MAX (MIN (dy, (DY-Y)/expand + Ry), 0);
+  }    
+
+  dropback = expand_out - (i_end - i_start) % expand_out;
+  if ((i_end - i_start) % expand_out == 0) dropback = 0;
+
+  data = out_pix = (unsigned char *) image[0].picture.data;
+  imdata  = (float *) matrix[0].buffer;
+  in_pix  = &imdata[DX*(int)MAX(Y,0) + (int)MAX(X,0)];
+
+  /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/
+
+  /**** fill in bottom area ****/
+  for (j = 0; j < j_start; j++) {
+    for (i = 0; i < dx; i++, out_pix+=2) {
+      out_pix[0] = back1;
+      out_pix[1] = back2;
+    }
+  }
+  
+  for (j = j_start; j < j_end; j+= expand_out, in_pix += expand_in*DX) {
+    out_pix = &data[2*j*dx];
+
+    /**** fill in area to the left of the picture ****/
+    for (jj = 0; (i_start > 0) && (jj < expand_out); jj++) { 
+      out_pix2 = out_pix + 2*jj*dx;
+      for (i = 0; i < i_start; i++, out_pix2+=2) {
+	out_pix2[0] = back1;
+	out_pix2[1] = back2;
+      }
+    }
+    out_pix += 2*i_start;
+    
+    /*** fill in the picture region ***/
+    in_pix2 = in_pix;
+    if (expand_out == 1) {
+      for (i = i_start; i < i_end; i++, in_pix2+= expand_in, out_pix+=2) {
+	pixelN = PixelLookup(*in_pix2);
+	out_pix[0] = pixel1[pixelN];
+	out_pix[1] = pixel2[pixelN];
+      }
+    }
+    else {
+      for (i = i_start; i < i_end; i+= expand_out, in_pix2++, out_pix+= 2*expand_out) { 
+	pixelN    = PixelLookup(*in_pix2);
+	pixvalue1 = pixel1[pixelN];
+	pixvalue2 = pixel2[pixelN];
+	out_pix2 = out_pix;
+	for (jj = 0; jj < expand_out; jj++, out_pix2+=2*(dx-expand_out)) {
+	  for (ii = 0; ii < expand_out; ii++, out_pix2+=2) {
+	    out_pix2[0] = pixvalue1; 
+	    out_pix2[1] = pixvalue2; 
+	  }
+	}
+      }
+    }
+    out_pix -= 2*dropback;
+    
+    /**** fill in area to the right of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) {
+      out_pix2 = out_pix + 2*jj*dx;
+      for (i = i_end; i < dx; i++, out_pix2+=2) {
+	out_pix2[0] = back1;
+	out_pix2[1] = back2;
+      }
+    }
+  } 
+  
+  /*
+  if ((j_end - j_start) % expand_out > 0)
+    out_pix -= expand_out - (j_end - j_start) % expand_out;
+  */
+  
+  out_pix = &data[2*j_end*dx];
+  /**** fill in top area ****/
+  for (j = 0; j < (dy - j_end); j++) {
+    for (i = 0; i < dx; i++, out_pix+=2) { 
+      out_pix[0] = back1;
+      out_pix[1] = back2;
+    }
+  }
+
+  image[0].picture.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					image[0].picture.data, image[0].picture.dx, image[0].picture.dy, 16, 0);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap24.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap24.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap24.c	(revision 15879)
@@ -0,0 +1,188 @@
+# include "Ximage.h"
+
+static float slope = 1.0;
+static float start = 0.0;
+static int MaxValue = 255;
+
+// XXX inline this if needed
+static int PixelLookup(float value) {
+  int out;
+  out = MIN (MAX (slope * value - start, 0), MaxValue);
+  return (out);
+}
+
+void Remap24 (Graphic *graphic, KapaImageWidget *image, Matrix *matrix) {
+
+  int i, j, ii, jj;
+  int i_start, i_end, j_start, j_end;
+  int dropback, extra;  /* this is a bit of a kludge... */
+  int dx, dy, DX, DY, pixelN;
+  double expand, Rx, Ry, X, Y;
+  int expand_in, expand_out;
+  unsigned char *out_pix, *out_pix2, *data;
+  float *imdata, *in_pix, *in_pix2;
+  unsigned char pixel1[256], pixel2[256], pixel3[256];
+  unsigned char pixvalue1, pixvalue2, pixvalue3;
+  unsigned long back;
+  unsigned char back1, back2, back3;
+
+  // local arrays for pixel values
+  for (i = 0; i < 256; i++) { /* set up pixel array */
+    pixel1[i] = 0x0000ff &  graphic[0].cmap[i].pixel;
+    pixel2[i] = 0x0000ff & (graphic[0].cmap[i].pixel >> 8);
+    pixel3[i] = 0x0000ff & (graphic[0].cmap[i].pixel >> 16);
+  }
+  back = graphic[0].back;
+  back1 = 0x0000ff & back;
+  back2 = 0x0000ff & (back >> 8);
+  back3 = 0x0000ff & (back >> 16);
+
+  // define the color transform parameters
+  MaxValue = graphic[0].Npixels - 1;
+  if (image[0].range != 0.0) {
+    slope = graphic[0].Npixels / image[0].range;
+    start = graphic[0].Npixels * image[0].zero / image[0].range;
+  } else {
+    slope = 1.0;
+    start = image[0].zero;
+  }
+
+  // set up expansions
+  expand = expand_in = expand_out = 1.0;
+  if (image[0].expand == 0) /* set up expansions */
+    image[0].expand = 1;
+  if (image[0].expand > 0) {
+    expand = 1 / (1.0*image[0].expand);
+    expand_out = image[0].expand;
+    expand_in  = 1;
+  }
+  if (image[0].expand < 0) {
+    expand = fabs((double)image[0].expand);
+    expand_out = 1;
+    expand_in  = -image[0].expand;
+  }
+
+  dx = image[0].picture.dx;
+  dy = image[0].picture.dy;
+  DX = matrix[0].Naxis[0];
+  DY = matrix[0].Naxis[1];
+  extra = 4 - (dx * 3) % 4;
+
+  /* X,Y are the image coordinates of the first image pixel */
+  X = MAX(0.5*(DX - dx*expand) - image[0].X, 0);
+  if ((int)X != X) 
+    X = (int) X + 1;
+  else 
+    X = (int) X;
+  Y = MAX(0.5*(DY - dy*expand) - image[0].Y, 0);
+  if ((int)Y != Y) 
+    Y = (int) Y + 1;
+  else 
+    Y = (int) Y;
+
+  /* Rx,Ry are the screen coordinates of the first image pixel */
+  Rx = (X + image[0].X - 0.5*DX)/expand + 0.5*dx;
+  Ry = (Y + image[0].Y - 0.5*DY)/expand + 0.5*dy;
+
+  i_start = MIN (MAX (Rx, 0), dx - expand_out + 1);
+  j_start = MIN (MAX (Ry, 0), dy - expand_out + 1);
+  
+  if (image[0].expand > 0) {
+    i_end = MAX (MIN (i_start + ((int)(expand*(dx-i_start)))/expand, expand_out*(DX-X) + Rx), 0);
+    j_end = MAX (MIN (j_start + ((int)(expand*(dy-j_start)))/expand, expand_out*(DY-Y) + Ry), 0);
+  } else {
+    i_end = MAX (MIN (dx, (DX-X)/expand + Rx), 0);
+    j_end = MAX (MIN (dy, (DY-Y)/expand + Ry), 0);
+  }    
+
+  dropback = expand_out - (i_end - i_start) % expand_out;
+  if ((i_end - i_start) % expand_out == 0) dropback = 0;
+
+  data = out_pix = (unsigned char *) image[0].picture.data;
+  imdata  = (float *) matrix[0].buffer;
+  in_pix  = &imdata[DX*(int)MAX(Y,0) + (int)MAX(X,0)];
+
+  /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/
+
+  /**** fill in bottom area ****/
+  for (j = 0; j < j_start; j++) {
+    for (i = 0; i < dx; i++, out_pix+=3) {
+      out_pix[0] = back1;
+      out_pix[1] = back2;
+      out_pix[2] = back3;
+    }
+    out_pix += extra;
+  }
+  
+  for (j = j_start; j < j_end; j+= expand_out, in_pix += expand_in*DX) {
+    out_pix = &data[j*(3*dx+extra)];
+
+    /**** fill in area to the left of the picture ****/
+    for (jj = 0; (i_start > 0) && (jj < expand_out); jj++) { 
+      out_pix2 = out_pix + jj*(3*dx + extra);
+      for (i = 0; i < i_start; i++, out_pix2+=3) {
+	out_pix2[0] = back1;
+	out_pix2[1] = back2;
+	out_pix2[2] = back3;
+      }
+    }
+    out_pix += 3*i_start;
+    
+    /*** fill in the picture region ***/
+    in_pix2 = in_pix;
+    if (expand_out == 1) {
+      for (i = i_start; i < i_end; i++, in_pix2+= expand_in, out_pix+=3) {
+	pixelN = PixelLookup(*in_pix2);
+	out_pix[0] = pixel1[pixelN];
+	out_pix[1] = pixel2[pixelN];
+	out_pix[2] = pixel3[pixelN];
+      }
+    } else {
+      for (i = i_start; i < i_end; i+= expand_out, in_pix2++, out_pix+= 3*expand_out) { 
+	pixelN = PixelLookup(*in_pix2);
+	pixvalue1 = pixel1[pixelN];
+	pixvalue2 = pixel2[pixelN];
+	pixvalue3 = pixel3[pixelN];
+	out_pix2 = out_pix;
+	for (jj = 0; jj < expand_out; jj++, out_pix2+=3*(dx-expand_out)+extra) {
+	  for (ii = 0; ii < expand_out; ii++, out_pix2+=3) {
+	    out_pix2[0] = pixvalue1; 
+	    out_pix2[1] = pixvalue2; 
+	    out_pix2[2] = pixvalue3; 
+	  }
+	}
+      }
+    }
+    out_pix -= 3*dropback;
+    
+    /**** fill in area to the right of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) {
+      out_pix2 = out_pix + jj*(3*dx+extra);
+      for (i = i_end; i < dx; i++, out_pix2+=3) {
+	out_pix2[0] = back1;
+	out_pix2[1] = back2;
+	out_pix2[2] = back3;
+      }
+    }
+  } 
+  
+  /*
+  if ((j_end - j_start) % expand_out > 0)
+    out_pix -= expand_out - (j_end - j_start) % expand_out;
+  */
+  
+  out_pix = &data[j_end*(3*dx+extra)];
+  /**** fill in top area ****/
+  for (j = 0; j < (dy - j_end); j++) {
+    for (i = 0; i < dx; i++, out_pix+=3) { 
+      out_pix[0] = back1;
+      out_pix[1] = back2;
+      out_pix[2] = back3;
+    }
+    out_pix+=extra;
+  }
+
+  image[0].picture.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					image[0].picture.data, image[0].picture.dx, image[0].picture.dy, 32, 0);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap32.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap32.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap32.c	(revision 15879)
@@ -0,0 +1,157 @@
+# include "Ximage.h"
+
+static float slope = 1.0;
+static float start = 0.0;
+static int MaxValue = 255;
+
+// XXX inline this if needed
+static int PixelLookup(float value) {
+  int out;
+  out = MIN (MAX (slope * value - start, 0), MaxValue);
+  return (out);
+}
+
+void Remap32 (Graphic *graphic, KapaImageWidget *image, Matrix *matrix) {
+
+  int i, j, ii, jj;
+  int i_start, i_end, j_start, j_end;
+  int dropback;  /* this is a bit of a kludge... */
+  int dx, dy, DX, DY, pixelN;
+  double expand, Rx, Ry, X, Y;
+  int expand_in, expand_out;
+  unsigned int *out_pix, *out_pix2;
+  float *imdata, *in_pix, *in_pix2;
+  unsigned long pixel[256], pixvalue;
+  unsigned long back;
+
+  // local array for pixel values
+  for (i = 0; i < 256; i++) { 
+    pixel[i] = graphic[0].cmap[i].pixel;
+  }
+  back = graphic[0].back;
+
+  // define the color transform parameters
+  MaxValue = graphic[0].Npixels - 1;
+  if (image[0].range != 0.0) {
+    slope = graphic[0].Npixels / image[0].range;
+    start = graphic[0].Npixels * image[0].zero / image[0].range;
+  } else {
+    slope = 1.0;
+    start = image[0].zero;
+  }
+
+  // set up expansions
+  expand = expand_in = expand_out = 1.0;
+  if (image[0].expand == 0) 
+    image[0].expand = 1;
+  if (image[0].expand > 0) {
+    expand = 1 / (1.0*image[0].expand);
+    expand_out = image[0].expand;
+    expand_in  = 1;
+  }
+  if (image[0].expand < 0) {
+    expand = fabs((double)image[0].expand);
+    expand_out = 1;
+    expand_in  = -image[0].expand;
+  }
+
+  // define the image boundaries
+  dx = image[0].picture.dx;
+  dy = image[0].picture.dy;
+  DX = matrix[0].Naxis[0];
+  DY = matrix[0].Naxis[1];
+  /* X,Y are the image coordinates of the first image pixel */
+  X = MAX(0.5*(DX - dx*expand) - image[0].X, 0);
+  if ((int)X != X) 
+    X = (int) X + 1;
+  else 
+    X = (int) X;
+  Y = MAX(0.5*(DY - dy*expand) - image[0].Y, 0);
+  if ((int)Y != Y) 
+    Y = (int) Y + 1;
+  else 
+    Y = (int) Y;
+
+  /* Rx,Ry are the screen coordinates of the first image pixel */
+  Rx = (X + image[0].X - 0.5*DX)/expand + 0.5*dx;
+  Ry = (Y + image[0].Y - 0.5*DY)/expand + 0.5*dy;
+
+  i_start = MIN (MAX (Rx, 0), dx - expand_out + 1);
+  j_start = MIN (MAX (Ry, 0), dy - expand_out + 1);
+  
+  if (image[0].expand > 0) {
+    i_end = MAX (MIN (i_start + ((int)(expand*(dx-i_start)))/expand, expand_out*(DX-X) + Rx), 0);
+    j_end = MAX (MIN (j_start + ((int)(expand*(dy-j_start)))/expand, expand_out*(DY-Y) + Ry), 0);
+  } else {
+    i_end = MAX (MIN (dx, (DX-X)/expand + Rx), 0);
+    j_end = MAX (MIN (dy, (DY-Y)/expand + Ry), 0);
+  }    
+
+  dropback = expand_out - (i_end - i_start) % expand_out;
+  if ((i_end - i_start) % expand_out == 0) dropback = 0;
+
+  out_pix = (unsigned int *) image[0].picture.data;
+  imdata  = (float *) matrix[0].buffer;
+  in_pix  = &imdata[DX*(int)MAX(Y,0) + (int)MAX(X,0)];
+
+  /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/
+
+  /**** fill in bottom area ****/
+  for (j = 0; j < dx*j_start; j++, out_pix++) 
+    *out_pix = back;
+  
+  for (j = j_start; j < j_end; j+= expand_out, out_pix+=(expand_out-1)*dx, in_pix += expand_in*DX) {
+
+    /**** fill in area to the left of the picture ****/
+    for (jj = 0; (i_start > 0) && (jj < expand_out); jj++) { 
+      out_pix2 = out_pix + jj*dx;
+      for (i = 0; i < i_start; i++, out_pix2++) {
+	*out_pix2 = back;
+      }
+    }
+    out_pix += i_start;
+    
+    /*** fill in the picture region ***/
+    in_pix2 = in_pix;
+    if (expand_out == 1) {
+      for (i = i_start; i < i_end; i++, in_pix2+= expand_in, out_pix++) {
+	pixelN = PixelLookup(*in_pix2);
+	*out_pix = pixel[pixelN];
+      }
+    }
+    else {
+      for (i = i_start; i < i_end; i+= expand_out, in_pix2++, out_pix+= expand_out) { 
+	pixelN   = PixelLookup(*in_pix2);
+	pixvalue = pixel[pixelN];
+	out_pix2 = out_pix;
+	for (jj = 0; jj < expand_out; jj++, out_pix2+=(dx-expand_out)) {
+	  for (ii = 0; ii < expand_out; ii++, out_pix2++) {
+	    *out_pix2 = pixvalue;
+	  }
+	}
+      }
+    }
+    out_pix -= dropback;
+    
+    /**** fill in area to the right of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) {
+      out_pix2 = out_pix + jj*dx;
+      for (i = i_end; i < dx; i++, out_pix2++) {
+	*out_pix2 = back;
+      }
+    }
+    out_pix += (dx - i_end);
+    
+  } 
+  
+  if ((j_end - j_start) % expand_out > 0)
+    out_pix -= expand_out - (j_end - j_start) % expand_out;
+  
+  /**** fill in top area ****/
+  for (j = 0; (j < dx*(dy - j_end)) && (out_pix - (unsigned int *)image[0].picture.data < dx*dy); j++, out_pix++) { 
+    *out_pix = back;
+  }
+  image[0].picture.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					image[0].picture.data, image[0].picture.dx, image[0].picture.dy, 32, 0);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap8.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap8.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap8.c	(revision 15879)
@@ -0,0 +1,157 @@
+# include "Ximage.h"
+
+static float slope = 1.0;
+static float start = 0.0;
+static int MaxValue = 255;
+
+// XXX inline this if needed
+static int PixelLookup(float value) {
+  int out;
+  out = MIN (MAX (slope * value - start, 0), MaxValue);
+  return (out);
+}
+
+void Remap8 (Graphic *graphic, KapaImageWidget *image, Matrix *matrix) {
+
+  int i, j, ii, jj;
+  int i_start, i_end, j_start, j_end;
+  int dropback;  /* this is a bit of a kludge... */
+  int dx, dy, DX, DY, pixelN;
+  double expand, Rx, Ry, X, Y;
+  int expand_in, expand_out;
+  unsigned char *out_pix, *out_pix2;
+  float *imdata, *in_pix,  *in_pix2;
+  unsigned long pixel[256], pixvalue;
+  unsigned long back;
+
+  // local array for pixel values
+  for (i = 0; i < 256; i++) {
+    pixel[i] = graphic[0].cmap[i].pixel;
+  }
+  back = graphic[0].back;
+
+  // define the color transform parameters
+  MaxValue = graphic[0].Npixels - 1;
+  if (image[0].range != 0.0) {
+    slope = graphic[0].Npixels / image[0].range;
+    start = graphic[0].Npixels * image[0].zero / image[0].range;
+  } else {
+    slope = 1.0;
+    start = image[0].zero;
+  }
+
+  // set up expansions
+  expand = expand_in = expand_out = 1.0;
+  if (image[0].expand == 0) /* set up expansions */
+    image[0].expand = 1;
+  if (image[0].expand > 0) {
+    expand = 1 / (1.0*image[0].expand);
+    expand_out = image[0].expand;
+    expand_in  = 1;
+  }
+  if (image[0].expand < 0) {
+    expand = fabs((double)image[0].expand);
+    expand_out = 1;
+    expand_in  = -image[0].expand;
+  }
+
+  // define the image boundaries
+  dx = image[0].picture.dx;
+  dy = image[0].picture.dy;
+  DX = matrix[0].Naxis[0];
+  DY = matrix[0].Naxis[1];
+
+  /* X,Y are the image coordinates of the first image pixel */
+  X = MAX(0.5*(DX - dx*expand) - image[0].X, 0);
+  if ((int)X != X) 
+    X = (int) X + 1;
+  else 
+    X = (int) X;
+  Y = MAX(0.5*(DY - dy*expand) - image[0].Y, 0);
+  if ((int)Y != Y) 
+    Y = (int) Y + 1;
+  else 
+    Y = (int) Y;
+
+  /* Rx,Ry are the screen coordinates of the first image pixel */
+  Rx = (X + image[0].X - 0.5*DX)/expand + 0.5*dx;
+  Ry = (Y + image[0].Y - 0.5*DY)/expand + 0.5*dy;
+
+  i_start = MIN (MAX (Rx, 0), dx - expand_out + 1);
+  j_start = MIN (MAX (Ry, 0), dy - expand_out + 1);
+  
+  if (image[0].expand > 0) {
+    i_end = MAX (MIN (i_start + ((int)(expand*(dx-i_start)))/expand, expand_out*(DX-X) + Rx), 0);
+    j_end = MAX (MIN (j_start + ((int)(expand*(dy-j_start)))/expand, expand_out*(DY-Y) + Ry), 0);
+  } else {
+    i_end = MAX (MIN (dx, (DX-X)/expand + Rx), 0);
+    j_end = MAX (MIN (dy, (DY-Y)/expand + Ry), 0);
+  }    
+
+  dropback = expand_out - (i_end - i_start) % expand_out;
+  if ((i_end - i_start) % expand_out == 0) dropback = 0;
+
+  out_pix = (unsigned char *) image[0].picture.data;
+  imdata  = (float *) matrix[0].buffer;
+  in_pix  = &imdata[(int)(DX*(int)MAX(Y,0) + (int)MAX(X,0))];
+
+  /********** below we do the mapping from buffer pixels (in) to picture pixels (out) **********/
+
+  /**** fill in bottom area ****/
+  for (j = 0; j < dx*j_start; j++, out_pix++) 
+    *out_pix = back;
+  
+  for (j = j_start; j < j_end; j+= expand_out, out_pix+=(expand_out-1)*dx, in_pix += expand_in*DX) {
+
+    /**** fill in area to the left of the picture ****/
+    for (jj = 0; (i_start > 0) && (jj < expand_out); jj++) { 
+      out_pix2 = out_pix + jj*dx;
+      for (i = 0; i < i_start; i++, out_pix2++) {
+	*out_pix2 = back;
+      }
+    }
+    out_pix += i_start;
+    
+    /*** fill in the picture region ***/
+    in_pix2 = in_pix;
+    if (expand_out == 1) {
+      for (i = i_start; i < i_end; i++, in_pix2+= expand_in, out_pix++) {
+	pixelN = PixelLookup(*in_pix2);
+	*out_pix = pixel[pixelN];
+      }
+    } else {
+      for (i = i_start; i < i_end; i+= expand_out, in_pix2++, out_pix+= expand_out) { 
+	pixelN   = PixelLookup(*in_pix2);
+	pixvalue = pixel[pixelN];
+	out_pix2 = out_pix;
+	for (jj = 0; jj < expand_out; jj++, out_pix2+=(dx-expand_out)) {
+	  for (ii = 0; ii < expand_out; ii++, out_pix2++) {
+	    *out_pix2 = pixvalue;
+	  }
+	}
+      }
+    }
+    out_pix -= dropback;
+    
+    /**** fill in area to the right of the picture ****/
+    for (jj = 0; jj < expand_out; jj++) {
+      out_pix2 = out_pix + jj*dx;
+      for (i = i_end; i < dx; i++, out_pix2++) {
+	*out_pix2 = back;
+      }
+    }
+    out_pix += (dx - i_end);
+    
+  } 
+  
+  if ((j_end - j_start) % expand_out > 0)
+    out_pix -= expand_out - (j_end - j_start) % expand_out;
+  
+  /**** fill in top area ****/
+  for (j = 0; (j < dx*(dy - j_end)) && (out_pix - (unsigned char *)image[0].picture.data < dx*dy); j++, out_pix++) { 
+    *out_pix = back;
+  }
+  image[0].picture.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
+					image[0].picture.data, image[0].picture.dx, image[0].picture.dy, 8, 0);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Reorient.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Reorient.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Reorient.c	(revision 15879)
@@ -0,0 +1,56 @@
+# include "Ximage.h"
+
+void Reorient (Graphic *graphic, KapaImageWidget *image, double X, double Y, int mode) {
+
+  if (image[0].expand == 0) image[0].expand = 1;
+
+  switch (mode) {
+  case 0:
+    if ((image[0].X != X) || (image[0].Y != Y)) {
+      image[0].X = X;
+      image[0].Y = Y;
+    }
+    break;
+  case -1: 
+    image[0].expand--;
+    if ((image[0].expand == 0) || (image[0].expand == -1))
+      image[0].expand = -2;
+    if (image[0].expand < -30) {
+      fprintf (stderr, "can't get smaller!\n");
+      image[0].expand = -30;
+      return;
+    }
+    image[0].X = X;
+    image[0].Y = Y;
+    break;
+  case +1:
+    image[0].expand++;
+    if ((image[0].expand == 0) || (image[0].expand == -1))
+      image[0].expand = 1;
+    if (image[0].expand > 30) {
+      fprintf (stderr, "can't get bigger!\n");
+      image[0].expand = 30;
+      return;
+    }
+    image[0].X = X;
+    image[0].Y = Y;
+    break;
+  }
+
+  Remap (graphic, image, &image[0].matrix);
+  Refresh ();
+ 
+  XFlush (graphic[0].display);
+}
+
+# if (0) /* the "warp" function seems to be a problem on SUNs for some reason */
+  XQueryPointer (graphic[0].display, graphic[0].window, &dummy1, &dummy1, &dummy2, &dummy2, &x, &y, &dummy3); 
+  if ((x > image[0].picture.x) && (x < image[0].picture.x + image[0].picture.dx) &&
+      (y > image[0].picture.y) && (y < image[0].picture.y + image[0].picture.dy) &&
+      ((mouse_event[0].button == 2) || (mouse_event[0].button == 3))) {
+    XWarpPointer (graphic[0].display, None, graphic[0].window, 0, 0, 0, 0, 
+		  image[0].picture.x + 0.5*image[0].picture.dx,
+		  image[0].picture.y + 0.5*image[0].picture.dy);
+  }
+# endif
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Resize.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Resize.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Resize.c	(revision 15879)
@@ -0,0 +1,39 @@
+# include "Ximage.h"
+
+// XXX Should there be a base command + KiiMessage command?
+int Resize (int sock) {
+ 
+  int i, Nsection;
+  unsigned int NX, NY;
+  Graphic *graphic;
+  Section *section;
+
+  graphic = GetGraphic();
+
+  KiiScanMessage (sock, "%d %d", &NX, &NY);
+
+  // XXX keep this min limit (or modify for !USE_XWINDOW)?
+  NX = MAX(NX, MIN_WIDTH); 
+  NY = MAX(NY, MIN_HEIGHT); 
+
+  // if the new size is the same as the old size, do nothing.
+  if ((graphic->dx == NX) && (graphic->dy == NY)) return (TRUE);
+
+  // set the new window size
+  graphic->dx = NX; 
+  graphic->dy = NY; 
+
+  if (USE_XWINDOW) XResizeWindow (graphic->display, graphic->window, NX, NY);
+
+  // reset the sizes for all sections
+  Nsection = GetNumberOfSections ();
+  for (i = 0; i < Nsection; i++) {
+      section = GetSectionByNumber (i);
+      SetSectionSizes (section);
+  }
+
+  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
+  Refresh (1);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SaveOverlay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SaveOverlay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SaveOverlay.c	(revision 15879)
@@ -0,0 +1,39 @@
+# include "Ximage.h"
+
+int SaveOverlay (int sock) {
+
+  int i, N;
+  char filename[256], *type;
+  FILE *f;
+  Section *section;
+  KapaImageWidget *image;
+
+  section = GetActiveSection();
+  image   = section->image;
+  if (image == NULL) return (TRUE);
+
+  KiiScanMessage (sock, "%*s %d %s", &N, filename);
+  
+  f = fopen (filename, "w");
+  if (f == NULL) {
+    fprintf (stderr, "could not open %s\n", filename);
+    return (TRUE);
+  }
+
+  for (i = 0; i < image[0].overlay[N].Nobjects; i++) {
+    type = KiiOverlayTypeByNumber (image[0].overlay[N].objects[i].type);
+    if (type == NULL) continue;
+    fprintf (f, "%s %lf %lf %lf %lf\n", 
+	     type,
+	     image[0].overlay[N].objects[i].x,
+	     image[0].overlay[N].objects[i].y,
+	     image[0].overlay[N].objects[i].dx,
+	     image[0].overlay[N].objects[i].dy);
+  }
+  fclose (f);
+  return (TRUE);
+}
+
+/* this is asymmetric with LoadOverlay.c.  In that case, the client reads the file and sends
+ * the overlay objects to kapa.  In this case, kapa writes the file directly... 
+ */
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Sections.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Sections.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Sections.c	(revision 15879)
@@ -0,0 +1,218 @@
+# include "Ximage.h"
+
+static int  ActiveSection  = 0;
+static int       Nsections = 0;
+static Section **sections = NULL;
+
+Section *InitSection () {
+
+  Section *section;
+  ALLOCATE (section, Section, 1);
+
+  section[0].graph = NULL;
+  section[0].image = NULL;
+  section[0].x = 0;
+  section[0].y = 0;
+  section[0].dx = 0;
+  section[0].dy = 0;
+
+  section[0].name = NULL;
+  return (section);
+}
+
+void FreeSection (Section *section) {
+
+  if (section == NULL) return;
+  FreeGraph (section[0].graph);
+  FreeImage (section[0].image);
+  FREE (section[0].name);
+  free (section);
+}
+
+void FreeSections () {
+
+  int i;
+
+  for (i = 0; i < Nsections; i++) {
+    FreeSection (sections[i]);
+  }
+  free (sections);
+  Nsections = 0;
+  sections = NULL;
+}
+
+Section *AddSection (char *name, float x, float y, float dx, float dy) {
+
+  int N;
+
+  N = Nsections;
+
+  if (sections == NULL) {
+    Nsections = 1;
+    ALLOCATE (sections, Section *, Nsections);
+  } else {
+    Nsections ++;
+    REALLOCATE (sections, Section *, MAX (1, Nsections));
+  }
+  sections[N] = InitSection();
+  sections[N][0].name = strcreate (name);
+  sections[N][0].x = x;
+  sections[N][0].y = y;
+  sections[N][0].dx = dx;
+  sections[N][0].dy = dy;
+  ActiveSection = N;
+  return (sections[N]);
+}
+
+int DelSection (char *name) {
+
+  int i, j;
+
+  for (i = 0; i < Nsections; i++) {
+    if (strcmp (name, sections[i][0].name)) continue;
+    FreeSection (sections[i]);
+    for (j = i; j < Nsections - 1; j++) {
+      sections[j] = sections[j+1];
+    }
+    return (TRUE);
+  }
+  return (FALSE);
+}
+
+int GetSectionByName (char *name) {
+
+  int i;
+
+  for (i = 0; i < Nsections; i++) {
+    if (strcmp (name, sections[i][0].name)) continue;
+    return (i);
+  }
+  return (-1);
+}
+
+int GetNumberOfSections () {
+  return (Nsections);
+}
+
+Section *GetSectionByNumber (int N) {
+  if (N >= Nsections) return NULL;
+  if (N < 0) return NULL;
+  return sections[N];
+}
+
+Section *GetActiveSection () {
+  int N;
+  N = ActiveSection;
+  return (sections[N]);
+}
+
+int SetActiveSectionByNumber (int N) {
+  if (N >= Nsections) return FALSE;
+  if (N < 0) return FALSE;
+  ActiveSection = N;
+  return TRUE;
+}
+
+int ListSection (int sock) {
+  
+  int i, ThisSection;
+  char name[128];
+
+  KiiScanMessage (sock, "%s", name);
+
+  if (!strcmp (name, "*")) {
+    for (i = 0; i < Nsections; i++) {
+      fprintf (stderr, "%s: %6.3f %6.3f %6.3f %6.3f\n", 
+	       sections[i][0].name, sections[i][0].x, sections[i][0].y, sections[i][0].dx, sections[i][0].dy);
+    }
+    return (TRUE);
+  }
+
+  ThisSection = -1;
+  for (i = 0; i < Nsections; i++) {
+    if (!strcmp (name, sections[i][0].name)) {
+      ThisSection = i;
+      break;
+    }
+  }
+  if (ThisSection == -1) {
+    fprintf (stderr, "section %s not found\n", name);
+    return (TRUE);
+  }
+
+  fprintf (stderr, "%s: %6.3f %6.3f %6.3f %6.3f\n", 
+	   sections[ThisSection][0].name, 
+	   sections[ThisSection][0].x,  sections[ThisSection][0].y, 
+	   sections[ThisSection][0].dx, sections[ThisSection][0].dy);
+  return (TRUE);
+}
+
+void SetSectionSizes (Section *section) {
+
+    SetGraphSize (section);
+    SetImageSize (section);
+    return;
+}
+
+// return TRUE even for nonsense cases to avoid quitting kapa
+int MoveSection (int sock) {
+
+  int i, N;
+  char name[128];
+  char direction[16];
+  Section *tmpSection = NULL;
+
+  KiiScanMessage (sock, "%s %s", name, direction);
+  
+  N = GetSectionByName (name);
+  if (N < 0) {
+    fprintf (stderr, "section %s not found\n", name);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (direction, "up")) {
+      if (N < 0) return (TRUE);
+      if (N > Nsections - 2) return (TRUE);
+      tmpSection = sections[N];
+      sections[N] = sections[N+1];
+      sections[N+1] = tmpSection;
+      Refresh (1);
+      return (TRUE);
+  }
+
+  if (!strcasecmp (direction, "down")) {
+      if (N < 1) return (TRUE);
+      if (N > Nsections - 1) return (TRUE);
+      tmpSection = sections[N];
+      sections[N] = sections[N-1];
+      sections[N-1] = tmpSection;
+      Refresh (1);
+      return (TRUE);
+  }
+
+  if (!strcasecmp (direction, "top")) {
+      if (N < 0) return (TRUE);
+      if (N > Nsections - 2) return (TRUE);
+      tmpSection = sections[N];
+      for (i = N; i < Nsections - 1; i++) {
+	sections[i] = sections[i+1];
+      }
+      sections[i] = tmpSection;
+      Refresh (1);
+      return (TRUE);
+  }
+
+  if (!strcasecmp (direction, "bottom")) {
+      if (N < 1) return (TRUE);
+      if (N > Nsections - 1) return (TRUE);
+      tmpSection = sections[N];
+      for (i = N; i >= 1; i--) {
+	sections[i] = sections[i-1];
+      }
+      sections[i] = tmpSection;
+      Refresh (1);
+      return (TRUE);
+  }
+  fprintf (stderr, "unknown direction %s for MoveSection\n", direction);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetColormap.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetColormap.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetColormap.c	(revision 15879)
@@ -0,0 +1,104 @@
+# include "Ximage.h"
+
+/*** this function uses only private colormaps.  it should try the standard colormap
+     first to get better control over the smooth greyscales ***/
+
+int SetColormap (char *name) {
+
+  int i;
+  Graphic *graphic;
+
+  graphic = GetGraphic();
+
+  /* greyscale */
+  if ((!strcmp (name, "grayscale")) || (!strcmp (name, "greyscale"))) {
+    for (i = 0; i < graphic[0].Npixels; i++) {  
+      graphic[0].cmap[i].red = 256*(255 - 255*i/graphic[0].Npixels);
+      graphic[0].cmap[i].green = 256*(255 - 255*i/graphic[0].Npixels);
+      graphic[0].cmap[i].blue = 256*(255 - 255*i/graphic[0].Npixels);
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    goto store_colors;
+  }
+  /* heat */
+  if (!strcmp (name, "Puns")) {
+    for (i = 0; i < (int)(0.25*graphic[0].Npixels); i++) {  
+      graphic[0].cmap[i].green = 0;
+      graphic[0].cmap[i].blue = 0;
+      graphic[0].cmap[i].red = MIN (256*255, 256*255*2*i/(1.0*graphic[0].Npixels));  
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    for (i = (int)(0.25*graphic[0].Npixels); i < (int)(0.50*graphic[0].Npixels); i++) {  
+      graphic[0].cmap[i].red = MIN (256*255, 256*255*2*i/(1.0*graphic[0].Npixels));
+      graphic[0].cmap[i].green = MIN (256*255, 256*255*2*(i/(1.0*graphic[0].Npixels) - 0.25));
+      graphic[0].cmap[i].blue = 0;
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    for (i = (int)(0.50*graphic[0].Npixels); i < (int)(0.75*graphic[0].Npixels); i++) {  
+      graphic[0].cmap[i].red = 256*255;
+      graphic[0].cmap[i].green = MIN (256*255, 256*255*2*(i/(1.0*graphic[0].Npixels) - 0.25));
+      graphic[0].cmap[i].blue = MIN (256*255, 256*255*2*(i/(1.0*graphic[0].Npixels) - 0.50));
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    for (i = (int)(0.75*graphic[0].Npixels); i < graphic[0].Npixels; i++) {  
+      graphic[0].cmap[i].red = 256*255;
+      graphic[0].cmap[i].green = 256*255;
+      graphic[0].cmap[i].blue = MIN (256*255, 256*255*2*(i/(1.0*graphic[0].Npixels) - 0.50));
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    goto store_colors;
+  }
+  /* -grayscale */
+  if ((!strcmp (name, "-grayscale")) || (!strcmp (name, "-greyscale"))) {
+    for (i = 0; i < graphic[0].Npixels; i++) {  
+      graphic[0].cmap[i].red = 256*(255*i/graphic[0].Npixels);
+      graphic[0].cmap[i].green = 256*(255*i/graphic[0].Npixels);
+      graphic[0].cmap[i].blue = 256*(255*i/graphic[0].Npixels);
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    goto store_colors;
+  }
+  /* rainbow */
+  if (!strcmp (name, "Rainbow")) {
+    for (i = 0; i < (int)(0.25*graphic[0].Npixels); i++) {  
+      graphic[0].cmap[i].red = 0;
+      graphic[0].cmap[i].green = 0;
+      graphic[0].cmap[i].blue = 256*(255*4*(i/(1.0*graphic[0].Npixels)));  
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    for (i = (int)(0.25*graphic[0].Npixels); i < (int)(0.50*graphic[0].Npixels); i++) {  
+      graphic[0].cmap[i].red = 256*(255*4*((i/(1.0*graphic[0].Npixels)) - 0.25));
+      graphic[0].cmap[i].green = 0;
+      graphic[0].cmap[i].blue = 256*(255*4*(0.50 - (i/(1.0*graphic[0].Npixels))));
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    for (i = (int)(0.50*graphic[0].Npixels); i < (int)(0.75*graphic[0].Npixels); i++) {  
+      graphic[0].cmap[i].red = 256*255;
+      graphic[0].cmap[i].green = 256*(255*4*((i/(1.0*graphic[0].Npixels)) - 0.50));
+      graphic[0].cmap[i].blue = 0;
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    for (i = (int)(0.75*graphic[0].Npixels); i < graphic[0].Npixels; i++) {  
+      graphic[0].cmap[i].red = 256*255;
+      graphic[0].cmap[i].green = 256*255;
+      graphic[0].cmap[i].blue = 256*(255*4*((i/(1.0*graphic[0].Npixels)) - 0.75));
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    goto store_colors;
+  }
+  return (FALSE);
+
+ store_colors:
+  if (!USE_XWINDOW) return (TRUE);
+  if (graphic[0].visualclass) {
+    XStoreColors(graphic[0].display, graphic[0].colormap, graphic[0].cmap, graphic[0].Npixels);
+  } else {
+    for (i = 0; i < graphic[0].Npixels; i++) {
+      if (XAllocColor (graphic[0].display, graphic[0].colormap, &graphic[0].cmap[i]) == 0) {
+	fprintf (stderr, "error on %d\n", i);
+      }
+    }
+  }
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetFont.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetFont.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetFont.c	(revision 15879)
@@ -0,0 +1,15 @@
+# include "Ximage.h"
+
+int SetFont (int sock) {
+  
+  char name[64];
+  int size;
+  
+  KiiScanCommand (sock, 16, "%s", name);
+  KiiScanCommand (sock, 16, "%d", &size);
+
+  SetRotFont (name, size);
+  
+  return (TRUE);
+  
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetGraphData.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetGraphData.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetGraphData.c	(revision 15879)
@@ -0,0 +1,119 @@
+# include "Ximage.h"
+
+int SetGraphData (int sock) {
+  
+  int i;
+  double xmin, xmax, ymin, ymax;
+  Graphic *graphic;
+  Section *section;
+  KapaGraphWidget *graph;
+
+  graphic = GetGraphic();
+
+  section = GetActiveSection();
+  if (section->graph == NULL) {
+    section->graph = InitGraph ();
+    SetSectionSizes (section);
+  }
+  graph = section->graph;
+  
+  // get graph data from client 
+  KiiScanMessage (sock, "%d %d %d %d %d %d %lf %lf", 
+		  &graph[0].data.style, 
+		  &graph[0].data.ptype, 
+		  &graph[0].data.ltype, 
+		  &graph[0].data.etype, 
+		  &graph[0].data.ebar, 
+		  &graph[0].data.color, 
+		  &graph[0].data.lweight, 
+		  &graph[0].data.size);
+
+  KiiScanMessage (sock, "%lf %lf %lf %lf", 
+		  &graph[0].data.xmin, 
+		  &graph[0].data.xmax, 
+		  &graph[0].data.ymin, 
+		  &graph[0].data.ymax);
+
+  KiiScanMessage (sock, "%f %f %f %f", 
+		  &graph[0].data.coords.pc1_1, &graph[0].data.coords.pc2_2,
+		  &graph[0].data.coords.pc1_2, &graph[0].data.coords.pc2_1);
+
+  KiiScanMessage (sock, "%d %d %s", 
+		  &graph[0].data.flipeast, &graph[0].data.flipnorth,
+		  graph[0].data.coords.ctype);
+
+  KiiScanMessage (sock, "%lf %lf %f %f %f %f", 
+		  &graph[0].data.coords.crval1,
+		  &graph[0].data.coords.crval2,
+		  &graph[0].data.coords.crpix1,
+		  &graph[0].data.coords.crpix2,
+		  &graph[0].data.coords.cdelt1,
+		  &graph[0].data.coords.cdelt2);
+
+
+
+  xmin = graph[0].data.xmin;
+  xmax = graph[0].data.xmax;
+  ymin = graph[0].data.ymin;
+  ymax = graph[0].data.ymax;
+
+  // XXX there are now two things which track the graph limits
+  // make sure these are kept in sync (or drop one!)
+  graph[0].axis[2].min = graph[0].axis[0].min = xmin;
+  graph[0].axis[2].max = graph[0].axis[0].max = xmax;
+  graph[0].axis[3].min = graph[0].axis[1].min = ymin; 
+  graph[0].axis[3].max = graph[0].axis[1].max = ymax;
+  
+  for (i = 0; i < graph[0].Nobjects; i++) {
+    graph[0].objects[i].x0 = xmin;
+    graph[0].objects[i].x1 = xmax;
+    graph[0].objects[i].y0 = ymin;
+    graph[0].objects[i].y1 = ymax;
+  }
+
+  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
+  Refresh (1);
+
+  return (TRUE);  
+}
+
+int GetGraphData (int sock) {
+  
+  Section *section;
+  KapaGraphWidget *graph;
+
+  section = GetActiveSection();
+  if (section->graph == NULL) {
+    section->graph = InitGraph ();
+    SetSectionSizes (section);
+  }
+  graph = section->graph;
+
+  KiiSendMessage (sock, "%8d %d %d %d %d %d %f %f", 
+		  graph[0].data.style, 
+		  graph[0].data.ptype, graph[0].data.ltype, 
+		  graph[0].data.etype, graph[0].data.ebar, graph[0].data.color, 
+		  graph[0].data.lweight, graph[0].data.size);
+
+  KiiSendMessage (sock, "%g %g %g %g", 
+		  graph[0].data.xmin, graph[0].data.xmax, 
+		  graph[0].data.ymin, graph[0].data.ymax);
+
+  KiiSendMessage (sock, "%g %g %g %g", 
+		  graph[0].data.coords.pc1_1, graph[0].data.coords.pc2_2,
+		  graph[0].data.coords.pc1_2, graph[0].data.coords.pc2_1);
+
+  KiiSendMessage (sock, "%d %d %s", 
+		  graph[0].data.flipeast, graph[0].data.flipnorth,
+		  graph[0].data.coords.ctype);
+
+  KiiSendMessage (sock, "%g %g %g %g %g %g", 
+		  graph[0].data.coords.crval1,
+		  graph[0].data.coords.crval2,
+		  graph[0].data.coords.crpix1,
+		  graph[0].data.coords.crpix2,
+		  graph[0].data.coords.cdelt1,
+		  graph[0].data.coords.cdelt2);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetGraphSize.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetGraphSize.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetGraphSize.c	(revision 15879)
@@ -0,0 +1,128 @@
+# include "Ximage.h"
+
+/* Set the dimensions of the specific graph based on the current window size.  The graph
+   is placed within the window at the fractional position defined by the section */
+
+void SetGraphSize (Section *section) {
+
+  int fontsize, bump, Nc;
+  int textpad, textdY, WdY; 
+  double PADx, PADy, Dx, Dy;
+  double PXm, PXp, PYm, PYp;
+  double X0, Y0, dX, dY;
+  char string[64], *fontname;
+  KapaGraphWidget *graph;
+  Graphic *graphic;
+
+  if (section == NULL) return;
+  graph = section->graph;
+  if (graph == NULL) return;
+
+  graphic = GetGraphic ();
+  fontname = GetRotFont (&fontsize);
+
+  PADx = MAX (graphic->dx / 20.0, fontsize);
+  PADy = MAX (graphic->dy / 20.0, fontsize);
+  Dx = graphic->dx - 2*PADx;
+  Dy = graphic->dy - 2*PADy;
+
+  /* each graph has a padding PXm, PXp, PYm, PYp */
+  PXm = (graph[0].axis[1].islabel) ? 4*fontsize : 0;
+  PXp = (graph[0].axis[3].islabel) ? 4*fontsize : 0;
+  PYm = (graph[0].axis[0].islabel) ? 4*fontsize : 0;
+  PYp = (graph[0].axis[2].islabel) ? 4*fontsize : 0;
+ 
+  /* basic size of the graph in Xwindow coordinates */
+  X0 = PADx + PXm + (Dx * section[0].x);
+  Y0 = PADy + PYm + (Dy * section[0].y);
+  dX = (Dx * section[0].dx) - PXp - PXm;
+  dY = (Dy * section[0].dy) - PYp - PYm;
+
+  // if we are tied to an image, make mods as needed
+  if (section->image) {
+    textpad = graphic[0].font[0].ascent;
+    textdY = 6*textpad + 7*PAD1;
+    WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1);
+
+    switch (section->image->location) {
+      case 1:
+	Y0 = graphic[0].dy * section[0].y + 2*PAD1 + WdY + 2; // tied to image in Y
+	dY = graphic[0].dy * section[0].dy - 5*PAD1 - WdY - COLORPAD + 1;
+	break;
+      case 3:
+	dY = graphic[0].dy * section[0].dy - 5*PAD1 - WdY - COLORPAD - PADy - PYm;
+	break;
+      case 2:
+	X0 = graphic[0].dx * section[0].x  + 2*PAD1 + ZOOM_X;
+	dX = graphic[0].dx * section[0].dx - 3*PAD1 - ZOOM_X;
+	break;
+      case 4:
+	dX = graphic[0].dx * section[0].dx - 3*PAD1 - ZOOM_X - PADx - PXm;
+	break;
+    }
+  }
+
+  /* define locations of coordinate axes */
+  graph[0].axis[0].fx  = X0;
+  graph[0].axis[0].fy  = graphic->dy - Y0;
+  graph[0].axis[0].dfx = dX;
+  graph[0].axis[0].dfy = 0;
+  
+  graph[0].axis[1].fx  = X0;
+  graph[0].axis[1].fy  = graphic->dy - Y0;
+  graph[0].axis[1].dfx = 0;
+  graph[0].axis[1].dfy = -dY;
+
+  graph[0].axis[2].fx  = X0;
+  graph[0].axis[2].fy  = graphic->dy - Y0 - dY;
+  graph[0].axis[2].dfx = dX;
+  graph[0].axis[2].dfy = 0;
+
+  graph[0].axis[3].fx  = X0 + dX;
+  graph[0].axis[3].fy  = graphic->dy - Y0;
+  graph[0].axis[3].dfx = 0;
+  graph[0].axis[3].dfy = -dY;
+
+  PADx = 0.8*fontsize + 2;
+  PADy = 3.0*fontsize + 4;
+
+  /* define locations of axis labels */
+  graph[0].label[LABELX0].x = graph[0].axis[0].fx + 0.5*graph[0].axis[0].dfx;
+  bump = (graph[0].axis[0].islabel) ? PADy : PADx;
+  graph[0].label[LABELX0].y = graph[0].axis[0].fy + bump;
+
+  graph[0].label[LABELX1].x = graph[0].axis[2].fx + 0.5*graph[0].axis[2].dfx;
+  bump = (graph[0].axis[2].islabel) ? PADy : PADx;
+  graph[0].label[LABELX1].y = graph[0].axis[2].fy - bump;
+
+  /* check for the max size of the axis label */
+  sprintf (string, "%4g", graph[0].axis[1].min);
+  Nc = strlen (string);
+  sprintf (string, "%4g", graph[0].axis[1].max);
+  Nc = MAX (Nc, strlen (string));
+
+  graph[0].label[LABELY0].y = graph[0].axis[1].fy + 0.5*graph[0].axis[1].dfy;
+  bump = (graph[0].axis[1].islabel) ? (0.8*Nc*fontsize + 1) : PADx;
+  graph[0].label[LABELY0].x = graph[0].axis[1].fx - bump;
+
+  sprintf (string, "%4g", graph[0].axis[3].min);
+  Nc = strlen (string);
+  sprintf (string, "%4g", graph[0].axis[3].max);
+  Nc = MAX (Nc, strlen (string));
+
+  graph[0].label[LABELY1].y = graph[0].axis[3].fy + 0.5*graph[0].axis[3].dfy;
+  bump = (graph[0].axis[3].islabel) ? (0.8*Nc*fontsize + 1) : PADx;
+  graph[0].label[LABELY1].x = graph[0].axis[3].fx + bump;
+  
+  /* these are wrong and have to be adjusted to sit in the corners */
+
+  graph[0].label[LABELUL].x = graph[0].axis[2].fx - PADx;
+  graph[0].label[LABELUL].y = graph[0].axis[2].fy - PADx;
+  graph[0].label[LABELUR].x = graph[0].axis[2].fx + graph[0].axis[2].dfx + PADx;
+  graph[0].label[LABELUR].y = graph[0].axis[2].fy - PADx;
+  graph[0].label[LABELLL].x = graph[0].axis[0].fx - PADx;
+  graph[0].label[LABELLL].y = graph[0].axis[0].fy + PADx;
+  graph[0].label[LABELLR].x = graph[0].axis[0].fx + graph[0].axis[0].dfx + PADx;
+  graph[0].label[LABELLR].y = graph[0].axis[0].fy + PADx;
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetGraphStyle.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetGraphStyle.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetGraphStyle.c	(revision 15879)
@@ -0,0 +1,84 @@
+# include "Ximage.h"
+
+int SetGraphStyle (int sock) {
+  
+  int i;
+  double xmin, xmax, ymin, ymax;
+  Graphic *graphic;
+  Section *section;
+  KapaGraphWidget *graph;
+
+  graphic = GetGraphic();
+
+  section = GetActiveSection();
+  if (section->graph == NULL) {
+    section->graph = InitGraph ();
+    SetSectionSizes (section);
+  }
+  graph = section->graph;
+  
+  // get graph style from client 
+  KiiScanMessage (sock, "%d %d %d %d %d %d %lf %lf", 
+		  &graph[0].style.style, 
+		  &graph[0].style.ptype, 
+		  &graph[0].style.ltype, 
+		  &graph[0].style.etype, 
+		  &graph[0].style.ebar, 
+		  &graph[0].style.color, 
+		  &graph[0].style.lweight, 
+		  &graph[0].style.size);
+
+  KiiScanMessage (sock, "%lf %lf %lf %lf", 
+		  &graph[0].style.xmin, 
+		  &graph[0].style.xmax, 
+		  &graph[0].style.ymin, 
+		  &graph[0].style.ymax);
+
+  xmin = graph[0].style.xmin;
+  xmax = graph[0].style.xmax;
+  ymin = graph[0].style.ymin;
+  ymax = graph[0].style.ymax;
+
+  // XXX there are now two things which track the graph limits
+  // make sure these are kept in sync (or drop one!)
+  graph[0].axis[2].min = graph[0].axis[0].min = xmin;
+  graph[0].axis[2].max = graph[0].axis[0].max = xmax;
+  graph[0].axis[3].min = graph[0].axis[1].min = ymin; 
+  graph[0].axis[3].max = graph[0].axis[1].max = ymax;
+  
+  for (i = 0; i < graph[0].Nobjects; i++) {
+    graph[0].objects[i].x0 = xmin;
+    graph[0].objects[i].x1 = xmax;
+    graph[0].objects[i].y0 = ymin;
+    graph[0].objects[i].y1 = ymax;
+  }
+
+  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
+  Refresh (1);
+
+  return (TRUE);  
+}
+
+int GetGraphStyle (int sock) {
+  
+  Section *section;
+  KapaGraphWidget *graph;
+
+  section = GetActiveSection();
+  if (section->graph == NULL) {
+    section->graph = InitGraph ();
+    SetSectionSizes (section);
+  }
+  graph = section->graph;
+
+  KiiSendMessage (sock, "%8d %d %d %d %d %d %f %f", 
+		  graph[0].style.style, 
+		  graph[0].style.ptype, graph[0].style.ltype, 
+		  graph[0].style.etype, graph[0].style.ebar, graph[0].style.color, 
+		  graph[0].style.lweight, graph[0].style.size);
+  KiiSendMessage (sock, "%g %g %g %g", 
+		  graph[0].style.xmin, graph[0].style.xmax, 
+		  graph[0].style.ymin, graph[0].style.ymax);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetImageData.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetImageData.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetImageData.c	(revision 15879)
@@ -0,0 +1,134 @@
+# include "Ximage.h"
+
+int SetImageData (int sock) {
+  
+  Graphic *graphic;
+  Section *section;
+  KapaImageWidget *image;
+
+  graphic = GetGraphic();
+
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image = section->image;
+  
+  // get image data from client 
+  KiiScanMessage (sock, "%lf %lf %s", 
+		  &image[0].zero, 
+		  &image[0].range, 
+		  image[0].name, 
+		  image[0].file);
+
+  // XXX when we go to 32bit, this should remap the image
+  // if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
+  // Refresh (1);
+
+  return (TRUE);  
+}
+
+int GetImageData (int sock) {
+  
+  Section *section;
+  KapaImageWidget *image;
+
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image = section->image;
+
+  KiiSendMessage (sock, "%g %g %s %s", 
+		  image[0].zero,
+		  image[0].range,
+		  image[0].name,
+		  image[0].file);
+
+  return (TRUE);
+}
+
+int SetImageCoords (int sock) {
+  
+  Graphic *graphic;
+  Section *section;
+  KapaImageWidget *image;
+
+  graphic = GetGraphic();
+
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image = section->image;
+  
+  KiiScanMessage (sock, "%f %f %f %f", 
+		  &image[0].coords.pc1_1, &image[0].coords.pc2_2,
+		  &image[0].coords.pc1_2, &image[0].coords.pc2_1);
+
+  KiiScanMessage (sock, "%s", image[0].coords.ctype);
+
+  KiiScanMessage (sock, "%lf %lf %f %f %f %f", 
+		  &image[0].coords.crval1,
+		  &image[0].coords.crval2,
+		  &image[0].coords.crpix1,
+		  &image[0].coords.crpix2,
+		  &image[0].coords.cdelt1,
+		  &image[0].coords.cdelt2);
+
+  return (TRUE);  
+}
+
+int GetImageCoords (int sock) {
+  
+  Section *section;
+  KapaImageWidget *image;
+
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image = section->image;
+
+  KiiSendMessage (sock, "%g %g %g %g", 
+		  image[0].coords.pc1_1, image[0].coords.pc2_2,
+		  image[0].coords.pc1_2, image[0].coords.pc2_1);
+
+  KiiSendMessage (sock, "%s", image[0].coords.ctype);
+
+  KiiSendMessage (sock, "%g %g %g %g %g %g", 
+		  image[0].coords.crval1,
+		  image[0].coords.crval2,
+		  image[0].coords.crpix1,
+		  image[0].coords.crpix2,
+		  image[0].coords.cdelt1,
+		  image[0].coords.cdelt2);
+
+  return (TRUE);
+}
+
+int GetImageRange (int sock) {
+  
+  Section *section;
+  KapaImageWidget *image;
+  double Xmin, Xmax, Ymin, Ymax;
+
+  section = GetActiveSection();
+  if (section->image == NULL) {
+    section->image = InitImage ();
+    SetSectionSizes (section);
+  }
+  image = section->image;
+
+  Screen_to_Image (&Xmin, &Ymin, 0.0, 0.0, image);
+  Screen_to_Image (&Xmax, &Ymax, image[0].picture.dx, image[0].picture.dy, image);
+
+  KiiSendMessage (sock, "%g %g %g %g", Xmin, Xmax, Ymin, Ymax);
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetImageSize.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetImageSize.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetImageSize.c	(revision 15879)
@@ -0,0 +1,326 @@
+# include "Ximage.h"
+
+/* Set the dimensions of the specific image based on the current window size.  The image
+   is placed within the window at the fractional position defined by the section */
+
+// XXX currently only set to fill the window; does not adjust for section range
+void SetImageSize (Section *section) {
+
+  int Xs, Ys, dX, dY;
+  int textpad, textdY, WdY; 
+  KapaImageWidget *image;
+  KapaGraphWidget *graph;
+  Graphic *graphic;
+
+  if (section == NULL) return;
+  image = section->image;
+  if (image == NULL) return;
+  graph = section->graph;
+
+  graphic = GetGraphic ();
+
+  /* the image is placed within the graphic window in region specified by section */
+  Xs = graphic[0].dx * section[0].x;
+  Ys = graphic[0].dy * (1 - section[0].y - section[0].dy);
+  dX = graphic[0].dx * section[0].dx;
+  dY = graphic[0].dy * section[0].dy;
+
+  switch (image[0].location) {
+    case 0:
+      if (section->graph) {
+	  image[0].picture.x  = graph[0].axis[0].fx;
+	  image[0].picture.y  = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+	  image[0].picture.dx = MAX(graph[0].axis[0].dfx + 1, 1);
+	  image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1);
+      } else {
+	  image[0].picture.x  = Xs + PAD1;
+	  image[0].picture.y  = Ys + PAD1;
+	  image[0].picture.dx = dX - 2*PAD1; 
+	  image[0].picture.dy = dY - 2*PAD1;
+      }
+      if (USE_XWINDOW) CreatePicture (image, graphic);
+      Remap (graphic, image, &image[0].matrix);
+      return;
+
+    case 1:
+      textpad = graphic[0].font[0].ascent;
+      textdY = 6*textpad + 7*PAD1;
+      WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1);
+
+      if (section->graph) {
+	  image[0].picture.x = graph[0].axis[0].fx;
+	  image[0].picture.y = Ys + 2*PAD1 + COLORPAD;
+	  image[0].picture.dx = graph[0].axis[0].dfx;
+	  image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD;
+      } else {
+	  image[0].picture.x  = Xs + PAD1;
+	  image[0].picture.y  = Ys + 2*PAD1 + COLORPAD;
+	  image[0].picture.dx = dX - 2*PAD1; 
+	  image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD;
+      }
+
+      image[0].cmapbar.dx = dX - 2*PAD1; 
+      image[0].cmapbar.dy = COLORPAD;
+      image[0].cmapbar.x = Xs + PAD1;
+      image[0].cmapbar.y = Ys + PAD1;
+
+      // XXX zoom should scale somewhat with the image? (with a min and a max)
+      // XXX actually, it is limited by the buttons and status region
+      image[0].zoom.dx = ZOOM_X; 
+      image[0].zoom.dy = ZOOM_Y;
+      image[0].zoom.x = Xs + PAD1;
+      image[0].zoom.y = image[0].picture.y + image[0].picture.dy + PAD1;
+
+      /** everything below is tied in x-dir to the zoom box **/
+      image[0].text_x = image[0].zoom.x + image[0].zoom.dx + PAD1;
+      image[0].text_y = image[0].zoom.y;
+      image[0].text_dx = ZOOM_X;
+      image[0].text_dy = 6*textpad + 7*PAD1;
+      image[0].text_dyo = 3*textpad + 4*PAD1;
+
+      image[0].overlay_button[0].x = image[0].text_x;
+      image[0].overlay_button[0].y = image[0].text_y + image[0].text_dy + PAD1;
+   
+      image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;
+      image[0].overlay_button[1].y = image[0].overlay_button[0].y;
+
+      image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;
+      image[0].overlay_button[2].y = image[0].overlay_button[0].y;
+
+      image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;
+      image[0].overlay_button[3].y = image[0].overlay_button[0].y;
+
+      image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
+      image[0].hms_button.y = image[0].overlay_button[0].y;
+
+      image[0].PS_button.x = image[0].text_x;
+      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
+
+      /** everything below is tied to the PS_button in y-dir + the neighbor in x-dir **/
+      image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1;
+      image[0].grey_button.y = image[0].PS_button.y;
+
+      image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1;
+      image[0].rainbow_button.y = image[0].PS_button.y;
+
+      image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;
+      image[0].puns_button.y = image[0].PS_button.y;
+
+      image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1;
+      image[0].recenter_button.y = image[0].PS_button.y;
+      break;
+
+    case 3:
+      textpad = graphic[0].font[0].ascent;
+      textdY = 6*textpad + 7*PAD1;
+      WdY = MAX (ZOOM_Y, textdY + 2*BUTTON_HEIGHT + PAD1);
+
+      if (section->graph) {
+	image[0].picture.x = graph[0].axis[0].fx;
+	image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+	image[0].picture.dx = MAX(graph[0].axis[0].dfx, 1);
+	image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1);
+      } else {
+	image[0].picture.dx = dX - 2*PAD1; 
+	image[0].picture.dy = dY - 5*PAD1 - WdY - COLORPAD;
+	image[0].picture.x = Xs + PAD1;
+	image[0].picture.y = Ys + 4*PAD1 + COLORPAD + WdY;
+      }
+
+      image[0].cmapbar.dx = dX - 2*PAD1; 
+      image[0].cmapbar.dy = COLORPAD;
+      image[0].cmapbar.x = Xs + PAD1;
+      image[0].cmapbar.y = Ys + PAD1;
+
+      // XXX zoom should scale somewhat with the image? (with a min and a max)
+      // XXX actually, it is limited by the buttons and status region
+      image[0].zoom.dx = ZOOM_X; 
+      image[0].zoom.dy = ZOOM_Y;
+      image[0].zoom.x = Xs + PAD1;
+      image[0].zoom.y = Ys + 2*PAD1 + COLORPAD;
+
+      /** everything below is tied in x-dir to the zoom box **/
+      image[0].text_x = image[0].zoom.x + image[0].zoom.dx + PAD1;
+      image[0].text_y = image[0].zoom.y;
+      image[0].text_dx = ZOOM_X;
+      image[0].text_dy = 6*textpad + 7*PAD1;
+      image[0].text_dyo = 3*textpad + 4*PAD1;
+
+      image[0].overlay_button[0].x = image[0].text_x;
+      image[0].overlay_button[0].y = image[0].text_y + image[0].text_dy + PAD1;
+   
+      image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;
+      image[0].overlay_button[1].y = image[0].overlay_button[0].y;
+
+      image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;
+      image[0].overlay_button[2].y = image[0].overlay_button[0].y;
+
+      image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;
+      image[0].overlay_button[3].y = image[0].overlay_button[0].y;
+
+      image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
+      image[0].hms_button.y = image[0].overlay_button[0].y;
+
+      image[0].PS_button.x = image[0].text_x;
+      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
+
+      /** everything below is tied to the PS_button in y-dir + the neighbor in x-dir **/
+      image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1;
+      image[0].grey_button.y = image[0].PS_button.y;
+
+      image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1;
+      image[0].rainbow_button.y = image[0].PS_button.y;
+
+      image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;
+      image[0].puns_button.y = image[0].PS_button.y;
+
+      image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1;
+      image[0].recenter_button.y = image[0].PS_button.y;
+      break;
+
+    case 2:
+
+      if (section->graph) {
+	image[0].picture.x = Xs + 2*PAD1 + ZOOM_X;
+	image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+	image[0].picture.dx = dX - 3*PAD1 - ZOOM_X; 
+	image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1);
+      } else {
+	image[0].picture.dx = dX - 3*PAD1 - ZOOM_X; 
+	image[0].picture.dy = dY - 3*PAD1 - COLORPAD;
+	image[0].picture.x = Xs + 2*PAD1 + ZOOM_X;
+	image[0].picture.y = Ys + 2*PAD1 + COLORPAD;
+      }
+
+      image[0].cmapbar.dx = dX - 2*PAD1; 
+      image[0].cmapbar.dy = COLORPAD;
+      image[0].cmapbar.x = Xs + PAD1;
+      image[0].cmapbar.y = Ys + PAD1;
+
+      // XXX zoom should scale somewhat with the image? (with a min and a max)
+      // XXX actually, it is limited by the buttons and status region
+      image[0].zoom.dx = ZOOM_X; 
+      image[0].zoom.dy = ZOOM_Y;
+      image[0].zoom.x = Xs + PAD1;
+      image[0].zoom.y = image[0].picture.y;
+
+      /** everything below is tied in x-dir to the zoom box **/
+      textpad = graphic[0].font[0].ascent;
+      image[0].text_x = image[0].zoom.x;
+      image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD1;
+      image[0].text_dx = ZOOM_X;
+      image[0].text_dy = 6*textpad + 7*PAD1;
+      image[0].text_dyo = 3*textpad + 4*PAD1;
+
+      image[0].overlay_button[0].x = image[0].text_x;
+      image[0].overlay_button[0].y = image[0].text_y + image[0].text_dy + PAD1;
+   
+      image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;
+      image[0].overlay_button[1].y = image[0].overlay_button[0].y;
+
+      image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;
+      image[0].overlay_button[2].y = image[0].overlay_button[0].y;
+
+      image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;
+      image[0].overlay_button[3].y = image[0].overlay_button[0].y;
+
+      image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
+      image[0].hms_button.y = image[0].overlay_button[0].y;
+
+      image[0].PS_button.x = image[0].zoom.x;
+      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
+
+      /** everything below is tied to the PS_button in y-dir + the neighbor in x-dir **/
+      image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1;
+      image[0].grey_button.y = image[0].PS_button.y;
+
+      image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1;
+      image[0].rainbow_button.y = image[0].PS_button.y;
+
+      image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;
+      image[0].puns_button.y = image[0].PS_button.y;
+
+      image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1;
+      image[0].recenter_button.y = image[0].PS_button.y;
+      break;
+
+    case 4:
+
+      if (section->graph) {
+	image[0].picture.x = graph[0].axis[0].fx;
+	image[0].picture.y = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+	image[0].picture.dx = dX - 3*PAD1 - ZOOM_X - graph[0].axis[0].fx; 
+	image[0].picture.dy = MAX(fabs(graph[0].axis[1].dfy) - 1, 1);
+      } else {
+	image[0].picture.dx = dX - 3*PAD1 - ZOOM_X; 
+	image[0].picture.dy = dY - 3*PAD1 - COLORPAD;
+	image[0].picture.x = Xs + PAD1;
+	image[0].picture.y = Ys + 2*PAD1 + COLORPAD;
+      }
+
+      image[0].cmapbar.dx = dX - 2*PAD1; 
+      image[0].cmapbar.dy = COLORPAD;
+      image[0].cmapbar.x = Xs + PAD1;
+      image[0].cmapbar.y = Ys + PAD1;
+
+      // XXX zoom should scale somewhat with the image? (with a min and a max)
+      // XXX actually, it is limited by the buttons and status region
+      image[0].zoom.dx = ZOOM_X; 
+      image[0].zoom.dy = ZOOM_Y;
+      image[0].zoom.x = image[0].picture.x + image[0].picture.dx + PAD1;
+      image[0].zoom.y = image[0].picture.y;
+
+      /** everything below is tied in x-dir to the zoom box **/
+      textpad = graphic[0].font[0].ascent;
+      image[0].text_x = image[0].zoom.x;
+      image[0].text_y = image[0].zoom.y + image[0].zoom.dy + PAD1;
+      image[0].text_dx = ZOOM_X;
+      image[0].text_dy = 6*textpad + 7*PAD1;
+      image[0].text_dyo = 3*textpad + 4*PAD1;
+
+      image[0].overlay_button[0].x = image[0].text_x;
+      image[0].overlay_button[0].y = image[0].text_y + image[0].text_dy + PAD1;
+   
+      image[0].overlay_button[1].x = image[0].overlay_button[0].x + image[0].overlay_button[0].dx + PAD1;
+      image[0].overlay_button[1].y = image[0].overlay_button[0].y;
+
+      image[0].overlay_button[2].x = image[0].overlay_button[1].x + image[0].overlay_button[1].dx + PAD1;
+      image[0].overlay_button[2].y = image[0].overlay_button[0].y;
+
+      image[0].overlay_button[3].x = image[0].overlay_button[2].x + image[0].overlay_button[2].dx + PAD1;
+      image[0].overlay_button[3].y = image[0].overlay_button[0].y;
+
+      image[0].hms_button.x = image[0].overlay_button[3].x + image[0].overlay_button[3].dx + PAD1;
+      image[0].hms_button.y = image[0].overlay_button[0].y;
+
+      image[0].PS_button.x = image[0].zoom.x;
+      image[0].PS_button.y = image[0].overlay_button[0].y + BUTTON_HEIGHT + PAD1;
+
+      /** everything below is tied to the PS_button in y-dir + the neighbor in x-dir **/
+      image[0].grey_button.x = image[0].PS_button.x + image[0].PS_button.dx + PAD1;
+      image[0].grey_button.y = image[0].PS_button.y;
+
+      image[0].rainbow_button.x = image[0].grey_button.x + image[0].grey_button.dx + PAD1;
+      image[0].rainbow_button.y = image[0].PS_button.y;
+
+      image[0].puns_button.x = image[0].rainbow_button.x + image[0].rainbow_button.dx + PAD1;
+      image[0].puns_button.y = image[0].PS_button.y;
+
+      image[0].recenter_button.x = image[0].puns_button.x + image[0].puns_button.dx + PAD1;
+      image[0].recenter_button.y = image[0].PS_button.y;
+      break;
+
+    default:
+      abort ();
+      break;
+  }
+
+  if (USE_XWINDOW) {
+    CreatePicture (image, graphic);
+    CreateColorbar (image, graphic);
+    CreateZoom (image, graphic, 0, 0); 
+  }
+  Remap (graphic, image, &image[0].matrix);
+
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetLimits.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetLimits.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetLimits.c	(revision 15879)
@@ -0,0 +1,60 @@
+# include "Ximage.h"
+
+int SetLimits (int sock) {
+  
+  int i;
+  double xmin, xmax, ymin, ymax;
+  Graphic *graphic;
+  Section *section;
+  KapaGraphWidget *graph;
+
+  KiiScanMessage (sock, "%lf %lf %lf %lf", &xmin, &xmax, &ymin, &ymax);
+
+  graphic = GetGraphic();
+
+  section = GetActiveSection();
+  if (section->graph == NULL) {
+    section->graph = InitGraph ();
+    SetSectionSizes (section);
+  }
+  graph = section->graph;
+  
+  graph[0].axis[2].min = graph[0].axis[0].min = xmin;
+  graph[0].axis[2].max = graph[0].axis[0].max = xmax;
+  graph[0].axis[3].min = graph[0].axis[1].min = ymin; 
+  graph[0].axis[3].max = graph[0].axis[1].max = ymax;
+  
+  for (i = 0; i < graph[0].Nobjects; i++) {
+    graph[0].objects[i].x0 = xmin;
+    graph[0].objects[i].x1 = xmax;
+    graph[0].objects[i].y0 = ymin;
+    graph[0].objects[i].y1 = ymax;
+  }
+
+  if (USE_XWINDOW) XClearWindow (graphic->display, graphic->window);
+  Refresh (1);
+
+  return (TRUE);  
+}
+
+int GetLimits (int sock) {
+  
+  double dX, dY;
+  Section *section;
+  KapaGraphWidget *graph;
+
+  section = GetActiveSection();
+  graph = section->graph;
+
+  if (graph == NULL) {
+    dX = 0.0;
+    dY = 0.0;
+  } else {
+    dX = graph[0].axis[0].dfx;
+    dY = graph[0].axis[1].dfy;
+  }
+
+  KiiSendMessage (sock, "%8.1f %8.1f ", dX, dY);
+  
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetNormalHints.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetNormalHints.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetNormalHints.c	(revision 15879)
@@ -0,0 +1,28 @@
+# include "Ximage.h"
+
+/************** SetNormalHints  *************/
+void SetNormalHints (Graphic *graphic) {
+
+  XSizeHints *sizehints;
+
+  sizehints = XAllocSizeHints ();
+  if (sizehints == NULL) return;
+
+  sizehints[0].x = graphic->x;
+  sizehints[0].y = graphic->x;
+  sizehints[0].width = graphic->dx;
+  sizehints[0].height = graphic->dy;
+  sizehints[0].min_width = MIN_WIDTH;
+  sizehints[0].min_height = MIN_HEIGHT;    
+
+  // XXX : can we drop the position flag 
+  // sizehints[0].flags = USPosition | USSize | PMinSize;
+  sizehints[0].flags = USSize | PMinSize;
+
+  sizehints[0].base_width = graphic->dx;
+  sizehints[0].base_height = graphic->dy;
+  sizehints[0].flags |= PBaseSize;
+    
+  XSetWMNormalHints (graphic->display, graphic->window, sizehints);
+  XFree (sizehints);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetSection.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetSection.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetSection.c	(revision 15879)
@@ -0,0 +1,19 @@
+# include "Ximage.h"
+
+// set active section
+int SetSection (int sock) {
+  
+  int N;
+  char name[128];
+
+  KiiScanMessage (sock, "%s", name);
+  
+  N = GetSectionByName (name);
+  if (N < 0) {
+    fprintf (stderr, "section %s not found\n", name);
+    return (TRUE);
+  }
+
+  SetActiveSectionByNumber (N);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetToolbox.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetToolbox.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetToolbox.c	(revision 15879)
@@ -0,0 +1,33 @@
+# include "Ximage.h"
+
+// set the position of the image toolbox
+void SetToolbox (int sock) {
+
+  int location;
+  Section *section;
+  Graphic *graphic;
+
+  KiiScanMessage (sock, "%d", &location);
+  if ((location < 0) || (location > 4)) {
+    fprintf (stderr, "invalid toolbox location %d\n", location);
+    return;
+  }
+
+  graphic = GetGraphic ();
+  section = GetActiveSection();
+  if (section->image == NULL) { 
+    section->image = InitImage ();
+  }
+  section->image->location = location;
+  SetSectionSizes (section);
+
+  if (!USE_XWINDOW) return;
+
+  Remap (graphic, section->image, &section->image->matrix);
+  if (DEBUG) fprintf (stderr, "remapped image\n");
+  Refresh ();
+  if (DEBUG) fprintf (stderr, "refreshed\n");
+  XFlush (graphic->display);
+
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetUpGraphic.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetUpGraphic.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetUpGraphic.c	(revision 15879)
@@ -0,0 +1,63 @@
+# include "Ximage.h"
+# include "icons.h"
+
+static Graphic *graphic = NULL;
+
+/************** SetUpDisplay *************/
+void SetUpGraphic (int *argc, char **argv) {
+
+  Icon icon;
+  char *name;
+  int Ncolors;
+
+  ALLOCATE (graphic, Graphic, 1);
+  graphic->x  = 10;
+  graphic->y  = 10;
+  graphic->dx = 512;
+  graphic->dy = 512; 
+
+  if (!USE_XWINDOW) return;
+
+  name = CheckDisplayName (argc, argv);
+
+  graphic->display  = OpenDisplay     (name,    &graphic->screen);
+  graphic->colormap = DefaultColormap (graphic->display, graphic->screen);
+  graphic->depth    = DefaultDepth    (graphic->display, graphic->screen);
+  graphic->visual   = DefaultVisual   (graphic->display, graphic->screen);
+  if (name != NULL) free (name);
+
+  CheckVisual (graphic, argc, argv);
+  CheckColors (graphic, argc, argv);
+
+  icon.width = icon_width;
+  icon.height = icon_height;
+  icon.bits = icon_bits;
+
+  CheckGeometry (graphic, argc, argv);
+  TopWindow (graphic, &icon);
+  LoadFont (graphic, argc, argv, "fixed"); 
+
+  // FlushDisplay (graphic);
+  XSetWindowBackground (graphic->display, graphic->window, graphic->back);
+
+  SetNormalHints (graphic);
+  SetWMHints (graphic, &icon);
+
+  if (NAME_WINDOW == NULL) {
+    NameWindow (graphic, "Kapa");
+  } else {
+    ALLOCATE (name, char, strlen(NAME_WINDOW) + 10);
+    sprintf (name, "Kapa %s", NAME_WINDOW);
+    NameWindow (graphic, name);
+    free (name);
+  }
+
+  graphic->color = KapaX11colors (graphic->display, graphic->colormap, graphic->fore, &Ncolors);
+  if (MAP_WINDOW) MapWindow (graphic);
+  return;
+}
+
+Graphic *GetGraphic () {
+  return graphic;
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetWMHints.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetWMHints.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetWMHints.c	(revision 15879)
@@ -0,0 +1,23 @@
+# include "Ximage.h"
+
+/************** SetWMHints  *************/
+void SetWMHints (Graphic *graphic, Icon *icon) {
+
+  XWMHints *wmhints;
+
+  wmhints = XAllocWMHints ();
+  if (wmhints == NULL) return;
+
+  wmhints[0].initial_state = NormalState;
+  wmhints[0].input = True;
+  if (icon[0].pixmap != (Pixmap) None) {
+    wmhints[0].icon_pixmap = icon[0].pixmap;
+    wmhints[0].icon_mask = icon[0].pixmap;
+    wmhints[0].flags = StateHint | InputHint | IconPixmapHint | IconMaskHint;
+  } else {
+    wmhints[0].flags = StateHint | InputHint;
+  }
+    
+  XSetWMHints (graphic->display, graphic->window, wmhints);
+  XFree (wmhints);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/StatusBox.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/StatusBox.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/StatusBox.c	(revision 15879)
@@ -0,0 +1,21 @@
+# include "Ximage.h"
+
+void StatusBox (Graphic *graphic, KapaImageWidget *image) {
+
+  double  x, y, z;
+
+  if (image[0].MovePointer) {
+    x = 0.5*image[0].matrix.Naxis[0];
+    y = 0.5*image[0].matrix.Naxis[1];
+    z = -1;
+    image[0].x = x;
+    image[0].y = y;
+    image[0].z = z;
+  } else {
+    x = image[0].x;
+    y = image[0].y;
+    z = image[0].z;
+  }
+  
+  UpdateStatusBox (graphic, image, x, y, z, 1);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/TopWindow.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/TopWindow.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/TopWindow.c	(revision 15879)
@@ -0,0 +1,18 @@
+# include "Ximage.h"
+
+/************** TopWindow *************/
+void TopWindow (Graphic *graphic, Icon *icon) {
+
+  Window rootwindow;
+
+  rootwindow = RootWindow (graphic->display, graphic->screen);
+
+  CreateWindow (graphic, rootwindow, BORDER_WIDTH, EVENT_MASK);
+  MakeGC (graphic);
+
+  icon[0].pixmap = XCreateBitmapFromData (graphic->display, graphic->window, (char *) icon[0].bits, icon[0].width, icon[0].height);
+
+  MakeCursor (graphic, DEFAULT_CURSOR);
+  XFreeCursor (graphic->display, graphic->cursor);
+  // FlushDisplay (graphic);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/UpdatePointer.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/UpdatePointer.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/UpdatePointer.c	(revision 15879)
@@ -0,0 +1,64 @@
+# include "Ximage.h"
+# define FRAC(a) ((a) - (int)(a))
+
+int UpdatePointer (Graphic *graphic, XMotionEvent *event) {
+
+  int textpad;
+  double  x, y, z;
+  float *data;
+  char line[100];
+  Section *section;
+  KapaImageWidget *image;
+
+  // XXX select the window element which contains the event
+  section = GetActiveSection();
+  image   = section->image;
+  if (image == NULL) return (TRUE);
+  if (!image[0].location) return (TRUE);
+
+  if (image[0].MovePointer && InPicture ((XButtonEvent *)event, &image[0].picture)) {
+
+    data = (float *) image[0].matrix.buffer;
+    Screen_to_Image (&x, &y, (double)event[0].x, (double)event[0].y, image);
+
+    z = -1;
+    if (x < 0) goto skip;
+    if (x >= image[0].matrix.Naxis[0]) goto skip;
+    if (y < 0) goto skip;
+    if (y >= image[0].matrix.Naxis[1]) goto skip;
+    z = data[(int)(y)*image[0].matrix.Naxis[0] + (int)(x)];
+
+  skip:
+    image[0].x = x;
+    image[0].y = y;
+    image[0].z = z;
+    
+    UpdateStatusBox (graphic, image, x, y, z, 0);
+    XFlush (graphic[0].display);
+      
+    CreateZoom (image, graphic, x, y);  
+    XPutImage (graphic[0].display, graphic[0].window, graphic[0].gc,
+	       image[0].zoom.pix, 0, 0, 
+	       image[0].zoom.x, image[0].zoom.y, 
+	       image[0].zoom.dx, image[0].zoom.dy);
+    CrossHairs (graphic, image);
+    XFlush (graphic[0].display);
+  }
+  
+  if (InPicture ((XButtonEvent *)event, &image[0].cmapbar)) {
+    z = image[0].zero  + image[0].range * (event[0].x - image[0].cmapbar.x) / image[0].cmapbar.dx;
+    textpad = graphic[0].font[0].ascent;
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
+    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc,
+                  image[0].text_x + 1, image[0].text_y + 1, ZOOM_X - 2, textpad + PAD1 + 1);
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+    bzero (line, 100);
+    sprintf (line, "%22.3f", z);
+    XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 
+                 image[0].text_x + PAD1, image[0].text_y + textpad + PAD1, 
+		 line, strlen(line));
+    
+  }
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/UpdateStatusBox.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/UpdateStatusBox.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/UpdateStatusBox.c	(revision 15879)
@@ -0,0 +1,62 @@
+# include "Ximage.h"
+
+void UpdateStatusBox (Graphic *graphic, KapaImageWidget *image, double x, double y, double z, int mode) {
+
+  int textpad;
+  double ra, dec; 
+  char line[100];
+
+  XY_to_RD (&ra, &dec, x, y, &image[0].coords);
+
+  textpad = graphic[0].font[0].ascent;
+
+  if (mode) {
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
+    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc,
+		    image[0].text_x, image[0].text_y, image[0].text_dx, image[0].text_dy);  
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+    XDrawRectangle (graphic[0].display, graphic[0].window, graphic[0].gc,
+		    image[0].text_x, image[0].text_y, image[0].text_dx, image[0].text_dy);
+  
+    bzero (line, 100);
+    sprintf (line, "(%d x %d) @ %d                                         ", 
+	     image[0].picture.dx, image[0].picture.dy, image[0].expand); 
+    XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 
+		 image[0].text_x + PAD1, image[0].text_y + 4*textpad + 4*PAD1, line, 25);
+    
+    bzero (line, 100);
+    sprintf (line, "%-25s", image[0].file); 
+    XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 
+		 image[0].text_x + PAD1, image[0].text_y + 5*textpad + 5*PAD1, line, strlen(line));
+    
+    bzero (line, 100);
+    sprintf (line, "(%s)                                          ", image[0].name); 
+    XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 
+		 image[0].text_x + PAD1, image[0].text_y + 6*textpad + 6*PAD1, line, 25);
+    
+  } else {
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].back);
+    // XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].overlay_color[1]);
+    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc,
+		    image[0].text_x+1, image[0].text_y+1, image[0].text_dx-1, image[0].text_dyo-2);  
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].fore);
+  }
+  bzero (line, 100);
+  sprintf (line, "%22.3f", z);
+  XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	       image[0].text_x + PAD1, image[0].text_y + textpad + PAD1, line, strlen(line));
+  
+  bzero (line, 100);
+  sprintf (line, "%10.1f %10.1f", x, y);
+  XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	       image[0].text_x + PAD1, image[0].text_y + 2*textpad + 2*PAD1, line, strlen(line));
+  
+  bzero (line, 100);
+  if (image[0].DecimalDegrees) {
+    sprintf (line, "%10.6f %10.6f", ra, dec); 
+  } else {
+    hh_hms (line, ra, dec, ':');
+  }
+  XDrawString (graphic[0].display, graphic[0].window, graphic[0].gc, 
+	       image[0].text_x + PAD1, image[0].text_y + 3*textpad + 3*PAD1, line, strlen(line));
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/args.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/args.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/args.c	(revision 15879)
@@ -0,0 +1,40 @@
+# include "Ximage.h"
+
+int args (int *argc, char **argv) {
+
+  int N;
+
+  MAP_WINDOW = TRUE;
+  if ((N = get_argument (*argc, argv, "-nomap"))) {
+    remove_argument(N, argc, argv);
+    MAP_WINDOW = FALSE;
+  }
+
+  NAME_WINDOW = NULL;
+  if ((N = get_argument (*argc, argv, "-name"))) {
+    remove_argument(N, argc, argv);
+    NAME_WINDOW = strcreate (argv[N]);
+    remove_argument(N, argc, argv);
+  }
+
+  USE_XWINDOW = TRUE;
+  if ((N = get_argument (*argc, argv, "-noX"))) {
+    remove_argument(N, argc, argv);
+    USE_XWINDOW = FALSE;
+  }
+
+  if ((N = get_argument (*argc, argv, "-debug"))) {
+    remove_argument(N, argc, argv);
+    DEBUG = TRUE;
+  } else {
+    DEBUG = FALSE;
+  }
+
+  FOREGROUND = FALSE;
+  if ((N = get_argument (*argc, argv, "-fg"))) {
+    remove_argument(N, argc, argv);
+    FOREGROUND = TRUE;
+  }
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawFrame.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawFrame.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawFrame.c	(revision 15879)
@@ -0,0 +1,92 @@
+# include "Ximage.h"
+
+int bDrawFrame (KapaGraphWidget *graph) {
+  
+  int i, P, IsLabel, fontsize;
+  double fx, fy, dfx, dfy, range, major, minor, first, next;
+  char *fontname;
+
+  /* each axis is drawn independently */
+  fontname = GetRotFont (&fontsize);
+  for (i = 0; i < 4; i++) {
+    fx  = graph[0].axis[i].fx;
+    fy  = graph[0].axis[i].fy;
+    dfx = graph[0].axis[i].dfx;
+    dfy = graph[0].axis[i].dfy;
+    P = hypot ((double)graph[0].axis[(i+1)%2].dfx, (double)graph[0].axis[(i+1)%2].dfy);
+
+    if (graph[0].axis[i].isaxis) { 
+      bDrawLine (fx, fy, fx+dfx, fy+dfy); 
+    }
+    
+    if (graph[0].axis[i].areticks) {
+      if (isnan(graph[0].axis[i].min) || isinf(graph[0].axis[i].min)) continue;
+      if (isnan(graph[0].axis[i].max) || isinf(graph[0].axis[i].max)) continue;
+
+      range = graph[0].axis[i].max - graph[0].axis[i].min;
+
+      AxisTickScale (&graph[0].axis[i], &major, &minor);
+
+      first = minor*((int)(graph[0].axis[i].min/minor));
+      if ((range > 0) && (first < graph[0].axis[i].min)) {
+	first += minor;
+      }
+      if ((range < 0) && (first > graph[0].axis[i].min)) {
+	first -= minor;
+      }
+      for (next = first; ((range > 0) && (next <= graph[0].axis[i].max)) || ((range < 0) && (next >= graph[0].axis[i].max));) {
+	IsLabel = FALSE;
+	if ((fabs((int)(next/major) - (next/major)) < 0.5*(minor/major)) || 
+	    (fabs ((int)((next + 0.5*minor)/major) - (next/major)) < 0.5*(minor/major)) ||
+	    (fabs ((int)((next - 0.5*minor)/major) - (next/major)) < 0.5*(minor/major)))
+	  IsLabel = graph[0].axis[i].islabel;
+	bDrawTick (fx, fy, dfx, dfy, P, graph[0].axis[i].min, graph[0].axis[i].max, next, IsLabel, i);
+	if (range > 0) 
+	  next += minor;
+	else 
+	  next -= minor;
+      }
+    }
+  }
+  return (TRUE);
+}
+
+void bDrawTick (double fx, double fy, double dfx, double dfy, int P, double min, double max, double value, int mode, int naxis) {
+  
+  int pos, dir, fontsize;
+  double size, n, x, y, dx, dy;
+  char string[64], *fontname;
+
+  pos = size = 0;
+
+  if (mode == 1) { size = MAX (0.02, 7.0 / P); }
+  if (mode == 0) { size = MAX (0.01, 4.0 / P); }
+  
+  n = P / sqrt ((double)(dfx*dfx + dfy*dfy));
+  x = fx + (value-min)*dfx/(max - min);
+  y = fy + (value-min)*dfy/(max - min);
+
+  dir = +1;
+  if ((naxis == 0) || (naxis == 1)) dir *= -1;
+  dx = dir*size*dfy*n;	
+  dy = dir*size*dfx*n;
+  
+  bDrawLine (x, y, x+dx, y+dy);
+
+  if (mode == 1) {
+    fontname = GetRotFont (&fontsize);
+
+    /* temporarily assume rectilinear axes */
+    if (naxis == 0) { dx = 0; dy = -dir*(0.8*fontsize + 1); pos = 1; }
+    if (naxis == 2) { dx = 0; dy = -dir*(0.8*fontsize + 1); pos = 7; }
+
+    if (naxis == 1) { dy = 0; dx = -(0.8*fontsize + 1); pos = 3; }
+    if (naxis == 3) { dy = 0; dx = +(0.8*fontsize + 1); pos = 5; }
+
+    x = fx + (value-min)*dfx/(max - min) + dx;
+    y = fy + (value-min)*dfy/(max - min) + dy;
+    if (fabs(value) < 1e-14) { value = 0.0; }
+    sprintf (string, "%g", value);
+    bDrawRotText ((int)x, (int)y, string, pos, 0.0);
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawIt.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawIt.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawIt.c	(revision 15879)
@@ -0,0 +1,36 @@
+# include "Ximage.h"
+
+bDrawBuffer *bDrawIt () {
+
+  int i, Nsection;
+  bDrawBuffer *buffer;
+  bDrawColor black;
+  Graphic *graphic;
+  Section *section;
+
+  graphic = GetGraphic();
+
+  black = KapaColorByName ("black");
+
+  buffer = bDrawBufferCreate (graphic->dx, graphic->dy);
+  bDrawSetBuffer (buffer);
+  bDrawSetStyle (black, 0, 0);
+  
+  // reset the sizes for all sections
+  Nsection = GetNumberOfSections ();
+  for (i = 0; i < Nsection; i++) {
+      section = GetSectionByNumber (i);
+      bDrawGraph (section->graph);
+      // bDrawImage (section->image);
+  }
+
+  return (buffer);
+}
+
+void bDrawGraph (KapaGraphWidget *graph) {
+  if (graph == NULL) return;
+  bDrawFrame (graph); 
+  bDrawObjects (graph);
+  bDrawLabels (graph);
+  bDrawTextlines (graph);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawLabels.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawLabels.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawLabels.c	(revision 15879)
@@ -0,0 +1,65 @@
+# include "Ximage.h"
+  
+void bDrawLabels (KapaGraphWidget *graph) {
+  
+  int i, pos, x, y, size;
+  double angle;
+  char *fontname;
+
+  pos = 0;
+  fontname = GetRotFont (&size);
+  for (i = 0; i < 8; i++) {
+    if (strcmp (graph[0].label[i].text, "")) {
+      angle = 0;
+      switch (i) {
+      case 0: pos = 7; break;
+      case 1: pos = 1; angle = -90; break;
+      case 2: pos = 1; break;
+      case 3: pos = 1; angle =  90; break;
+      case 4: pos = 2; break;
+      case 5: pos = 0; break;
+      case 6: pos = 8; break;
+      case 7: pos = 6; break;
+      }	
+      x = graph[0].label[i].x;
+      y = graph[0].label[i].y;
+      SetRotFont (graph[0].label[i].font, graph[0].label[i].size); 
+      bDrawRotText (x, y, graph[0].label[i].text, pos, angle);
+    }
+  }
+  SetRotFont (fontname, size);
+}
+
+void bDrawTextlines (KapaGraphWidget *graph) {
+
+  int i, x, y, size;
+  double angle;
+  char *fontname;
+
+  fontname = GetRotFont (&size);
+  for (i = 0; i < graph[0].Ntextline; i++) {
+    if (strcmp (graph[0].textline[i].text, "")) {
+      angle = graph[0].textline[i].angle;
+      x = graph[0].textline[i].x;
+      y = graph[0].textline[i].y;
+      SetRotFont (graph[0].textline[i].font, graph[0].textline[i].size);
+      bDrawRotText (x, y, graph[0].textline[i].text, 5, angle);
+    }
+  }
+  SetRotFont (fontname, size);
+}
+
+/*
+            
+ 4____2___5 
+  |       | 
+  |       | 
+ 1|       |3
+  |       |
+  |       |
+  ---------
+  6   0   7
+
+*/
+
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawObjects.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawObjects.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawObjects.c	(revision 15879)
@@ -0,0 +1,574 @@
+# include "Ximage.h"
+
+# define DrawLine(X1,Y1,X2,Y2) (bDrawLine ((X1), (Y1), (X2), (Y2)))
+# define DrawCircle(X1,Y1,R) (bDrawCircle ((X1), (Y1), (R)))
+# define DrawRectangle(X,Y,dX,dY) (bDrawRectOpen ((X-0.5*dX), (Y-0.5*dY), (X+0.5*dX), (Y+0.5*dY)))
+# define FillRectangle(X,Y,dX,dY) (bDrawRectFill ((X-0.5*dX), (Y-0.5*dY), (X+0.5*dX), (Y+0.5*dY)))
+# define FillTriangle(X1,Y1,X2,Y2,X3,Y3) (bDrawTriFill ((X1), (Y1), (X2), (Y2), (X3), (Y3)))
+# define OpenTriangle(X1,Y1,X2,Y2,X3,Y3) (bDrawTriOpen ((X1), (Y1), (X2), (Y2), (X3), (Y3)))
+# define CONNECT 0
+# define HISTOGRAM 1
+# define POINTS 2
+
+static Graphic *graphic;
+
+int bDrawObjects (KapaGraphWidget *graph) {
+  
+  int i;
+  int type;
+  int weight;
+  bDrawColor color;
+  bDrawColor black;
+  
+  graphic = GetGraphic();
+
+  black = KapaColorByName ("black");
+  for (i = 0; i < graph[0].Nobjects; i++) {
+
+    weight = MAX (0, MIN (10, graph[0].objects[i].lweight));
+    type = graph[0].objects[i].ltype;    
+    color = graph[0].objects[i].color;
+    bDrawSetStyle (color, weight, type);
+
+    switch (graph[0].objects[i].style) {
+    case CONNECT: 
+      bDrawConnect (graph, &graph[0].objects[i]);
+      break;
+    case HISTOGRAM:
+      bDrawHistogram (graph, &graph[0].objects[i]);
+      break;
+    case POINTS:
+      bDrawPoints (graph, &graph[0].objects[i]);
+      break;
+    }
+
+    if (graph[0].objects[i].etype & 0x01) {
+      bDrawYErrors (graph, &graph[0].objects[i]);
+    }
+    if (graph[0].objects[i].etype & 0x02) {
+      bDrawXErrors (graph, &graph[0].objects[i]);
+    }
+  }
+  bDrawSetStyle (black, 0, 0);
+  return (TRUE);
+}
+
+void bDrawConnect (KapaGraphWidget *graph, Gobjects *object) {
+  
+  int i;
+  float *x, *y;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1;
+  double X0, X1, Y0, Y1;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0); 
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0); 
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  X0 = graph[0].axis[0].fx;
+  X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx;
+  Y0 = graph[0].axis[1].fy;
+  Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+
+  x = object[0].x; y = object[0].y;
+  for (i = 0; (i < object[0].Npts) && !(finite(x[i]) && finite(y[i])); i++);
+  if (i >= object[0].Npts) return;
+  sx0 = x[i]*mxi + y[i]*mxj + bx;
+  sy0 = x[i]*myi + y[i]*myj + by;
+  
+  for (i++; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]))) continue;
+    sx1 = x[i]*mxi + y[i]*mxj + bx;
+    sy1 = x[i]*myi + y[i]*myj + by;
+    bDrawClipLine (sx0, sy0, sx1, sy1, X0, Y0, X1, Y1);
+    sx0 = sx1; sy0 = sy1;
+  }
+}
+
+void bDrawClipLine (double x0, double y0, double x1, double y1, double X0, double Y1, double X1, double Y0) {
+
+  /* skip line segement if both points are beyond box */
+  if ((x0 <= X0) && (x1 <= X0)) return;
+  if ((x0 >= X1) && (x1 >= X1)) return;
+  if ((y0 <= Y0) && (y1 <= Y0)) return;
+  if ((y0 >= Y1) && (y1 >= Y1)) return;
+
+  /* replace x0,y0 if outside box */
+  if ((x0 < X0) && (x1 >= X0)) {
+    y0 = y0 + (X0 - x0)*(y1 - y0)/(x1 - x0);
+    x0 = X0;
+  }
+  if ((x0 > X1) && (x1 <= X1)) {
+    y0 = y0 + (X1 - x0)*(y1 - y0)/(x1 - x0);
+    x0 = X1;
+  }
+  if ((y0 < Y0) && (y1 >= Y0)) {
+    x0 = x0 + (Y0 - y0)*(x1 - x0)/(y1 - y0);
+    y0 = Y0;
+  }
+  if ((y0 > Y1) && (y1 <= Y1)) {
+    x0 = x0 + (Y1 - y0)*(x1 - x0)/(y1 - y0);
+    y0 = Y1;
+  }
+
+  /* skip line segement if both points are beyond box */
+  if ((x0 <= X0) && (x1 <= X0)) return;
+  if ((x0 >= X1) && (x1 >= X1)) return;
+  if ((y0 <= Y0) && (y1 <= Y0)) return;
+  if ((y0 >= Y1) && (y1 >= Y1)) return;
+
+  /* replace x1,y1 if outside box */
+  if ((x1 < X0) && (x0 >= X0)) {
+    y1 = y0 + (X0 - x0)*(y1 - y0)/(x1 - x0);
+    x1 = X0;
+  }
+  if ((x1 > X1) && (x0 <= X1)) {
+    y1 = y0 + (X1 - x0)*(y1 - y0)/(x1 - x0);
+    x1 = X1;
+  }
+  if ((y1 < Y0) && (y0 >= Y0)) {
+    x1 = x0 + (Y0 - y0)*(x1 - x0)/(y1 - y0);
+    y1 = Y0;
+  }
+  if ((y1 > Y1) && (y0 <= Y1)) {
+    x1 = x0 + (Y1 - y0)*(x1 - x0)/(y1 - y0);
+    y1 = Y1;
+  }
+  DrawLine (x0, y0, x1, y1);
+}
+
+/*******/
+void bDrawHistogram (KapaGraphWidget *graph, Gobjects *object) {
+
+  int i;
+  float *x, *y;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1, sxa;
+  double X0, X1, Y0, Y1;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0); 
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0); 
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  X0 = graph[0].axis[0].fx;
+  X1 = graph[0].axis[0].fx + graph[0].axis[0].dfx;
+  Y0 = graph[0].axis[1].fy;
+  Y1 = graph[0].axis[1].fy + graph[0].axis[1].dfy;
+
+  /* find the first valid datapoint */
+  x = object[0].x; y = object[0].y;
+  for (i = 0; (i < object[0].Npts) && !(finite(x[i]) && finite(y[i])); i++);
+  if (i >= object[0].Npts) return;
+  sx0 = x[i]*mxi + y[i]*mxj + bx;
+  sy0 = x[i]*myi + y[i]*myj + by;
+  sx0 = MIN (MAX (sx0, X0), X1);
+  sy0 = MAX (MIN (sy0, Y0), Y1);
+  
+  /* continue with rest of points */
+  for (i++; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]))) continue;
+    sx1 = x[i]*mxi + y[i]*mxj + bx;
+    sy1 = x[i]*myi + y[i]*myj + by;
+    sx1 = MIN (MAX (sx1, X0), X1);
+    sy1 = MAX (MIN (sy1, Y0), Y1);
+    sxa = 0.5*(sx0 + sx1);
+    DrawLine (sx0, sy0, sxa, sy0);
+    DrawLine (sxa, sy0, sxa, sy1);
+    DrawLine (sxa, sy1, sx1, sy1);
+    sx0 = sx1; sy0 = sy1;
+  }
+}
+
+/*******/
+void bDrawPoints (KapaGraphWidget *graph, Gobjects *object) {
+ 
+  int i;
+  float *x, *y, *z;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx, sy, d, sx1, sy1, sx2, sy2;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);  
+ 
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);  
+
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  /* below here, code is identical with DrawObjects */
+  /**** points are scaled by object.z ***/
+  if (object[0].size < 0) {
+    d = 0.5 * (graphic->dx + graphic->dy) * 0.01;
+    x = object[0].x; y = object[0].y; z = object[0].z;
+    if (object[0].ptype == 0) {	/* filled box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    FillRectangle (sx, sy, 2*d*z[i], 2*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 1) {	/* open box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawRectangle (sx, sy, 2*d*z[i], 2*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 2) { /* cross */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx - d*z[i], sy, sx + d*z[i], sy);
+	    DrawLine (sx, sy - d*z[i], sx, sy + d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 3) {	/* x */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx + d*z[i], sy - d*z[i], sx - d*z[i], sy + d*z[i]);
+	    DrawLine (sx - d*z[i], sy - d*z[i], sx + d*z[i], sy + d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 4) {	/* filled triangle */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    FillTriangle (sx - d*z[i], sy - 0.58*d*z[i], sx + d*z[i], sy - 0.58*d*z[i], sx, sy + 1.15*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 5) {	/* open triangle */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    OpenTriangle (sx - d*z[i], sy + 0.58*d*z[i], sx, sy - 1.15*d*z[i], sx + d*z[i], sy + 0.58*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 6) {	/* Y */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx, sy, sx - d*z[i], sy + 0.58*d*z[i]);
+	    DrawLine (sx, sy, sx + d*z[i], sy + 0.58*d*z[i]);
+	    DrawLine (sx, sy, sx,          sy - 1.15*d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 7) {	/* 0 */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawCircle (sx, sy, d*z[i]);
+	  }
+      }
+    }
+    if (object[0].ptype == 100) {	/* connect a pair of points */
+      for (i = 0; i + 1 < object[0].Npts; i+=2) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx1 = x[i]*mxi + y[i]*mxj + bx;
+	sy1 = x[i]*myi + y[i]*myj + by;
+	sx2 = x[i+1]*mxi + y[i+1]*mxj + bx;
+	sy2 = x[i+1]*myi + y[i+1]*myj + by;
+	DrawLine (sx1, sy1, sx2, sy2);
+      }
+    }
+  } else {
+    d = object[0].size * 0.5 * (graphic->dx + graphic->dy) * 0.003;
+    x = object[0].x; y = object[0].y;
+    if (object[0].ptype == 0) {	/* filled box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    FillRectangle (sx, sy, 2*d, 2*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 1) {		/* open box */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+   	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawRectangle (sx, sy, 2*d, 2*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 2) { /* cross */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx - d, sy, sx + d, sy);
+	    DrawLine (sx, sy - d, sx, sy + d);
+	  }
+      }
+    }
+    if (object[0].ptype == 3) {		/* x */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx + d, sy - d, sx - d, sy + d);
+	    DrawLine (sx - d, sy - d, sx + d, sy + d);
+	  }
+      }
+    }
+    if (object[0].ptype == 4) {	/* filled triangle */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    FillTriangle (sx - d, sy - 0.58*d, sx + d, sy - 0.58*d, sx, sy + 1.15*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 5) {	/* open triangle */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    OpenTriangle (sx - d, sy + 0.58*d, sx + d, sy + 0.58*d, sx, sy - 1.15*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 6) {	/* Y */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawLine (sx, sy, sx - d, sy - 0.58*d);
+	    DrawLine (sx, sy, sx + d, sy - 0.58*d);
+	    DrawLine (sx, sy, sx,     sy + 1.15*d);
+	  }
+      }
+    }
+    if (object[0].ptype == 7) {	/* 0 */
+      for (i = 0; i < object[0].Npts; i++) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx = x[i]*mxi + y[i]*mxj + bx;
+	sy = x[i]*myi + y[i]*myj + by;
+	if ((sx > graph[0].axis[0].fx) && (sx < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	    (sy < graph[0].axis[1].fy) && (sy > graph[0].axis[1].fy + graph[0].axis[1].dfy))
+	  {
+	    DrawCircle (sx, sy, d);
+	  }
+      }
+    }
+    if (object[0].ptype == 100) {	
+      for (i = 0; i + 1 < object[0].Npts; i+=2) {
+	if (!(finite(x[i]) && finite(y[i]))) continue;
+	sx1 = x[i]*mxi + y[i]*mxj + bx;
+	sy1 = x[i]*myi + y[i]*myj + by;
+	sx2 = x[i+1]*mxi + y[i+1]*mxj + bx;
+	sy2 = x[i+1]*myi + y[i+1]*myj + by;
+	DrawLine (sx1, sy1, sx2, sy2);
+      }
+    }
+  }
+}
+    
+/*******/
+void bDrawXErrors (KapaGraphWidget *graph, Gobjects *object) {
+  
+  int i, bar;
+  float *x, *y, *dxm, *dxp;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1, sz, sx10, sx11;
+
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  x = object[0].x; y = object[0].y; dxp = object[0].dxp; dxm = object[0].dxm; 
+  bar = object[0].ebar; sz = object[0].size*graph[0].axis[1].dfy*0.03;
+   
+  for (i = 0; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]) && finite(dxp[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = (x[i] + dxp[i])*mxi + y[i]*mxj + bx;
+    sy1 = (x[i] + dxp[i])*myi + y[i]*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sy1 - sz;
+	  sx11 = sy1 + sz;
+	  DrawLine (sx1, sx10, sx1, sx11);
+	}
+      }
+    if (!(finite(x[i]) && finite(y[i]) && finite(dxm[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = (x[i] - dxm[i])*mxi + y[i]*mxj + bx;
+    sy1 = (x[i] - dxm[i])*myi + y[i]*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sy1 - sz;
+	  sx11 = sy1 + sz;
+	  DrawLine (sx1, sx10, sx1, sx11);
+	}
+      }
+  }
+}
+    
+/*******/
+void bDrawYErrors (KapaGraphWidget *graph, Gobjects *object) {
+  
+  int i, bar;
+  float *x, *y, *dym, *dyp;
+  double mxi, mxj, myi, myj, bxi, bxj, byi, byj, bx, by;
+  double sx0, sy0, sx1, sy1, sz, sx10, sx11;
+  
+  mxi = graph[0].axis[0].dfx / (object[0].x1 - object[0].x0);
+  mxj = graph[0].axis[1].dfx / (object[0].y1 - object[0].y0);
+  myi = graph[0].axis[0].dfy / (object[0].x1 - object[0].x0);
+  myj = graph[0].axis[1].dfy / (object[0].y1 - object[0].y0);
+  
+  bxi  =  graph[0].axis[0].fx - object[0].x0*graph[0].axis[0].dfx/(object[0].x1 - object[0].x0);
+  bxj  =  -object[0].y0*graph[0].axis[1].dfx/(object[0].y1 - object[0].y0);
+  byi  =  -object[0].x0*graph[0].axis[0].dfy/(object[0].x1 - object[0].x0);
+  byj  =  graph[0].axis[1].fy - object[0].y0*graph[0].axis[1].dfy/(object[0].y1 - object[0].y0);
+  
+  bx = bxi + bxj;
+  by = byi + byj;
+  
+  x = object[0].x; y = object[0].y; dyp = object[0].dyp; dym = object[0].dym; 
+  bar = object[0].ebar; sz = object[0].size*graph[0].axis[0].dfx*0.03;
+  
+  for (i = 0; i < object[0].Npts; i++) {
+    if (!(finite(x[i]) && finite(y[i]) && finite(dyp[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = x[i]*mxi + (y[i] + dyp[i])*mxj + bx;
+    sy1 = x[i]*myi + (y[i] + dyp[i])*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sx1 - sz;
+	  sx11 = sx1 + sz;
+	  DrawLine (sx10, sy1, sx11, sy1);
+	}
+      }
+    if (!(finite(x[i]) && finite(y[i]) && finite(dym[i]))) continue;
+    sx0 = x[i]*mxi + y[i]*mxj + bx;
+    sy0 = x[i]*myi + y[i]*myj + by;
+    sx1 = x[i]*mxi + (y[i] - dym[i])*mxj + bx;
+    sy1 = x[i]*myi + (y[i] - dym[i])*myj + by;
+    if (((sx0 > graph[0].axis[0].fx) && (sx0 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy0 < graph[0].axis[1].fy) && (sy0 > graph[0].axis[1].fy + graph[0].axis[1].dfy)) ||
+	((sx1 > graph[0].axis[0].fx) && (sx1 < graph[0].axis[0].fx + graph[0].axis[0].dfx) &&
+	 (sy1 < graph[0].axis[1].fy) && (sy1 > graph[0].axis[1].fy + graph[0].axis[1].dfy)))
+      {
+	DrawLine (sx0, sy0, sx1, sy1);
+	if (bar) {
+	  sx10 = sx1 - sz;
+	  sx11 = sx1 + sz;
+	  DrawLine (sx10, sy1, sx11, sy1);
+	}
+      }
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawOverlay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawOverlay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/bDrawOverlay.c	(revision 15879)
@@ -0,0 +1,101 @@
+# include "Ximage.h"
+# define INFRONT 4
+
+static char name[4][16] = {"red", "green", "blue", "yellow"};
+
+void bDrawOverlay (KapaImageWidget *image, int N) {
+
+  int i;
+  int dX, dY, dx, dy;
+  int X, Y, Xmin, Ymin, Xmax, Ymax, Xrange, Yrange;
+  double expand, X0, Y0;
+  bDrawColor color;
+ 
+  /* translate color to bDrawColors : image[0].overlay[N].color */
+  color = KapaColorByName (name[N]);
+  bDrawSetStyle (color, 0, 0);
+  
+  expand = 1.0;
+  if (image[0].expand > 0) {
+    expand = 1 / (1.0*image[0].expand);
+  }
+  if (image[0].expand < 0) {
+    expand = fabs((double)image[0].expand);
+  }
+
+  Image_to_Screen (&X0, &Y0, 0.0, 0.0, image);
+  X0 -= image[0].picture.x;
+  Y0 -= image[0].picture.y;
+
+  Xmin = 0;
+  Ymin = 0;
+  Xmax = image[0].picture.dx;
+  Ymax = image[0].picture.dy;
+  Xrange = image[0].picture.dx;
+  Yrange = image[0].picture.dy;
+
+  for (i = 0; i < image[0].overlay[N].Nobjects; i++) {
+    if (N == INFRONT) {
+      X  = image[0].overlay[N].objects[i].x * Xrange;
+      Y  = image[0].overlay[N].objects[i].y * Yrange;
+      dX = image[0].overlay[N].objects[i].dx * Xrange;
+      dY = image[0].overlay[N].objects[i].dy * Yrange;
+    } else {
+      X  = image[0].overlay[N].objects[i].x/expand + X0;
+      Y =  image[0].overlay[N].objects[i].y/expand + Y0;
+      dX = image[0].overlay[N].objects[i].dx/expand;
+      dY = image[0].overlay[N].objects[i].dy/expand;
+    }
+    if ((X + dX < Xmin) || (X - dX > Xmax) ||
+	(Y + dY < Ymin) || (Y - dY > Ymax)) {
+      continue;
+    }
+
+    /* for a LINE, (x, y) is the start, (dx, dy) is the distance to end
+       for a CIRCLE (x, y) is the center, (dx, dy) is the radius 
+       for a BOX (x, y) is the center, (dx, dy) is the width */
+
+    switch (image[0].overlay[N].objects[i].type) {
+      case KII_OVERLAY_LINE:
+	bDrawLine (X, Y, (X+dX), (Y+dY));
+	break;
+      case KII_OVERLAY_TEXT:
+	bDrawRotText (X, Y, image[0].overlay[N].objects[i].text, 8, 0.0);
+	break;
+      case KII_OVERLAY_BOX:
+	dx = MAX (abs(dX),2) / 2;
+	dy = MAX (abs(dY),2) / 2;
+	bDrawRectOpen ((X-dx), (Y-dy), (X+dx), (Y+dy));
+	// bDrawRectOpen ((X-dx), (Y-dy), (X), (Y));
+	break;
+      case KII_OVERLAY_CIRCLE:
+	dx = MAX (abs(dX),2);
+	dy = MAX (abs(dY),2);
+	if (image[0].overlay[N].objects[i].angle == 0.0) {
+	  bDrawArc (X, Y, dx, dy, 0, 360);
+	} else {
+	  // very stupid rotate ellipse drawing:
+	  double x, y, t;
+	  double angle = image[0].overlay[N].objects[i].angle * RAD_DEG;
+	  double cs = cos(angle);
+	  double sn = sin(angle);
+	  // XXX dt should be based on the size of the ellipse...
+	  for (t = 0; t < 2*M_PI; t+=0.05) {
+	    x = X + dx*cos(t)*cs + dy*sin(t)*sn;
+	    y = Y - dx*cos(t)*sn + dy*sin(t)*cs;
+	    bDrawPoint (x, y);
+	  }
+	}
+	break;
+      default:
+	fprintf (stderr, "skipping unknown object\n");
+	break;
+    }
+  }
+  
+  /* translate color to bDrawColors : image[0].overlay[N].color */
+  bDrawSetStyle (color, 0, 0);
+}
+
+/* this routine is independent of the number of overlays */
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/hh_hms.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/hh_hms.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/hh_hms.c	(revision 15879)
@@ -0,0 +1,28 @@
+# include "Ximage.h"
+
+void hh_hms (char *line, double ra, double dec, char sep) {
+
+  int h, m, flag;
+  double s;
+  
+  ra /= 15.0;  /* convert from degrees to hours */
+  flag = SIGN(ra);
+  ra *= flag;
+  h = ra;
+  m = 60.000001*(ra - h);
+  s = 3600*(ra - h - m / 60.0);
+  if (flag > 0)
+    sprintf (line, " %02d%c%02d%c%04.1f  ", h, sep, m, sep, s);
+  else
+    sprintf (line, "-%02d%c%02d%c%04.1f  ", h, sep, m, sep, s);
+  
+  flag = SIGN(dec);
+  dec *= flag;
+  h = dec;
+  m = 60.000001*(dec - h);
+  s = 3600*(dec - h - m / 60.0);
+  if (flag > 0)
+    sprintf (&line[13], " %02d%c%02d%c%04.1f", h, sep, m, sep, s);
+  else
+    sprintf (&line[13], "-%02d%c%02d%c%04.1f", h, sep, m, sep, s);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/kapa.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/kapa.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/kapa.c	(revision 15879)
@@ -0,0 +1,14 @@
+# include "Ximage.h"
+
+int main (int argc, char **argv) {
+  
+  args (&argc, argv);
+
+  SetUpGraphic (&argc, argv);
+
+  InitLayout (argc, argv);
+  EventLoop ();
+
+  CloseDisplay ();
+  exit (0);
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/CheckTextLines.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/CheckTextLines.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/CheckTextLines.c	(revision 15879)
@@ -0,0 +1,28 @@
+# include "Ximage.h"
+
+/******** Here we test the TextLines specific to this program  ****
+TextLine *
+CheckTextLines (graphic, event, layout)
+Graphic         graphic[];
+XEvent          event[];
+Layout          layout[];
+{
+
+  TextLine *textline;
+  textline = (TextLine *) NULL;
+
+  if (InTextLine (graphic, event, &layout[0].zero))
+    textline = &layout[0].zero;
+  if (InTextLine (graphic, event, &layout[0].range))
+    textline = &layout[0].range;
+  if (InTextLine (graphic, event, &layout[0].effects))
+    textline = &layout[0].effects;
+  if (InTextLine (graphic, event, &layout[0].command))
+    textline = &layout[0].command;
+
+  return (textline);
+
+}
+
+
+***/
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DownArrow.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DownArrow.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DownArrow.c	(revision 15879)
@@ -0,0 +1,20 @@
+# include "Ximage"
+# include "ScrollBars.h"
+
+int 
+DownArrow (button_event, height, width, SB_x, SB_y)
+XButtonEvent *button_event;
+int height, width, SB_x, SB_y;
+{
+
+  int answer, m_x, m_y;
+
+  m_x = button_event -> x;
+  m_y = button_event -> y;
+  answer = ((m_y > (height - SB_y)) && 
+	    (m_x > (width - SB_y)));
+    return (answer);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DrawCursor.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DrawCursor.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DrawCursor.c	(revision 15879)
@@ -0,0 +1,45 @@
+# include "Ximage.h"
+# define XBorder 5
+# define YBorder 2
+
+
+
+DrawCursor (graphic, textline)    
+Graphic       graphic[];
+TextLine      textline[];
+{
+
+  int dx, label_width, DX, text_width, i;
+
+  label_width  = XTextWidth (graphic[0].font, 
+			     textline[0].label,
+			     strlen(textline[0].label));
+  
+  text_width  = XTextWidth (graphic[0].font, 
+			    textline[0].text,
+			    strlen(textline[0].text));
+
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].black);
+
+  if (label_width + text_width + 2*XBorder > textline[0].dx) {
+    DX = textline[0].dx - label_width - 2*XBorder - arrow_width;
+    for (i = 1; (i < strlen (textline[0].text)) && (text_width > DX); i++) {
+      text_width  = XTextWidth (graphic[0].font, 
+				&textline[0].text[i],
+				strlen(&textline[0].text[i]));
+    }
+    dx  = XTextWidth (graphic[0].font, &textline[0].text[i - 1], 
+		      textline[0].cursor - i + 1) + arrow_width;
+  }
+  else 
+    dx  = XTextWidth (graphic[0].font, textline[0].text, textline[0].cursor);
+
+  XDrawLine (graphic[0].display, 
+	     graphic[0].window, 
+	     graphic[0].gc, 
+	     textline[0].x + label_width + XBorder + dx, 
+	     textline[0].y + YBorder,
+	     textline[0].x + label_width + XBorder + dx, 
+	     textline[0].y + textline[0].dy - YBorder);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DrawTextBox.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DrawTextBox.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DrawTextBox.c	(revision 15879)
@@ -0,0 +1,63 @@
+# include "Ximage.h"
+# define XBorder 10
+# define YBorder 2
+# define arrow_width 6
+# define arrow_height 9
+static char arrow_bits[] = {
+  0x00, 0x02, 0x06, 0x0e, 0x1e, 0x0e, 0x06, 0x02, 0x00};
+#define down_width 9
+#define down_height 6
+static char down_bits[] = {
+   0x00, 0x00, 0xfe, 0x00, 0x7c, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00};
+
+/******************* DrawTextBox ****************/
+DrawTextBox (graphic, textbox)
+Graphic      graphic[];
+TextBox      textbox[];
+{
+
+  int X, Y, y, dy, Nlines, i;
+
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].white);
+  XFillRectangle (graphic[0].display, 
+		  graphic[0].window,
+		  graphic[0].gc,
+		  textbox[0].x  + 1,  textbox[0].y + 1,
+		  XBorder - 2, textbox[0].dy - 2);
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].black);
+  if (textbox[0].outline) {
+    XDrawRectangle (graphic[0].display, 
+		    graphic[0].window,
+		    graphic[0].gc,
+		    textbox[0].x,  textbox[0].y,
+		    textbox[0].dx, textbox[0].dy);
+  }
+
+  dy = graphic[0].font[0].ascent + graphic[0].font[0].descent;
+  Nlines = (textbox[0].dy - 2*YBorder) / dy;
+
+  for (i = 0; (i < Nlines) && (i < textbox[0].Nlines); i++) {
+    y = textbox[0].y + graphic[0].font[0].ascent + dy*i + YBorder;
+    XDrawString (graphic[0].display, 
+		 graphic[0].window, 
+		 graphic[0].gc, 
+		 textbox[0].x + XBorder, y,
+		 textbox[0].text[i], 
+		 strlen(textbox[0].text[i]));
+  }
+
+  if (Nlines < textbox[0].Nlines) {
+    DrawBitmap (graphic, 
+		textbox[0].x + textbox[0].dx - down_width - 2,
+		textbox[0].y + textbox[0].dy - down_height - 2,
+		down_width, down_height, down_bits, 1);
+  }
+
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].black);
+  if (textbox[0].cursor_line != -1) {
+    Y = textbox[0].y + dy*textbox[0].cursor_line + YBorder + (dy - arrow_height)/2;
+    X = textbox[0].x + (XBorder - arrow_width) / 2;
+    DrawBitmap (graphic, X, Y, arrow_width, arrow_height, arrow_bits, 1);
+  }
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DrawTextLine.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DrawTextLine.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/DrawTextLine.c	(revision 15879)
@@ -0,0 +1,34 @@
+# include "Ximage.h"
+# define XBorder 5
+# define YBorder 2
+
+DrawTextLine (graphic, textline)
+Graphic  graphic[];
+TextLine textline[];
+{
+
+  int y;
+
+  XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].black);
+  if (textline[0].outline) {
+    XDrawRectangle (graphic[0].display, 
+		    graphic[0].window,
+		    graphic[0].gc,
+		    textline[0].x,  textline[0].y,
+		    textline[0].dx, textline[0].dy);
+  }
+
+  y = textline[0].y + (textline[0].dy + graphic[0].font[0].ascent) / 2;
+  XDrawString (graphic[0].display, 
+	       graphic[0].window, 
+	       graphic[0].gc, 
+	       textline[0].x + XBorder, y,
+	       textline[0].label, 
+	       strlen(textline[0].label));
+  RedrawString (graphic, textline);
+
+  if (textline[0].cursor != -1)
+    DrawCursor (graphic, textline);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/InTextBox.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/InTextBox.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/InTextBox.c	(revision 15879)
@@ -0,0 +1,57 @@
+# include "Ximage.h"
+# define XBorder 10
+# define YBorder 2
+# define arrow_width 6
+# define arrow_height 9
+static char arrow_bits[] = {
+  0x00, 0x02, 0x06, 0x0e, 0x1e, 0x0e, 0x06, 0x02, 0x00};
+#define down_width 9
+#define down_height 6
+static char down_bits[] = {
+   0x00, 0x00, 0xfe, 0x00, 0x7c, 0x00, 0x38, 0x00, 0x10, 0x00, 0x00, 0x00};
+
+/******************* InTextBox ****************/
+int
+InTextBox (graphic, event, textbox)
+Graphic          graphic[];
+XButtonEvent    *event;
+TextBox          textbox[];
+{
+
+  int answer;
+  int i, x, y, Y, X, dy;
+  int minX, maxX, minY, maxY;
+  
+  x = event[0].x;
+  y = event[0].y;
+  dy = graphic[0].font[0].ascent + graphic[0].font[0].descent;
+  
+  minX = textbox[0].x;
+  maxX = textbox[0].x + textbox[0].dx;
+  minY = textbox[0].y;
+  maxY = textbox[0].y + textbox[0].dy;
+  if (dy*textbox[0].Nlines + 2*YBorder < textbox[0].dy)
+    maxY = textbox[0].y + dy*textbox[0].Nlines + 2*YBorder;
+
+  answer = ((x >= minX) && (x <= maxX) && (y >= minY) && (y <= maxY));
+  
+  /* find the cursor position, erase the old arrow and draw a new arrow */
+  if (answer) {
+    if (textbox[0].cursor_line != -1) {
+      Y = textbox[0].y + dy*textbox[0].cursor_line + YBorder + (dy - arrow_height)/2;
+      X = textbox[0].x + (XBorder - arrow_width) / 2;
+      DrawBitmap (graphic, X, Y, arrow_width, arrow_height, arrow_bits, 0);
+    }
+    textbox[0].cursor_line = (y - textbox[0].y - YBorder)/dy;
+    X = textbox[0].x + (XBorder - arrow_width) / 2;
+    Y = textbox[0].y + dy*textbox[0].cursor_line + YBorder + (dy - arrow_height)/2;
+    DrawBitmap (graphic, X, Y, arrow_width, arrow_height, arrow_bits, 1);
+    textbox[0].cursor_x = x;
+    textbox[0].cursor_y = y;
+    XFlush (graphic[0].display);
+  }
+  
+  return (answer);
+  
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/InTextLine.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/InTextLine.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/InTextLine.c	(revision 15879)
@@ -0,0 +1,58 @@
+# include "Ximage.h"
+# define XBorder 5
+# define YBorder 2
+
+int
+InTextLine (graphic, event, textline)
+Graphic          graphic[];
+XButtonEvent    *event;
+TextLine         textline[];
+{
+
+  int answer, done;
+  int i, x, dx, y, text_width, label_width;
+  int minX, maxX, minY, maxY;
+  char testline[1000];
+
+  x = event[0].x;
+  y = event[0].y;
+  
+  label_width  = XTextWidth (graphic[0].font, 
+			     textline[0].label,
+			     strlen(textline[0].label));
+  
+  minX = textline[0].x + XBorder + label_width;
+  maxX = textline[0].x + textline[0].dx;
+  minY = textline[0].y;
+  maxY = textline[0].y + textline[0].dy;
+
+  answer = ((x >= minX) && (x <= maxX) && (y >= minY) && (y <= maxY));
+
+  /* find the cursor position and draw a vertical bar */
+  if (answer) {
+    text_width  = XTextWidth (graphic[0].font, 
+			      textline[0].text,
+			      strlen(textline[0].text));
+    
+    if (x >= minX + text_width) {
+      textline[0].cursor = strlen (textline[0].text);
+    }
+    else {
+      for (i = 1, done = FALSE; (i <= strlen (textline[0].text)) && !done; i++) {
+	dx  = XTextWidth (graphic[0].font, 
+			  textline[0].text, i);
+	if (x < minX + dx) {
+	  textline[0].cursor = i - 1;
+	  done = TRUE;
+	}
+      }
+    }
+    DrawCursor (graphic, textline);
+  }    
+  XFlush (graphic[0].display);
+  
+  return (answer);
+  
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/LeftArrow.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/LeftArrow.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/LeftArrow.c	(revision 15879)
@@ -0,0 +1,18 @@
+# include "Ximage"
+# include "ScrollBars.h"
+
+int
+LeftArrow (button_event, height, width, SB_x, SB_y) 
+XButtonEvent *button_event;
+int height, width, SB_x, SB_y;
+{
+
+  int answer, m_x, m_y;
+
+  m_x = button_event -> x;
+  m_y = button_event -> y;
+  answer = ((m_x < SB_x) && (m_y < SB_x));
+  return (answer);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/RedrawString.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/RedrawString.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/RedrawString.c	(revision 15879)
@@ -0,0 +1,73 @@
+# include "Ximage.h"
+# define XBorder 5
+# define YBorder 2
+
+
+#define arrow_width 6
+#define arrow_height 9
+RedrawString (graphic, textline)
+Graphic       graphic[];
+TextLine      textline[];
+{
+
+  int label_width, text_width, y, i, DX;
+  static char arrow_bits[] = {
+    0x00, 0x10, 0x18, 0x1c, 0x1e, 0x1c, 0x18, 0x10, 0x00};
+  
+  label_width  = XTextWidth (graphic[0].font, 
+			     textline[0].label,
+			     strlen(textline[0].label));
+  
+  text_width  = XTextWidth (graphic[0].font, 
+			    textline[0].text,
+			    strlen(textline[0].text));
+
+  if (label_width + text_width + 2*XBorder > textline[0].dx) {
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].white);
+    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc, 
+		    textline[0].x + XBorder + label_width, 
+		    textline[0].y + YBorder, 
+		    textline[0].dx - XBorder - label_width, 
+		    textline[0].dy - 2*YBorder + 1);
+    
+    DX = textline[0].dx - label_width - 2*XBorder - arrow_width;
+    for (i = 1; (i < strlen (textline[0].text)) && (text_width > DX); i++) {
+      text_width  = XTextWidth (graphic[0].font, 
+				&textline[0].text[i],
+				strlen(&textline[0].text[i]));
+    }
+
+    y = textline[0].y + (textline[0].dy + graphic[0].font[0].ascent) / 2;
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].black);
+    DrawBitmap (graphic, 
+		textline[0].x + XBorder + label_width,
+		textline[0].y + YBorder + (textline[0].dy - arrow_height)/2,
+		arrow_width, arrow_height, arrow_bits, 1);
+    XDrawString (graphic[0].display, 
+		 graphic[0].window, 
+		 graphic[0].gc, 
+		 textline[0].x + XBorder + label_width + arrow_width, y,
+		 &textline[0].text[i - 1], 
+		 strlen(&textline[0].text[i - 1]));
+    XFlush (graphic[0].display);
+  }
+  else {
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].white);
+    XFillRectangle (graphic[0].display, graphic[0].window, graphic[0].gc, 
+		    textline[0].x + XBorder + label_width, 
+		    textline[0].y + YBorder, 
+		    textline[0].dx - XBorder - label_width, 
+		    textline[0].dy - 2*YBorder + 1);
+    
+    y = textline[0].y + (textline[0].dy + graphic[0].font[0].ascent) / 2;
+    
+    XSetForeground (graphic[0].display, graphic[0].gc, graphic[0].black);
+    XDrawString (graphic[0].display, 
+		 graphic[0].window, 
+		 graphic[0].gc, 
+		 textline[0].x + XBorder + label_width, y,
+		 textline[0].text, 
+		 strlen(textline[0].text));
+  }
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/RightArrow.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/RightArrow.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/RightArrow.c	(revision 15879)
@@ -0,0 +1,20 @@
+# include "Ximage"
+# include "ScrollBars.h"
+
+int
+RightArrow (button_event, height, width, SB_x, SB_y) 
+XButtonEvent *button_event;
+int height, width, SB_x, SB_y;
+{
+
+  int answer, m_x, m_y;
+
+  m_x = button_event -> x;
+  m_y = button_event -> y;
+  answer = ((m_x < SB_x) && 
+	    (m_y > (height - SB_x - SB_y)) && 
+	    (m_y < (height - SB_y)));
+  return (answer);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/TextLineEntry.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/TextLineEntry.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/TextLineEntry.c	(revision 15879)
@@ -0,0 +1,81 @@
+# include "Ximage.h"
+# define XBorder 5
+# define YBorder 2
+
+int 
+TextLineEntry (graphic, textline, keyevent)
+Graphic        graphic[];
+TextLine       textline[];
+XKeyEvent     *keyevent;
+{
+
+  int i, status, N;
+  char dummy[3];
+  XComposeStatus compose_status;
+  KeySym keysym;
+
+  status = TRUE;
+  strcpy (textline[0].old_text, textline[0].text);
+  bzero (&textline[0].text[strlen(textline[0].text)], 
+	 1024 - strlen(textline[0].text));
+  i = textline[0].cursor;
+
+
+  N = XLookupString (keyevent, dummy, 1, &keysym, &compose_status);
+  switch (keysym) {
+  case XK_BackSpace:
+  case XK_Delete:
+    if (textline[0].cursor > 0) {
+      bcopy (&textline[0].text[i], &textline[0].text[i - 1], 
+	     strlen(&textline[0].text[i]) + 1);
+      RedrawString (graphic, textline);
+      textline[0].cursor --;
+      DrawCursor (graphic, textline);
+    }
+    break;
+  case XK_Left:
+    RedrawString (graphic, textline);
+    textline[0].cursor --;
+    if (textline[0].cursor < 0)
+      textline[0].cursor = 0;
+    DrawCursor (graphic, textline);
+    break;
+  case XK_Right:
+    RedrawString (graphic, textline);
+    textline[0].cursor ++;
+    if (textline[0].cursor > strlen (textline[0].text))
+      textline[0].cursor = strlen (textline[0].text);
+    DrawCursor (graphic, textline);
+    break;
+  case XK_Return:
+    RedrawString (graphic, textline);
+    textline[0].cursor = -1;
+    status = FALSE;
+    break;
+  case XK_d:
+  case XK_D: 
+    if (dummy[0] == 4) { /* a control-d was typed! */
+      if (textline[0].cursor < strlen(textline[0].text)) {
+	bcopy (&textline[0].text[i + 1], &textline[0].text[i], 
+	       strlen(&textline[0].text[i]));
+	RedrawString (graphic, textline);
+	DrawCursor (graphic, textline);
+      }
+      break;  /* WARNING: this case MUST come before default.
+		 anything between this and default will be executed
+		 if no cntl-d is typed! */
+    }
+  default:
+    if (N != 0) {
+      bcopy (&textline[0].text[i], &textline[0].text[i + 1], 
+	     strlen(&textline[0].text[i]));
+      textline[0].text[i] = dummy[0];
+      RedrawString (graphic, textline);
+      textline[0].cursor ++;
+      DrawCursor (graphic, textline);
+    }
+  }
+  return (status);
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/UpArrow.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/UpArrow.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/UpArrow.c	(revision 15879)
@@ -0,0 +1,20 @@
+# include "Ximage"
+# include "ScrollBars.h"
+
+int
+UpArrow (button_event, height, width, SB_x, SB_y) 
+XButtonEvent *button_event;
+int height, width, SB_x, SB_y;
+{
+
+  int answer, m_x, m_y;
+
+  m_x = button_event -> x;
+  m_y = button_event -> y;
+  answer = ((m_y > (height - SB_y)) && 
+	    (m_x > SB_x) && 
+	    (m_x < (SB_x + SB_y)));
+  return (answer);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/xScrollBar.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/xScrollBar.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/xScrollBar.c	(revision 15879)
@@ -0,0 +1,26 @@
+# include "Ximage"
+# include "ScrollBars.h"
+
+int 
+xScrollBar (button_event, height, width, SB_x, SB_y, f)
+XButtonEvent *button_event;
+int height, width, SB_x, SB_y;
+double *f;
+{
+
+  int answer, m_x, m_y;
+  double f1, f2;
+
+  m_x = button_event -> x;
+  m_y = button_event -> y;
+  answer = ((m_x < SB_x) && 
+	    (m_y > SB_x) && 
+	    (m_y < (height - SB_x - SB_y)));
+  f1 = (double)(m_y - SB_x);
+  f2 = (double)(height - 2*SB_x - SB_y);
+  *f = f1 / f2;
+  return (answer);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/yScrollBar.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/yScrollBar.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/textbox/yScrollBar.c	(revision 15879)
@@ -0,0 +1,26 @@
+# include "Ximage"
+# include "ScrollBars.h"
+
+int
+yScrollBar (button_event, height, width, SB_x, SB_y, f)
+XButtonEvent *button_event;
+int height, width, SB_x, SB_y;
+double *f;
+{
+
+  int answer, m_x, m_y;
+  double f1, f2;
+
+  m_x = button_event -> x;
+  m_y = button_event -> y;
+  answer = ((m_y > (height - SB_y)) && 
+	    (m_x > (SB_x + SB_y)) && 
+	    (m_x < (width - SB_y)));
+  f1 = (double)(m_x - SB_x - SB_y);
+  f2 = (double)(width - 2*SB_y - SB_x);
+  *f = f1 / f2;
+  return (answer);
+
+}
+
+	
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/.cvsignore
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/.cvsignore	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/.cvsignore	(revision 15879)
@@ -0,0 +1,1 @@
+lib
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/Makefile	(revision 15879)
@@ -0,0 +1,48 @@
+default: install
+help:
+	@echo "make options: install libkapa clean dist"
+
+include ../../Makefile.System
+HOME 	=	$(ROOT)/src/libkapa
+LIB	= 	$(HOME)/lib
+SRC	=	$(HOME)/src
+MAN	=	$(HOME)/doc
+INC	=	$(HOME)/include
+include ../../Makefile.Common
+
+# programs may add their own internal requirements here
+FULL_CFLAGS   = $(BASE_CFLAGS) -fPIC
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(BASE_LDFLAGS)
+
+install: $(DESTINC)/kapa.h $(DESTLIB)/libkapa.a $(DESTLIB)/libkapa.$(DLLTYPE)
+libkapa: $(LIB)/libkapa.$(ARCH).a $(LIB)/libkapa.$(ARCH).$(DLLTYPE)
+
+INCS = $(DESTINC)/kapa.h
+
+OBJS = \
+$(SRC)/IOfuncs.$(ARCH).o  \
+$(SRC)/KiiPicture.$(ARCH).o \
+$(SRC)/KiiOpen.$(ARCH).o \
+$(SRC)/KiiOverlay.$(ARCH).o \
+$(SRC)/KiiCursor.$(ARCH).o \
+$(SRC)/KiiConvert.$(ARCH).o \
+$(SRC)/KapaWindow.$(ARCH).o \
+$(SRC)/KapaColors.$(ARCH).o \
+$(SRC)/KapaOpen.$(ARCH).o
+
+DRAW = \
+$(SRC)/bDrawFuncs.$(ARCH).o     \
+$(SRC)/bDrawRotFont.$(ARCH).o   \
+$(SRC)/RotFont.$(ARCH).o        \
+$(SRC)/DrawRotString.$(ARCH).o  \
+$(SRC)/PSRotFont.$(ARCH).o
+
+$(OBJS): $(INCS)
+$(DRAW): $(INCS)
+
+$(LIB)/libkapa.$(ARCH).a: $(OBJS) $(DRAW)
+$(LIB)/libkapa.$(ARCH).$(DLLTYPE): $(OBJS) $(DRAW)
+
+$(DESTLIB)/libkapa.a:  $(LIB)/libkapa.$(ARCH).a  
+$(DESTLIB)/libkapa.$(DLLTYPE): $(LIB)/libkapa.$(ARCH).$(DLLTYPE)
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/doc/ChangeLog.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/doc/ChangeLog.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/doc/ChangeLog.txt	(revision 15879)
@@ -0,0 +1,12 @@
+
+- libkapa 1.2 : 2006.08.23
+  * added KapaInitGraph
+  * added KapaColorName
+  * added KapaPrepPlot
+  * added KapaPlotVector
+
+- libkapa 1.1
+  * added bDrawCircleSingle to fix circles with weight
+  * fixed format of textline data message
+
+
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/doc/api.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/doc/api.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/doc/api.txt	(revision 15879)
@@ -0,0 +1,37 @@
+
+COMM | Kapa Function  	| libkapa file  | libkapa API 
+-----------------------------------------------------
+DBOX | LoadFrame      	| KapaWindow.c  | KapaBox
+ERSP | ErasePlots       | KapaWindow.c  | KapaClearPlots
+ERSS | EraseSections    | KapaWindow.c  | KapaClearSections
+ERSI | EraseImage       | KapaWindow.c  | KapaClearImage
+ERSC | EraseCurrentPlot | KapaWindow.c  | KapaClearCurrentPlot
+LSEC | ListSection    	| KapaWindow.c  | KapaGetSection
+PNGF | PNGit          	| KiiConvert.c  | KapaPNG
+PPMF | PPMit          	| KiiConvert.c  | KapaPPM
+PLOT | LoadObject     	| KapaWindow.c  | KapaPrepPlot
+SSEC | SetSection     	| KapaWindow.c  | KapaSelectSection
+LABL | LoadLabels     	| KapaWindow.c  | KapaSendLabel
+PTXT | LoadTextlines  	| KapaWindow.c  | KapaSendTextline
+FONT | SetFont        	| KapaWindow.c  | KapaSetFont
+SLIM | SetLimits      	| KapaWindow.c  | KapaSetLimits
+DSEC | DefineSection  	| KapaWindow.c  | KapaSetSection
+MSEC | MoveSection  	| KapaWindow.c  | KapaMoveSection
+CENT | Center           | KapaWindow.c  | KiiCenter
+QUIT | Quit           	| KiiOpen.c     | KiiClose
+NCUR | !ACTIVE_CURSOR 	| KiiCursor.c   | KiiCursorOff
+CURS | +ACTIVE_CURSOR 	| KiiCursor.c   | KiiCursorOn
+ERSO | EraseOverlay     | KiiOverlay.c  | KiiEraseOverlay
+JPEG | JPEGit24         | KiiConvert.c  | KiiJPEG
+LOAD | LoadOverlay      | KiiOverlay.c  | KiiLoadOverlay
+READ | LoadPicture      | KiiPicture.c  | KiiNewPicture1D
+READ | LoadPicture      | KiiPicture.c  | KiiNewPicture2D
+PSIT | PScommand      	| KiiConvert.c  | KiiPS
+RSIZ | Resize         	| KapaWindow.c  | KiiResize
+SAVE | SaveOverlay      | KiiOverlay.c  | KiiSaveOverlay
+CSVE | CSaveOverlay     | KiiOverlay.c  | KiiSaveOverlay
+SLIM | GetLimits      	| KapaWindow.c  | KapaGetLimits
+SSTY | SetGraphData	| KapaWindow.c 	| KapaSetGraphData
+GSTY | GetGraphData	| KapaWindow.c 	| KapaGetGraphData
+SIMD | SetImageData	| KapaWindow.c 	| KapaSetImageData
+GIMD | GetImageData	| KapaWindow.c 	| KapaGetImageData
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/doc/notes.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/doc/notes.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/doc/notes.txt	(revision 15879)
@@ -0,0 +1,31 @@
+
+KII library functions:
+
+KiiOpen ()
+KiiClose ()
+KiiNewPicture ()
+KiiLoadOverlay ()
+KiiLoadTickmarks ()
+KiiEraseOverlay ()
+KiiSaveOverlay ()
+KiiPS
+KiiJPEG
+KiiResize 
+
+
+-----------------------
+
+KapaOpen ()
+KapaClose
+KapaPS
+KapaPNG
+KapaPPM
+KapaResize
+KapaLoadObject
+KapaSetLimits
+KapaLoadLabels
+KapaSetSection
+KapaLoadText
+KapaSetFont
+KapaErase
+KapaLoadBox
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/include/alphabet.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/include/alphabet.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/include/alphabet.h	(revision 15879)
@@ -0,0 +1,53 @@
+# include "../rotfont/times8.h"
+# include "../rotfont/times12.h"
+# include "../rotfont/times14.h"
+# include "../rotfont/times18.h"
+# include "../rotfont/times24.h"
+
+# include "../rotfont/courier8.h"
+# include "../rotfont/courier12.h"
+# include "../rotfont/courier14.h"
+# include "../rotfont/courier18.h"
+# include "../rotfont/courier24.h"
+
+# include "../rotfont/helvetica8.h"
+# include "../rotfont/helvetica12.h"
+# include "../rotfont/helvetica14.h"
+# include "../rotfont/helvetica18.h"
+# include "../rotfont/helvetica24.h"
+
+# include "../rotfont/symbol8.h"
+# include "../rotfont/symbol12.h"
+# include "../rotfont/symbol14.h"
+# include "../rotfont/symbol18.h"
+# include "../rotfont/symbol24.h"
+
+# define DEFFONT 1
+static FontSet HardwiredFonts[] = {
+  {times8font,  "times", 8},
+  {times12font, "times", 12},
+  {times14font, "times", 14},
+  {times18font, "times", 18},
+  {times24font, "times", 24},
+  
+  {courier8font,  "courier", 8},
+  {courier12font, "courier", 12},
+  {courier14font, "courier", 14},
+  {courier18font, "courier", 18},
+  {courier24font, "courier", 24},
+  
+  {helvetica8font,  "helvetica", 8},
+  {helvetica12font, "helvetica", 12},
+  {helvetica14font, "helvetica", 14},
+  {helvetica18font, "helvetica", 18},
+  {helvetica24font, "helvetica", 24},
+  
+  {symbol8font,  "symbol", 8},
+  {symbol12font, "symbol", 12},
+  {symbol14font, "symbol", 14},
+  {symbol18font, "symbol", 18},
+  {symbol24font, "symbol", 24}
+};
+
+/* put these as static in RotFont.c with accessor functions */
+# define NROT 256
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/include/kapa.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/include/kapa.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/include/kapa.h	(revision 15879)
@@ -0,0 +1,260 @@
+# ifndef KAPA_H
+# define KAPA_H
+
+/* linux is happy with this, not solaris */
+# include <netinet/ip.h>
+# include <netdb.h>
+# include <arpa/inet.h>
+
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <X11/Xlib.h>
+# include <png.h>
+# include <dvo.h>
+
+typedef struct sockaddr_in KapaSockAddress;
+
+typedef struct {
+  float *data1d;
+  float **data2d;
+  int Nx;
+  int Ny;
+} KiiImage;
+
+typedef struct {
+  float x;
+  float y;
+  float dx;
+  float dy;
+  float angle;
+  int type;
+} KiiOverlayBase;
+
+typedef struct {
+  float x;
+  float y;
+  float dx;
+  float dy;
+  float angle;
+  int type;
+  char *text;
+} KiiOverlay;
+
+typedef enum {
+  KII_OVERLAY_NONE, 
+  KII_OVERLAY_TEXT, 
+  KII_OVERLAY_BOX, 
+  KII_OVERLAY_LINE,
+  KII_OVERLAY_CIRCLE
+} KiiOverlayType;
+
+typedef enum {
+  KAPA_LABEL_XM,
+  KAPA_LABEL_YM,
+  KAPA_LABEL_XP,
+  KAPA_LABEL_YP,
+  KAPA_LABEL_UL,
+  KAPA_LABEL_UR,
+  KAPA_LABEL_LL,
+  KAPA_LABEL_LR,
+} KapaLabelType;
+
+typedef enum {
+  KAPA_PS_NEWPLOT,
+  KAPA_PS_NEWPAGE,
+  KAPA_PS_RAWPAGE
+} KapaPSmode;
+
+typedef struct {
+  char *name;
+  float x;
+  float y;
+  float dx;
+  float dy;
+} KapaSection;
+
+typedef struct {
+  double xmin, xmax, ymin, ymax;
+  int style, ptype, ltype, etype, ebar, color;
+  double lweight, size;
+  Coords coords;
+  int flipeast, flipnorth;
+  char axis[8], labels[8], ticks[8];
+} Graphdata;
+
+typedef struct {
+  int logflux;
+  double zero, range;
+  char name[1024];
+  char file[1024];
+} KapaImageData;
+
+typedef struct {
+  int dx, dy, ascent;
+  unsigned char *bits;
+} RotFont;
+
+typedef struct {
+  RotFont *font;
+  char name[64];
+  int size;
+} FontSet;
+
+typedef png_byte bDrawColor;
+
+typedef struct {
+  int Nx, Ny;
+  bDrawColor **pixels;
+} bDrawBuffer;
+
+/* IOfuncs.c */
+int KiiSendMessage (int device, char *format, ...);
+int KiiScanMessage (int device, char *format, ...);
+int KiiSendCommand (int device, int length, char *format, ...);
+int KiiSendCommandV (int device, int length, char *format, va_list argp);
+int KiiScanCommand (int device, int length, char *format, ...);
+int KiiSendData (int device, char *data, int Nbytes);
+char *KiiRecvData (int device);
+int KiiWaitAnswer (int device, char *expect);
+
+/* KiiOpen.c */
+int KiiOpen (char *kii_exec, char *name);
+int KiiClose (int socket);
+int KiiWait (char *sockpath);
+
+/* KiiPicture.c */
+int KiiNewPicture1D (int fd, KiiImage *image, KapaImageData *data, Coords *coords);
+int KiiNewPicture2D (int fd, KiiImage *image, KapaImageData *data, Coords *coords);
+
+int KapaSetImageCoords (int fd, Coords *coords);
+int KapaGetImageCoords (int fd, Coords *coords);
+int KapaGetImageRange (int fd, double *Xmin, double *Xmax, double *Ymin, double *Ymax);
+
+/* KiiOverlay.c */
+int KiiSelectOverlay (char *name, int *number);
+int KiiLoadOverlay (int fd, KiiOverlay *overlay, int Noverlay, char *name);
+int KiiEraseOverlay (int fd, char *name);
+int KiiSaveOverlay (int fd, int celestial, char *name, char *file);
+int KiiOverlayTypeByName (char *name);
+char *KiiOverlayTypeByNumber (int n);
+
+/* KiiConvert.c */
+int KiiPS (int fd, const char *filename, int scaleMode, int pageMode, char *pagename);
+int KiiJPEG (int fd, const char *filename);
+int KapaPNG (int fd, const char *filename);
+int KapaPPM (int fd, const char *filename);
+
+/* KiiCursor.c */
+int KiiCursorOn (int fd);
+int KiiCursorOff (int fd);
+int KiiCursorRead (int fd, double *x, double *y, double *z, double *r, double *d, char *key);
+
+/* KapaWindow.c */
+int KiiResize (int fd, int Nx, int Ny);
+int KiiCenter (int fd, double x, double y, int zoom);
+int KapaBox (int fd, Graphdata *graphdata);
+int KapaClearCurrentPlot (int fd);
+int KapaClearPlots (int fd);
+int KapaClearSections (int fd);
+int KapaClearImage (int fd);
+int KapaInitGraph (Graphdata *graphdata);
+int KapaPrepPlot (int fd, int Npts, Graphdata *graphmode);
+int KapaPlotVector (int fd, int Npts, float *values, char *type);
+int KapaSetFont (int fd, char *name, int size);
+int KapaSendLabel (int fd, char *string, int mode);
+int KapaSendTextline (int fd, char *string, float x, float y, float angle);
+int KapaSetLimits (int fd, Graphdata *graphmode);
+int KapaGetLimits (int fd, float *dx, float *dy);
+int KapaSetSection (int fd, KapaSection *section);
+int KapaSelectSection (int fd, char *name);
+int KapaGetSection (int fd, char *name);
+int KapaMoveSection (int fd, char *name, char *direction);
+int KapaSetGraphData (int fd, Graphdata *graphmode);
+int KapaGetGraphData (int fd, Graphdata *graphmode);
+int KapaSetImageData (int fd, KapaImageData *graphmode);
+int KapaGetImageData (int fd, KapaImageData *graphmode);
+int KapaSetToolbox (int fd, int location);
+
+/* KapaColors */
+int KapaColorByName (char *name);
+int KapaColormapSize ();
+char *KapaColorRGBString (int N);
+char *KapaColorName (int N);
+png_color *KapaPNGPalette (int *Npalette);
+unsigned long *KapaX11colors (Display *display, Colormap colormap, unsigned long default_color, int *Ncolors);
+
+/* RotFont.c */
+void InitRotFonts PROTO(());
+int SetRotFont PROTO((char *name, int size));
+char *GetRotFont PROTO((int *size));
+RotFont *GetRotFontData (double *scale);
+int RotStrlen PROTO((char *c));
+
+/* DrawRotString.c */
+int DrawRotText PROTO((int x, int y, char *string, int pos, double angle));
+int DrawRotBitmap PROTO((int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale));
+int DrawRotTextInit (Display *display, Window window, GC gc, unsigned long fore, unsigned long back);
+
+
+/* PSRotFont.c */
+void PSRotText PROTO((FILE *f, int x, int y, char *string, int pos, double angle));
+void PSDumpRotSegment PROTO((FILE *f, char *segment, int *Nseg));
+void PSSetFont PROTO((FILE *f, char *name, int size));
+
+/* bDrawFuncs.c */
+bDrawBuffer *bDrawBufferCreate (int Nx, int Ny);
+void bDrawBufferFree (bDrawBuffer *buffer);
+void bDrawSetBuffer (bDrawBuffer *buffer);
+void bDrawSetStyle (bDrawColor color, int lw, int lt);
+void bDrawPoint (int x, int y);
+void bDrawPointf (float x, float y);
+
+void bDrawArc (double Xc, double Yc, double Xr, double Yr, double Ts, double Te);
+void bDrawCircle (double Xc, double Yc, double radius);
+void bDrawCircleFill (double xc, double yc, double radius);
+
+void bDrawLine (double x1, double y1, double x2, double y2);
+void bDrawLineWeight (int X1, int Y1, int X2, int Y2, int swapcoords);
+void bDrawLineBresen (int X1, int Y1, int X2, int Y2, int swapcoords);
+void bDrawLineHorizontal (int X1, int X2, int Y);
+void bDrawLineVertical (int X, int Y1, int Y2);
+
+void bDrawRectOpen (double x1, double y1, double x2, double y2);
+void bDrawRectFill (double x1, double y1, double x2, double y2);
+void bDrawTriOpen (double x1, double y1, double x2, double y2, double x3, double y3);
+void bDrawTriFill (double x1, double y1, double x2, double y2, double x3, double y3);
+
+/* bDrawRotFont.c */
+int bDrawRotText (int x, int y, char *string, int pos, double angle);
+int bDrawRotBitmap (int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale);
+
+/* Kapa Socket functions */
+int KapaOpen (char *kapa_exec, char *kapa_name);
+int KapaServerInit (KapaSockAddress *Address);
+int KapaServerWait (int InitSocket, KapaSockAddress *Address);
+int KapaDefineValidIP (char *ipstring);
+int KapaClientSocket (char *hostname);
+int KapaOpenNamedSocket (char *kapa_exec, char *name);
+int KapaWaitNamedSocket (char *sockpath);
+
+/* define Kapa names for shared functions */
+// # define KapaOpen(p,n) KiiOpen(p,n)
+# define KapaResize(fd,Nx,Ny) KiiResize(fd,Nx,Ny)
+# define KapaCenter(fd,x,y,z) KiiResize(fd,x,y,z)
+# define KapaCursorOn(fd) KiiCursorOn(fd)
+# define KapaCursorOff(fd) KiiCursorOff(fd)
+# define KapaCursorRead(fd,x,y,k) KiiCursorRead(fd,x,y,k)
+# define KapaPS(fd,s,r,f) KiiPS(fd,s,r,f)
+
+# define KapaClose(socket) KiiClose(socket)
+# define KapaWait(sockpath) KiiWait(sockpath)
+# define KapaSendCommandV(device, length, format, argp) KiiSendCommandV(device, length, format, argp)
+# define KapaSendData(device, data, Nbytes) KiiSendData(device, data, Nbytes)
+# define KapaRecvData(device) KiiRecvData(device)
+
+/* these use varargs: is this safe, or should we make a stub function? */
+# define KapaSendMessage KiiSendMessage
+# define KapaSendCommand KiiSendCommand
+# define KapaScanMessage KiiScanMessage
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/include/kapa_internal.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/include/kapa_internal.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/include/kapa_internal.h	(revision 15879)
@@ -0,0 +1,18 @@
+# include <signal.h>
+# include <unistd.h>
+# include <sys/uio.h>
+# include <fcntl.h>
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <sys/socket.h>
+# include <sys/un.h>
+# include <sys/time.h>
+# include <time.h>
+# include <errno.h>
+
+# include <ohana.h>
+# include <dvo.h>
+# include <kapa.h>
+
+/* do we need to move the Coords structure outside 
+   of libautocode? */
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/lib/.cvsignore
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/lib/.cvsignore	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/lib/.cvsignore	(revision 15879)
@@ -0,0 +1,1 @@
+*.linux *.lin64 *.sol *.sun *.sid *.hp *.irix
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/.cvsignore
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/.cvsignore	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/.cvsignore	(revision 15879)
@@ -0,0 +1,1 @@
+fixfont
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/ReadMe
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/ReadMe	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/ReadMe	(revision 15879)
@@ -0,0 +1,10 @@
+start font server (as root): 
+ xfs &
+
+dump font to bdf file:
+
+fstobdf -s localhost:7100 -fn "-adobe-times-medium-r-*-*-12-*-*-*-*-*-*-*" > times12.bdf
+
+convert to .h file:
+ fixfont times12.bdf times12 > times12.h
+
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/alphabet.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/alphabet.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/alphabet.h	(revision 15879)
@@ -0,0 +1,69 @@
+typedef struct {
+  int dx, dy, ascent;
+  char *bits;
+} RotFont;
+
+typedef struct {
+  RotFont *font;
+  char name[64];
+  int size;
+} FontSet;
+
+# include "../rotfont/times8.h"
+# include "../rotfont/times12.h"
+# include "../rotfont/times14.h"
+# include "../rotfont/times18.h"
+# include "../rotfont/times24.h"
+
+# include "../rotfont/courier8.h"
+# include "../rotfont/courier12.h"
+# include "../rotfont/courier14.h"
+# include "../rotfont/courier18.h"
+# include "../rotfont/courier24.h"
+
+# include "../rotfont/helvetica8.h"
+# include "../rotfont/helvetica12.h"
+# include "../rotfont/helvetica14.h"
+# include "../rotfont/helvetica18.h"
+# include "../rotfont/helvetica24.h"
+
+# include "../rotfont/symbol8.h"
+# include "../rotfont/symbol12.h"
+# include "../rotfont/symbol14.h"
+# include "../rotfont/symbol18.h"
+# include "../rotfont/symbol24.h"
+
+# define DEFFONT 1
+static FontSet HardwiredFonts[] = {
+  {times8font,  "times", 8},
+  {times12font, "times", 12},
+  {times14font, "times", 14},
+  {times18font, "times", 18},
+  {times24font, "times", 24},
+  
+  {courier8font,  "courier", 8},
+  {courier12font, "courier", 12},
+  {courier14font, "courier", 14},
+  {courier18font, "courier", 18},
+  {courier24font, "courier", 24},
+  
+  {helvetica8font,  "helvetica", 8},
+  {helvetica12font, "helvetica", 12},
+  {helvetica14font, "helvetica", 14},
+  {helvetica18font, "helvetica", 18},
+  {helvetica24font, "helvetica", 24},
+  
+  {symbol8font,  "symbol", 8},
+  {symbol12font, "symbol", 12},
+  {symbol14font, "symbol", 14},
+  {symbol18font, "symbol", 18},
+  {symbol24font, "symbol", 24}
+};
+
+int Nallfonts;
+FontSet *AllFonts;
+RotFont *activefont;
+double activescale;
+
+char currentname[64];
+int  currentsize;
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/blank.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/blank.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/blank.h	(revision 15879)
@@ -0,0 +1,4 @@
+#define blank_width 5
+#define blank_height 1
+static unsigned char blank_bits[] = {
+   0x00};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier12.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier12.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier12.bdf	(revision 15879)
@@ -0,0 +1,2839 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) IBM Corporation 1990,1991. IBM Courier is a Trademark of the IBM Corporation.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -adobe-courier-medium-r-normal--12-116-75-75-m-70-iso8859-1
+SIZE 12 75 75
+FONTBOUNDINGBOX 8 12 0 -2
+STARTPROPERTIES 25
+FOUNDRY "adobe"
+FAMILY_NAME "courier"
+WEIGHT_NAME "medium"
+SLANT "r"
+SETWIDTH_NAME "normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 12
+POINT_SIZE 116
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "m"
+AVERAGE_WIDTH 70
+CHARSET_REGISTRY "iso8859"
+CHARSET_ENCODING "1"
+FONT "-adobe-courier-medium-r-normal--12-116-75-75-m-70-iso8859-1"
+COPYRIGHT "Copyright (c) IBM Corporation 1990,1991. IBM Courier is a Trademark of the IBM Corporation."
+RAW_PIXEL_SIZE 1000
+RAW_POINT_SIZE 964
+RAW_ASCENT 841
+RAW_DESCENT 288
+RAW_AVERAGE_WIDTH 6000
+FACE_NAME "Couriere."
+DEFAULT_CHAR 0
+FONT_ASCENT 10
+FONT_DESCENT 3
+ENDPROPERTIES
+CHARS 190
+STARTCHAR space
+ENCODING 32
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 0 0 0 0
+ATTRIBUTES 0x0258
+BITMAP
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 7 3 0
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+80
+80
+80
+00
+40
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 3 2 4
+ATTRIBUTES 0x0258
+BITMAP
+a0
+a0
+a0
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+50
+50
+50
+f8
+50
+f8
+50
+50
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 -2
+ATTRIBUTES 0x0258
+BITMAP
+20
+60
+b8
+a8
+60
+38
+a8
+f0
+20
+20
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+90
+6c
+70
+4c
+12
+1c
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+30
+48
+40
+28
+e8
+90
+68
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 3 2 4
+ATTRIBUTES 0x0258
+BITMAP
+40
+80
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 9 3 -1
+ATTRIBUTES 0x0258
+BITMAP
+40
+40
+40
+80
+80
+80
+40
+40
+40
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 9 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+40
+40
+40
+40
+40
+80
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 4 1 3
+ATTRIBUTES 0x0258
+BITMAP
+20
+f0
+20
+50
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+ATTRIBUTES 0x0258
+BITMAP
+20
+20
+f8
+20
+20
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 3 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+40
+80
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 1 1 3
+ATTRIBUTES 0x0258
+BITMAP
+fc
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 2 3 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 -2
+ATTRIBUTES 0x0258
+BITMAP
+08
+08
+10
+10
+20
+20
+20
+40
+40
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+88
+88
+88
+88
+c8
+70
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+08
+08
+10
+20
+48
+f8
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+10
+10
+30
+08
+08
+f0
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+30
+50
+50
+f8
+10
+78
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+80
+f0
+88
+08
+08
+70
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+38
+40
+b0
+c8
+88
+88
+70
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+08
+10
+10
+10
+20
+20
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+88
+88
+70
+88
+88
+70
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+88
+88
+78
+08
+10
+e0
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 5 3 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+00
+c0
+40
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 6 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+60
+20
+00
+60
+40
+40
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 1 1
+ATTRIBUTES 0x0258
+BITMAP
+18
+20
+e0
+18
+04
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 3 1 2
+ATTRIBUTES 0x0258
+BITMAP
+fc
+00
+fc
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 1 1
+ATTRIBUTES 0x0258
+BITMAP
+60
+10
+1c
+e0
+80
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+88
+08
+10
+20
+00
+20
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+38
+44
+9a
+aa
+aa
+7c
+3c
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+28
+28
+28
+7c
+42
+c6
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+88
+88
+f8
+84
+84
+f8
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+7c
+44
+80
+80
+80
+c4
+78
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+44
+42
+42
+42
+44
+f8
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+fc
+44
+50
+70
+50
+44
+fc
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+fc
+44
+50
+70
+50
+40
+e0
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+3c
+44
+80
+80
+8e
+42
+3e
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+ee
+44
+44
+7c
+44
+44
+ee
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+7c
+08
+08
+08
+88
+88
+f8
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+cc
+48
+50
+60
+50
+48
+c4
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+40
+40
+40
+44
+44
+fc
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+c6
+6a
+6a
+6a
+52
+42
+e6
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+ee
+62
+52
+52
+4a
+4a
+e6
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+38
+44
+82
+82
+82
+44
+38
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+44
+44
+4c
+78
+40
+e0
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+38
+44
+82
+82
+82
+44
+38
+30
+2e
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+88
+98
+e0
+90
+88
+cc
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+88
+80
+70
+08
+88
+f0
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+fe
+92
+92
+10
+10
+10
+38
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+ee
+44
+44
+44
+44
+44
+38
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+ee
+44
+64
+28
+28
+28
+10
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+c6
+52
+52
+6a
+6a
+6a
+44
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+6c
+28
+28
+10
+28
+44
+e6
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+cc
+48
+48
+50
+20
+20
+78
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+90
+90
+20
+48
+88
+f8
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 9 4 -1
+ATTRIBUTES 0x0258
+BITMAP
+c0
+80
+80
+80
+80
+80
+80
+80
+c0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 -2
+ATTRIBUTES 0x0258
+BITMAP
+80
+40
+40
+20
+20
+20
+10
+10
+08
+08
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 9 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+e0
+20
+20
+20
+20
+20
+20
+20
+e0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 6 1 1
+ATTRIBUTES 0x0258
+BITMAP
+20
+50
+50
+50
+88
+88
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 8 1 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+ff
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 3 2 4
+ATTRIBUTES 0x0258
+BITMAP
+40
+40
+80
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+78
+88
+88
+fc
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+40
+7c
+42
+42
+42
+fc
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+84
+80
+80
+78
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+1c
+04
+7c
+84
+84
+c4
+3e
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+8c
+fc
+80
+78
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+7c
+40
+f8
+40
+40
+40
+f8
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+7e
+84
+84
+c4
+3c
+04
+38
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+40
+7c
+44
+44
+44
+ee
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 8 1 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+00
+00
+60
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 4 10 1 -2
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+00
+f0
+10
+10
+10
+10
+10
+e0
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+40
+4e
+58
+70
+48
+4e
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+fe
+92
+92
+92
+da
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+fc
+44
+44
+44
+ee
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+7c
+82
+82
+c6
+3c
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+fc
+42
+42
+46
+7c
+40
+f0
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+7e
+c4
+84
+c4
+3c
+04
+0e
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+fc
+40
+40
+40
+f0
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+88
+f0
+c8
+b0
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+40
+f8
+40
+40
+40
+78
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+cc
+44
+44
+44
+3e
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+e6
+44
+24
+28
+10
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+c6
+52
+6a
+6c
+24
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+66
+2c
+10
+6c
+c6
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+c6
+44
+24
+28
+10
+20
+f0
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+10
+20
+48
+f8
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 9 3 -1
+ATTRIBUTES 0x0258
+BITMAP
+60
+80
+80
+40
+80
+40
+40
+80
+60
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 1 10 3 -2
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 9 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+80
+40
+40
+40
+40
+40
+40
+40
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 2 1 3
+ATTRIBUTES 0x0258
+BITMAP
+68
+90
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 7 3 -2
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 8 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+20
+78
+a8
+a0
+a0
+70
+20
+20
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+38
+40
+40
+f8
+40
+40
+78
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+ATTRIBUTES 0x0258
+BITMAP
+f8
+88
+88
+88
+f8
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+cc
+48
+50
+78
+78
+20
+78
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 1 10 3 -2
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+80
+80
+00
+00
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 8 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+78
+48
+60
+90
+48
+38
+90
+f0
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 1 2 6
+ATTRIBUTES 0x0258
+BITMAP
+a0
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+38
+7c
+c6
+c2
+e6
+7c
+38
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 4 2 3
+ATTRIBUTES 0x0258
+BITMAP
+60
+e0
+e0
+e0
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+28
+50
+a0
+50
+28
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 3 1 2
+ATTRIBUTES 0x0258
+BITMAP
+f8
+08
+08
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 1 2 3
+ATTRIBUTES 0x0258
+BITMAP
+e0
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+38
+7c
+aa
+b2
+ba
+46
+38
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 4 1 2 6
+ATTRIBUTES 0x0258
+BITMAP
+f0
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 4 3 2 4
+ATTRIBUTES 0x0258
+BITMAP
+e0
+90
+e0
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+20
+f8
+20
+20
+00
+f8
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 4 2 3
+ATTRIBUTES 0x0258
+BITMAP
+e0
+20
+40
+e0
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 4 2 3
+ATTRIBUTES 0x0258
+BITMAP
+60
+40
+20
+e0
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 1 3 6
+ATTRIBUTES 0x0258
+BITMAP
+40
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+cc
+44
+44
+44
+7e
+40
+40
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 8 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+78
+a8
+a8
+68
+28
+28
+28
+28
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 2 2 3 3
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 3 2 -2
+ATTRIBUTES 0x0258
+BITMAP
+40
+60
+60
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 4 2 3
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+40
+e0
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 4 2 3
+ATTRIBUTES 0x0258
+BITMAP
+e0
+a0
+e0
+e0
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+a0
+50
+28
+50
+a0
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 -1
+ATTRIBUTES 0x0258
+BITMAP
+02
+42
+46
+4c
+ea
+16
+26
+4e
+46
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 -1
+ATTRIBUTES 0x0258
+BITMAP
+02
+46
+44
+4c
+fe
+1a
+22
+44
+4e
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 -1
+ATTRIBUTES 0x0258
+BITMAP
+02
+62
+66
+24
+ea
+16
+26
+4e
+46
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 -2
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+20
+c0
+80
+88
+78
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+70
+28
+28
+28
+7c
+42
+c6
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+08
+00
+70
+28
+28
+28
+7c
+42
+c6
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+70
+28
+28
+28
+7c
+42
+c6
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+3c
+00
+70
+28
+28
+28
+7c
+42
+c6
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+28
+00
+70
+28
+28
+28
+7c
+42
+c6
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 10 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+28
+10
+70
+28
+28
+28
+7c
+42
+c6
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+3e
+12
+36
+3c
+74
+52
+de
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 1 -2
+ATTRIBUTES 0x0258
+BITMAP
+7c
+8c
+80
+80
+80
+86
+78
+10
+30
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 1 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+00
+fc
+44
+50
+70
+50
+44
+fc
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 1 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+fc
+44
+50
+70
+50
+44
+fc
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 1 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+00
+fc
+44
+50
+70
+50
+44
+fc
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 1 0
+ATTRIBUTES 0x0258
+BITMAP
+50
+00
+fc
+44
+50
+70
+50
+44
+fc
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+00
+f8
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+f8
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+00
+f8
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+ATTRIBUTES 0x0258
+BITMAP
+50
+00
+f8
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+44
+42
+f2
+42
+44
+f8
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+3c
+00
+ee
+62
+52
+52
+4a
+4a
+e6
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+38
+44
+82
+82
+82
+44
+38
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+08
+00
+38
+44
+82
+82
+82
+44
+38
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+38
+44
+82
+82
+82
+44
+38
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+3c
+00
+38
+44
+82
+82
+82
+44
+38
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+28
+00
+38
+44
+82
+82
+82
+44
+38
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 4 5 2 1
+ATTRIBUTES 0x0258
+BITMAP
+90
+70
+20
+d0
+90
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+3a
+44
+8a
+92
+92
+64
+78
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+ee
+44
+44
+44
+44
+44
+38
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+08
+00
+ee
+44
+44
+44
+44
+44
+38
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+ee
+44
+44
+44
+44
+44
+38
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+ATTRIBUTES 0x0258
+BITMAP
+28
+00
+ee
+44
+44
+44
+44
+44
+38
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 1 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+cc
+48
+48
+50
+20
+20
+78
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+78
+4c
+44
+4c
+78
+e0
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+88
+b0
+88
+88
+88
+b0
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+00
+70
+78
+88
+88
+fc
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+70
+78
+88
+88
+fc
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+00
+70
+78
+88
+88
+fc
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+00
+70
+78
+88
+88
+fc
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+50
+00
+70
+78
+88
+88
+fc
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 8 1 0
+ATTRIBUTES 0x0258
+BITMAP
+30
+70
+00
+70
+78
+88
+88
+fc
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+7c
+12
+7e
+90
+6e
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 -2
+ATTRIBUTES 0x0258
+BITMAP
+7c
+84
+80
+80
+78
+20
+30
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+78
+8c
+fc
+80
+78
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+78
+8c
+fc
+80
+78
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+00
+78
+8c
+fc
+80
+78
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+50
+00
+78
+8c
+fc
+80
+78
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+00
+60
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+60
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+00
+60
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+ATTRIBUTES 0x0258
+BITMAP
+50
+00
+60
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 8 0 0
+ATTRIBUTES 0x0258
+BITMAP
+30
+28
+0c
+7e
+82
+82
+c6
+3c
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+3c
+00
+fc
+44
+44
+44
+ee
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+7c
+82
+82
+c6
+3c
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+08
+00
+7c
+82
+82
+c6
+3c
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+38
+00
+7c
+82
+82
+c6
+3c
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+3c
+00
+7c
+82
+82
+c6
+3c
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+28
+00
+7c
+82
+82
+c6
+3c
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+ATTRIBUTES 0x0258
+BITMAP
+20
+00
+f8
+00
+20
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+7e
+8a
+92
+e6
+9c
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+cc
+44
+44
+44
+3e
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+08
+00
+cc
+44
+44
+44
+3e
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+38
+00
+cc
+44
+44
+44
+3e
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+28
+00
+cc
+44
+44
+44
+3e
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+08
+00
+c6
+44
+24
+28
+10
+20
+f0
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+40
+40
+7c
+42
+42
+46
+7c
+40
+f0
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+28
+00
+c6
+44
+24
+28
+10
+20
+f0
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier12.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier12.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier12.h	(revision 15879)
@@ -0,0 +1,768 @@
+static unsigned char courier12_0_bits[] = {
+0x00};
+static unsigned char courier12_1_bits[] = {
+0x00};
+static unsigned char courier12_2_bits[] = {
+0x00};
+static unsigned char courier12_3_bits[] = {
+0x00};
+static unsigned char courier12_4_bits[] = {
+0x00};
+static unsigned char courier12_5_bits[] = {
+0x00};
+static unsigned char courier12_6_bits[] = {
+0x00};
+static unsigned char courier12_7_bits[] = {
+0x00};
+static unsigned char courier12_8_bits[] = {
+0x00};
+static unsigned char courier12_9_bits[] = {
+0x00};
+static unsigned char courier12_10_bits[] = {
+0x00};
+static unsigned char courier12_11_bits[] = {
+0x00};
+static unsigned char courier12_12_bits[] = {
+0x00};
+static unsigned char courier12_13_bits[] = {
+0x00};
+static unsigned char courier12_14_bits[] = {
+0x00};
+static unsigned char courier12_15_bits[] = {
+0x00};
+static unsigned char courier12_16_bits[] = {
+0x00};
+static unsigned char courier12_17_bits[] = {
+0x00};
+static unsigned char courier12_18_bits[] = {
+0x00};
+static unsigned char courier12_19_bits[] = {
+0x00};
+static unsigned char courier12_20_bits[] = {
+0x00};
+static unsigned char courier12_21_bits[] = {
+0x00};
+static unsigned char courier12_22_bits[] = {
+0x00};
+static unsigned char courier12_23_bits[] = {
+0x00};
+static unsigned char courier12_24_bits[] = {
+0x00};
+static unsigned char courier12_25_bits[] = {
+0x00};
+static unsigned char courier12_26_bits[] = {
+0x00};
+static unsigned char courier12_27_bits[] = {
+0x00};
+static unsigned char courier12_28_bits[] = {
+0x00};
+static unsigned char courier12_29_bits[] = {
+0x00};
+static unsigned char courier12_30_bits[] = {
+0x00};
+static unsigned char courier12_31_bits[] = {
+0x00};
+static unsigned char courier12_32_bits[] = {};
+static unsigned char courier12_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x02};
+static unsigned char courier12_34_bits[] = {
+0x05, 0x05, 0x05};
+static unsigned char courier12_35_bits[] = {
+0x0a, 0x0a, 0x0a, 0x1f, 0x0a, 0x1f, 0x0a, 0x0a, 0x0a};
+static unsigned char courier12_36_bits[] = {
+0x04, 0x06, 0x1d, 0x15, 0x06, 0x1c, 0x15, 0x0f, 0x04, 0x04};
+static unsigned char courier12_37_bits[] = {
+0x0e, 0x09, 0x36, 0x0e, 0x32, 0x48, 0x38};
+static unsigned char courier12_38_bits[] = {
+0x0c, 0x12, 0x02, 0x14, 0x17, 0x09, 0x16};
+static unsigned char courier12_39_bits[] = {
+0x02, 0x01, 0x01};
+static unsigned char courier12_40_bits[] = {
+0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02};
+static unsigned char courier12_41_bits[] = {
+0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01, 0x01};
+static unsigned char courier12_42_bits[] = {
+0x04, 0x0f, 0x04, 0x0a};
+static unsigned char courier12_43_bits[] = {
+0x04, 0x04, 0x1f, 0x04, 0x04};
+static unsigned char courier12_44_bits[] = {
+0x02, 0x01, 0x01};
+static unsigned char courier12_45_bits[] = {
+0x3f};
+static unsigned char courier12_46_bits[] = {
+0x03, 0x02};
+static unsigned char courier12_47_bits[] = {
+0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x02, 0x02, 0x01};
+static unsigned char courier12_48_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x11, 0x13, 0x0e};
+static unsigned char courier12_49_bits[] = {
+0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_50_bits[] = {
+0x0f, 0x10, 0x10, 0x08, 0x04, 0x12, 0x1f};
+static unsigned char courier12_51_bits[] = {
+0x0f, 0x08, 0x08, 0x0c, 0x10, 0x10, 0x0f};
+static unsigned char courier12_52_bits[] = {
+0x08, 0x0c, 0x0a, 0x0a, 0x1f, 0x08, 0x1e};
+static unsigned char courier12_53_bits[] = {
+0x0f, 0x01, 0x0f, 0x11, 0x10, 0x10, 0x0e};
+static unsigned char courier12_54_bits[] = {
+0x1c, 0x02, 0x0d, 0x13, 0x11, 0x11, 0x0e};
+static unsigned char courier12_55_bits[] = {
+0x1f, 0x10, 0x08, 0x08, 0x08, 0x04, 0x04};
+static unsigned char courier12_56_bits[] = {
+0x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x0e};
+static unsigned char courier12_57_bits[] = {
+0x0e, 0x11, 0x11, 0x1e, 0x10, 0x08, 0x07};
+static unsigned char courier12_58_bits[] = {
+0x03, 0x02, 0x00, 0x03, 0x02};
+static unsigned char courier12_59_bits[] = {
+0x06, 0x04, 0x00, 0x06, 0x02, 0x02};
+static unsigned char courier12_60_bits[] = {
+0x18, 0x04, 0x07, 0x18, 0x20};
+static unsigned char courier12_61_bits[] = {
+0x3f, 0x00, 0x3f};
+static unsigned char courier12_62_bits[] = {
+0x06, 0x08, 0x38, 0x07, 0x01};
+static unsigned char courier12_63_bits[] = {
+0x0f, 0x11, 0x10, 0x08, 0x04, 0x00, 0x04};
+static unsigned char courier12_64_bits[] = {
+0x1c, 0x22, 0x59, 0x55, 0x55, 0x3e, 0x3c};
+static unsigned char courier12_65_bits[] = {
+0x0e, 0x14, 0x14, 0x14, 0x3e, 0x42, 0x63};
+static unsigned char courier12_66_bits[] = {
+0x0f, 0x11, 0x11, 0x1f, 0x21, 0x21, 0x1f};
+static unsigned char courier12_67_bits[] = {
+0x3e, 0x22, 0x01, 0x01, 0x01, 0x23, 0x1e};
+static unsigned char courier12_68_bits[] = {
+0x1f, 0x22, 0x42, 0x42, 0x42, 0x22, 0x1f};
+static unsigned char courier12_69_bits[] = {
+0x3f, 0x22, 0x0a, 0x0e, 0x0a, 0x22, 0x3f};
+static unsigned char courier12_70_bits[] = {
+0x3f, 0x22, 0x0a, 0x0e, 0x0a, 0x02, 0x07};
+static unsigned char courier12_71_bits[] = {
+0x3c, 0x22, 0x01, 0x01, 0x71, 0x42, 0x7c};
+static unsigned char courier12_72_bits[] = {
+0x77, 0x22, 0x22, 0x3e, 0x22, 0x22, 0x77};
+static unsigned char courier12_73_bits[] = {
+0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_74_bits[] = {
+0x3e, 0x10, 0x10, 0x10, 0x11, 0x11, 0x1f};
+static unsigned char courier12_75_bits[] = {
+0x33, 0x12, 0x0a, 0x06, 0x0a, 0x12, 0x23};
+static unsigned char courier12_76_bits[] = {
+0x07, 0x02, 0x02, 0x02, 0x22, 0x22, 0x3f};
+static unsigned char courier12_77_bits[] = {
+0x63, 0x56, 0x56, 0x56, 0x4a, 0x42, 0x67};
+static unsigned char courier12_78_bits[] = {
+0x77, 0x46, 0x4a, 0x4a, 0x52, 0x52, 0x67};
+static unsigned char courier12_79_bits[] = {
+0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c};
+static unsigned char courier12_80_bits[] = {
+0x1f, 0x22, 0x22, 0x32, 0x1e, 0x02, 0x07};
+static unsigned char courier12_81_bits[] = {
+0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c, 0x0c, 0x74};
+static unsigned char courier12_82_bits[] = {
+0x0f, 0x11, 0x19, 0x07, 0x09, 0x11, 0x33};
+static unsigned char courier12_83_bits[] = {
+0x1e, 0x11, 0x01, 0x0e, 0x10, 0x11, 0x0f};
+static unsigned char courier12_84_bits[] = {
+0x7f, 0x49, 0x49, 0x08, 0x08, 0x08, 0x1c};
+static unsigned char courier12_85_bits[] = {
+0x77, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1c};
+static unsigned char courier12_86_bits[] = {
+0x77, 0x22, 0x26, 0x14, 0x14, 0x14, 0x08};
+static unsigned char courier12_87_bits[] = {
+0x63, 0x4a, 0x4a, 0x56, 0x56, 0x56, 0x22};
+static unsigned char courier12_88_bits[] = {
+0x36, 0x14, 0x14, 0x08, 0x14, 0x22, 0x67};
+static unsigned char courier12_89_bits[] = {
+0x33, 0x12, 0x12, 0x0a, 0x04, 0x04, 0x1e};
+static unsigned char courier12_90_bits[] = {
+0x1f, 0x09, 0x09, 0x04, 0x12, 0x11, 0x1f};
+static unsigned char courier12_91_bits[] = {
+0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03};
+static unsigned char courier12_92_bits[] = {
+0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10};
+static unsigned char courier12_93_bits[] = {
+0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07};
+static unsigned char courier12_94_bits[] = {
+0x04, 0x0a, 0x0a, 0x0a, 0x11, 0x11};
+static unsigned char courier12_95_bits[] = {
+0xff};
+static unsigned char courier12_96_bits[] = {
+0x02, 0x02, 0x01};
+static unsigned char courier12_97_bits[] = {
+0x0e, 0x1e, 0x11, 0x11, 0x3f};
+static unsigned char courier12_98_bits[] = {
+0x02, 0x02, 0x3e, 0x42, 0x42, 0x42, 0x3f};
+static unsigned char courier12_99_bits[] = {
+0x1e, 0x21, 0x01, 0x01, 0x1e};
+static unsigned char courier12_100_bits[] = {
+0x38, 0x20, 0x3e, 0x21, 0x21, 0x23, 0x7c};
+static unsigned char courier12_101_bits[] = {
+0x1e, 0x31, 0x3f, 0x01, 0x1e};
+static unsigned char courier12_102_bits[] = {
+0x3e, 0x02, 0x1f, 0x02, 0x02, 0x02, 0x1f};
+static unsigned char courier12_103_bits[] = {
+0x7e, 0x21, 0x21, 0x23, 0x3c, 0x20, 0x1c};
+static unsigned char courier12_104_bits[] = {
+0x02, 0x02, 0x3e, 0x22, 0x22, 0x22, 0x77};
+static unsigned char courier12_105_bits[] = {
+0x04, 0x00, 0x00, 0x06, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_106_bits[] = {
+0x08, 0x00, 0x00, 0x0f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x07};
+static unsigned char courier12_107_bits[] = {
+0x02, 0x02, 0x72, 0x1a, 0x0e, 0x12, 0x72};
+static unsigned char courier12_108_bits[] = {
+0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_109_bits[] = {
+0x7f, 0x49, 0x49, 0x49, 0x5b};
+static unsigned char courier12_110_bits[] = {
+0x3f, 0x22, 0x22, 0x22, 0x77};
+static unsigned char courier12_111_bits[] = {
+0x3e, 0x41, 0x41, 0x63, 0x3c};
+static unsigned char courier12_112_bits[] = {
+0x3f, 0x42, 0x42, 0x62, 0x3e, 0x02, 0x0f};
+static unsigned char courier12_113_bits[] = {
+0x7e, 0x23, 0x21, 0x23, 0x3c, 0x20, 0x70};
+static unsigned char courier12_114_bits[] = {
+0x3f, 0x02, 0x02, 0x02, 0x0f};
+static unsigned char courier12_115_bits[] = {
+0x1e, 0x11, 0x0f, 0x13, 0x0d};
+static unsigned char courier12_116_bits[] = {
+0x02, 0x02, 0x1f, 0x02, 0x02, 0x02, 0x1e};
+static unsigned char courier12_117_bits[] = {
+0x33, 0x22, 0x22, 0x22, 0x7c};
+static unsigned char courier12_118_bits[] = {
+0x67, 0x22, 0x24, 0x14, 0x08};
+static unsigned char courier12_119_bits[] = {
+0x63, 0x4a, 0x56, 0x36, 0x24};
+static unsigned char courier12_120_bits[] = {
+0x66, 0x34, 0x08, 0x36, 0x63};
+static unsigned char courier12_121_bits[] = {
+0x63, 0x22, 0x24, 0x14, 0x08, 0x04, 0x0f};
+static unsigned char courier12_122_bits[] = {
+0x1f, 0x08, 0x04, 0x12, 0x1f};
+static unsigned char courier12_123_bits[] = {
+0x06, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, 0x01, 0x06};
+static unsigned char courier12_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char courier12_125_bits[] = {
+0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03};
+static unsigned char courier12_126_bits[] = {
+0x16, 0x09};
+static unsigned char courier12_127_bits[] = {
+0x00};
+static unsigned char courier12_128_bits[] = {
+0x00};
+static unsigned char courier12_129_bits[] = {
+0x00};
+static unsigned char courier12_130_bits[] = {
+0x00};
+static unsigned char courier12_131_bits[] = {
+0x00};
+static unsigned char courier12_132_bits[] = {
+0x00};
+static unsigned char courier12_133_bits[] = {
+0x00};
+static unsigned char courier12_134_bits[] = {
+0x00};
+static unsigned char courier12_135_bits[] = {
+0x00};
+static unsigned char courier12_136_bits[] = {
+0x00};
+static unsigned char courier12_137_bits[] = {
+0x00};
+static unsigned char courier12_138_bits[] = {
+0x00};
+static unsigned char courier12_139_bits[] = {
+0x00};
+static unsigned char courier12_140_bits[] = {
+0x00};
+static unsigned char courier12_141_bits[] = {
+0x00};
+static unsigned char courier12_142_bits[] = {
+0x00};
+static unsigned char courier12_143_bits[] = {
+0x00};
+static unsigned char courier12_144_bits[] = {
+0x00};
+static unsigned char courier12_145_bits[] = {
+0x00};
+static unsigned char courier12_146_bits[] = {
+0x00};
+static unsigned char courier12_147_bits[] = {
+0x00};
+static unsigned char courier12_148_bits[] = {
+0x00};
+static unsigned char courier12_149_bits[] = {
+0x00};
+static unsigned char courier12_150_bits[] = {
+0x00};
+static unsigned char courier12_151_bits[] = {
+0x00};
+static unsigned char courier12_152_bits[] = {
+0x00};
+static unsigned char courier12_153_bits[] = {
+0x00};
+static unsigned char courier12_154_bits[] = {
+0x00};
+static unsigned char courier12_155_bits[] = {
+0x00};
+static unsigned char courier12_156_bits[] = {
+0x00};
+static unsigned char courier12_157_bits[] = {
+0x00};
+static unsigned char courier12_158_bits[] = {
+0x00};
+static unsigned char courier12_159_bits[] = {
+0x00};
+static unsigned char courier12_160_bits[] = {
+0x00};
+static unsigned char courier12_161_bits[] = {
+0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char courier12_162_bits[] = {
+0x04, 0x1e, 0x15, 0x05, 0x05, 0x0e, 0x04, 0x04};
+static unsigned char courier12_163_bits[] = {
+0x1c, 0x02, 0x02, 0x1f, 0x02, 0x02, 0x1e};
+static unsigned char courier12_164_bits[] = {
+0x1f, 0x11, 0x11, 0x11, 0x1f};
+static unsigned char courier12_165_bits[] = {
+0x33, 0x12, 0x0a, 0x1e, 0x1e, 0x04, 0x1e};
+static unsigned char courier12_166_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01};
+static unsigned char courier12_167_bits[] = {
+0x1e, 0x12, 0x06, 0x09, 0x12, 0x1c, 0x09, 0x0f};
+static unsigned char courier12_168_bits[] = {
+0x05};
+static unsigned char courier12_169_bits[] = {
+0x1c, 0x3e, 0x63, 0x43, 0x67, 0x3e, 0x1c};
+static unsigned char courier12_170_bits[] = {
+0x06, 0x07, 0x07, 0x07};
+static unsigned char courier12_171_bits[] = {
+0x14, 0x0a, 0x05, 0x0a, 0x14};
+static unsigned char courier12_172_bits[] = {
+0x1f, 0x10, 0x10};
+static unsigned char courier12_173_bits[] = {
+0x07};
+static unsigned char courier12_174_bits[] = {
+0x1c, 0x3e, 0x55, 0x4d, 0x5d, 0x62, 0x1c};
+static unsigned char courier12_175_bits[] = {
+0x0f};
+static unsigned char courier12_176_bits[] = {
+0x07, 0x09, 0x07};
+static unsigned char courier12_177_bits[] = {
+0x04, 0x04, 0x1f, 0x04, 0x04, 0x00, 0x1f};
+static unsigned char courier12_178_bits[] = {
+0x07, 0x04, 0x02, 0x07};
+static unsigned char courier12_179_bits[] = {
+0x06, 0x02, 0x04, 0x07};
+static unsigned char courier12_180_bits[] = {
+0x02};
+static unsigned char courier12_181_bits[] = {
+0x33, 0x22, 0x22, 0x22, 0x7e, 0x02, 0x02};
+static unsigned char courier12_182_bits[] = {
+0x1e, 0x15, 0x15, 0x16, 0x14, 0x14, 0x14, 0x14};
+static unsigned char courier12_183_bits[] = {
+0x03, 0x02};
+static unsigned char courier12_184_bits[] = {
+0x02, 0x06, 0x06};
+static unsigned char courier12_185_bits[] = {
+0x03, 0x02, 0x02, 0x07};
+static unsigned char courier12_186_bits[] = {
+0x07, 0x05, 0x07, 0x07};
+static unsigned char courier12_187_bits[] = {
+0x05, 0x0a, 0x14, 0x0a, 0x05};
+static unsigned char courier12_188_bits[] = {
+0x40, 0x42, 0x62, 0x32, 0x57, 0x68, 0x64, 0x72, 0x62};
+static unsigned char courier12_189_bits[] = {
+0x40, 0x62, 0x22, 0x32, 0x7f, 0x58, 0x44, 0x22, 0x72};
+static unsigned char courier12_190_bits[] = {
+0x40, 0x46, 0x66, 0x24, 0x57, 0x68, 0x64, 0x72, 0x62};
+static unsigned char courier12_191_bits[] = {
+0x08, 0x00, 0x04, 0x03, 0x01, 0x11, 0x1e};
+static unsigned char courier12_192_bits[] = {
+0x08, 0x00, 0x0e, 0x14, 0x14, 0x14, 0x3e, 0x42, 0x63};
+static unsigned char courier12_193_bits[] = {
+0x10, 0x00, 0x0e, 0x14, 0x14, 0x14, 0x3e, 0x42, 0x63};
+static unsigned char courier12_194_bits[] = {
+0x08, 0x00, 0x0e, 0x14, 0x14, 0x14, 0x3e, 0x42, 0x63};
+static unsigned char courier12_195_bits[] = {
+0x3c, 0x00, 0x0e, 0x14, 0x14, 0x14, 0x3e, 0x42, 0x63};
+static unsigned char courier12_196_bits[] = {
+0x14, 0x00, 0x0e, 0x14, 0x14, 0x14, 0x3e, 0x42, 0x63};
+static unsigned char courier12_197_bits[] = {
+0x08, 0x14, 0x08, 0x0e, 0x14, 0x14, 0x14, 0x3e, 0x42, 0x63};
+static unsigned char courier12_198_bits[] = {
+0x7c, 0x48, 0x6c, 0x3c, 0x2e, 0x4a, 0x7b};
+static unsigned char courier12_199_bits[] = {
+0x3e, 0x31, 0x01, 0x01, 0x01, 0x61, 0x1e, 0x08, 0x0c};
+static unsigned char courier12_200_bits[] = {
+0x04, 0x00, 0x3f, 0x22, 0x0a, 0x0e, 0x0a, 0x22, 0x3f};
+static unsigned char courier12_201_bits[] = {
+0x08, 0x00, 0x3f, 0x22, 0x0a, 0x0e, 0x0a, 0x22, 0x3f};
+static unsigned char courier12_202_bits[] = {
+0x04, 0x00, 0x3f, 0x22, 0x0a, 0x0e, 0x0a, 0x22, 0x3f};
+static unsigned char courier12_203_bits[] = {
+0x0a, 0x00, 0x3f, 0x22, 0x0a, 0x0e, 0x0a, 0x22, 0x3f};
+static unsigned char courier12_204_bits[] = {
+0x04, 0x00, 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_205_bits[] = {
+0x08, 0x00, 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_206_bits[] = {
+0x04, 0x00, 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_207_bits[] = {
+0x0a, 0x00, 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_208_bits[] = {
+0x1f, 0x22, 0x42, 0x4f, 0x42, 0x22, 0x1f};
+static unsigned char courier12_209_bits[] = {
+0x3c, 0x00, 0x77, 0x46, 0x4a, 0x4a, 0x52, 0x52, 0x67};
+static unsigned char courier12_210_bits[] = {
+0x08, 0x00, 0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c};
+static unsigned char courier12_211_bits[] = {
+0x10, 0x00, 0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c};
+static unsigned char courier12_212_bits[] = {
+0x08, 0x00, 0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c};
+static unsigned char courier12_213_bits[] = {
+0x3c, 0x00, 0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c};
+static unsigned char courier12_214_bits[] = {
+0x14, 0x00, 0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c};
+static unsigned char courier12_215_bits[] = {
+0x09, 0x0e, 0x04, 0x0b, 0x09};
+static unsigned char courier12_216_bits[] = {
+0x5c, 0x22, 0x51, 0x49, 0x49, 0x26, 0x1e};
+static unsigned char courier12_217_bits[] = {
+0x08, 0x00, 0x77, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1c};
+static unsigned char courier12_218_bits[] = {
+0x10, 0x00, 0x77, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1c};
+static unsigned char courier12_219_bits[] = {
+0x08, 0x00, 0x77, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1c};
+static unsigned char courier12_220_bits[] = {
+0x14, 0x00, 0x77, 0x22, 0x22, 0x22, 0x22, 0x22, 0x1c};
+static unsigned char courier12_221_bits[] = {
+0x08, 0x00, 0x33, 0x12, 0x12, 0x0a, 0x04, 0x04, 0x1e};
+static unsigned char courier12_222_bits[] = {
+0x07, 0x1e, 0x32, 0x22, 0x32, 0x1e, 0x07};
+static unsigned char courier12_223_bits[] = {
+0x0e, 0x11, 0x0d, 0x11, 0x11, 0x11, 0x0d};
+static unsigned char courier12_224_bits[] = {
+0x04, 0x00, 0x0e, 0x1e, 0x11, 0x11, 0x3f};
+static unsigned char courier12_225_bits[] = {
+0x08, 0x00, 0x0e, 0x1e, 0x11, 0x11, 0x3f};
+static unsigned char courier12_226_bits[] = {
+0x0e, 0x00, 0x0e, 0x1e, 0x11, 0x11, 0x3f};
+static unsigned char courier12_227_bits[] = {
+0x1e, 0x00, 0x0e, 0x1e, 0x11, 0x11, 0x3f};
+static unsigned char courier12_228_bits[] = {
+0x0a, 0x00, 0x0e, 0x1e, 0x11, 0x11, 0x3f};
+static unsigned char courier12_229_bits[] = {
+0x0c, 0x0e, 0x00, 0x0e, 0x1e, 0x11, 0x11, 0x3f};
+static unsigned char courier12_230_bits[] = {
+0x3e, 0x48, 0x7e, 0x09, 0x76};
+static unsigned char courier12_231_bits[] = {
+0x3e, 0x21, 0x01, 0x01, 0x1e, 0x04, 0x0c};
+static unsigned char courier12_232_bits[] = {
+0x08, 0x00, 0x1e, 0x31, 0x3f, 0x01, 0x1e};
+static unsigned char courier12_233_bits[] = {
+0x08, 0x00, 0x1e, 0x31, 0x3f, 0x01, 0x1e};
+static unsigned char courier12_234_bits[] = {
+0x0e, 0x00, 0x1e, 0x31, 0x3f, 0x01, 0x1e};
+static unsigned char courier12_235_bits[] = {
+0x0a, 0x00, 0x1e, 0x31, 0x3f, 0x01, 0x1e};
+static unsigned char courier12_236_bits[] = {
+0x04, 0x00, 0x06, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_237_bits[] = {
+0x08, 0x00, 0x06, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_238_bits[] = {
+0x0e, 0x00, 0x06, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_239_bits[] = {
+0x0a, 0x00, 0x06, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier12_240_bits[] = {
+0x0c, 0x14, 0x30, 0x7e, 0x41, 0x41, 0x63, 0x3c};
+static unsigned char courier12_241_bits[] = {
+0x3c, 0x00, 0x3f, 0x22, 0x22, 0x22, 0x77};
+static unsigned char courier12_242_bits[] = {
+0x08, 0x00, 0x3e, 0x41, 0x41, 0x63, 0x3c};
+static unsigned char courier12_243_bits[] = {
+0x10, 0x00, 0x3e, 0x41, 0x41, 0x63, 0x3c};
+static unsigned char courier12_244_bits[] = {
+0x1c, 0x00, 0x3e, 0x41, 0x41, 0x63, 0x3c};
+static unsigned char courier12_245_bits[] = {
+0x3c, 0x00, 0x3e, 0x41, 0x41, 0x63, 0x3c};
+static unsigned char courier12_246_bits[] = {
+0x14, 0x00, 0x3e, 0x41, 0x41, 0x63, 0x3c};
+static unsigned char courier12_247_bits[] = {
+0x04, 0x00, 0x1f, 0x00, 0x04};
+static unsigned char courier12_248_bits[] = {
+0x7e, 0x51, 0x49, 0x67, 0x39};
+static unsigned char courier12_249_bits[] = {
+0x08, 0x00, 0x33, 0x22, 0x22, 0x22, 0x7c};
+static unsigned char courier12_250_bits[] = {
+0x10, 0x00, 0x33, 0x22, 0x22, 0x22, 0x7c};
+static unsigned char courier12_251_bits[] = {
+0x1c, 0x00, 0x33, 0x22, 0x22, 0x22, 0x7c};
+static unsigned char courier12_252_bits[] = {
+0x14, 0x00, 0x33, 0x22, 0x22, 0x22, 0x7c};
+static unsigned char courier12_253_bits[] = {
+0x10, 0x00, 0x63, 0x22, 0x24, 0x14, 0x08, 0x04, 0x0f};
+static unsigned char courier12_254_bits[] = {
+0x02, 0x02, 0x3e, 0x42, 0x42, 0x62, 0x3e, 0x02, 0x0f};
+static unsigned char courier12_255_bits[] = {
+0x14, 0x00, 0x63, 0x22, 0x24, 0x14, 0x08, 0x04, 0x0f};
+static RotFont courier12font[] = {
+{5, 1, 1, courier12_0_bits},
+{5, 1, 1, courier12_1_bits},
+{5, 1, 1, courier12_2_bits},
+{5, 1, 1, courier12_3_bits},
+{5, 1, 1, courier12_4_bits},
+{5, 1, 1, courier12_5_bits},
+{5, 1, 1, courier12_6_bits},
+{5, 1, 1, courier12_7_bits},
+{5, 1, 1, courier12_8_bits},
+{5, 1, 1, courier12_9_bits},
+{5, 1, 1, courier12_10_bits},
+{5, 1, 1, courier12_11_bits},
+{5, 1, 1, courier12_12_bits},
+{5, 1, 1, courier12_13_bits},
+{5, 1, 1, courier12_14_bits},
+{5, 1, 1, courier12_15_bits},
+{5, 1, 1, courier12_16_bits},
+{5, 1, 1, courier12_17_bits},
+{5, 1, 1, courier12_18_bits},
+{5, 1, 1, courier12_19_bits},
+{5, 1, 1, courier12_20_bits},
+{5, 1, 1, courier12_21_bits},
+{5, 1, 1, courier12_22_bits},
+{5, 1, 1, courier12_23_bits},
+{5, 1, 1, courier12_24_bits},
+{5, 1, 1, courier12_25_bits},
+{5, 1, 1, courier12_26_bits},
+{5, 1, 1, courier12_27_bits},
+{5, 1, 1, courier12_28_bits},
+{5, 1, 1, courier12_29_bits},
+{5, 1, 1, courier12_30_bits},
+{5, 1, 1, courier12_31_bits},
+{5, 0, 0, courier12_32_bits},
+{2, 7, 7, courier12_33_bits},
+{3, 3, 7, courier12_34_bits},
+{5, 9, 8, courier12_35_bits},
+{5, 10, 8, courier12_36_bits},
+{7, 7, 7, courier12_37_bits},
+{5, 7, 7, courier12_38_bits},
+{2, 3, 7, courier12_39_bits},
+{3, 9, 8, courier12_40_bits},
+{2, 9, 8, courier12_41_bits},
+{5, 4, 7, courier12_42_bits},
+{5, 5, 6, courier12_43_bits},
+{2, 3, 2, courier12_44_bits},
+{6, 1, 4, courier12_45_bits},
+{2, 2, 2, courier12_46_bits},
+{5, 10, 8, courier12_47_bits},
+{5, 7, 7, courier12_48_bits},
+{5, 7, 7, courier12_49_bits},
+{5, 7, 7, courier12_50_bits},
+{5, 7, 7, courier12_51_bits},
+{5, 7, 7, courier12_52_bits},
+{5, 7, 7, courier12_53_bits},
+{5, 7, 7, courier12_54_bits},
+{5, 7, 7, courier12_55_bits},
+{5, 7, 7, courier12_56_bits},
+{5, 7, 7, courier12_57_bits},
+{2, 5, 5, courier12_58_bits},
+{3, 6, 5, courier12_59_bits},
+{6, 5, 6, courier12_60_bits},
+{6, 3, 5, courier12_61_bits},
+{6, 5, 6, courier12_62_bits},
+{5, 7, 7, courier12_63_bits},
+{7, 7, 7, courier12_64_bits},
+{7, 7, 7, courier12_65_bits},
+{6, 7, 7, courier12_66_bits},
+{6, 7, 7, courier12_67_bits},
+{7, 7, 7, courier12_68_bits},
+{6, 7, 7, courier12_69_bits},
+{6, 7, 7, courier12_70_bits},
+{7, 7, 7, courier12_71_bits},
+{7, 7, 7, courier12_72_bits},
+{5, 7, 7, courier12_73_bits},
+{6, 7, 7, courier12_74_bits},
+{6, 7, 7, courier12_75_bits},
+{6, 7, 7, courier12_76_bits},
+{7, 7, 7, courier12_77_bits},
+{7, 7, 7, courier12_78_bits},
+{7, 7, 7, courier12_79_bits},
+{6, 7, 7, courier12_80_bits},
+{7, 9, 7, courier12_81_bits},
+{6, 7, 7, courier12_82_bits},
+{5, 7, 7, courier12_83_bits},
+{7, 7, 7, courier12_84_bits},
+{7, 7, 7, courier12_85_bits},
+{7, 7, 7, courier12_86_bits},
+{7, 7, 7, courier12_87_bits},
+{7, 7, 7, courier12_88_bits},
+{6, 7, 7, courier12_89_bits},
+{5, 7, 7, courier12_90_bits},
+{2, 9, 8, courier12_91_bits},
+{5, 10, 8, courier12_92_bits},
+{3, 9, 8, courier12_93_bits},
+{5, 6, 7, courier12_94_bits},
+{8, 1, -1, courier12_95_bits},
+{2, 3, 7, courier12_96_bits},
+{6, 5, 5, courier12_97_bits},
+{7, 7, 7, courier12_98_bits},
+{6, 5, 5, courier12_99_bits},
+{7, 7, 7, courier12_100_bits},
+{6, 5, 5, courier12_101_bits},
+{6, 7, 7, courier12_102_bits},
+{7, 7, 5, courier12_103_bits},
+{7, 7, 7, courier12_104_bits},
+{5, 8, 8, courier12_105_bits},
+{4, 10, 8, courier12_106_bits},
+{7, 7, 7, courier12_107_bits},
+{5, 7, 7, courier12_108_bits},
+{7, 5, 5, courier12_109_bits},
+{7, 5, 5, courier12_110_bits},
+{7, 5, 5, courier12_111_bits},
+{7, 7, 5, courier12_112_bits},
+{7, 7, 5, courier12_113_bits},
+{6, 5, 5, courier12_114_bits},
+{5, 5, 5, courier12_115_bits},
+{5, 7, 7, courier12_116_bits},
+{7, 5, 5, courier12_117_bits},
+{7, 5, 5, courier12_118_bits},
+{7, 5, 5, courier12_119_bits},
+{7, 5, 5, courier12_120_bits},
+{7, 7, 5, courier12_121_bits},
+{5, 5, 5, courier12_122_bits},
+{3, 9, 8, courier12_123_bits},
+{1, 10, 8, courier12_124_bits},
+{2, 9, 8, courier12_125_bits},
+{5, 2, 5, courier12_126_bits},
+{5, 1, 1, courier12_127_bits},
+{5, 1, 1, courier12_128_bits},
+{5, 1, 1, courier12_129_bits},
+{5, 1, 1, courier12_130_bits},
+{5, 1, 1, courier12_131_bits},
+{5, 1, 1, courier12_132_bits},
+{5, 1, 1, courier12_133_bits},
+{5, 1, 1, courier12_134_bits},
+{5, 1, 1, courier12_135_bits},
+{5, 1, 1, courier12_136_bits},
+{5, 1, 1, courier12_137_bits},
+{5, 1, 1, courier12_138_bits},
+{5, 1, 1, courier12_139_bits},
+{5, 1, 1, courier12_140_bits},
+{5, 1, 1, courier12_141_bits},
+{5, 1, 1, courier12_142_bits},
+{5, 1, 1, courier12_143_bits},
+{5, 1, 1, courier12_144_bits},
+{5, 1, 1, courier12_145_bits},
+{5, 1, 1, courier12_146_bits},
+{5, 1, 1, courier12_147_bits},
+{5, 1, 1, courier12_148_bits},
+{5, 1, 1, courier12_149_bits},
+{5, 1, 1, courier12_150_bits},
+{5, 1, 1, courier12_151_bits},
+{5, 1, 1, courier12_152_bits},
+{5, 1, 1, courier12_153_bits},
+{5, 1, 1, courier12_154_bits},
+{5, 1, 1, courier12_155_bits},
+{5, 1, 1, courier12_156_bits},
+{5, 1, 1, courier12_157_bits},
+{5, 1, 1, courier12_158_bits},
+{5, 1, 1, courier12_159_bits},
+{5, 1, 1, courier12_160_bits},
+{2, 7, 5, courier12_161_bits},
+{5, 8, 7, courier12_162_bits},
+{5, 7, 7, courier12_163_bits},
+{5, 5, 6, courier12_164_bits},
+{6, 7, 7, courier12_165_bits},
+{1, 10, 8, courier12_166_bits},
+{5, 8, 7, courier12_167_bits},
+{3, 1, 7, courier12_168_bits},
+{7, 7, 7, courier12_169_bits},
+{3, 4, 7, courier12_170_bits},
+{5, 5, 5, courier12_171_bits},
+{5, 3, 5, courier12_172_bits},
+{3, 1, 4, courier12_173_bits},
+{7, 7, 7, courier12_174_bits},
+{4, 1, 7, courier12_175_bits},
+{4, 3, 7, courier12_176_bits},
+{5, 7, 7, courier12_177_bits},
+{3, 4, 7, courier12_178_bits},
+{3, 4, 7, courier12_179_bits},
+{2, 1, 7, courier12_180_bits},
+{7, 7, 5, courier12_181_bits},
+{5, 8, 7, courier12_182_bits},
+{2, 2, 5, courier12_183_bits},
+{3, 3, 1, courier12_184_bits},
+{3, 4, 7, courier12_185_bits},
+{3, 4, 7, courier12_186_bits},
+{5, 5, 5, courier12_187_bits},
+{7, 9, 8, courier12_188_bits},
+{7, 9, 8, courier12_189_bits},
+{7, 9, 8, courier12_190_bits},
+{5, 7, 5, courier12_191_bits},
+{7, 9, 9, courier12_192_bits},
+{7, 9, 9, courier12_193_bits},
+{7, 9, 9, courier12_194_bits},
+{7, 9, 9, courier12_195_bits},
+{7, 9, 9, courier12_196_bits},
+{7, 10, 10, courier12_197_bits},
+{7, 7, 7, courier12_198_bits},
+{7, 9, 7, courier12_199_bits},
+{6, 9, 9, courier12_200_bits},
+{6, 9, 9, courier12_201_bits},
+{6, 9, 9, courier12_202_bits},
+{6, 9, 9, courier12_203_bits},
+{5, 9, 9, courier12_204_bits},
+{5, 9, 9, courier12_205_bits},
+{5, 9, 9, courier12_206_bits},
+{5, 9, 9, courier12_207_bits},
+{7, 7, 7, courier12_208_bits},
+{7, 9, 9, courier12_209_bits},
+{7, 9, 9, courier12_210_bits},
+{7, 9, 9, courier12_211_bits},
+{7, 9, 9, courier12_212_bits},
+{7, 9, 9, courier12_213_bits},
+{7, 9, 9, courier12_214_bits},
+{4, 5, 6, courier12_215_bits},
+{7, 7, 7, courier12_216_bits},
+{7, 9, 9, courier12_217_bits},
+{7, 9, 9, courier12_218_bits},
+{7, 9, 9, courier12_219_bits},
+{7, 9, 9, courier12_220_bits},
+{6, 9, 9, courier12_221_bits},
+{6, 7, 7, courier12_222_bits},
+{5, 7, 7, courier12_223_bits},
+{6, 7, 7, courier12_224_bits},
+{6, 7, 7, courier12_225_bits},
+{6, 7, 7, courier12_226_bits},
+{6, 7, 7, courier12_227_bits},
+{6, 7, 7, courier12_228_bits},
+{6, 8, 8, courier12_229_bits},
+{7, 5, 5, courier12_230_bits},
+{6, 7, 5, courier12_231_bits},
+{6, 7, 7, courier12_232_bits},
+{6, 7, 7, courier12_233_bits},
+{6, 7, 7, courier12_234_bits},
+{6, 7, 7, courier12_235_bits},
+{5, 7, 7, courier12_236_bits},
+{5, 7, 7, courier12_237_bits},
+{5, 7, 7, courier12_238_bits},
+{5, 7, 7, courier12_239_bits},
+{7, 8, 8, courier12_240_bits},
+{7, 7, 7, courier12_241_bits},
+{7, 7, 7, courier12_242_bits},
+{7, 7, 7, courier12_243_bits},
+{7, 7, 7, courier12_244_bits},
+{7, 7, 7, courier12_245_bits},
+{7, 7, 7, courier12_246_bits},
+{5, 5, 6, courier12_247_bits},
+{7, 5, 5, courier12_248_bits},
+{7, 7, 7, courier12_249_bits},
+{7, 7, 7, courier12_250_bits},
+{7, 7, 7, courier12_251_bits},
+{7, 7, 7, courier12_252_bits},
+{7, 9, 7, courier12_253_bits},
+{7, 9, 7, courier12_254_bits},
+{7, 9, 7, courier12_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier14.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier14.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier14.bdf	(revision 15879)
@@ -0,0 +1,3076 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Courier-Medium-R-Normal--14-100-100-100-M-90-ISO8859-1
+SIZE 10 100 100
+FONTBOUNDINGBOX 10 15 -1 -3
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Courier"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 14
+POINT_SIZE 100
+RESOLUTION_X 100
+RESOLUTION_Y 100
+SPACING "M"
+AVERAGE_WIDTH 90
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 9
+X_HEIGHT 7
+FACE_NAME "Courier"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "No mark"
+_DEC_DEVICE_FONTNAMES "PS=Courier"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Courier"
+FONT "-Adobe-Courier-Medium-R-Normal--14-100-100-100-M-90-ISO8859-1"
+WEIGHT 10
+RESOLUTION 138
+QUAD_WIDTH 9
+DEFAULT_CHAR 32
+FONT_ASCENT 11
+FONT_DESCENT 3
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 1 9 3 0
+BITMAP
+80
+80
+80
+80
+80
+80
+00
+80
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 4 4 2 6
+BITMAP
+90
+90
+90
+90
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 10 2 -1
+BITMAP
+50
+50
+50
+f8
+50
+50
+f8
+50
+50
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 13 2 -2
+BITMAP
+20
+20
+78
+88
+80
+c0
+30
+08
+88
+f0
+20
+20
+20
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+60
+90
+90
+73
+0c
+30
+cc
+12
+12
+0c
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 8 1 0
+BITMAP
+38
+40
+40
+40
+a8
+90
+98
+64
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 4 2 6
+BITMAP
+60
+60
+c0
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 12 3 -2
+BITMAP
+20
+40
+40
+80
+80
+80
+80
+80
+80
+40
+40
+20
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 12 2 -2
+BITMAP
+80
+40
+40
+20
+20
+20
+20
+20
+20
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 6 1 3
+BITMAP
+20
+20
+f8
+20
+50
+88
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 1
+BITMAP
+10
+10
+10
+fe
+10
+10
+10
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 4 2 -2
+BITMAP
+60
+60
+c0
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 1 1 4
+BITMAP
+fe
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 2 2 3 0
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 11 1 -1
+BITMAP
+04
+08
+08
+10
+10
+20
+20
+40
+40
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 10 1 0
+BITMAP
+30
+48
+84
+84
+84
+84
+84
+84
+48
+30
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 10 1 0
+BITMAP
+20
+60
+a0
+20
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 10 1 0
+BITMAP
+70
+88
+88
+08
+10
+20
+40
+80
+88
+f8
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 10 1 0
+BITMAP
+38
+44
+04
+04
+18
+04
+04
+04
+84
+78
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 10 1 0
+BITMAP
+18
+28
+28
+48
+48
+88
+88
+fc
+08
+1c
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 10 1 0
+BITMAP
+7c
+40
+40
+40
+78
+04
+04
+04
+84
+78
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 10 1 0
+BITMAP
+38
+40
+80
+80
+b8
+c4
+84
+84
+44
+38
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 10 1 0
+BITMAP
+fc
+84
+04
+08
+08
+08
+10
+10
+10
+10
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 10 2 0
+BITMAP
+70
+88
+88
+88
+70
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 10 1 0
+BITMAP
+70
+88
+84
+84
+8c
+74
+04
+04
+08
+70
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 2 7 3 0
+BITMAP
+c0
+c0
+00
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 9 2 -2
+BITMAP
+60
+60
+00
+00
+00
+60
+60
+c0
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 0 1
+BITMAP
+06
+18
+60
+80
+60
+18
+06
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 3 1 3
+BITMAP
+fe
+00
+fe
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 1
+BITMAP
+c0
+30
+0c
+02
+0c
+30
+c0
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 9 1 0
+BITMAP
+70
+88
+08
+08
+30
+20
+00
+20
+20
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 -1
+BITMAP
+38
+44
+84
+9c
+a4
+a4
+9e
+80
+40
+38
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 9 -1 0
+BITMAP
+3800
+0800
+1400
+1400
+2200
+3e00
+4100
+4100
+f780
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 0 0
+BITMAP
+fc
+42
+42
+42
+7c
+42
+42
+42
+fc
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+3a
+46
+82
+80
+80
+80
+80
+42
+3c
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+fc
+42
+41
+41
+41
+41
+41
+42
+fc
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+fe
+42
+42
+48
+78
+48
+42
+42
+fe
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+fe
+42
+42
+48
+78
+48
+40
+40
+f0
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+3a
+46
+82
+80
+80
+8f
+82
+42
+3c
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+e7
+42
+42
+42
+7e
+42
+42
+42
+e7
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 9 2 0
+BITMAP
+f8
+20
+20
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+3e
+08
+08
+08
+08
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+ee
+44
+48
+50
+70
+48
+44
+44
+e3
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+f8
+20
+20
+20
+20
+21
+21
+21
+ff
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+e380
+6300
+5500
+5500
+4900
+4900
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+e7
+62
+52
+52
+4a
+4a
+46
+46
+e2
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+fc
+42
+42
+42
+42
+7c
+40
+40
+f0
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 11 0 -2
+BITMAP
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+31
+5e
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+fc
+42
+42
+42
+44
+78
+44
+42
+e1
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 9 1 0
+BITMAP
+74
+8c
+84
+80
+78
+04
+84
+c4
+b8
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+fe
+92
+92
+10
+10
+10
+10
+10
+7c
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+e7
+42
+42
+42
+42
+42
+42
+42
+3c
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+e380
+4100
+4100
+2200
+2200
+1400
+1400
+0800
+0800
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+e380
+4100
+4900
+4900
+5500
+5500
+2200
+2200
+2200
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+e7
+42
+24
+24
+18
+24
+24
+42
+e7
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 0 0
+BITMAP
+ee
+44
+44
+28
+28
+10
+10
+10
+7c
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 9 1 0
+BITMAP
+fc
+84
+88
+10
+20
+20
+44
+84
+fc
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 12 3 -2
+BITMAP
+e0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+e0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 11 1 -1
+BITMAP
+80
+40
+40
+20
+20
+10
+10
+08
+08
+04
+04
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 12 2 -2
+BITMAP
+e0
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+e0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 5 2 4
+BITMAP
+20
+50
+50
+88
+88
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 1 0 -3
+BITMAP
+ff80
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 4 2 6
+BITMAP
+c0
+c0
+60
+20
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 0
+BITMAP
+78
+84
+04
+7c
+84
+84
+7a
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+c0
+40
+40
+5c
+62
+41
+41
+41
+62
+dc
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 0
+BITMAP
+3a
+46
+82
+80
+80
+42
+3c
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+06
+02
+02
+3a
+46
+82
+82
+82
+46
+3b
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 0
+BITMAP
+38
+44
+82
+fe
+80
+42
+3c
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+1e
+20
+20
+fc
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 -3
+BITMAP
+3b
+46
+82
+82
+82
+46
+3a
+02
+04
+78
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+c0
+40
+40
+5c
+62
+42
+42
+42
+42
+e7
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 10 2 0
+BITMAP
+20
+20
+00
+e0
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 13 1 -3
+BITMAP
+08
+08
+00
+f8
+08
+08
+08
+08
+08
+08
+08
+10
+e0
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+c0
+40
+40
+4e
+48
+50
+60
+50
+48
+ce
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 10 2 0
+BITMAP
+e0
+20
+20
+20
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 7 0 0
+BITMAP
+db00
+6d00
+4900
+4900
+4900
+4900
+ed80
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+dc
+62
+42
+42
+42
+42
+e7
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+3c
+42
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 -3
+BITMAP
+dc
+62
+41
+41
+41
+62
+5c
+40
+40
+f0
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 -3
+BITMAP
+3b
+46
+82
+82
+82
+46
+3a
+02
+02
+0f
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 0
+BITMAP
+cc
+52
+60
+40
+40
+40
+f8
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 7 1 0
+BITMAP
+7c
+84
+80
+78
+04
+84
+f8
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 0 0
+BITMAP
+20
+20
+fc
+20
+20
+20
+20
+22
+1c
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+c6
+42
+42
+42
+42
+46
+3b
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+e7
+42
+42
+24
+24
+18
+18
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 7 0 0
+BITMAP
+e380
+4100
+4900
+4900
+2a00
+3600
+2200
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 0 0
+BITMAP
+ee
+44
+28
+10
+28
+44
+ee
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 -3
+BITMAP
+e7
+42
+42
+24
+24
+18
+08
+10
+10
+78
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 7 2 0
+BITMAP
+f8
+88
+10
+20
+40
+88
+f8
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 12 2 -2
+BITMAP
+20
+40
+40
+40
+40
+80
+40
+40
+40
+40
+40
+20
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 1 11 3 -2
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 12 2 -2
+BITMAP
+80
+40
+40
+40
+40
+20
+40
+40
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 2 1 3
+BITMAP
+64
+98
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 1 9 4 -2
+BITMAP
+80
+80
+00
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 9 2 0
+BITMAP
+20
+20
+78
+88
+80
+88
+70
+20
+20
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+18
+24
+20
+20
+78
+20
+20
+42
+fc
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 6 1 1
+BITMAP
+b4
+48
+84
+84
+48
+b4
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+ee
+44
+44
+28
+7c
+10
+7c
+10
+38
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 1 11 3 -2
+BITMAP
+80
+80
+80
+80
+00
+00
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 10 1 -1
+BITMAP
+3c
+44
+40
+f0
+88
+44
+3c
+08
+88
+f0
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 1 2 8
+BITMAP
+d8
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+3c
+42
+99
+a5
+a1
+a5
+99
+42
+3c
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 4 6 2 3
+BITMAP
+c0
+20
+e0
+b0
+00
+f0
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+11
+22
+44
+cc
+44
+22
+11
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 3 1 3
+BITMAP
+fe
+02
+02
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 1 1 4
+BITMAP
+fc
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+3c
+42
+b9
+a5
+b9
+a9
+a5
+42
+3c
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 4 1 2 8
+BITMAP
+f0
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 4 4 2 6
+BITMAP
+60
+90
+90
+60
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 1
+BITMAP
+10
+10
+fe
+10
+10
+00
+fe
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 4 6 2 4
+BITMAP
+60
+90
+10
+20
+40
+f0
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 4 6 2 4
+BITMAP
+60
+90
+60
+10
+90
+60
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 4 2 2 8
+BITMAP
+30
+c0
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 -3
+BITMAP
+c6
+42
+42
+42
+42
+46
+7b
+40
+40
+40
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 -1
+BITMAP
+7e
+94
+94
+94
+74
+14
+14
+14
+14
+3e
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 2 2 3 3
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 3 2 -3
+BITMAP
+40
+20
+e0
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 3 6 3 4
+BITMAP
+40
+c0
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 4 6 2 3
+BITMAP
+60
+90
+90
+60
+00
+f0
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+88
+44
+22
+33
+22
+44
+88
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 10 10 -1 0
+BITMAP
+4000
+c100
+4200
+4400
+4480
+e980
+1280
+1480
+27c0
+4080
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 10 10 -1 0
+BITMAP
+4000
+c100
+4200
+4400
+4580
+ea40
+1040
+1080
+2100
+43c0
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 10 10 -1 0
+BITMAP
+6000
+9100
+6200
+1400
+9480
+6980
+1280
+1480
+27c0
+4080
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 9 2 -2
+BITMAP
+20
+20
+00
+20
+60
+80
+80
+88
+70
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+3000
+0c00
+0000
+3800
+0800
+1400
+1400
+2200
+3e00
+4100
+4100
+f780
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+0c00
+3000
+0000
+3800
+0800
+1400
+1400
+2200
+3e00
+4100
+4100
+f780
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+0800
+1400
+0000
+3800
+0800
+1400
+1400
+2200
+3e00
+4100
+4100
+f780
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+1a00
+2c00
+0000
+3800
+0800
+1400
+1400
+2200
+3e00
+4100
+4100
+f780
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 11 0 0
+BITMAP
+3600
+0000
+3800
+0800
+1400
+1400
+2200
+3e00
+4100
+4100
+f780
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+1800
+2400
+1800
+3800
+0800
+1400
+1400
+2200
+3e00
+4100
+4100
+f780
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 9 -1 0
+BITMAP
+1f80
+0c80
+1400
+1480
+2780
+3c80
+4400
+4480
+ef80
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 12 1 -3
+BITMAP
+3a
+46
+82
+80
+80
+80
+80
+42
+3c
+10
+08
+38
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+60
+18
+00
+fe
+42
+42
+48
+78
+48
+42
+42
+fe
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+0c
+30
+00
+fe
+42
+42
+48
+78
+48
+42
+42
+fe
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+10
+28
+00
+fe
+42
+42
+48
+78
+48
+42
+42
+fe
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 11 1 0
+BITMAP
+6c
+00
+fe
+42
+42
+48
+78
+48
+42
+42
+fe
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 12 2 0
+BITMAP
+c0
+30
+00
+f8
+20
+20
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 12 2 0
+BITMAP
+18
+60
+00
+f8
+20
+20
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 12 2 0
+BITMAP
+20
+50
+00
+f8
+20
+20
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 11 2 0
+BITMAP
+d8
+00
+f8
+20
+20
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+fc
+42
+41
+41
+f1
+41
+41
+42
+fc
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+1a
+2c
+00
+e7
+62
+52
+52
+4a
+4a
+46
+46
+e2
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+30
+0c
+00
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+0c
+30
+00
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+10
+28
+00
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+1a
+2c
+00
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 11 0 0
+BITMAP
+66
+00
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 1
+BITMAP
+82
+44
+28
+10
+28
+44
+82
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 9 -1 0
+BITMAP
+1e80
+2100
+4280
+4480
+4880
+5080
+2080
+6100
+9e00
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+30
+0c
+00
+e7
+42
+42
+42
+42
+42
+42
+42
+3c
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+0c
+30
+00
+e7
+42
+42
+42
+42
+42
+42
+42
+3c
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+10
+28
+00
+e7
+42
+42
+42
+42
+42
+42
+42
+3c
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 11 0 0
+BITMAP
+66
+00
+e7
+42
+42
+42
+42
+42
+42
+42
+3c
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+0c
+30
+00
+ee
+44
+44
+28
+28
+10
+10
+10
+7c
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 0 0
+BITMAP
+e0
+40
+7c
+42
+42
+42
+7c
+40
+e0
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 0 0
+BITMAP
+38
+44
+44
+58
+44
+42
+42
+52
+cc
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+60
+18
+00
+78
+84
+04
+7c
+84
+8c
+76
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+18
+60
+00
+78
+84
+04
+7c
+84
+8c
+76
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+10
+28
+00
+78
+84
+04
+7c
+84
+8c
+76
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+34
+58
+00
+78
+84
+04
+7c
+84
+8c
+76
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+6c
+00
+78
+84
+04
+7c
+84
+8c
+76
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+30
+48
+30
+78
+84
+04
+7c
+84
+8c
+76
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+76
+89
+09
+7f
+88
+89
+76
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 -3
+BITMAP
+3a
+46
+82
+80
+80
+42
+3c
+10
+08
+38
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+60
+18
+00
+38
+44
+82
+fe
+80
+42
+3c
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+0c
+30
+00
+38
+44
+82
+fe
+80
+42
+3c
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+10
+28
+00
+38
+44
+82
+fe
+80
+42
+3c
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+6c
+00
+38
+44
+82
+fe
+80
+42
+3c
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 10 2 0
+BITMAP
+c0
+30
+00
+e0
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 10 2 0
+BITMAP
+30
+c0
+00
+e0
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 10 2 0
+BITMAP
+20
+50
+00
+e0
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 5 9 2 0
+BITMAP
+d8
+00
+e0
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+02
+e4
+18
+28
+44
+3c
+42
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+1a
+2c
+00
+dc
+62
+42
+42
+42
+42
+e7
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+30
+0c
+00
+3c
+42
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+0c
+30
+00
+3c
+42
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+10
+28
+00
+3c
+42
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+1a
+2c
+00
+3c
+42
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+6c
+00
+3c
+42
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 7 0 1
+BITMAP
+18
+18
+00
+ff
+00
+18
+18
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+3d
+46
+89
+91
+a1
+42
+bc
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+30
+0c
+00
+c6
+42
+42
+42
+42
+46
+3b
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+0c
+30
+00
+c6
+42
+42
+42
+42
+46
+3b
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+10
+28
+00
+c6
+42
+42
+42
+42
+46
+3b
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+6c
+00
+c6
+42
+42
+42
+42
+46
+3b
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 13 0 -3
+BITMAP
+06
+18
+00
+e7
+42
+42
+24
+24
+18
+08
+10
+10
+78
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 -3
+BITMAP
+c0
+40
+5c
+62
+41
+41
+41
+62
+5c
+40
+40
+f0
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 12 0 -3
+BITMAP
+36
+00
+e7
+42
+42
+24
+24
+18
+08
+10
+10
+78
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier14.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier14.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier14.h	(revision 15879)
@@ -0,0 +1,789 @@
+static unsigned char courier14_0_bits[] = {
+0x00};
+static unsigned char courier14_1_bits[] = {
+0x00};
+static unsigned char courier14_2_bits[] = {
+0x00};
+static unsigned char courier14_3_bits[] = {
+0x00};
+static unsigned char courier14_4_bits[] = {
+0x00};
+static unsigned char courier14_5_bits[] = {
+0x00};
+static unsigned char courier14_6_bits[] = {
+0x00};
+static unsigned char courier14_7_bits[] = {
+0x00};
+static unsigned char courier14_8_bits[] = {
+0x00};
+static unsigned char courier14_9_bits[] = {
+0x00};
+static unsigned char courier14_10_bits[] = {
+0x00};
+static unsigned char courier14_11_bits[] = {
+0x00};
+static unsigned char courier14_12_bits[] = {
+0x00};
+static unsigned char courier14_13_bits[] = {
+0x00};
+static unsigned char courier14_14_bits[] = {
+0x00};
+static unsigned char courier14_15_bits[] = {
+0x00};
+static unsigned char courier14_16_bits[] = {
+0x00};
+static unsigned char courier14_17_bits[] = {
+0x00};
+static unsigned char courier14_18_bits[] = {
+0x00};
+static unsigned char courier14_19_bits[] = {
+0x00};
+static unsigned char courier14_20_bits[] = {
+0x00};
+static unsigned char courier14_21_bits[] = {
+0x00};
+static unsigned char courier14_22_bits[] = {
+0x00};
+static unsigned char courier14_23_bits[] = {
+0x00};
+static unsigned char courier14_24_bits[] = {
+0x00};
+static unsigned char courier14_25_bits[] = {
+0x00};
+static unsigned char courier14_26_bits[] = {
+0x00};
+static unsigned char courier14_27_bits[] = {
+0x00};
+static unsigned char courier14_28_bits[] = {
+0x00};
+static unsigned char courier14_29_bits[] = {
+0x00};
+static unsigned char courier14_30_bits[] = {
+0x00};
+static unsigned char courier14_31_bits[] = {
+0x00};
+static unsigned char courier14_32_bits[] = {
+0x00};
+static unsigned char courier14_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01};
+static unsigned char courier14_34_bits[] = {
+0x09, 0x09, 0x09, 0x09};
+static unsigned char courier14_35_bits[] = {
+0x0a, 0x0a, 0x0a, 0x1f, 0x0a, 0x0a, 0x1f, 0x0a, 0x0a, 0x0a};
+static unsigned char courier14_36_bits[] = {
+0x04, 0x04, 0x1e, 0x11, 0x01, 0x03, 0x0c, 0x10, 0x11, 0x0f, 0x04, 0x04, 
+0x04};
+static unsigned char courier14_37_bits[] = {
+0x06, 0x09, 0x09, 0xce, 0x30, 0x0c, 0x33, 0x48, 0x48, 0x30};
+static unsigned char courier14_38_bits[] = {
+0x1c, 0x02, 0x02, 0x02, 0x15, 0x09, 0x19, 0x26};
+static unsigned char courier14_39_bits[] = {
+0x06, 0x06, 0x03, 0x01};
+static unsigned char courier14_40_bits[] = {
+0x04, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x04};
+static unsigned char courier14_41_bits[] = {
+0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x02, 0x01};
+static unsigned char courier14_42_bits[] = {
+0x04, 0x04, 0x1f, 0x04, 0x0a, 0x11};
+static unsigned char courier14_43_bits[] = {
+0x08, 0x08, 0x08, 0x7f, 0x08, 0x08, 0x08};
+static unsigned char courier14_44_bits[] = {
+0x06, 0x06, 0x03, 0x01};
+static unsigned char courier14_45_bits[] = {
+0x7f};
+static unsigned char courier14_46_bits[] = {
+0x03, 0x03};
+static unsigned char courier14_47_bits[] = {
+0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01};
+static unsigned char courier14_48_bits[] = {
+0x0c, 0x12, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x12, 0x0c};
+static unsigned char courier14_49_bits[] = {
+0x04, 0x06, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_50_bits[] = {
+0x0e, 0x11, 0x11, 0x10, 0x08, 0x04, 0x02, 0x01, 0x11, 0x1f};
+static unsigned char courier14_51_bits[] = {
+0x1c, 0x22, 0x20, 0x20, 0x18, 0x20, 0x20, 0x20, 0x21, 0x1e};
+static unsigned char courier14_52_bits[] = {
+0x18, 0x14, 0x14, 0x12, 0x12, 0x11, 0x11, 0x3f, 0x10, 0x38};
+static unsigned char courier14_53_bits[] = {
+0x3e, 0x02, 0x02, 0x02, 0x1e, 0x20, 0x20, 0x20, 0x21, 0x1e};
+static unsigned char courier14_54_bits[] = {
+0x1c, 0x02, 0x01, 0x01, 0x1d, 0x23, 0x21, 0x21, 0x22, 0x1c};
+static unsigned char courier14_55_bits[] = {
+0x3f, 0x21, 0x20, 0x10, 0x10, 0x10, 0x08, 0x08, 0x08, 0x08};
+static unsigned char courier14_56_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char courier14_57_bits[] = {
+0x0e, 0x11, 0x21, 0x21, 0x31, 0x2e, 0x20, 0x20, 0x10, 0x0e};
+static unsigned char courier14_58_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x00, 0x03, 0x03};
+static unsigned char courier14_59_bits[] = {
+0x06, 0x06, 0x00, 0x00, 0x00, 0x06, 0x06, 0x03, 0x01};
+static unsigned char courier14_60_bits[] = {
+0x60, 0x18, 0x06, 0x01, 0x06, 0x18, 0x60};
+static unsigned char courier14_61_bits[] = {
+0x7f, 0x00, 0x7f};
+static unsigned char courier14_62_bits[] = {
+0x03, 0x0c, 0x30, 0x40, 0x30, 0x0c, 0x03};
+static unsigned char courier14_63_bits[] = {
+0x0e, 0x11, 0x10, 0x10, 0x0c, 0x04, 0x00, 0x04, 0x04};
+static unsigned char courier14_64_bits[] = {
+0x1c, 0x22, 0x21, 0x39, 0x25, 0x25, 0x79, 0x01, 0x02, 0x1c};
+static unsigned char courier14_65_bits[] = {
+0x1c, 0x00, 0x10, 0x00, 0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0xef, 0x01};
+static unsigned char courier14_66_bits[] = {
+0x3f, 0x42, 0x42, 0x42, 0x3e, 0x42, 0x42, 0x42, 0x3f};
+static unsigned char courier14_67_bits[] = {
+0x5c, 0x62, 0x41, 0x01, 0x01, 0x01, 0x01, 0x42, 0x3c};
+static unsigned char courier14_68_bits[] = {
+0x3f, 0x42, 0x82, 0x82, 0x82, 0x82, 0x82, 0x42, 0x3f};
+static unsigned char courier14_69_bits[] = {
+0x7f, 0x42, 0x42, 0x12, 0x1e, 0x12, 0x42, 0x42, 0x7f};
+static unsigned char courier14_70_bits[] = {
+0x7f, 0x42, 0x42, 0x12, 0x1e, 0x12, 0x02, 0x02, 0x0f};
+static unsigned char courier14_71_bits[] = {
+0x5c, 0x62, 0x41, 0x01, 0x01, 0xf1, 0x41, 0x42, 0x3c};
+static unsigned char courier14_72_bits[] = {
+0xe7, 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0xe7};
+static unsigned char courier14_73_bits[] = {
+0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_74_bits[] = {
+0x7c, 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char courier14_75_bits[] = {
+0x77, 0x22, 0x12, 0x0a, 0x0e, 0x12, 0x22, 0x22, 0xc7};
+static unsigned char courier14_76_bits[] = {
+0x1f, 0x04, 0x04, 0x04, 0x04, 0x84, 0x84, 0x84, 0xff};
+static unsigned char courier14_77_bits[] = {
+0xc7, 0x01, 0xc6, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0x92, 0x00, 0x92, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char courier14_78_bits[] = {
+0xe7, 0x46, 0x4a, 0x4a, 0x52, 0x52, 0x62, 0x62, 0x47};
+static unsigned char courier14_79_bits[] = {
+0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_80_bits[] = {
+0x3f, 0x42, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x02, 0x0f};
+static unsigned char courier14_81_bits[] = {
+0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x8c, 0x7a};
+static unsigned char courier14_82_bits[] = {
+0x3f, 0x42, 0x42, 0x42, 0x22, 0x1e, 0x22, 0x42, 0x87};
+static unsigned char courier14_83_bits[] = {
+0x2e, 0x31, 0x21, 0x01, 0x1e, 0x20, 0x21, 0x23, 0x1d};
+static unsigned char courier14_84_bits[] = {
+0x7f, 0x49, 0x49, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3e};
+static unsigned char courier14_85_bits[] = {
+0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c};
+static unsigned char courier14_86_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char courier14_87_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x92, 0x00, 0x92, 0x00, 0xaa, 0x00, 0xaa, 0x00, 
+0x44, 0x00, 0x44, 0x00, 0x44, 0x00};
+static unsigned char courier14_88_bits[] = {
+0xe7, 0x42, 0x24, 0x24, 0x18, 0x24, 0x24, 0x42, 0xe7};
+static unsigned char courier14_89_bits[] = {
+0x77, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 0x08, 0x3e};
+static unsigned char courier14_90_bits[] = {
+0x3f, 0x21, 0x11, 0x08, 0x04, 0x04, 0x22, 0x21, 0x3f};
+static unsigned char courier14_91_bits[] = {
+0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07};
+static unsigned char courier14_92_bits[] = {
+0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20};
+static unsigned char courier14_93_bits[] = {
+0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07};
+static unsigned char courier14_94_bits[] = {
+0x04, 0x0a, 0x0a, 0x11, 0x11};
+static unsigned char courier14_95_bits[] = {
+0xff, 0x01};
+static unsigned char courier14_96_bits[] = {
+0x03, 0x03, 0x06, 0x04};
+static unsigned char courier14_97_bits[] = {
+0x1e, 0x21, 0x20, 0x3e, 0x21, 0x21, 0x5e};
+static unsigned char courier14_98_bits[] = {
+0x03, 0x02, 0x02, 0x3a, 0x46, 0x82, 0x82, 0x82, 0x46, 0x3b};
+static unsigned char courier14_99_bits[] = {
+0x5c, 0x62, 0x41, 0x01, 0x01, 0x42, 0x3c};
+static unsigned char courier14_100_bits[] = {
+0x60, 0x40, 0x40, 0x5c, 0x62, 0x41, 0x41, 0x41, 0x62, 0xdc};
+static unsigned char courier14_101_bits[] = {
+0x1c, 0x22, 0x41, 0x7f, 0x01, 0x42, 0x3c};
+static unsigned char courier14_102_bits[] = {
+0x78, 0x04, 0x04, 0x3f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_103_bits[] = {
+0xdc, 0x62, 0x41, 0x41, 0x41, 0x62, 0x5c, 0x40, 0x20, 0x1e};
+static unsigned char courier14_104_bits[] = {
+0x03, 0x02, 0x02, 0x3a, 0x46, 0x42, 0x42, 0x42, 0x42, 0xe7};
+static unsigned char courier14_105_bits[] = {
+0x04, 0x04, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_106_bits[] = {
+0x10, 0x10, 0x00, 0x1f, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x08, 
+0x07};
+static unsigned char courier14_107_bits[] = {
+0x03, 0x02, 0x02, 0x72, 0x12, 0x0a, 0x06, 0x0a, 0x12, 0x73};
+static unsigned char courier14_108_bits[] = {
+0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_109_bits[] = {
+0xdb, 0x00, 0xb6, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 
+0xb7, 0x01};
+static unsigned char courier14_110_bits[] = {
+0x3b, 0x46, 0x42, 0x42, 0x42, 0x42, 0xe7};
+static unsigned char courier14_111_bits[] = {
+0x3c, 0x42, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_112_bits[] = {
+0x3b, 0x46, 0x82, 0x82, 0x82, 0x46, 0x3a, 0x02, 0x02, 0x0f};
+static unsigned char courier14_113_bits[] = {
+0xdc, 0x62, 0x41, 0x41, 0x41, 0x62, 0x5c, 0x40, 0x40, 0xf0};
+static unsigned char courier14_114_bits[] = {
+0x33, 0x4a, 0x06, 0x02, 0x02, 0x02, 0x1f};
+static unsigned char courier14_115_bits[] = {
+0x3e, 0x21, 0x01, 0x1e, 0x20, 0x21, 0x1f};
+static unsigned char courier14_116_bits[] = {
+0x04, 0x04, 0x3f, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38};
+static unsigned char courier14_117_bits[] = {
+0x63, 0x42, 0x42, 0x42, 0x42, 0x62, 0xdc};
+static unsigned char courier14_118_bits[] = {
+0xe7, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18};
+static unsigned char courier14_119_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x92, 0x00, 0x92, 0x00, 0x54, 0x00, 0x6c, 0x00, 
+0x44, 0x00};
+static unsigned char courier14_120_bits[] = {
+0x77, 0x22, 0x14, 0x08, 0x14, 0x22, 0x77};
+static unsigned char courier14_121_bits[] = {
+0xe7, 0x42, 0x42, 0x24, 0x24, 0x18, 0x10, 0x08, 0x08, 0x1e};
+static unsigned char courier14_122_bits[] = {
+0x1f, 0x11, 0x08, 0x04, 0x02, 0x11, 0x1f};
+static unsigned char courier14_123_bits[] = {
+0x04, 0x02, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x04};
+static unsigned char courier14_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char courier14_125_bits[] = {
+0x01, 0x02, 0x02, 0x02, 0x02, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01};
+static unsigned char courier14_126_bits[] = {
+0x26, 0x19};
+static unsigned char courier14_127_bits[] = {
+0x00};
+static unsigned char courier14_128_bits[] = {
+0x00};
+static unsigned char courier14_129_bits[] = {
+0x00};
+static unsigned char courier14_130_bits[] = {
+0x00};
+static unsigned char courier14_131_bits[] = {
+0x00};
+static unsigned char courier14_132_bits[] = {
+0x00};
+static unsigned char courier14_133_bits[] = {
+0x00};
+static unsigned char courier14_134_bits[] = {
+0x00};
+static unsigned char courier14_135_bits[] = {
+0x00};
+static unsigned char courier14_136_bits[] = {
+0x00};
+static unsigned char courier14_137_bits[] = {
+0x00};
+static unsigned char courier14_138_bits[] = {
+0x00};
+static unsigned char courier14_139_bits[] = {
+0x00};
+static unsigned char courier14_140_bits[] = {
+0x00};
+static unsigned char courier14_141_bits[] = {
+0x00};
+static unsigned char courier14_142_bits[] = {
+0x00};
+static unsigned char courier14_143_bits[] = {
+0x00};
+static unsigned char courier14_144_bits[] = {
+0x00};
+static unsigned char courier14_145_bits[] = {
+0x00};
+static unsigned char courier14_146_bits[] = {
+0x00};
+static unsigned char courier14_147_bits[] = {
+0x00};
+static unsigned char courier14_148_bits[] = {
+0x00};
+static unsigned char courier14_149_bits[] = {
+0x00};
+static unsigned char courier14_150_bits[] = {
+0x00};
+static unsigned char courier14_151_bits[] = {
+0x00};
+static unsigned char courier14_152_bits[] = {
+0x00};
+static unsigned char courier14_153_bits[] = {
+0x00};
+static unsigned char courier14_154_bits[] = {
+0x00};
+static unsigned char courier14_155_bits[] = {
+0x00};
+static unsigned char courier14_156_bits[] = {
+0x00};
+static unsigned char courier14_157_bits[] = {
+0x00};
+static unsigned char courier14_158_bits[] = {
+0x00};
+static unsigned char courier14_159_bits[] = {
+0x00};
+static unsigned char courier14_160_bits[] = {
+0x00};
+static unsigned char courier14_161_bits[] = {
+0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char courier14_162_bits[] = {
+0x04, 0x04, 0x1e, 0x11, 0x01, 0x11, 0x0e, 0x04, 0x04};
+static unsigned char courier14_163_bits[] = {
+0x18, 0x24, 0x04, 0x04, 0x1e, 0x04, 0x04, 0x42, 0x3f};
+static unsigned char courier14_164_bits[] = {
+0x2d, 0x12, 0x21, 0x21, 0x12, 0x2d};
+static unsigned char courier14_165_bits[] = {
+0x77, 0x22, 0x22, 0x14, 0x3e, 0x08, 0x3e, 0x08, 0x1c};
+static unsigned char courier14_166_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char courier14_167_bits[] = {
+0x3c, 0x22, 0x02, 0x0f, 0x11, 0x22, 0x3c, 0x10, 0x11, 0x0f};
+static unsigned char courier14_168_bits[] = {
+0x1b};
+static unsigned char courier14_169_bits[] = {
+0x3c, 0x42, 0x99, 0xa5, 0x85, 0xa5, 0x99, 0x42, 0x3c};
+static unsigned char courier14_170_bits[] = {
+0x03, 0x04, 0x07, 0x0d, 0x00, 0x0f};
+static unsigned char courier14_171_bits[] = {
+0x88, 0x44, 0x22, 0x33, 0x22, 0x44, 0x88};
+static unsigned char courier14_172_bits[] = {
+0x7f, 0x40, 0x40};
+static unsigned char courier14_173_bits[] = {
+0x3f};
+static unsigned char courier14_174_bits[] = {
+0x3c, 0x42, 0x9d, 0xa5, 0x9d, 0x95, 0xa5, 0x42, 0x3c};
+static unsigned char courier14_175_bits[] = {
+0x0f};
+static unsigned char courier14_176_bits[] = {
+0x06, 0x09, 0x09, 0x06};
+static unsigned char courier14_177_bits[] = {
+0x08, 0x08, 0x7f, 0x08, 0x08, 0x00, 0x7f};
+static unsigned char courier14_178_bits[] = {
+0x06, 0x09, 0x08, 0x04, 0x02, 0x0f};
+static unsigned char courier14_179_bits[] = {
+0x06, 0x09, 0x06, 0x08, 0x09, 0x06};
+static unsigned char courier14_180_bits[] = {
+0x0c, 0x03};
+static unsigned char courier14_181_bits[] = {
+0x63, 0x42, 0x42, 0x42, 0x42, 0x62, 0xde, 0x02, 0x02, 0x02};
+static unsigned char courier14_182_bits[] = {
+0x7e, 0x29, 0x29, 0x29, 0x2e, 0x28, 0x28, 0x28, 0x28, 0x7c};
+static unsigned char courier14_183_bits[] = {
+0x03, 0x03};
+static unsigned char courier14_184_bits[] = {
+0x02, 0x04, 0x07};
+static unsigned char courier14_185_bits[] = {
+0x02, 0x03, 0x02, 0x02, 0x02, 0x07};
+static unsigned char courier14_186_bits[] = {
+0x06, 0x09, 0x09, 0x06, 0x00, 0x0f};
+static unsigned char courier14_187_bits[] = {
+0x11, 0x22, 0x44, 0xcc, 0x44, 0x22, 0x11};
+static unsigned char courier14_188_bits[] = {
+0x02, 0x00, 0x83, 0x00, 0x42, 0x00, 0x22, 0x00, 0x22, 0x01, 0x97, 0x01, 
+0x48, 0x01, 0x28, 0x01, 0xe4, 0x03, 0x02, 0x01};
+static unsigned char courier14_189_bits[] = {
+0x02, 0x00, 0x83, 0x00, 0x42, 0x00, 0x22, 0x00, 0xa2, 0x01, 0x57, 0x02, 
+0x08, 0x02, 0x08, 0x01, 0x84, 0x00, 0xc2, 0x03};
+static unsigned char courier14_190_bits[] = {
+0x06, 0x00, 0x89, 0x00, 0x46, 0x00, 0x28, 0x00, 0x29, 0x01, 0x96, 0x01, 
+0x48, 0x01, 0x28, 0x01, 0xe4, 0x03, 0x02, 0x01};
+static unsigned char courier14_191_bits[] = {
+0x04, 0x04, 0x00, 0x04, 0x06, 0x01, 0x01, 0x11, 0x0e};
+static unsigned char courier14_192_bits[] = {
+0x0c, 0x00, 0x30, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 0x82, 0x00, 0xef, 0x01};
+static unsigned char courier14_193_bits[] = {
+0x30, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 0x82, 0x00, 0xef, 0x01};
+static unsigned char courier14_194_bits[] = {
+0x10, 0x00, 0x28, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 0x82, 0x00, 0xef, 0x01};
+static unsigned char courier14_195_bits[] = {
+0x58, 0x00, 0x34, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 0x82, 0x00, 0xef, 0x01};
+static unsigned char courier14_196_bits[] = {
+0x6c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x10, 0x00, 0x28, 0x00, 0x28, 0x00, 
+0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 0x82, 0x00, 0xef, 0x01};
+static unsigned char courier14_197_bits[] = {
+0x18, 0x00, 0x24, 0x00, 0x18, 0x00, 0x1c, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 0x82, 0x00, 0xef, 0x01};
+static unsigned char courier14_198_bits[] = {
+0xf8, 0x01, 0x30, 0x01, 0x28, 0x00, 0x28, 0x01, 0xe4, 0x01, 0x3c, 0x01, 
+0x22, 0x00, 0x22, 0x01, 0xf7, 0x01};
+static unsigned char courier14_199_bits[] = {
+0x5c, 0x62, 0x41, 0x01, 0x01, 0x01, 0x01, 0x42, 0x3c, 0x08, 0x10, 0x1c};
+static unsigned char courier14_200_bits[] = {
+0x06, 0x18, 0x00, 0x7f, 0x42, 0x42, 0x12, 0x1e, 0x12, 0x42, 0x42, 0x7f};
+static unsigned char courier14_201_bits[] = {
+0x30, 0x0c, 0x00, 0x7f, 0x42, 0x42, 0x12, 0x1e, 0x12, 0x42, 0x42, 0x7f};
+static unsigned char courier14_202_bits[] = {
+0x08, 0x14, 0x00, 0x7f, 0x42, 0x42, 0x12, 0x1e, 0x12, 0x42, 0x42, 0x7f};
+static unsigned char courier14_203_bits[] = {
+0x36, 0x00, 0x7f, 0x42, 0x42, 0x12, 0x1e, 0x12, 0x42, 0x42, 0x7f};
+static unsigned char courier14_204_bits[] = {
+0x03, 0x0c, 0x00, 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_205_bits[] = {
+0x18, 0x06, 0x00, 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_206_bits[] = {
+0x04, 0x0a, 0x00, 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_207_bits[] = {
+0x1b, 0x00, 0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_208_bits[] = {
+0x3f, 0x42, 0x82, 0x82, 0x8f, 0x82, 0x82, 0x42, 0x3f};
+static unsigned char courier14_209_bits[] = {
+0x58, 0x34, 0x00, 0xe7, 0x46, 0x4a, 0x4a, 0x52, 0x52, 0x62, 0x62, 0x47};
+static unsigned char courier14_210_bits[] = {
+0x0c, 0x30, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_211_bits[] = {
+0x30, 0x0c, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_212_bits[] = {
+0x08, 0x14, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_213_bits[] = {
+0x58, 0x34, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_214_bits[] = {
+0x66, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_215_bits[] = {
+0x41, 0x22, 0x14, 0x08, 0x14, 0x22, 0x41};
+static unsigned char courier14_216_bits[] = {
+0x78, 0x01, 0x84, 0x00, 0x42, 0x01, 0x22, 0x01, 0x12, 0x01, 0x0a, 0x01, 
+0x04, 0x01, 0x86, 0x00, 0x79, 0x00};
+static unsigned char courier14_217_bits[] = {
+0x0c, 0x30, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c};
+static unsigned char courier14_218_bits[] = {
+0x30, 0x0c, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c};
+static unsigned char courier14_219_bits[] = {
+0x08, 0x14, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c};
+static unsigned char courier14_220_bits[] = {
+0x66, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3c};
+static unsigned char courier14_221_bits[] = {
+0x30, 0x0c, 0x00, 0x77, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08, 0x08, 0x3e};
+static unsigned char courier14_222_bits[] = {
+0x07, 0x02, 0x3e, 0x42, 0x42, 0x42, 0x3e, 0x02, 0x07};
+static unsigned char courier14_223_bits[] = {
+0x1c, 0x22, 0x22, 0x1a, 0x22, 0x42, 0x42, 0x4a, 0x33};
+static unsigned char courier14_224_bits[] = {
+0x06, 0x18, 0x00, 0x1e, 0x21, 0x20, 0x3e, 0x21, 0x31, 0x6e};
+static unsigned char courier14_225_bits[] = {
+0x18, 0x06, 0x00, 0x1e, 0x21, 0x20, 0x3e, 0x21, 0x31, 0x6e};
+static unsigned char courier14_226_bits[] = {
+0x08, 0x14, 0x00, 0x1e, 0x21, 0x20, 0x3e, 0x21, 0x31, 0x6e};
+static unsigned char courier14_227_bits[] = {
+0x2c, 0x1a, 0x00, 0x1e, 0x21, 0x20, 0x3e, 0x21, 0x31, 0x6e};
+static unsigned char courier14_228_bits[] = {
+0x36, 0x00, 0x1e, 0x21, 0x20, 0x3e, 0x21, 0x31, 0x6e};
+static unsigned char courier14_229_bits[] = {
+0x0c, 0x12, 0x0c, 0x1e, 0x21, 0x20, 0x3e, 0x21, 0x31, 0x6e};
+static unsigned char courier14_230_bits[] = {
+0x6e, 0x91, 0x90, 0xfe, 0x11, 0x91, 0x6e};
+static unsigned char courier14_231_bits[] = {
+0x5c, 0x62, 0x41, 0x01, 0x01, 0x42, 0x3c, 0x08, 0x10, 0x1c};
+static unsigned char courier14_232_bits[] = {
+0x06, 0x18, 0x00, 0x1c, 0x22, 0x41, 0x7f, 0x01, 0x42, 0x3c};
+static unsigned char courier14_233_bits[] = {
+0x30, 0x0c, 0x00, 0x1c, 0x22, 0x41, 0x7f, 0x01, 0x42, 0x3c};
+static unsigned char courier14_234_bits[] = {
+0x08, 0x14, 0x00, 0x1c, 0x22, 0x41, 0x7f, 0x01, 0x42, 0x3c};
+static unsigned char courier14_235_bits[] = {
+0x36, 0x00, 0x1c, 0x22, 0x41, 0x7f, 0x01, 0x42, 0x3c};
+static unsigned char courier14_236_bits[] = {
+0x03, 0x0c, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_237_bits[] = {
+0x0c, 0x03, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_238_bits[] = {
+0x04, 0x0a, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_239_bits[] = {
+0x1b, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier14_240_bits[] = {
+0x40, 0x27, 0x18, 0x14, 0x22, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_241_bits[] = {
+0x58, 0x34, 0x00, 0x3b, 0x46, 0x42, 0x42, 0x42, 0x42, 0xe7};
+static unsigned char courier14_242_bits[] = {
+0x0c, 0x30, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_243_bits[] = {
+0x30, 0x0c, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_244_bits[] = {
+0x08, 0x14, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_245_bits[] = {
+0x58, 0x34, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_246_bits[] = {
+0x36, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier14_247_bits[] = {
+0x18, 0x18, 0x00, 0xff, 0x00, 0x18, 0x18};
+static unsigned char courier14_248_bits[] = {
+0xbc, 0x62, 0x91, 0x89, 0x85, 0x42, 0x3d};
+static unsigned char courier14_249_bits[] = {
+0x0c, 0x30, 0x00, 0x63, 0x42, 0x42, 0x42, 0x42, 0x62, 0xdc};
+static unsigned char courier14_250_bits[] = {
+0x30, 0x0c, 0x00, 0x63, 0x42, 0x42, 0x42, 0x42, 0x62, 0xdc};
+static unsigned char courier14_251_bits[] = {
+0x08, 0x14, 0x00, 0x63, 0x42, 0x42, 0x42, 0x42, 0x62, 0xdc};
+static unsigned char courier14_252_bits[] = {
+0x36, 0x00, 0x63, 0x42, 0x42, 0x42, 0x42, 0x62, 0xdc};
+static unsigned char courier14_253_bits[] = {
+0x60, 0x18, 0x00, 0xe7, 0x42, 0x42, 0x24, 0x24, 0x18, 0x10, 0x08, 0x08, 
+0x1e};
+static unsigned char courier14_254_bits[] = {
+0x03, 0x02, 0x3a, 0x46, 0x82, 0x82, 0x82, 0x46, 0x3a, 0x02, 0x02, 0x0f};
+static unsigned char courier14_255_bits[] = {
+0x6c, 0x00, 0xe7, 0x42, 0x42, 0x24, 0x24, 0x18, 0x10, 0x08, 0x08, 0x1e};
+static RotFont courier14font[] = {
+{5, 1, 1, courier14_0_bits},
+{5, 1, 1, courier14_1_bits},
+{5, 1, 1, courier14_2_bits},
+{5, 1, 1, courier14_3_bits},
+{5, 1, 1, courier14_4_bits},
+{5, 1, 1, courier14_5_bits},
+{5, 1, 1, courier14_6_bits},
+{5, 1, 1, courier14_7_bits},
+{5, 1, 1, courier14_8_bits},
+{5, 1, 1, courier14_9_bits},
+{5, 1, 1, courier14_10_bits},
+{5, 1, 1, courier14_11_bits},
+{5, 1, 1, courier14_12_bits},
+{5, 1, 1, courier14_13_bits},
+{5, 1, 1, courier14_14_bits},
+{5, 1, 1, courier14_15_bits},
+{5, 1, 1, courier14_16_bits},
+{5, 1, 1, courier14_17_bits},
+{5, 1, 1, courier14_18_bits},
+{5, 1, 1, courier14_19_bits},
+{5, 1, 1, courier14_20_bits},
+{5, 1, 1, courier14_21_bits},
+{5, 1, 1, courier14_22_bits},
+{5, 1, 1, courier14_23_bits},
+{5, 1, 1, courier14_24_bits},
+{5, 1, 1, courier14_25_bits},
+{5, 1, 1, courier14_26_bits},
+{5, 1, 1, courier14_27_bits},
+{5, 1, 1, courier14_28_bits},
+{5, 1, 1, courier14_29_bits},
+{5, 1, 1, courier14_30_bits},
+{5, 1, 1, courier14_31_bits},
+{6, 1, 1, courier14_32_bits},
+{1, 9, 9, courier14_33_bits},
+{4, 4, 10, courier14_34_bits},
+{5, 10, 9, courier14_35_bits},
+{5, 13, 11, courier14_36_bits},
+{8, 10, 10, courier14_37_bits},
+{6, 8, 8, courier14_38_bits},
+{3, 4, 10, courier14_39_bits},
+{3, 12, 10, courier14_40_bits},
+{3, 12, 10, courier14_41_bits},
+{5, 6, 9, courier14_42_bits},
+{7, 7, 8, courier14_43_bits},
+{3, 4, 2, courier14_44_bits},
+{7, 1, 5, courier14_45_bits},
+{2, 2, 2, courier14_46_bits},
+{6, 11, 10, courier14_47_bits},
+{6, 10, 10, courier14_48_bits},
+{5, 10, 10, courier14_49_bits},
+{5, 10, 10, courier14_50_bits},
+{6, 10, 10, courier14_51_bits},
+{6, 10, 10, courier14_52_bits},
+{6, 10, 10, courier14_53_bits},
+{6, 10, 10, courier14_54_bits},
+{6, 10, 10, courier14_55_bits},
+{5, 10, 10, courier14_56_bits},
+{6, 10, 10, courier14_57_bits},
+{2, 7, 7, courier14_58_bits},
+{3, 9, 7, courier14_59_bits},
+{7, 7, 8, courier14_60_bits},
+{7, 3, 6, courier14_61_bits},
+{7, 7, 8, courier14_62_bits},
+{5, 9, 9, courier14_63_bits},
+{7, 10, 9, courier14_64_bits},
+{9, 9, 9, courier14_65_bits},
+{7, 9, 9, courier14_66_bits},
+{7, 9, 9, courier14_67_bits},
+{8, 9, 9, courier14_68_bits},
+{7, 9, 9, courier14_69_bits},
+{7, 9, 9, courier14_70_bits},
+{8, 9, 9, courier14_71_bits},
+{8, 9, 9, courier14_72_bits},
+{5, 9, 9, courier14_73_bits},
+{7, 9, 9, courier14_74_bits},
+{8, 9, 9, courier14_75_bits},
+{8, 9, 9, courier14_76_bits},
+{9, 9, 9, courier14_77_bits},
+{8, 9, 9, courier14_78_bits},
+{8, 9, 9, courier14_79_bits},
+{7, 9, 9, courier14_80_bits},
+{8, 11, 9, courier14_81_bits},
+{8, 9, 9, courier14_82_bits},
+{6, 9, 9, courier14_83_bits},
+{7, 9, 9, courier14_84_bits},
+{8, 9, 9, courier14_85_bits},
+{9, 9, 9, courier14_86_bits},
+{9, 9, 9, courier14_87_bits},
+{8, 9, 9, courier14_88_bits},
+{7, 9, 9, courier14_89_bits},
+{6, 9, 9, courier14_90_bits},
+{3, 12, 10, courier14_91_bits},
+{6, 11, 10, courier14_92_bits},
+{3, 12, 10, courier14_93_bits},
+{5, 5, 9, courier14_94_bits},
+{9, 1, -2, courier14_95_bits},
+{3, 4, 10, courier14_96_bits},
+{7, 7, 7, courier14_97_bits},
+{8, 10, 10, courier14_98_bits},
+{7, 7, 7, courier14_99_bits},
+{8, 10, 10, courier14_100_bits},
+{7, 7, 7, courier14_101_bits},
+{7, 10, 10, courier14_102_bits},
+{8, 10, 7, courier14_103_bits},
+{8, 10, 10, courier14_104_bits},
+{5, 10, 10, courier14_105_bits},
+{5, 13, 10, courier14_106_bits},
+{7, 10, 10, courier14_107_bits},
+{5, 10, 10, courier14_108_bits},
+{9, 7, 7, courier14_109_bits},
+{8, 7, 7, courier14_110_bits},
+{8, 7, 7, courier14_111_bits},
+{8, 10, 7, courier14_112_bits},
+{8, 10, 7, courier14_113_bits},
+{7, 7, 7, courier14_114_bits},
+{6, 7, 7, courier14_115_bits},
+{7, 9, 9, courier14_116_bits},
+{8, 7, 7, courier14_117_bits},
+{8, 7, 7, courier14_118_bits},
+{9, 7, 7, courier14_119_bits},
+{7, 7, 7, courier14_120_bits},
+{8, 10, 7, courier14_121_bits},
+{5, 7, 7, courier14_122_bits},
+{3, 12, 10, courier14_123_bits},
+{1, 11, 9, courier14_124_bits},
+{3, 12, 10, courier14_125_bits},
+{6, 2, 5, courier14_126_bits},
+{5, 1, 1, courier14_127_bits},
+{5, 1, 1, courier14_128_bits},
+{5, 1, 1, courier14_129_bits},
+{5, 1, 1, courier14_130_bits},
+{5, 1, 1, courier14_131_bits},
+{5, 1, 1, courier14_132_bits},
+{5, 1, 1, courier14_133_bits},
+{5, 1, 1, courier14_134_bits},
+{5, 1, 1, courier14_135_bits},
+{5, 1, 1, courier14_136_bits},
+{5, 1, 1, courier14_137_bits},
+{5, 1, 1, courier14_138_bits},
+{5, 1, 1, courier14_139_bits},
+{5, 1, 1, courier14_140_bits},
+{5, 1, 1, courier14_141_bits},
+{5, 1, 1, courier14_142_bits},
+{5, 1, 1, courier14_143_bits},
+{5, 1, 1, courier14_144_bits},
+{5, 1, 1, courier14_145_bits},
+{5, 1, 1, courier14_146_bits},
+{5, 1, 1, courier14_147_bits},
+{5, 1, 1, courier14_148_bits},
+{5, 1, 1, courier14_149_bits},
+{5, 1, 1, courier14_150_bits},
+{5, 1, 1, courier14_151_bits},
+{5, 1, 1, courier14_152_bits},
+{5, 1, 1, courier14_153_bits},
+{5, 1, 1, courier14_154_bits},
+{5, 1, 1, courier14_155_bits},
+{5, 1, 1, courier14_156_bits},
+{5, 1, 1, courier14_157_bits},
+{5, 1, 1, courier14_158_bits},
+{5, 1, 1, courier14_159_bits},
+{1, 1, 1, courier14_160_bits},
+{1, 9, 7, courier14_161_bits},
+{5, 9, 9, courier14_162_bits},
+{7, 9, 9, courier14_163_bits},
+{6, 6, 7, courier14_164_bits},
+{7, 9, 9, courier14_165_bits},
+{1, 11, 9, courier14_166_bits},
+{6, 10, 9, courier14_167_bits},
+{5, 1, 9, courier14_168_bits},
+{8, 9, 9, courier14_169_bits},
+{4, 6, 9, courier14_170_bits},
+{8, 7, 7, courier14_171_bits},
+{7, 3, 6, courier14_172_bits},
+{6, 1, 5, courier14_173_bits},
+{8, 9, 9, courier14_174_bits},
+{4, 1, 9, courier14_175_bits},
+{4, 4, 10, courier14_176_bits},
+{7, 7, 8, courier14_177_bits},
+{4, 6, 10, courier14_178_bits},
+{4, 6, 10, courier14_179_bits},
+{4, 2, 10, courier14_180_bits},
+{8, 10, 7, courier14_181_bits},
+{7, 10, 9, courier14_182_bits},
+{2, 2, 5, courier14_183_bits},
+{3, 3, 0, courier14_184_bits},
+{3, 6, 10, courier14_185_bits},
+{4, 6, 9, courier14_186_bits},
+{8, 7, 7, courier14_187_bits},
+{10, 10, 10, courier14_188_bits},
+{10, 10, 10, courier14_189_bits},
+{10, 10, 10, courier14_190_bits},
+{5, 9, 7, courier14_191_bits},
+{9, 12, 12, courier14_192_bits},
+{9, 12, 12, courier14_193_bits},
+{9, 12, 12, courier14_194_bits},
+{9, 12, 12, courier14_195_bits},
+{9, 11, 11, courier14_196_bits},
+{9, 12, 12, courier14_197_bits},
+{9, 9, 9, courier14_198_bits},
+{7, 12, 9, courier14_199_bits},
+{7, 12, 12, courier14_200_bits},
+{7, 12, 12, courier14_201_bits},
+{7, 12, 12, courier14_202_bits},
+{7, 11, 11, courier14_203_bits},
+{5, 12, 12, courier14_204_bits},
+{5, 12, 12, courier14_205_bits},
+{5, 12, 12, courier14_206_bits},
+{5, 11, 11, courier14_207_bits},
+{8, 9, 9, courier14_208_bits},
+{8, 12, 12, courier14_209_bits},
+{8, 12, 12, courier14_210_bits},
+{8, 12, 12, courier14_211_bits},
+{8, 12, 12, courier14_212_bits},
+{8, 12, 12, courier14_213_bits},
+{8, 11, 11, courier14_214_bits},
+{7, 7, 8, courier14_215_bits},
+{9, 9, 9, courier14_216_bits},
+{8, 12, 12, courier14_217_bits},
+{8, 12, 12, courier14_218_bits},
+{8, 12, 12, courier14_219_bits},
+{8, 11, 11, courier14_220_bits},
+{7, 12, 12, courier14_221_bits},
+{7, 9, 9, courier14_222_bits},
+{7, 9, 9, courier14_223_bits},
+{7, 10, 10, courier14_224_bits},
+{7, 10, 10, courier14_225_bits},
+{7, 10, 10, courier14_226_bits},
+{7, 10, 10, courier14_227_bits},
+{7, 9, 9, courier14_228_bits},
+{7, 10, 10, courier14_229_bits},
+{8, 7, 7, courier14_230_bits},
+{7, 10, 7, courier14_231_bits},
+{7, 10, 10, courier14_232_bits},
+{7, 10, 10, courier14_233_bits},
+{7, 10, 10, courier14_234_bits},
+{7, 9, 9, courier14_235_bits},
+{5, 10, 10, courier14_236_bits},
+{5, 10, 10, courier14_237_bits},
+{5, 10, 10, courier14_238_bits},
+{5, 9, 9, courier14_239_bits},
+{8, 12, 12, courier14_240_bits},
+{8, 10, 10, courier14_241_bits},
+{8, 10, 10, courier14_242_bits},
+{8, 10, 10, courier14_243_bits},
+{8, 10, 10, courier14_244_bits},
+{8, 10, 10, courier14_245_bits},
+{8, 9, 9, courier14_246_bits},
+{8, 7, 8, courier14_247_bits},
+{8, 7, 7, courier14_248_bits},
+{8, 10, 10, courier14_249_bits},
+{8, 10, 10, courier14_250_bits},
+{8, 10, 10, courier14_251_bits},
+{8, 9, 9, courier14_252_bits},
+{8, 13, 10, courier14_253_bits},
+{8, 12, 9, courier14_254_bits},
+{8, 12, 9, courier14_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier18.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier18.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier18.bdf	(revision 15879)
@@ -0,0 +1,3453 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Courier-Medium-R-Normal--18-180-75-75-M-110-ISO8859-1
+SIZE 18 75 75
+FONTBOUNDINGBOX 12 19 -1 -4
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Courier"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 18
+POINT_SIZE 180
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "M"
+AVERAGE_WIDTH 110
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 11
+X_HEIGHT 8
+FACE_NAME "Courier"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "No mark"
+_DEC_DEVICE_FONTNAMES "PS=Courier"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Courier"
+FONT "-Adobe-Courier-Medium-R-Normal--18-180-75-75-M-110-ISO8859-1"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 11
+DEFAULT_CHAR 32
+FONT_ASCENT 14
+FONT_DESCENT 4
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 2 12 4 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+40
+40
+00
+c0
+c0
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 5 5 3 7
+BITMAP
+d8
+d8
+d8
+90
+90
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 15 1 -2
+BITMAP
+1200
+1200
+1200
+1200
+1200
+ff80
+2400
+2400
+2400
+ff00
+2400
+2400
+2400
+2400
+2400
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 15 2 -2
+BITMAP
+10
+10
+7a
+86
+82
+80
+70
+0c
+02
+82
+c2
+bc
+10
+10
+10
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+7000
+8800
+8800
+8800
+7180
+0e00
+3000
+ce00
+1100
+1100
+1100
+0e00
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 10 2 0
+BITMAP
+38
+44
+40
+40
+20
+74
+88
+88
+98
+66
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 4 5 3 7
+BITMAP
+30
+30
+60
+60
+c0
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 3 14 5 -2
+BITMAP
+20
+40
+40
+80
+80
+80
+80
+80
+80
+80
+80
+40
+40
+20
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 3 14 3 -2
+BITMAP
+80
+40
+40
+20
+20
+20
+20
+20
+20
+20
+20
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 8 2 4
+BITMAP
+10
+10
+10
+fe
+38
+28
+44
+44
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 9 1 1
+BITMAP
+0800
+0800
+0800
+0800
+ff80
+0800
+0800
+0800
+0800
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 4 5 3 -3
+BITMAP
+30
+30
+60
+60
+c0
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 1 1 5
+BITMAP
+ff80
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 2 2 4 0
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 16 1 -3
+BITMAP
+01
+01
+02
+02
+04
+04
+08
+08
+10
+10
+20
+20
+40
+40
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+38
+44
+82
+82
+82
+82
+82
+82
+82
+82
+44
+38
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+30
+d0
+10
+10
+10
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 1 0
+BITMAP
+1c
+22
+41
+41
+01
+02
+04
+08
+10
+20
+41
+ff
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+78
+84
+02
+02
+04
+38
+04
+02
+02
+02
+84
+78
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+0c
+14
+14
+24
+24
+44
+44
+84
+fe
+04
+04
+1e
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 1 0
+BITMAP
+7e
+40
+40
+40
+5c
+62
+01
+01
+01
+01
+c2
+3c
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+1e
+20
+40
+40
+80
+b8
+c4
+82
+82
+82
+44
+38
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 2 0
+BITMAP
+ff
+81
+02
+02
+04
+04
+04
+04
+08
+08
+08
+08
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+38
+44
+82
+82
+44
+38
+44
+82
+82
+82
+44
+38
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+38
+44
+82
+82
+82
+46
+3a
+02
+02
+04
+08
+f0
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 2 8 5 0
+BITMAP
+c0
+c0
+00
+00
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 5 11 2 -3
+BITMAP
+18
+18
+00
+00
+00
+00
+30
+30
+60
+60
+c0
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 9 0 1
+BITMAP
+00c0
+0300
+0c00
+3000
+c000
+3000
+0c00
+0300
+00c0
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 4 1 3
+BITMAP
+ff80
+0000
+0000
+ff80
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 9 0 1
+BITMAP
+c000
+3000
+0c00
+0300
+00c0
+0300
+0c00
+3000
+c000
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 11 2 0
+BITMAP
+7c
+86
+82
+02
+04
+08
+30
+20
+00
+30
+30
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 13 2 -1
+BITMAP
+3c
+42
+82
+82
+8e
+92
+92
+92
+8f
+80
+80
+43
+3c
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 11 0 0
+BITMAP
+3c00
+0400
+0a00
+0a00
+1100
+1100
+2080
+3f80
+4040
+4040
+f1e0
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+fe00
+4100
+4100
+4100
+4200
+7e00
+4100
+4080
+4080
+4100
+fe00
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+1e80
+6180
+4080
+8000
+8000
+8000
+8000
+8000
+4080
+6100
+1e00
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 1 0
+BITMAP
+fc
+42
+41
+41
+41
+41
+41
+41
+41
+42
+fc
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 1 0
+BITMAP
+ff
+41
+41
+41
+48
+78
+48
+41
+41
+41
+ff
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 1 0
+BITMAP
+ff
+41
+41
+41
+48
+78
+48
+40
+40
+40
+f0
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 11 1 0
+BITMAP
+1e80
+6180
+4080
+8000
+8000
+8000
+83c0
+8080
+4080
+6100
+1e00
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+e380
+4100
+4100
+4100
+4100
+7f00
+4100
+4100
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 11 2 0
+BITMAP
+fe
+10
+10
+10
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+1f80
+0200
+0200
+0200
+0200
+0200
+8200
+8200
+8200
+4400
+3800
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 11 0 0
+BITMAP
+f3c0
+4100
+4200
+4400
+4800
+5800
+6400
+4200
+4200
+4100
+f1c0
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+f800
+2000
+2000
+2000
+2000
+2000
+2000
+2080
+2080
+2080
+ff80
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 11 0 0
+BITMAP
+e0e0
+60c0
+5140
+5140
+4a40
+4a40
+4440
+4440
+4040
+4040
+f1e0
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+e780
+6100
+5100
+5100
+4900
+4900
+4500
+4500
+4300
+4300
+f100
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+fe00
+4100
+4080
+4080
+4080
+4100
+7e00
+4000
+4000
+4000
+f800
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 1 -2
+BITMAP
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+3880
+4700
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 11 1 0
+BITMAP
+fe00
+4100
+4100
+4100
+4200
+7c00
+4200
+4200
+4100
+4100
+f0c0
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 2 0
+BITMAP
+3a
+46
+82
+80
+40
+3c
+02
+01
+81
+c2
+bc
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+ff80
+8880
+8880
+8880
+0800
+0800
+0800
+0800
+0800
+0800
+3e00
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 11 0 0
+BITMAP
+f3c0
+4080
+4080
+4080
+4080
+4080
+4080
+4080
+4080
+2100
+1e00
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 11 0 0
+BITMAP
+f1e0
+4040
+4040
+2080
+2080
+1100
+1100
+0a00
+0a00
+0400
+0400
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 11 0 0
+BITMAP
+f1e0
+4040
+4440
+4440
+4440
+2a80
+2a80
+2a80
+2a80
+1100
+1100
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+e380
+4100
+2200
+2200
+1400
+0800
+1400
+2200
+2200
+4100
+e380
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+e380
+4100
+2200
+2200
+1400
+1400
+0800
+0800
+0800
+0800
+3e00
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 11 2 0
+BITMAP
+fe
+82
+84
+08
+08
+10
+20
+20
+42
+82
+fe
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 3 15 5 -3
+BITMAP
+e0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+e0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 16 2 -3
+BITMAP
+80
+80
+40
+40
+20
+20
+10
+10
+08
+08
+04
+04
+02
+02
+01
+01
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 3 15 3 -3
+BITMAP
+e0
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+e0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 4 2 8
+BITMAP
+10
+28
+44
+82
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 1 0 -4
+BITMAP
+ffe0
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 4 5 3 7
+BITMAP
+c0
+c0
+60
+60
+30
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 8 1 0
+BITMAP
+3c00
+4200
+0200
+7e00
+8200
+8200
+8600
+7b80
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+c000
+4000
+4000
+4000
+5e00
+6100
+4080
+4080
+4080
+4080
+6100
+de00
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 8 1 0
+BITMAP
+3d
+43
+81
+80
+80
+80
+43
+3c
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+0300
+0100
+0100
+0100
+3d00
+4300
+8100
+8100
+8100
+8100
+4300
+3d80
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 8 1 0
+BITMAP
+3c
+42
+81
+ff
+80
+80
+43
+3c
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 2 0
+BITMAP
+0f
+10
+20
+20
+fe
+20
+20
+20
+20
+20
+20
+fe
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 -4
+BITMAP
+3d80
+4300
+8100
+8100
+8100
+8100
+4300
+3d00
+0100
+0100
+0200
+7c00
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+c000
+4000
+4000
+4000
+5e00
+6100
+4100
+4100
+4100
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 11 2 0
+BITMAP
+10
+10
+00
+70
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 6 15 2 -4
+BITMAP
+08
+08
+00
+fc
+04
+04
+04
+04
+04
+04
+04
+04
+04
+08
+f0
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+c000
+4000
+4000
+4000
+4f00
+4400
+4800
+7000
+4800
+4400
+4200
+c780
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+f0
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 8 0 0
+BITMAP
+d980
+6640
+4440
+4440
+4440
+4440
+4440
+e660
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 8 1 0
+BITMAP
+de00
+6100
+4100
+4100
+4100
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 8 1 0
+BITMAP
+3c
+42
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 -4
+BITMAP
+de00
+6100
+4080
+4080
+4080
+4080
+6100
+5e00
+4000
+4000
+4000
+f000
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 -4
+BITMAP
+3d80
+4300
+8100
+8100
+8100
+8100
+4300
+3d00
+0100
+0100
+0100
+0780
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 8 1 0
+BITMAP
+ee
+31
+20
+20
+20
+20
+20
+fe
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 8 2 0
+BITMAP
+7a
+86
+82
+70
+0c
+82
+c2
+bc
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 2 0
+BITMAP
+20
+20
+20
+fe
+20
+20
+20
+20
+20
+21
+1e
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 8 1 0
+BITMAP
+c300
+4100
+4100
+4100
+4100
+4100
+4300
+3d80
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 8 1 0
+BITMAP
+e380
+4100
+2200
+2200
+1400
+1400
+0800
+0800
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 8 1 0
+BITMAP
+e380
+4100
+4900
+4900
+5500
+5500
+2200
+2200
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 8 1 0
+BITMAP
+e7
+42
+24
+18
+18
+24
+42
+e7
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 -4
+BITMAP
+e380
+4100
+4100
+2200
+2200
+1400
+1400
+0800
+0800
+1000
+1000
+f800
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 8 2 0
+BITMAP
+fe
+82
+84
+08
+10
+22
+42
+fe
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 5 15 3 -3
+BITMAP
+18
+20
+20
+20
+20
+20
+c0
+20
+20
+20
+20
+20
+20
+20
+18
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 1 15 5 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 5 15 3 -3
+BITMAP
+c0
+20
+20
+20
+20
+20
+18
+20
+20
+20
+20
+20
+20
+20
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 3 1 4
+BITMAP
+60
+99
+06
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 2 13 4 -4
+BITMAP
+c0
+c0
+00
+00
+80
+80
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 6 12 2 0
+BITMAP
+10
+10
+10
+3c
+44
+84
+80
+80
+44
+38
+10
+10
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 1 0
+BITMAP
+1c
+22
+20
+20
+10
+fc
+10
+20
+21
+41
+7e
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 6 7 2 2
+BITMAP
+84
+78
+84
+84
+84
+78
+84
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+e380
+4100
+2200
+2200
+1400
+1400
+7f00
+0800
+7f00
+0800
+3e00
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 1 15 5 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+00
+00
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 13 2 -1
+BITMAP
+3e
+42
+42
+40
+70
+8c
+82
+62
+1c
+04
+84
+84
+f8
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 5 1 3 10
+BITMAP
+d8
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 11 0 0
+BITMAP
+1e00
+6180
+4e80
+9240
+a040
+a040
+a040
+9240
+4c80
+6180
+1e00
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 6 8 2 3
+BITMAP
+70
+08
+78
+88
+98
+ec
+00
+fc
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 8 1 0
+BITMAP
+0880
+3300
+6600
+cc00
+cc00
+6600
+3300
+0880
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 4 1 3
+BITMAP
+ff80
+0080
+0080
+0080
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 1 1 5
+BITMAP
+ff
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 11 0 0
+BITMAP
+1f00
+60c0
+5e40
+9120
+9120
+9e20
+9420
+9220
+51c0
+6080
+1f00
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 5 1 3 9
+BITMAP
+f8
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 5 5 3 7
+BITMAP
+70
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 9 1 1
+BITMAP
+0800
+0800
+0800
+ff80
+0800
+0800
+0800
+0000
+ff80
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 5 7 3 5
+BITMAP
+70
+88
+08
+10
+20
+40
+f8
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 5 7 3 5
+BITMAP
+70
+88
+08
+30
+08
+88
+70
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 3 3 4 9
+BITMAP
+20
+40
+80
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 -4
+BITMAP
+c300
+4100
+4100
+4100
+4100
+4100
+4300
+7d80
+4000
+4000
+4000
+4000
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 13 1 -1
+BITMAP
+3f
+4a
+8a
+8a
+8a
+4a
+3a
+0a
+0a
+0a
+0a
+0a
+3b
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 2 2 4 5
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 3 3 4 -3
+BITMAP
+40
+20
+c0
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 5 7 3 5
+BITMAP
+20
+e0
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 6 8 2 3
+BITMAP
+78
+84
+84
+84
+84
+78
+00
+fc
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 8 1 0
+BITMAP
+8800
+6600
+3300
+1980
+1980
+3300
+6600
+8800
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 13 0 0
+BITMAP
+2000
+e000
+2040
+2080
+2100
+2100
+fa40
+04c0
+0940
+0a40
+13e0
+2040
+00e0
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 13 0 0
+BITMAP
+2000
+e000
+2040
+2080
+2100
+2100
+fac0
+0520
+0920
+0840
+1080
+2100
+03e0
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 13 0 0
+BITMAP
+7000
+8800
+0840
+3080
+0900
+8900
+7240
+04c0
+0940
+0a40
+13e0
+2040
+00e0
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 6 12 2 -3
+BITMAP
+18
+18
+00
+10
+10
+70
+80
+80
+84
+84
+84
+78
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 15 0 0
+BITMAP
+1000
+0800
+0400
+0000
+3c00
+0400
+0a00
+0a00
+1100
+1100
+2080
+3f80
+4040
+4040
+f1e0
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 15 0 0
+BITMAP
+0200
+0400
+0800
+0000
+3c00
+0400
+0a00
+0a00
+1100
+1100
+2080
+3f80
+4040
+4040
+f1e0
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 15 0 0
+BITMAP
+0400
+0a00
+1100
+0000
+3c00
+0400
+0a00
+0a00
+1100
+1100
+2080
+3f80
+4040
+4040
+f1e0
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 14 0 0
+BITMAP
+1900
+2600
+0000
+3c00
+0400
+0a00
+0a00
+1100
+1100
+2080
+3f80
+4040
+4040
+f1e0
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 14 0 0
+BITMAP
+1b00
+0000
+0000
+3c00
+0400
+0a00
+0a00
+1100
+1100
+2080
+3f80
+4040
+4040
+f1e0
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 15 0 0
+BITMAP
+0c00
+1200
+1200
+0c00
+7c00
+0400
+0a00
+0a00
+1100
+1100
+2080
+3f80
+4040
+4040
+f1e0
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 11 -1 0
+BITMAP
+1fe0
+0620
+0a20
+0a00
+1240
+13c0
+3e40
+2200
+4220
+4220
+e7e0
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 -3
+BITMAP
+1e80
+6180
+4080
+8000
+8000
+8000
+8000
+8000
+4080
+6100
+1e00
+0800
+0400
+1800
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 15 1 0
+BITMAP
+20
+10
+08
+00
+ff
+41
+41
+41
+48
+78
+48
+41
+41
+41
+ff
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 15 1 0
+BITMAP
+04
+08
+10
+00
+ff
+41
+41
+41
+48
+78
+48
+41
+41
+41
+ff
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 15 1 0
+BITMAP
+18
+24
+42
+00
+ff
+41
+41
+41
+48
+78
+48
+41
+41
+41
+ff
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 14 1 0
+BITMAP
+66
+00
+00
+ff
+41
+41
+41
+48
+78
+48
+41
+41
+41
+ff
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 15 2 0
+BITMAP
+20
+10
+08
+00
+fe
+10
+10
+10
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 15 2 0
+BITMAP
+08
+10
+20
+00
+fe
+10
+10
+10
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 15 2 0
+BITMAP
+10
+28
+44
+00
+fe
+10
+10
+10
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 14 2 0
+BITMAP
+6c
+00
+00
+fe
+10
+10
+10
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 1 0
+BITMAP
+fc
+42
+41
+41
+41
+f1
+41
+41
+41
+42
+fc
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+1900
+2600
+0000
+e780
+6100
+5100
+5100
+4900
+4900
+4500
+4500
+4300
+4300
+f100
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 15 1 0
+BITMAP
+1000
+0800
+0400
+0000
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 15 1 0
+BITMAP
+0400
+0800
+1000
+0000
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 15 1 0
+BITMAP
+0800
+1400
+2200
+0000
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+1900
+2600
+0000
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+3600
+0000
+0000
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 9 1 1
+BITMAP
+8080
+4100
+2200
+1400
+0800
+1400
+2200
+4100
+8080
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 11 0 0
+BITMAP
+0e20
+3140
+2080
+4140
+4240
+4440
+4840
+5040
+2080
+5180
+8e00
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 15 0 0
+BITMAP
+1000
+0800
+0400
+0000
+f3c0
+4080
+4080
+4080
+4080
+4080
+4080
+4080
+4080
+2100
+1e00
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 15 0 0
+BITMAP
+0200
+0400
+0800
+0000
+f3c0
+4080
+4080
+4080
+4080
+4080
+4080
+4080
+4080
+2100
+1e00
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 15 0 0
+BITMAP
+0c00
+1200
+2100
+0000
+f3c0
+4080
+4080
+4080
+4080
+4080
+4080
+4080
+4080
+2100
+1e00
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 14 0 0
+BITMAP
+3300
+0000
+0000
+f3c0
+4080
+4080
+4080
+4080
+4080
+4080
+4080
+4080
+2100
+1e00
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 15 1 0
+BITMAP
+0200
+0400
+0800
+0000
+e380
+4100
+2200
+2200
+1400
+1400
+0800
+0800
+0800
+0800
+3e00
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+e000
+4000
+7e00
+4100
+4080
+4080
+4100
+7e00
+4000
+4000
+e000
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 1 0
+BITMAP
+1c
+22
+42
+42
+44
+4c
+42
+41
+41
+41
+49
+e6
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+2000
+1000
+0800
+0000
+3c00
+4200
+0200
+7e00
+8200
+8200
+8600
+7b80
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+0400
+0800
+1000
+0000
+3c00
+4200
+0200
+7e00
+8200
+8200
+8600
+7b80
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+1800
+2400
+4200
+0000
+3c00
+4200
+0200
+7e00
+8200
+8200
+8600
+7b80
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+3200
+4c00
+0000
+3c00
+4200
+0200
+7e00
+8200
+8200
+8600
+7b80
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+3600
+0000
+0000
+3c00
+4200
+0200
+7e00
+8200
+8200
+8600
+7b80
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 1 0
+BITMAP
+1800
+2400
+2400
+1800
+0000
+3c00
+4200
+0200
+7e00
+8200
+8200
+8600
+7b80
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 8 0 0
+BITMAP
+7180
+8a40
+0420
+7fe0
+8400
+8400
+8a20
+71c0
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 1 -3
+BITMAP
+3d
+43
+81
+80
+80
+80
+43
+3c
+10
+08
+30
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 1 0
+BITMAP
+20
+10
+08
+00
+3c
+42
+81
+ff
+80
+80
+43
+3c
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 1 0
+BITMAP
+04
+08
+10
+00
+3c
+42
+81
+ff
+80
+80
+43
+3c
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 1 0
+BITMAP
+18
+24
+42
+00
+3c
+42
+81
+ff
+80
+80
+43
+3c
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 1 0
+BITMAP
+66
+00
+00
+3c
+42
+81
+ff
+80
+80
+43
+3c
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+40
+20
+10
+00
+70
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+08
+10
+20
+00
+70
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 12 2 0
+BITMAP
+10
+28
+44
+00
+70
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 11 2 0
+BITMAP
+6c
+00
+00
+70
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 1 0
+BITMAP
+73
+8c
+34
+42
+02
+3d
+43
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+1900
+2600
+0000
+de00
+6100
+4100
+4100
+4100
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 1 0
+BITMAP
+20
+10
+08
+00
+3c
+42
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 1 0
+BITMAP
+02
+04
+08
+00
+3c
+42
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 12 1 0
+BITMAP
+18
+24
+42
+00
+3c
+42
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 1 0
+BITMAP
+32
+4c
+00
+3c
+42
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 11 1 0
+BITMAP
+66
+00
+00
+3c
+42
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 9 1 1
+BITMAP
+18
+18
+00
+00
+ff
+00
+00
+18
+18
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 8 1 0
+BITMAP
+3d
+42
+85
+89
+91
+a1
+42
+bc
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+1000
+0800
+0400
+0000
+c300
+4100
+4100
+4100
+4100
+4100
+4300
+3d80
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+0400
+0800
+1000
+0000
+c300
+4100
+4100
+4100
+4100
+4100
+4300
+3d80
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+0800
+1400
+2200
+0000
+c300
+4100
+4100
+4100
+4100
+4100
+4300
+3d80
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+3600
+0000
+0000
+c300
+4100
+4100
+4100
+4100
+4100
+4300
+3d80
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 16 1 -4
+BITMAP
+0200
+0400
+0800
+0000
+e380
+4100
+4100
+2200
+2200
+1400
+1400
+0800
+0800
+1000
+1000
+f800
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 16 1 -4
+BITMAP
+c000
+4000
+4000
+4000
+5e00
+6100
+4080
+4080
+4080
+4080
+6100
+5e00
+4000
+4000
+4000
+f000
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 15 1 -4
+BITMAP
+3600
+0000
+0000
+e380
+4100
+4100
+2200
+2200
+1400
+1400
+0800
+0800
+1000
+1000
+f800
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier18.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier18.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier18.h	(revision 15879)
@@ -0,0 +1,906 @@
+static unsigned char courier18_0_bits[] = {
+0x00};
+static unsigned char courier18_1_bits[] = {
+0x00};
+static unsigned char courier18_2_bits[] = {
+0x00};
+static unsigned char courier18_3_bits[] = {
+0x00};
+static unsigned char courier18_4_bits[] = {
+0x00};
+static unsigned char courier18_5_bits[] = {
+0x00};
+static unsigned char courier18_6_bits[] = {
+0x00};
+static unsigned char courier18_7_bits[] = {
+0x00};
+static unsigned char courier18_8_bits[] = {
+0x00};
+static unsigned char courier18_9_bits[] = {
+0x00};
+static unsigned char courier18_10_bits[] = {
+0x00};
+static unsigned char courier18_11_bits[] = {
+0x00};
+static unsigned char courier18_12_bits[] = {
+0x00};
+static unsigned char courier18_13_bits[] = {
+0x00};
+static unsigned char courier18_14_bits[] = {
+0x00};
+static unsigned char courier18_15_bits[] = {
+0x00};
+static unsigned char courier18_16_bits[] = {
+0x00};
+static unsigned char courier18_17_bits[] = {
+0x00};
+static unsigned char courier18_18_bits[] = {
+0x00};
+static unsigned char courier18_19_bits[] = {
+0x00};
+static unsigned char courier18_20_bits[] = {
+0x00};
+static unsigned char courier18_21_bits[] = {
+0x00};
+static unsigned char courier18_22_bits[] = {
+0x00};
+static unsigned char courier18_23_bits[] = {
+0x00};
+static unsigned char courier18_24_bits[] = {
+0x00};
+static unsigned char courier18_25_bits[] = {
+0x00};
+static unsigned char courier18_26_bits[] = {
+0x00};
+static unsigned char courier18_27_bits[] = {
+0x00};
+static unsigned char courier18_28_bits[] = {
+0x00};
+static unsigned char courier18_29_bits[] = {
+0x00};
+static unsigned char courier18_30_bits[] = {
+0x00};
+static unsigned char courier18_31_bits[] = {
+0x00};
+static unsigned char courier18_32_bits[] = {
+0x00};
+static unsigned char courier18_33_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x00, 0x03, 0x03};
+static unsigned char courier18_34_bits[] = {
+0x1b, 0x1b, 0x1b, 0x09, 0x09};
+static unsigned char courier18_35_bits[] = {
+0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 0xff, 0x01, 
+0x24, 0x00, 0x24, 0x00, 0x24, 0x00, 0xff, 0x00, 0x24, 0x00, 0x24, 0x00, 
+0x24, 0x00, 0x24, 0x00, 0x24, 0x00};
+static unsigned char courier18_36_bits[] = {
+0x08, 0x08, 0x5e, 0x61, 0x41, 0x01, 0x0e, 0x30, 0x40, 0x41, 0x43, 0x3d, 
+0x08, 0x08, 0x08};
+static unsigned char courier18_37_bits[] = {
+0x0e, 0x00, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x8e, 0x01, 0x70, 0x00, 
+0x0c, 0x00, 0x73, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x70, 0x00};
+static unsigned char courier18_38_bits[] = {
+0x1c, 0x22, 0x02, 0x02, 0x04, 0x2e, 0x11, 0x11, 0x19, 0x66};
+static unsigned char courier18_39_bits[] = {
+0x0c, 0x0c, 0x06, 0x06, 0x03};
+static unsigned char courier18_40_bits[] = {
+0x04, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 
+0x02, 0x04};
+static unsigned char courier18_41_bits[] = {
+0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 
+0x02, 0x01};
+static unsigned char courier18_42_bits[] = {
+0x08, 0x08, 0x08, 0x7f, 0x1c, 0x14, 0x22, 0x22};
+static unsigned char courier18_43_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0xff, 0x01, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char courier18_44_bits[] = {
+0x0c, 0x0c, 0x06, 0x06, 0x03};
+static unsigned char courier18_45_bits[] = {
+0xff, 0x01};
+static unsigned char courier18_46_bits[] = {
+0x03, 0x03};
+static unsigned char courier18_47_bits[] = {
+0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 
+0x02, 0x02, 0x01, 0x01};
+static unsigned char courier18_48_bits[] = {
+0x1c, 0x22, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x22, 0x1c};
+static unsigned char courier18_49_bits[] = {
+0x0c, 0x0b, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x7f};
+static unsigned char courier18_50_bits[] = {
+0x38, 0x44, 0x82, 0x82, 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x82, 0xff};
+static unsigned char courier18_51_bits[] = {
+0x1e, 0x21, 0x40, 0x40, 0x20, 0x1c, 0x20, 0x40, 0x40, 0x40, 0x21, 0x1e};
+static unsigned char courier18_52_bits[] = {
+0x30, 0x28, 0x28, 0x24, 0x24, 0x22, 0x22, 0x21, 0x7f, 0x20, 0x20, 0x78};
+static unsigned char courier18_53_bits[] = {
+0x7e, 0x02, 0x02, 0x02, 0x3a, 0x46, 0x80, 0x80, 0x80, 0x80, 0x43, 0x3c};
+static unsigned char courier18_54_bits[] = {
+0x78, 0x04, 0x02, 0x02, 0x01, 0x1d, 0x23, 0x41, 0x41, 0x41, 0x22, 0x1c};
+static unsigned char courier18_55_bits[] = {
+0xff, 0x81, 0x40, 0x40, 0x20, 0x20, 0x20, 0x20, 0x10, 0x10, 0x10, 0x10};
+static unsigned char courier18_56_bits[] = {
+0x1c, 0x22, 0x41, 0x41, 0x22, 0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c};
+static unsigned char courier18_57_bits[] = {
+0x1c, 0x22, 0x41, 0x41, 0x41, 0x62, 0x5c, 0x40, 0x40, 0x20, 0x10, 0x0f};
+static unsigned char courier18_58_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03};
+static unsigned char courier18_59_bits[] = {
+0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x06, 0x06, 0x03};
+static unsigned char courier18_60_bits[] = {
+0x00, 0x03, 0xc0, 0x00, 0x30, 0x00, 0x0c, 0x00, 0x03, 0x00, 0x0c, 0x00, 
+0x30, 0x00, 0xc0, 0x00, 0x00, 0x03};
+static unsigned char courier18_61_bits[] = {
+0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01};
+static unsigned char courier18_62_bits[] = {
+0x03, 0x00, 0x0c, 0x00, 0x30, 0x00, 0xc0, 0x00, 0x00, 0x03, 0xc0, 0x00, 
+0x30, 0x00, 0x0c, 0x00, 0x03, 0x00};
+static unsigned char courier18_63_bits[] = {
+0x3e, 0x61, 0x41, 0x40, 0x20, 0x10, 0x0c, 0x04, 0x00, 0x0c, 0x0c};
+static unsigned char courier18_64_bits[] = {
+0x3c, 0x42, 0x41, 0x41, 0x71, 0x49, 0x49, 0x49, 0xf1, 0x01, 0x01, 0xc2, 
+0x3c};
+static unsigned char courier18_65_bits[] = {
+0x3c, 0x00, 0x20, 0x00, 0x50, 0x00, 0x50, 0x00, 0x88, 0x00, 0x88, 0x00, 
+0x04, 0x01, 0xfc, 0x01, 0x02, 0x02, 0x02, 0x02, 0x8f, 0x07};
+static unsigned char courier18_66_bits[] = {
+0x7f, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x42, 0x00, 0x7e, 0x00, 
+0x82, 0x00, 0x02, 0x01, 0x02, 0x01, 0x82, 0x00, 0x7f, 0x00};
+static unsigned char courier18_67_bits[] = {
+0x78, 0x01, 0x86, 0x01, 0x02, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x86, 0x00, 0x78, 0x00};
+static unsigned char courier18_68_bits[] = {
+0x3f, 0x42, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x42, 0x3f};
+static unsigned char courier18_69_bits[] = {
+0xff, 0x82, 0x82, 0x82, 0x12, 0x1e, 0x12, 0x82, 0x82, 0x82, 0xff};
+static unsigned char courier18_70_bits[] = {
+0xff, 0x82, 0x82, 0x82, 0x12, 0x1e, 0x12, 0x02, 0x02, 0x02, 0x0f};
+static unsigned char courier18_71_bits[] = {
+0x78, 0x01, 0x86, 0x01, 0x02, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0xc1, 0x03, 0x01, 0x01, 0x02, 0x01, 0x86, 0x00, 0x78, 0x00};
+static unsigned char courier18_72_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xfe, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char courier18_73_bits[] = {
+0x7f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x7f};
+static unsigned char courier18_74_bits[] = {
+0xf8, 0x01, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 
+0x41, 0x00, 0x41, 0x00, 0x41, 0x00, 0x22, 0x00, 0x1c, 0x00};
+static unsigned char courier18_75_bits[] = {
+0xcf, 0x03, 0x82, 0x00, 0x42, 0x00, 0x22, 0x00, 0x12, 0x00, 0x1a, 0x00, 
+0x26, 0x00, 0x42, 0x00, 0x42, 0x00, 0x82, 0x00, 0x8f, 0x03};
+static unsigned char courier18_76_bits[] = {
+0x1f, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 
+0x04, 0x00, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 0xff, 0x01};
+static unsigned char courier18_77_bits[] = {
+0x07, 0x07, 0x06, 0x03, 0x8a, 0x02, 0x8a, 0x02, 0x52, 0x02, 0x52, 0x02, 
+0x22, 0x02, 0x22, 0x02, 0x02, 0x02, 0x02, 0x02, 0x8f, 0x07};
+static unsigned char courier18_78_bits[] = {
+0xe7, 0x01, 0x86, 0x00, 0x8a, 0x00, 0x8a, 0x00, 0x92, 0x00, 0x92, 0x00, 
+0xa2, 0x00, 0xa2, 0x00, 0xc2, 0x00, 0xc2, 0x00, 0x8f, 0x00};
+static unsigned char courier18_79_bits[] = {
+0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 0xc6, 0x00, 0x38, 0x00};
+static unsigned char courier18_80_bits[] = {
+0x7f, 0x00, 0x82, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x82, 0x00, 
+0x7e, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x1f, 0x00};
+static unsigned char courier18_81_bits[] = {
+0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 0xc6, 0x00, 0x38, 0x00, 0x1c, 0x01, 
+0xe2, 0x00};
+static unsigned char courier18_82_bits[] = {
+0x7f, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x42, 0x00, 0x3e, 0x00, 
+0x42, 0x00, 0x42, 0x00, 0x82, 0x00, 0x82, 0x00, 0x0f, 0x03};
+static unsigned char courier18_83_bits[] = {
+0x5c, 0x62, 0x41, 0x01, 0x02, 0x3c, 0x40, 0x80, 0x81, 0x43, 0x3d};
+static unsigned char courier18_84_bits[] = {
+0xff, 0x01, 0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x10, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x7c, 0x00};
+static unsigned char courier18_85_bits[] = {
+0xcf, 0x03, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x84, 0x00, 0x78, 0x00};
+static unsigned char courier18_86_bits[] = {
+0x8f, 0x07, 0x02, 0x02, 0x02, 0x02, 0x04, 0x01, 0x04, 0x01, 0x88, 0x00, 
+0x88, 0x00, 0x50, 0x00, 0x50, 0x00, 0x20, 0x00, 0x20, 0x00};
+static unsigned char courier18_87_bits[] = {
+0x8f, 0x07, 0x02, 0x02, 0x22, 0x02, 0x22, 0x02, 0x22, 0x02, 0x54, 0x01, 
+0x54, 0x01, 0x54, 0x01, 0x54, 0x01, 0x88, 0x00, 0x88, 0x00};
+static unsigned char courier18_88_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x10, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char courier18_89_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x7c, 0x00};
+static unsigned char courier18_90_bits[] = {
+0x7f, 0x41, 0x21, 0x10, 0x10, 0x08, 0x04, 0x04, 0x42, 0x41, 0x7f};
+static unsigned char courier18_91_bits[] = {
+0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x07};
+static unsigned char courier18_92_bits[] = {
+0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x08, 0x08, 0x10, 0x10, 0x20, 0x20, 
+0x40, 0x40, 0x80, 0x80};
+static unsigned char courier18_93_bits[] = {
+0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0x07};
+static unsigned char courier18_94_bits[] = {
+0x08, 0x14, 0x22, 0x41};
+static unsigned char courier18_95_bits[] = {
+0xff, 0x07};
+static unsigned char courier18_96_bits[] = {
+0x03, 0x03, 0x06, 0x06, 0x0c};
+static unsigned char courier18_97_bits[] = {
+0x3c, 0x00, 0x42, 0x00, 0x40, 0x00, 0x7e, 0x00, 0x41, 0x00, 0x41, 0x00, 
+0x61, 0x00, 0xde, 0x01};
+static unsigned char courier18_98_bits[] = {
+0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x7a, 0x00, 0x86, 0x00, 
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x86, 0x00, 0x7b, 0x00};
+static unsigned char courier18_99_bits[] = {
+0xbc, 0xc2, 0x81, 0x01, 0x01, 0x01, 0xc2, 0x3c};
+static unsigned char courier18_100_bits[] = {
+0xc0, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xbc, 0x00, 0xc2, 0x00, 
+0x81, 0x00, 0x81, 0x00, 0x81, 0x00, 0x81, 0x00, 0xc2, 0x00, 0xbc, 0x01};
+static unsigned char courier18_101_bits[] = {
+0x3c, 0x42, 0x81, 0xff, 0x01, 0x01, 0xc2, 0x3c};
+static unsigned char courier18_102_bits[] = {
+0xf0, 0x08, 0x04, 0x04, 0x7f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x7f};
+static unsigned char courier18_103_bits[] = {
+0xbc, 0x01, 0xc2, 0x00, 0x81, 0x00, 0x81, 0x00, 0x81, 0x00, 0x81, 0x00, 
+0xc2, 0x00, 0xbc, 0x00, 0x80, 0x00, 0x80, 0x00, 0x40, 0x00, 0x3e, 0x00};
+static unsigned char courier18_104_bits[] = {
+0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x7a, 0x00, 0x86, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char courier18_105_bits[] = {
+0x08, 0x08, 0x00, 0x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x7f};
+static unsigned char courier18_106_bits[] = {
+0x10, 0x10, 0x00, 0x3f, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
+0x20, 0x10, 0x0f};
+static unsigned char courier18_107_bits[] = {
+0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0xf2, 0x00, 0x22, 0x00, 
+0x12, 0x00, 0x0e, 0x00, 0x12, 0x00, 0x22, 0x00, 0x42, 0x00, 0xe3, 0x01};
+static unsigned char courier18_108_bits[] = {
+0x0f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x7f};
+static unsigned char courier18_109_bits[] = {
+0x9b, 0x01, 0x66, 0x02, 0x22, 0x02, 0x22, 0x02, 0x22, 0x02, 0x22, 0x02, 
+0x22, 0x02, 0x67, 0x06};
+static unsigned char courier18_110_bits[] = {
+0x7b, 0x00, 0x86, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0xc7, 0x01};
+static unsigned char courier18_111_bits[] = {
+0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier18_112_bits[] = {
+0x7b, 0x00, 0x86, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 
+0x86, 0x00, 0x7a, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x0f, 0x00};
+static unsigned char courier18_113_bits[] = {
+0xbc, 0x01, 0xc2, 0x00, 0x81, 0x00, 0x81, 0x00, 0x81, 0x00, 0x81, 0x00, 
+0xc2, 0x00, 0xbc, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0xe0, 0x01};
+static unsigned char courier18_114_bits[] = {
+0x77, 0x8c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x7f};
+static unsigned char courier18_115_bits[] = {
+0x5e, 0x61, 0x41, 0x0e, 0x30, 0x41, 0x43, 0x3d};
+static unsigned char courier18_116_bits[] = {
+0x04, 0x04, 0x04, 0x7f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x84, 0x78};
+static unsigned char courier18_117_bits[] = {
+0xc3, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 
+0xc2, 0x00, 0xbc, 0x01};
+static unsigned char courier18_118_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 
+0x10, 0x00, 0x10, 0x00};
+static unsigned char courier18_119_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x92, 0x00, 0x92, 0x00, 0xaa, 0x00, 0xaa, 0x00, 
+0x44, 0x00, 0x44, 0x00};
+static unsigned char courier18_120_bits[] = {
+0xe7, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0xe7};
+static unsigned char courier18_121_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x10, 0x00, 0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0x1f, 0x00};
+static unsigned char courier18_122_bits[] = {
+0x7f, 0x41, 0x21, 0x10, 0x08, 0x44, 0x42, 0x7f};
+static unsigned char courier18_123_bits[] = {
+0x18, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0x18};
+static unsigned char courier18_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01};
+static unsigned char courier18_125_bits[] = {
+0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x18, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0x03};
+static unsigned char courier18_126_bits[] = {
+0x06, 0x99, 0x60};
+static unsigned char courier18_127_bits[] = {
+0x00};
+static unsigned char courier18_128_bits[] = {
+0x00};
+static unsigned char courier18_129_bits[] = {
+0x00};
+static unsigned char courier18_130_bits[] = {
+0x00};
+static unsigned char courier18_131_bits[] = {
+0x00};
+static unsigned char courier18_132_bits[] = {
+0x00};
+static unsigned char courier18_133_bits[] = {
+0x00};
+static unsigned char courier18_134_bits[] = {
+0x00};
+static unsigned char courier18_135_bits[] = {
+0x00};
+static unsigned char courier18_136_bits[] = {
+0x00};
+static unsigned char courier18_137_bits[] = {
+0x00};
+static unsigned char courier18_138_bits[] = {
+0x00};
+static unsigned char courier18_139_bits[] = {
+0x00};
+static unsigned char courier18_140_bits[] = {
+0x00};
+static unsigned char courier18_141_bits[] = {
+0x00};
+static unsigned char courier18_142_bits[] = {
+0x00};
+static unsigned char courier18_143_bits[] = {
+0x00};
+static unsigned char courier18_144_bits[] = {
+0x00};
+static unsigned char courier18_145_bits[] = {
+0x00};
+static unsigned char courier18_146_bits[] = {
+0x00};
+static unsigned char courier18_147_bits[] = {
+0x00};
+static unsigned char courier18_148_bits[] = {
+0x00};
+static unsigned char courier18_149_bits[] = {
+0x00};
+static unsigned char courier18_150_bits[] = {
+0x00};
+static unsigned char courier18_151_bits[] = {
+0x00};
+static unsigned char courier18_152_bits[] = {
+0x00};
+static unsigned char courier18_153_bits[] = {
+0x00};
+static unsigned char courier18_154_bits[] = {
+0x00};
+static unsigned char courier18_155_bits[] = {
+0x00};
+static unsigned char courier18_156_bits[] = {
+0x00};
+static unsigned char courier18_157_bits[] = {
+0x00};
+static unsigned char courier18_158_bits[] = {
+0x00};
+static unsigned char courier18_159_bits[] = {
+0x00};
+static unsigned char courier18_160_bits[] = {
+0x00};
+static unsigned char courier18_161_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char courier18_162_bits[] = {
+0x08, 0x08, 0x08, 0x3c, 0x22, 0x21, 0x01, 0x01, 0x22, 0x1c, 0x08, 0x08};
+static unsigned char courier18_163_bits[] = {
+0x38, 0x44, 0x04, 0x04, 0x08, 0x3f, 0x08, 0x04, 0x84, 0x82, 0x7e};
+static unsigned char courier18_164_bits[] = {
+0x21, 0x1e, 0x21, 0x21, 0x21, 0x1e, 0x21};
+static unsigned char courier18_165_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 
+0xfe, 0x00, 0x10, 0x00, 0xfe, 0x00, 0x10, 0x00, 0x7c, 0x00};
+static unsigned char courier18_166_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01};
+static unsigned char courier18_167_bits[] = {
+0x7c, 0x42, 0x42, 0x02, 0x0e, 0x31, 0x41, 0x46, 0x38, 0x20, 0x21, 0x21, 
+0x1f};
+static unsigned char courier18_168_bits[] = {
+0x1b};
+static unsigned char courier18_169_bits[] = {
+0x78, 0x00, 0x86, 0x01, 0x72, 0x01, 0x49, 0x02, 0x05, 0x02, 0x05, 0x02, 
+0x05, 0x02, 0x49, 0x02, 0x32, 0x01, 0x86, 0x01, 0x78, 0x00};
+static unsigned char courier18_170_bits[] = {
+0x0e, 0x10, 0x1e, 0x11, 0x19, 0x37, 0x00, 0x3f};
+static unsigned char courier18_171_bits[] = {
+0x10, 0x01, 0xcc, 0x00, 0x66, 0x00, 0x33, 0x00, 0x33, 0x00, 0x66, 0x00, 
+0xcc, 0x00, 0x10, 0x01};
+static unsigned char courier18_172_bits[] = {
+0xff, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01};
+static unsigned char courier18_173_bits[] = {
+0xff};
+static unsigned char courier18_174_bits[] = {
+0xf8, 0x00, 0x06, 0x03, 0x7a, 0x02, 0x89, 0x04, 0x89, 0x04, 0x79, 0x04, 
+0x29, 0x04, 0x49, 0x04, 0x8a, 0x03, 0x06, 0x01, 0xf8, 0x00};
+static unsigned char courier18_175_bits[] = {
+0x1f};
+static unsigned char courier18_176_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char courier18_177_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0xff, 0x01, 0x10, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x00, 0x00, 0xff, 0x01};
+static unsigned char courier18_178_bits[] = {
+0x0e, 0x11, 0x10, 0x08, 0x04, 0x02, 0x1f};
+static unsigned char courier18_179_bits[] = {
+0x0e, 0x11, 0x10, 0x0c, 0x10, 0x11, 0x0e};
+static unsigned char courier18_180_bits[] = {
+0x04, 0x02, 0x01};
+static unsigned char courier18_181_bits[] = {
+0xc3, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 
+0xc2, 0x00, 0xbe, 0x01, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00};
+static unsigned char courier18_182_bits[] = {
+0xfc, 0x52, 0x51, 0x51, 0x51, 0x52, 0x5c, 0x50, 0x50, 0x50, 0x50, 0x50, 
+0xdc};
+static unsigned char courier18_183_bits[] = {
+0x03, 0x03};
+static unsigned char courier18_184_bits[] = {
+0x02, 0x04, 0x03};
+static unsigned char courier18_185_bits[] = {
+0x04, 0x07, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char courier18_186_bits[] = {
+0x1e, 0x21, 0x21, 0x21, 0x21, 0x1e, 0x00, 0x3f};
+static unsigned char courier18_187_bits[] = {
+0x11, 0x00, 0x66, 0x00, 0xcc, 0x00, 0x98, 0x01, 0x98, 0x01, 0xcc, 0x00, 
+0x66, 0x00, 0x11, 0x00};
+static unsigned char courier18_188_bits[] = {
+0x04, 0x00, 0x07, 0x00, 0x04, 0x02, 0x04, 0x01, 0x84, 0x00, 0x84, 0x00, 
+0x5f, 0x02, 0x20, 0x03, 0x90, 0x02, 0x50, 0x02, 0xc8, 0x07, 0x04, 0x02, 
+0x00, 0x07};
+static unsigned char courier18_189_bits[] = {
+0x04, 0x00, 0x07, 0x00, 0x04, 0x02, 0x04, 0x01, 0x84, 0x00, 0x84, 0x00, 
+0x5f, 0x03, 0xa0, 0x04, 0x90, 0x04, 0x10, 0x02, 0x08, 0x01, 0x84, 0x00, 
+0xc0, 0x07};
+static unsigned char courier18_190_bits[] = {
+0x0e, 0x00, 0x11, 0x00, 0x10, 0x02, 0x0c, 0x01, 0x90, 0x00, 0x91, 0x00, 
+0x4e, 0x02, 0x20, 0x03, 0x90, 0x02, 0x50, 0x02, 0xc8, 0x07, 0x04, 0x02, 
+0x00, 0x07};
+static unsigned char courier18_191_bits[] = {
+0x18, 0x18, 0x00, 0x08, 0x08, 0x0e, 0x01, 0x01, 0x21, 0x21, 0x21, 0x1e};
+static unsigned char courier18_192_bits[] = {
+0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x20, 0x00, 
+0x50, 0x00, 0x50, 0x00, 0x88, 0x00, 0x88, 0x00, 0x04, 0x01, 0xfc, 0x01, 
+0x02, 0x02, 0x02, 0x02, 0x8f, 0x07};
+static unsigned char courier18_193_bits[] = {
+0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x20, 0x00, 
+0x50, 0x00, 0x50, 0x00, 0x88, 0x00, 0x88, 0x00, 0x04, 0x01, 0xfc, 0x01, 
+0x02, 0x02, 0x02, 0x02, 0x8f, 0x07};
+static unsigned char courier18_194_bits[] = {
+0x20, 0x00, 0x50, 0x00, 0x88, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x20, 0x00, 
+0x50, 0x00, 0x50, 0x00, 0x88, 0x00, 0x88, 0x00, 0x04, 0x01, 0xfc, 0x01, 
+0x02, 0x02, 0x02, 0x02, 0x8f, 0x07};
+static unsigned char courier18_195_bits[] = {
+0x98, 0x00, 0x64, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x20, 0x00, 0x50, 0x00, 
+0x50, 0x00, 0x88, 0x00, 0x88, 0x00, 0x04, 0x01, 0xfc, 0x01, 0x02, 0x02, 
+0x02, 0x02, 0x8f, 0x07};
+static unsigned char courier18_196_bits[] = {
+0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x20, 0x00, 0x50, 0x00, 
+0x50, 0x00, 0x88, 0x00, 0x88, 0x00, 0x04, 0x01, 0xfc, 0x01, 0x02, 0x02, 
+0x02, 0x02, 0x8f, 0x07};
+static unsigned char courier18_197_bits[] = {
+0x30, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, 0x00, 0x3e, 0x00, 0x20, 0x00, 
+0x50, 0x00, 0x50, 0x00, 0x88, 0x00, 0x88, 0x00, 0x04, 0x01, 0xfc, 0x01, 
+0x02, 0x02, 0x02, 0x02, 0x8f, 0x07};
+static unsigned char courier18_198_bits[] = {
+0xf8, 0x07, 0x60, 0x04, 0x50, 0x04, 0x50, 0x00, 0x48, 0x02, 0xc8, 0x03, 
+0x7c, 0x02, 0x44, 0x00, 0x42, 0x04, 0x42, 0x04, 0xe7, 0x07};
+static unsigned char courier18_199_bits[] = {
+0x78, 0x01, 0x86, 0x01, 0x02, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x02, 0x01, 0x86, 0x00, 0x78, 0x00, 0x10, 0x00, 
+0x20, 0x00, 0x18, 0x00};
+static unsigned char courier18_200_bits[] = {
+0x04, 0x08, 0x10, 0x00, 0xff, 0x82, 0x82, 0x82, 0x12, 0x1e, 0x12, 0x82, 
+0x82, 0x82, 0xff};
+static unsigned char courier18_201_bits[] = {
+0x20, 0x10, 0x08, 0x00, 0xff, 0x82, 0x82, 0x82, 0x12, 0x1e, 0x12, 0x82, 
+0x82, 0x82, 0xff};
+static unsigned char courier18_202_bits[] = {
+0x18, 0x24, 0x42, 0x00, 0xff, 0x82, 0x82, 0x82, 0x12, 0x1e, 0x12, 0x82, 
+0x82, 0x82, 0xff};
+static unsigned char courier18_203_bits[] = {
+0x66, 0x00, 0x00, 0xff, 0x82, 0x82, 0x82, 0x12, 0x1e, 0x12, 0x82, 0x82, 
+0x82, 0xff};
+static unsigned char courier18_204_bits[] = {
+0x04, 0x08, 0x10, 0x00, 0x7f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0x7f};
+static unsigned char courier18_205_bits[] = {
+0x10, 0x08, 0x04, 0x00, 0x7f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0x7f};
+static unsigned char courier18_206_bits[] = {
+0x08, 0x14, 0x22, 0x00, 0x7f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0x7f};
+static unsigned char courier18_207_bits[] = {
+0x36, 0x00, 0x00, 0x7f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x7f};
+static unsigned char courier18_208_bits[] = {
+0x3f, 0x42, 0x82, 0x82, 0x82, 0x8f, 0x82, 0x82, 0x82, 0x42, 0x3f};
+static unsigned char courier18_209_bits[] = {
+0x98, 0x00, 0x64, 0x00, 0x00, 0x00, 0xe7, 0x01, 0x86, 0x00, 0x8a, 0x00, 
+0x8a, 0x00, 0x92, 0x00, 0x92, 0x00, 0xa2, 0x00, 0xa2, 0x00, 0xc2, 0x00, 
+0xc2, 0x00, 0x8f, 0x00};
+static unsigned char courier18_210_bits[] = {
+0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc6, 0x00, 
+0x82, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x82, 0x00, 0xc6, 0x00, 0x38, 0x00};
+static unsigned char courier18_211_bits[] = {
+0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc6, 0x00, 
+0x82, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x82, 0x00, 0xc6, 0x00, 0x38, 0x00};
+static unsigned char courier18_212_bits[] = {
+0x10, 0x00, 0x28, 0x00, 0x44, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc6, 0x00, 
+0x82, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x82, 0x00, 0xc6, 0x00, 0x38, 0x00};
+static unsigned char courier18_213_bits[] = {
+0x98, 0x00, 0x64, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 
+0xc6, 0x00, 0x38, 0x00};
+static unsigned char courier18_214_bits[] = {
+0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 
+0xc6, 0x00, 0x38, 0x00};
+static unsigned char courier18_215_bits[] = {
+0x01, 0x01, 0x82, 0x00, 0x44, 0x00, 0x28, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x44, 0x00, 0x82, 0x00, 0x01, 0x01};
+static unsigned char courier18_216_bits[] = {
+0x70, 0x04, 0x8c, 0x02, 0x04, 0x01, 0x82, 0x02, 0x42, 0x02, 0x22, 0x02, 
+0x12, 0x02, 0x0a, 0x02, 0x04, 0x01, 0x8a, 0x01, 0x71, 0x00};
+static unsigned char courier18_217_bits[] = {
+0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0x00, 0x00, 0xcf, 0x03, 0x02, 0x01, 
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 
+0x02, 0x01, 0x84, 0x00, 0x78, 0x00};
+static unsigned char courier18_218_bits[] = {
+0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x00, 0x00, 0xcf, 0x03, 0x02, 0x01, 
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 
+0x02, 0x01, 0x84, 0x00, 0x78, 0x00};
+static unsigned char courier18_219_bits[] = {
+0x30, 0x00, 0x48, 0x00, 0x84, 0x00, 0x00, 0x00, 0xcf, 0x03, 0x02, 0x01, 
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 
+0x02, 0x01, 0x84, 0x00, 0x78, 0x00};
+static unsigned char courier18_220_bits[] = {
+0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcf, 0x03, 0x02, 0x01, 0x02, 0x01, 
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 
+0x84, 0x00, 0x78, 0x00};
+static unsigned char courier18_221_bits[] = {
+0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x82, 0x00, 
+0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x7c, 0x00};
+static unsigned char courier18_222_bits[] = {
+0x07, 0x00, 0x02, 0x00, 0x7e, 0x00, 0x82, 0x00, 0x02, 0x01, 0x02, 0x01, 
+0x82, 0x00, 0x7e, 0x00, 0x02, 0x00, 0x02, 0x00, 0x07, 0x00};
+static unsigned char courier18_223_bits[] = {
+0x38, 0x44, 0x42, 0x42, 0x22, 0x32, 0x42, 0x82, 0x82, 0x82, 0x92, 0x67};
+static unsigned char courier18_224_bits[] = {
+0x04, 0x00, 0x08, 0x00, 0x10, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x42, 0x00, 
+0x40, 0x00, 0x7e, 0x00, 0x41, 0x00, 0x41, 0x00, 0x61, 0x00, 0xde, 0x01};
+static unsigned char courier18_225_bits[] = {
+0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x42, 0x00, 
+0x40, 0x00, 0x7e, 0x00, 0x41, 0x00, 0x41, 0x00, 0x61, 0x00, 0xde, 0x01};
+static unsigned char courier18_226_bits[] = {
+0x18, 0x00, 0x24, 0x00, 0x42, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x42, 0x00, 
+0x40, 0x00, 0x7e, 0x00, 0x41, 0x00, 0x41, 0x00, 0x61, 0x00, 0xde, 0x01};
+static unsigned char courier18_227_bits[] = {
+0x4c, 0x00, 0x32, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x42, 0x00, 0x40, 0x00, 
+0x7e, 0x00, 0x41, 0x00, 0x41, 0x00, 0x61, 0x00, 0xde, 0x01};
+static unsigned char courier18_228_bits[] = {
+0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x42, 0x00, 0x40, 0x00, 
+0x7e, 0x00, 0x41, 0x00, 0x41, 0x00, 0x61, 0x00, 0xde, 0x01};
+static unsigned char courier18_229_bits[] = {
+0x18, 0x00, 0x24, 0x00, 0x24, 0x00, 0x18, 0x00, 0x00, 0x00, 0x3c, 0x00, 
+0x42, 0x00, 0x40, 0x00, 0x7e, 0x00, 0x41, 0x00, 0x41, 0x00, 0x61, 0x00, 
+0xde, 0x01};
+static unsigned char courier18_230_bits[] = {
+0x8e, 0x01, 0x51, 0x02, 0x20, 0x04, 0xfe, 0x07, 0x21, 0x00, 0x21, 0x00, 
+0x51, 0x04, 0x8e, 0x03};
+static unsigned char courier18_231_bits[] = {
+0xbc, 0xc2, 0x81, 0x01, 0x01, 0x01, 0xc2, 0x3c, 0x08, 0x10, 0x0c};
+static unsigned char courier18_232_bits[] = {
+0x04, 0x08, 0x10, 0x00, 0x3c, 0x42, 0x81, 0xff, 0x01, 0x01, 0xc2, 0x3c};
+static unsigned char courier18_233_bits[] = {
+0x20, 0x10, 0x08, 0x00, 0x3c, 0x42, 0x81, 0xff, 0x01, 0x01, 0xc2, 0x3c};
+static unsigned char courier18_234_bits[] = {
+0x18, 0x24, 0x42, 0x00, 0x3c, 0x42, 0x81, 0xff, 0x01, 0x01, 0xc2, 0x3c};
+static unsigned char courier18_235_bits[] = {
+0x66, 0x00, 0x00, 0x3c, 0x42, 0x81, 0xff, 0x01, 0x01, 0xc2, 0x3c};
+static unsigned char courier18_236_bits[] = {
+0x02, 0x04, 0x08, 0x00, 0x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x7f};
+static unsigned char courier18_237_bits[] = {
+0x10, 0x08, 0x04, 0x00, 0x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x7f};
+static unsigned char courier18_238_bits[] = {
+0x08, 0x14, 0x22, 0x00, 0x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x7f};
+static unsigned char courier18_239_bits[] = {
+0x36, 0x00, 0x00, 0x0e, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x7f};
+static unsigned char courier18_240_bits[] = {
+0xce, 0x31, 0x2c, 0x42, 0x40, 0xbc, 0xc2, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier18_241_bits[] = {
+0x98, 0x00, 0x64, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x86, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char courier18_242_bits[] = {
+0x04, 0x08, 0x10, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier18_243_bits[] = {
+0x40, 0x20, 0x10, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier18_244_bits[] = {
+0x18, 0x24, 0x42, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier18_245_bits[] = {
+0x4c, 0x32, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier18_246_bits[] = {
+0x66, 0x00, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char courier18_247_bits[] = {
+0x18, 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, 0x18, 0x18};
+static unsigned char courier18_248_bits[] = {
+0xbc, 0x42, 0xa1, 0x91, 0x89, 0x85, 0x42, 0x3d};
+static unsigned char courier18_249_bits[] = {
+0x08, 0x00, 0x10, 0x00, 0x20, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc2, 0x00, 0xbc, 0x01};
+static unsigned char courier18_250_bits[] = {
+0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc2, 0x00, 0xbc, 0x01};
+static unsigned char courier18_251_bits[] = {
+0x10, 0x00, 0x28, 0x00, 0x44, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc2, 0x00, 0xbc, 0x01};
+static unsigned char courier18_252_bits[] = {
+0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x00, 0x82, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc2, 0x00, 0xbc, 0x01};
+static unsigned char courier18_253_bits[] = {
+0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x82, 0x00, 
+0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x08, 0x00, 0x08, 0x00, 0x1f, 0x00};
+static unsigned char courier18_254_bits[] = {
+0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x7a, 0x00, 0x86, 0x00, 
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x86, 0x00, 0x7a, 0x00, 
+0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x0f, 0x00};
+static unsigned char courier18_255_bits[] = {
+0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x82, 0x00, 0x82, 0x00, 
+0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x08, 0x00, 0x08, 0x00, 0x1f, 0x00};
+static RotFont courier18font[] = {
+{5, 1, 1, courier18_0_bits},
+{5, 1, 1, courier18_1_bits},
+{5, 1, 1, courier18_2_bits},
+{5, 1, 1, courier18_3_bits},
+{5, 1, 1, courier18_4_bits},
+{5, 1, 1, courier18_5_bits},
+{5, 1, 1, courier18_6_bits},
+{5, 1, 1, courier18_7_bits},
+{5, 1, 1, courier18_8_bits},
+{5, 1, 1, courier18_9_bits},
+{5, 1, 1, courier18_10_bits},
+{5, 1, 1, courier18_11_bits},
+{5, 1, 1, courier18_12_bits},
+{5, 1, 1, courier18_13_bits},
+{5, 1, 1, courier18_14_bits},
+{5, 1, 1, courier18_15_bits},
+{5, 1, 1, courier18_16_bits},
+{5, 1, 1, courier18_17_bits},
+{5, 1, 1, courier18_18_bits},
+{5, 1, 1, courier18_19_bits},
+{5, 1, 1, courier18_20_bits},
+{5, 1, 1, courier18_21_bits},
+{5, 1, 1, courier18_22_bits},
+{5, 1, 1, courier18_23_bits},
+{5, 1, 1, courier18_24_bits},
+{5, 1, 1, courier18_25_bits},
+{5, 1, 1, courier18_26_bits},
+{5, 1, 1, courier18_27_bits},
+{5, 1, 1, courier18_28_bits},
+{5, 1, 1, courier18_29_bits},
+{5, 1, 1, courier18_30_bits},
+{5, 1, 1, courier18_31_bits},
+{7, 1, 1, courier18_32_bits},
+{2, 12, 12, courier18_33_bits},
+{5, 5, 12, courier18_34_bits},
+{9, 15, 13, courier18_35_bits},
+{7, 15, 13, courier18_36_bits},
+{9, 12, 12, courier18_37_bits},
+{7, 10, 10, courier18_38_bits},
+{4, 5, 12, courier18_39_bits},
+{3, 14, 12, courier18_40_bits},
+{3, 14, 12, courier18_41_bits},
+{7, 8, 12, courier18_42_bits},
+{9, 9, 10, courier18_43_bits},
+{4, 5, 2, courier18_44_bits},
+{9, 1, 6, courier18_45_bits},
+{2, 2, 2, courier18_46_bits},
+{8, 16, 13, courier18_47_bits},
+{7, 12, 12, courier18_48_bits},
+{7, 12, 12, courier18_49_bits},
+{8, 12, 12, courier18_50_bits},
+{7, 12, 12, courier18_51_bits},
+{7, 12, 12, courier18_52_bits},
+{8, 12, 12, courier18_53_bits},
+{7, 12, 12, courier18_54_bits},
+{8, 12, 12, courier18_55_bits},
+{7, 12, 12, courier18_56_bits},
+{7, 12, 12, courier18_57_bits},
+{2, 8, 8, courier18_58_bits},
+{5, 11, 8, courier18_59_bits},
+{10, 9, 10, courier18_60_bits},
+{9, 4, 7, courier18_61_bits},
+{10, 9, 10, courier18_62_bits},
+{7, 11, 11, courier18_63_bits},
+{8, 13, 12, courier18_64_bits},
+{11, 11, 11, courier18_65_bits},
+{9, 11, 11, courier18_66_bits},
+{9, 11, 11, courier18_67_bits},
+{8, 11, 11, courier18_68_bits},
+{8, 11, 11, courier18_69_bits},
+{8, 11, 11, courier18_70_bits},
+{10, 11, 11, courier18_71_bits},
+{9, 11, 11, courier18_72_bits},
+{7, 11, 11, courier18_73_bits},
+{9, 11, 11, courier18_74_bits},
+{10, 11, 11, courier18_75_bits},
+{9, 11, 11, courier18_76_bits},
+{11, 11, 11, courier18_77_bits},
+{9, 11, 11, courier18_78_bits},
+{9, 11, 11, courier18_79_bits},
+{9, 11, 11, courier18_80_bits},
+{9, 13, 11, courier18_81_bits},
+{10, 11, 11, courier18_82_bits},
+{8, 11, 11, courier18_83_bits},
+{9, 11, 11, courier18_84_bits},
+{10, 11, 11, courier18_85_bits},
+{11, 11, 11, courier18_86_bits},
+{11, 11, 11, courier18_87_bits},
+{9, 11, 11, courier18_88_bits},
+{9, 11, 11, courier18_89_bits},
+{7, 11, 11, courier18_90_bits},
+{3, 15, 12, courier18_91_bits},
+{8, 16, 13, courier18_92_bits},
+{3, 15, 12, courier18_93_bits},
+{7, 4, 12, courier18_94_bits},
+{11, 1, -3, courier18_95_bits},
+{4, 5, 12, courier18_96_bits},
+{9, 8, 8, courier18_97_bits},
+{9, 12, 12, courier18_98_bits},
+{8, 8, 8, courier18_99_bits},
+{9, 12, 12, courier18_100_bits},
+{8, 8, 8, courier18_101_bits},
+{8, 12, 12, courier18_102_bits},
+{9, 12, 8, courier18_103_bits},
+{9, 12, 12, courier18_104_bits},
+{7, 11, 11, courier18_105_bits},
+{6, 15, 11, courier18_106_bits},
+{9, 12, 12, courier18_107_bits},
+{7, 12, 12, courier18_108_bits},
+{11, 8, 8, courier18_109_bits},
+{9, 8, 8, courier18_110_bits},
+{8, 8, 8, courier18_111_bits},
+{9, 12, 8, courier18_112_bits},
+{9, 12, 8, courier18_113_bits},
+{8, 8, 8, courier18_114_bits},
+{7, 8, 8, courier18_115_bits},
+{8, 11, 11, courier18_116_bits},
+{9, 8, 8, courier18_117_bits},
+{9, 8, 8, courier18_118_bits},
+{9, 8, 8, courier18_119_bits},
+{8, 8, 8, courier18_120_bits},
+{9, 12, 8, courier18_121_bits},
+{7, 8, 8, courier18_122_bits},
+{5, 15, 12, courier18_123_bits},
+{1, 15, 12, courier18_124_bits},
+{5, 15, 12, courier18_125_bits},
+{8, 3, 7, courier18_126_bits},
+{5, 1, 1, courier18_127_bits},
+{5, 1, 1, courier18_128_bits},
+{5, 1, 1, courier18_129_bits},
+{5, 1, 1, courier18_130_bits},
+{5, 1, 1, courier18_131_bits},
+{5, 1, 1, courier18_132_bits},
+{5, 1, 1, courier18_133_bits},
+{5, 1, 1, courier18_134_bits},
+{5, 1, 1, courier18_135_bits},
+{5, 1, 1, courier18_136_bits},
+{5, 1, 1, courier18_137_bits},
+{5, 1, 1, courier18_138_bits},
+{5, 1, 1, courier18_139_bits},
+{5, 1, 1, courier18_140_bits},
+{5, 1, 1, courier18_141_bits},
+{5, 1, 1, courier18_142_bits},
+{5, 1, 1, courier18_143_bits},
+{5, 1, 1, courier18_144_bits},
+{5, 1, 1, courier18_145_bits},
+{5, 1, 1, courier18_146_bits},
+{5, 1, 1, courier18_147_bits},
+{5, 1, 1, courier18_148_bits},
+{5, 1, 1, courier18_149_bits},
+{5, 1, 1, courier18_150_bits},
+{5, 1, 1, courier18_151_bits},
+{5, 1, 1, courier18_152_bits},
+{5, 1, 1, courier18_153_bits},
+{5, 1, 1, courier18_154_bits},
+{5, 1, 1, courier18_155_bits},
+{5, 1, 1, courier18_156_bits},
+{5, 1, 1, courier18_157_bits},
+{5, 1, 1, courier18_158_bits},
+{5, 1, 1, courier18_159_bits},
+{1, 1, 1, courier18_160_bits},
+{2, 13, 9, courier18_161_bits},
+{6, 12, 12, courier18_162_bits},
+{8, 11, 11, courier18_163_bits},
+{6, 7, 9, courier18_164_bits},
+{9, 11, 11, courier18_165_bits},
+{1, 15, 12, courier18_166_bits},
+{7, 13, 12, courier18_167_bits},
+{5, 1, 11, courier18_168_bits},
+{10, 11, 11, courier18_169_bits},
+{6, 8, 11, courier18_170_bits},
+{9, 8, 8, courier18_171_bits},
+{9, 4, 7, courier18_172_bits},
+{8, 1, 6, courier18_173_bits},
+{11, 11, 11, courier18_174_bits},
+{5, 1, 10, courier18_175_bits},
+{5, 5, 12, courier18_176_bits},
+{9, 9, 10, courier18_177_bits},
+{5, 7, 12, courier18_178_bits},
+{5, 7, 12, courier18_179_bits},
+{3, 3, 12, courier18_180_bits},
+{9, 12, 8, courier18_181_bits},
+{8, 13, 12, courier18_182_bits},
+{2, 2, 7, courier18_183_bits},
+{3, 3, 0, courier18_184_bits},
+{5, 7, 12, courier18_185_bits},
+{6, 8, 11, courier18_186_bits},
+{9, 8, 8, courier18_187_bits},
+{11, 13, 13, courier18_188_bits},
+{11, 13, 13, courier18_189_bits},
+{11, 13, 13, courier18_190_bits},
+{6, 12, 9, courier18_191_bits},
+{11, 15, 15, courier18_192_bits},
+{11, 15, 15, courier18_193_bits},
+{11, 15, 15, courier18_194_bits},
+{11, 14, 14, courier18_195_bits},
+{11, 14, 14, courier18_196_bits},
+{11, 15, 15, courier18_197_bits},
+{11, 11, 11, courier18_198_bits},
+{9, 14, 11, courier18_199_bits},
+{8, 15, 15, courier18_200_bits},
+{8, 15, 15, courier18_201_bits},
+{8, 15, 15, courier18_202_bits},
+{8, 14, 14, courier18_203_bits},
+{7, 15, 15, courier18_204_bits},
+{7, 15, 15, courier18_205_bits},
+{7, 15, 15, courier18_206_bits},
+{7, 14, 14, courier18_207_bits},
+{8, 11, 11, courier18_208_bits},
+{9, 14, 14, courier18_209_bits},
+{9, 15, 15, courier18_210_bits},
+{9, 15, 15, courier18_211_bits},
+{9, 15, 15, courier18_212_bits},
+{9, 14, 14, courier18_213_bits},
+{9, 14, 14, courier18_214_bits},
+{9, 9, 10, courier18_215_bits},
+{11, 11, 11, courier18_216_bits},
+{10, 15, 15, courier18_217_bits},
+{10, 15, 15, courier18_218_bits},
+{10, 15, 15, courier18_219_bits},
+{10, 14, 14, courier18_220_bits},
+{9, 15, 15, courier18_221_bits},
+{9, 11, 11, courier18_222_bits},
+{8, 12, 12, courier18_223_bits},
+{9, 12, 12, courier18_224_bits},
+{9, 12, 12, courier18_225_bits},
+{9, 12, 12, courier18_226_bits},
+{9, 11, 11, courier18_227_bits},
+{9, 11, 11, courier18_228_bits},
+{9, 13, 13, courier18_229_bits},
+{11, 8, 8, courier18_230_bits},
+{8, 11, 8, courier18_231_bits},
+{8, 12, 12, courier18_232_bits},
+{8, 12, 12, courier18_233_bits},
+{8, 12, 12, courier18_234_bits},
+{8, 11, 11, courier18_235_bits},
+{7, 12, 12, courier18_236_bits},
+{7, 12, 12, courier18_237_bits},
+{7, 12, 12, courier18_238_bits},
+{7, 11, 11, courier18_239_bits},
+{8, 12, 12, courier18_240_bits},
+{9, 11, 11, courier18_241_bits},
+{8, 12, 12, courier18_242_bits},
+{8, 12, 12, courier18_243_bits},
+{8, 12, 12, courier18_244_bits},
+{8, 11, 11, courier18_245_bits},
+{8, 11, 11, courier18_246_bits},
+{8, 9, 10, courier18_247_bits},
+{8, 8, 8, courier18_248_bits},
+{9, 12, 12, courier18_249_bits},
+{9, 12, 12, courier18_250_bits},
+{9, 12, 12, courier18_251_bits},
+{9, 11, 11, courier18_252_bits},
+{9, 16, 12, courier18_253_bits},
+{9, 16, 12, courier18_254_bits},
+{9, 15, 11, courier18_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier24.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier24.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier24.bdf	(revision 15879)
@@ -0,0 +1,4150 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) IBM Corporation 1990,1991. IBM Courier is a Trademark of the IBM Corporation.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -adobe-courier-medium-r-normal--24-231-75-75-m-140-iso8859-1
+SIZE 23 75 75
+FONTBOUNDINGBOX 17 24 -1 -5
+STARTPROPERTIES 25
+FOUNDRY "adobe"
+FAMILY_NAME "courier"
+WEIGHT_NAME "medium"
+SLANT "r"
+SETWIDTH_NAME "normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 24
+POINT_SIZE 231
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "m"
+AVERAGE_WIDTH 140
+CHARSET_REGISTRY "iso8859"
+CHARSET_ENCODING "1"
+FONT "-adobe-courier-medium-r-normal--24-231-75-75-m-140-iso8859-1"
+COPYRIGHT "Copyright (c) IBM Corporation 1990,1991. IBM Courier is a Trademark of the IBM Corporation."
+RAW_PIXEL_SIZE 1000
+RAW_POINT_SIZE 964
+RAW_ASCENT 841
+RAW_DESCENT 288
+RAW_AVERAGE_WIDTH 6000
+FACE_NAME "Couriere."
+DEFAULT_CHAR 0
+FONT_ASCENT 20
+FONT_DESCENT 7
+ENDPROPERTIES
+CHARS 190
+STARTCHAR space
+ENCODING 32
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 0 0 0 0
+ATTRIBUTES 0x0258
+BITMAP
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 3 14 6 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+00
+00
+e0
+e0
+e0
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 6 7 4 7
+ATTRIBUTES 0x0258
+BITMAP
+cc
+cc
+cc
+cc
+cc
+cc
+cc
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 17 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+1180
+1100
+1100
+1100
+1100
+1100
+ffe0
+2100
+2100
+2100
+2100
+ffe0
+2100
+2100
+2100
+2100
+2100
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 19 2 -3
+ATTRIBUTES 0x0258
+BITMAP
+0400
+0400
+0400
+1f80
+2580
+4480
+4480
+64c0
+3c00
+0f00
+0580
+c440
+4440
+6440
+7480
+7f00
+0400
+0400
+0400
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+3800
+4400
+8200
+8200
+8200
+4460
+39e0
+0f80
+7c00
+71c0
+0220
+0410
+0410
+0630
+01e0
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 13 3 0
+ATTRIBUTES 0x0258
+BITMAP
+3d00
+6200
+4000
+4000
+2000
+3000
+51c0
+c900
+8d00
+8600
+8600
+c700
+79c0
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 6 4 8
+ATTRIBUTES 0x0258
+BITMAP
+30
+70
+60
+60
+c0
+c0
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 18 7 -2
+ATTRIBUTES 0x0258
+BITMAP
+10
+20
+20
+40
+40
+40
+80
+80
+80
+80
+80
+80
+c0
+40
+40
+20
+20
+10
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 18 3 -2
+ATTRIBUTES 0x0258
+BITMAP
+40
+40
+60
+20
+20
+10
+10
+10
+10
+10
+10
+10
+10
+20
+20
+60
+40
+c0
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 9 3 5
+ATTRIBUTES 0x0258
+BITMAP
+0800
+0800
+8880
+ff80
+3e00
+1c00
+3600
+6300
+2200
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 11 2 2
+ATTRIBUTES 0x0258
+BITMAP
+0400
+0400
+0400
+0400
+0400
+ffe0
+0400
+0400
+0400
+0400
+0400
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 6 4 -3
+ATTRIBUTES 0x0258
+BITMAP
+30
+60
+60
+60
+c0
+c0
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 1 2 7
+ATTRIBUTES 0x0258
+BITMAP
+ffe0
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 3 5 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+f0
+70
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 20 2 -3
+ATTRIBUTES 0x0258
+BITMAP
+0040
+0080
+0080
+0180
+0100
+0300
+0200
+0200
+0400
+0400
+0800
+0800
+1000
+1000
+3000
+2000
+6000
+4000
+c000
+8000
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 15 3 0
+ATTRIBUTES 0x0258
+BITMAP
+3c00
+6200
+4100
+8100
+8080
+8080
+8080
+8080
+8080
+8080
+8080
+8100
+4100
+6200
+3c00
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0c00
+3c00
+6400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+7fc0
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+1e00
+2300
+4180
+4080
+0080
+0080
+0180
+0100
+0200
+0400
+0800
+1080
+6080
+8080
+ff80
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+3c00
+6200
+4100
+0100
+0100
+0100
+0600
+0f00
+0100
+0080
+0080
+0080
+0080
+8300
+7e00
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0600
+0600
+0a00
+0a00
+1200
+1200
+2200
+4200
+4200
+8200
+ffc0
+0200
+0200
+0200
+1fc0
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+7f80
+4000
+4000
+4000
+4000
+4000
+5e00
+6180
+00c0
+0040
+0040
+0040
+0080
+c180
+7e00
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 15 3 0
+ATTRIBUTES 0x0258
+BITMAP
+0f80
+3800
+6000
+4000
+c000
+8000
+bc00
+e200
+c300
+8100
+8100
+8100
+4100
+6200
+3c00
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+ffc0
+8040
+8080
+8080
+0080
+0100
+0100
+0300
+0200
+0200
+0600
+0400
+0c00
+0c00
+0800
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 15 3 0
+ATTRIBUTES 0x0258
+BITMAP
+3c00
+6200
+c100
+8100
+8100
+8100
+6200
+3c00
+4300
+c100
+8080
+8080
+8080
+4300
+3e00
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+3c00
+6200
+4100
+8080
+8080
+8080
+c180
+6380
+3c80
+0080
+0100
+0100
+0200
+0400
+f800
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 9 5 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+f0
+70
+00
+00
+00
+60
+f0
+70
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 5 12 4 -3
+ATTRIBUTES 0x0258
+BITMAP
+30
+78
+38
+00
+00
+00
+30
+70
+60
+60
+40
+c0
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 11 1 2
+ATTRIBUTES 0x0258
+BITMAP
+0010
+0070
+0180
+0600
+3800
+e000
+3800
+0f00
+03e0
+0070
+0010
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 5 2 5
+ATTRIBUTES 0x0258
+BITMAP
+ffe0
+0000
+0000
+0000
+ffe0
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 11 1 2
+ATTRIBUTES 0x0258
+BITMAP
+8000
+e000
+3800
+0600
+01c0
+0070
+03c0
+1f00
+fc00
+f000
+c000
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 8 14 3 0
+ATTRIBUTES 0x0258
+BITMAP
+7c
+c2
+81
+81
+01
+01
+02
+1c
+10
+10
+00
+38
+38
+38
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 13 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0f80
+3060
+6010
+4698
+8d88
+8988
+9188
+9118
+9310
+dee0
+4400
+3070
+1fc0
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 14 0 0
+ATTRIBUTES 0x0258
+BITMAP
+3f00
+0300
+0780
+0680
+04c0
+0cc0
+0840
+1860
+1820
+1fe0
+3030
+2010
+6018
+f87c
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+ff80
+20c0
+2020
+2020
+2020
+2060
+3f80
+2060
+2030
+2010
+2010
+2010
+2060
+ffc0
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0f20
+30e0
+6060
+4060
+8020
+8000
+8000
+8000
+8000
+8000
+4000
+4030
+3060
+1f80
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+ff00
+20c0
+2060
+2020
+2010
+2010
+2010
+2010
+2010
+2010
+2030
+2020
+20c0
+ff80
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+fff0
+1010
+1010
+1010
+1010
+1080
+1f80
+1080
+1080
+1000
+1010
+1010
+1010
+fff0
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 14 2 0
+ATTRIBUTES 0x0258
+BITMAP
+ffe0
+2020
+2020
+2020
+2020
+2100
+3f00
+2100
+2100
+2000
+2000
+2000
+2000
+fc00
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0fa0
+30e0
+2060
+4020
+c020
+8000
+8000
+8000
+81f8
+8010
+4010
+6010
+3030
+0fc0
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f8f0
+2020
+2020
+2020
+2020
+2020
+2020
+3fe0
+2020
+2020
+2020
+2020
+2020
+f8f0
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 14 2 0
+ATTRIBUTES 0x0258
+BITMAP
+ffc0
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0ff8
+0040
+0040
+0040
+0040
+0040
+0040
+0040
+4040
+4040
+4040
+4040
+6080
+1f80
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+fcf8
+1020
+1040
+1080
+1100
+1200
+1400
+1e00
+1180
+1080
+1040
+1060
+1020
+fc38
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+fe00
+1000
+1000
+1000
+1000
+1000
+1000
+1000
+1010
+1010
+1010
+1010
+1010
+fff0
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 14 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f03c
+2828
+2828
+2848
+2448
+2448
+2488
+2288
+2288
+2308
+2008
+2008
+2008
+f87c
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f0f8
+3810
+2810
+2810
+2410
+2410
+2210
+2210
+2110
+2110
+2090
+2090
+2050
+f870
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0f80
+30c0
+6060
+4020
+c010
+8010
+8010
+8010
+8010
+8010
+4020
+6020
+30c0
+0f80
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 14 2 0
+ATTRIBUTES 0x0258
+BITMAP
+ff00
+21c0
+2040
+2020
+2020
+2020
+2060
+21c0
+3f80
+2000
+2000
+2000
+2000
+fc00
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 17 1 -3
+ATTRIBUTES 0x0258
+BITMAP
+0f00
+30c0
+6060
+4020
+c010
+8010
+8010
+8010
+8010
+8010
+4020
+6020
+30c0
+1f80
+0c00
+1f10
+10e0
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+ff80
+20c0
+2060
+2020
+2020
+2020
+20c0
+3f80
+2300
+2100
+2080
+2040
+2040
+f838
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 14 3 0
+ATTRIBUTES 0x0258
+BITMAP
+3c80
+4380
+8180
+8080
+8080
+8000
+6000
+3f00
+0180
+0080
+8080
+8080
+c100
+be00
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+7ff0
+4210
+4210
+4210
+4210
+c218
+0200
+0200
+0200
+0200
+0200
+0200
+0200
+1fc0
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f9f8
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+6020
+6020
+3040
+1f80
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 14 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f87c
+2010
+2010
+1010
+1020
+1020
+0820
+0840
+0c40
+04c0
+0480
+0280
+0380
+0300
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 15 14 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f83e
+6004
+6004
+6108
+2308
+2388
+2288
+2488
+24c8
+3458
+3850
+3830
+1830
+1030
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f8f0
+2040
+3040
+1880
+0900
+0500
+0600
+0600
+0d00
+0880
+10c0
+3060
+2020
+f8f8
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f8f8
+2020
+3060
+1040
+0880
+0c80
+0500
+0700
+0200
+0200
+0200
+0200
+0200
+1fc0
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 14 2 0
+ATTRIBUTES 0x0258
+BITMAP
+ff80
+8080
+8100
+8100
+8200
+0400
+0c00
+0800
+1000
+3040
+2040
+4040
+c040
+ffc0
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 18 8 -2
+ATTRIBUTES 0x0258
+BITMAP
+f0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+f0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 20 2 -3
+ATTRIBUTES 0x0258
+BITMAP
+8000
+c000
+4000
+6000
+2000
+3000
+1000
+1000
+0800
+0800
+0400
+0400
+0200
+0200
+0300
+0100
+0180
+0080
+00c0
+0040
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 18 3 -2
+ATTRIBUTES 0x0258
+BITMAP
+f0
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+f0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 11 2 3
+ATTRIBUTES 0x0258
+BITMAP
+0e00
+0a00
+1a00
+1900
+1100
+3180
+2080
+60c0
+60c0
+c040
+c060
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 17 1 -1 -3
+ATTRIBUTES 0x0258
+BITMAP
+ffff80
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 6 4 8
+ATTRIBUTES 0x0258
+BITMAP
+30
+30
+60
+60
+e0
+c0
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 10 2 0
+ATTRIBUTES 0x0258
+BITMAP
+3f00
+0180
+0080
+3f80
+4180
+8080
+8080
+8180
+c380
+7ce0
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 15 0 0
+ATTRIBUTES 0x0258
+BITMAP
+e000
+2000
+2000
+2000
+2000
+27c0
+2c30
+3010
+3008
+3008
+3008
+3008
+3810
+3c30
+e7c0
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 10 2 0
+ATTRIBUTES 0x0258
+BITMAP
+1fe0
+60c0
+4040
+8000
+8000
+8000
+8000
+4020
+60c0
+1f00
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+00e0
+0020
+0020
+0020
+0020
+1f20
+20e0
+4060
+8060
+8020
+8020
+8060
+4060
+31a0
+1f38
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 10 2 0
+ATTRIBUTES 0x0258
+BITMAP
+1f00
+60c0
+c060
+8020
+ffe0
+8000
+8000
+4000
+6060
+1f80
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0fc0
+1840
+1000
+1000
+1000
+ff80
+1000
+1000
+1000
+1000
+1000
+1000
+1000
+1000
+ff80
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 1 -4
+ATTRIBUTES 0x0258
+BITMAP
+1f70
+61c0
+40c0
+8040
+8040
+8040
+c040
+40c0
+31c0
+1e40
+0040
+0040
+0080
+1f00
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e000
+2000
+2000
+2000
+2000
+2f80
+3860
+2020
+2020
+2020
+2020
+2020
+2020
+2020
+f8f8
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 16 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0c00
+0c00
+0c00
+0000
+0000
+0000
+7c00
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 8 20 2 -4
+ATTRIBUTES 0x0258
+BITMAP
+03
+03
+03
+00
+00
+00
+fe
+02
+02
+02
+02
+02
+02
+02
+02
+02
+02
+02
+84
+f8
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e000
+2000
+2000
+2000
+2000
+21f0
+2180
+2300
+2c00
+3c00
+2200
+2180
+20c0
+2060
+e0f8
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+7c00
+4400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 15 10 0 0
+ATTRIBUTES 0x0258
+BITMAP
+eef0
+3188
+2108
+2108
+2108
+2108
+2108
+2108
+2108
+f9ce
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 10 1 0
+ATTRIBUTES 0x0258
+BITMAP
+ef80
+3040
+2020
+2020
+2020
+2020
+2020
+2020
+2020
+f9f8
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 10 1 0
+ATTRIBUTES 0x0258
+BITMAP
+1f80
+6060
+4020
+8010
+8010
+8010
+8010
+4020
+3060
+1f80
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 0 -4
+ATTRIBUTES 0x0258
+BITMAP
+f7c0
+1c30
+1810
+1008
+1008
+1008
+1008
+1810
+1c20
+17c0
+1000
+1000
+1000
+fe00
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 -4
+ATTRIBUTES 0x0258
+BITMAP
+1fb8
+60e0
+4060
+8020
+8020
+8020
+8020
+4060
+30a0
+1f20
+0020
+0020
+0020
+03f8
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 10 2 0
+ATTRIBUTES 0x0258
+BITMAP
+f3e0
+1620
+1800
+1000
+1000
+1000
+1000
+1000
+1000
+ff80
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 10 2 0
+ATTRIBUTES 0x0258
+BITMAP
+3e80
+4180
+4080
+6000
+3f00
+8380
+8040
+c040
+e0c0
+9f00
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 14 3 0
+ATTRIBUTES 0x0258
+BITMAP
+4000
+4000
+4000
+4000
+ff00
+4000
+4000
+4000
+4000
+4000
+4000
+4000
+20c0
+1f00
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 10 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e1c0
+2040
+2040
+2040
+2040
+2040
+2040
+2040
+31c0
+1f70
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 10 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f8f8
+2020
+3040
+1040
+1080
+0880
+0980
+0500
+0700
+0600
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 10 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f03c
+4008
+4108
+2310
+2390
+2290
+1490
+1460
+1460
+0860
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 10 0 0
+ATTRIBUTES 0x0258
+BITMAP
+7c78
+1820
+0c40
+0680
+0300
+0780
+0cc0
+1860
+3030
+f87c
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 -4
+ATTRIBUTES 0x0258
+BITMAP
+f078
+2020
+2020
+1040
+10c0
+0880
+0980
+0500
+0600
+0600
+0400
+0400
+0800
+fe00
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 10 2 0
+ATTRIBUTES 0x0258
+BITMAP
+7fc0
+4080
+4100
+0200
+0400
+0c00
+1800
+3040
+6040
+ffc0
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 5 18 6 -2
+ATTRIBUTES 0x0258
+BITMAP
+18
+20
+40
+40
+40
+60
+20
+20
+60
+c0
+60
+20
+20
+60
+40
+40
+60
+38
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 1 21 7 -5
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 6 18 3 -2
+ATTRIBUTES 0x0258
+BITMAP
+e0
+30
+10
+10
+10
+10
+10
+10
+18
+0c
+10
+10
+10
+10
+10
+10
+10
+e0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 4 2 5
+ATTRIBUTES 0x0258
+BITMAP
+2040
+7cc0
+8780
+8000
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 3 13 6 -3
+ATTRIBUTES 0x0258
+BITMAP
+e0
+e0
+e0
+00
+60
+60
+60
+60
+60
+60
+60
+60
+60
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 16 3 -1
+ATTRIBUTES 0x0258
+BITMAP
+0800
+0800
+0800
+0800
+3e80
+4980
+8880
+8800
+8800
+8800
+4880
+6b00
+1c00
+0800
+0800
+0800
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0f00
+18c0
+3040
+2040
+2000
+2000
+3000
+ffc0
+1000
+1000
+1000
+1000
+2000
+3c20
+63c0
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 11 2 1
+ATTRIBUTES 0x0258
+BITMAP
+8040
+5ec0
+3100
+6080
+4080
+4080
+4080
+2100
+5e80
+8040
+8040
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f8f8
+2060
+1040
+18c0
+0d80
+0700
+0200
+1fe0
+0200
+1fe0
+0200
+0200
+0200
+1fc0
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 1 21 7 -5
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+00
+00
+00
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 16 3 -2
+ATTRIBUTES 0x0258
+BITMAP
+3f00
+6100
+4100
+4100
+3000
+f800
+8c00
+8600
+4100
+3080
+1980
+0f00
+0600
+8200
+8200
+fc00
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 5 3 5 12
+ATTRIBUTES 0x0258
+BITMAP
+d8
+d8
+d8
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 14 0 0
+ATTRIBUTES 0x0258
+BITMAP
+07c0
+1820
+2010
+4788
+4c4c
+9044
+9004
+9004
+9804
+4c44
+4788
+2010
+1820
+07c0
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 6 8 4 6
+ATTRIBUTES 0x0258
+BITMAP
+78
+08
+78
+88
+98
+7c
+00
+fc
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 10 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0440
+1980
+3300
+6600
+cc00
+cc00
+6200
+1100
+0cc0
+0440
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 6 2 4
+ATTRIBUTES 0x0258
+BITMAP
+ffc0
+0040
+0040
+0040
+0040
+0040
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 5 1 5 6
+ATTRIBUTES 0x0258
+BITMAP
+f8
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 14 0 0
+ATTRIBUTES 0x0258
+BITMAP
+07c0
+1820
+2010
+4788
+c444
+84c4
+8704
+8484
+8484
+4f4c
+4008
+2010
+1820
+07c0
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 8 1 3 13
+ATTRIBUTES 0x0258
+BITMAP
+ff
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 7 7 4 8
+ATTRIBUTES 0x0258
+BITMAP
+38
+44
+82
+82
+82
+c4
+78
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 13 2 1
+ATTRIBUTES 0x0258
+BITMAP
+0400
+0400
+0400
+0400
+0400
+ffe0
+0400
+0400
+0400
+0400
+0000
+0000
+ffe0
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 6 9 4 6
+ATTRIBUTES 0x0258
+BITMAP
+78
+cc
+84
+04
+08
+10
+20
+44
+fc
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 6 9 4 6
+ATTRIBUTES 0x0258
+BITMAP
+70
+88
+08
+08
+38
+08
+04
+0c
+78
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 5 3 5 12
+ATTRIBUTES 0x0258
+BITMAP
+30
+60
+c0
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 1 -4
+ATTRIBUTES 0x0258
+BITMAP
+e1c0
+2040
+2040
+2040
+2040
+2040
+2040
+2040
+30c0
+2ff0
+2000
+2000
+2000
+2000
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 16 3 -2
+ATTRIBUTES 0x0258
+BITMAP
+3f80
+4900
+8900
+8900
+8900
+8900
+4900
+3900
+0900
+0900
+0900
+0900
+0900
+0900
+0900
+3b80
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 3 5 6
+ATTRIBUTES 0x0258
+BITMAP
+60
+f0
+70
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 4 4 5 -3
+ATTRIBUTES 0x0258
+BITMAP
+20
+30
+30
+f0
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 6 9 4 6
+ATTRIBUTES 0x0258
+BITMAP
+30
+f0
+10
+10
+10
+10
+10
+10
+fc
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 6 8 4 6
+ATTRIBUTES 0x0258
+BITMAP
+78
+c4
+84
+84
+cc
+38
+00
+fc
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 10 2 0
+ATTRIBUTES 0x0258
+BITMAP
+8800
+6600
+3300
+1980
+0cc0
+0cc0
+1980
+2200
+cc00
+4400
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 17 1 -2
+ATTRIBUTES 0x0258
+BITMAP
+6008
+a018
+2010
+2020
+2040
+2040
+2080
+2100
+f230
+0230
+0450
+0850
+1890
+1110
+21f8
+4010
+4078
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 17 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+3004
+5008
+1010
+1030
+1020
+1040
+10c0
+1080
+7938
+0244
+0604
+0404
+0808
+1018
+1030
+2044
+407c
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 17 1 -2
+ATTRIBUTES 0x0258
+BITMAP
+700c
+8808
+0810
+1820
+3060
+0840
+0880
+0900
+f130
+0230
+0450
+0850
+0890
+1190
+21f8
+4010
+4078
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 8 13 3 -3
+ATTRIBUTES 0x0258
+BITMAP
+1c
+1c
+1c
+00
+08
+18
+60
+40
+80
+80
+81
+41
+3e
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 18 0 0
+ATTRIBUTES 0x0258
+BITMAP
+0200
+0100
+0080
+0000
+3f00
+0300
+0780
+0680
+04c0
+0cc0
+0840
+1860
+1820
+1fe0
+3030
+2010
+6018
+f87c
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 18 0 0
+ATTRIBUTES 0x0258
+BITMAP
+0180
+0300
+0600
+0000
+3f00
+0300
+0780
+0680
+04c0
+0cc0
+0840
+1860
+1820
+1fe0
+3030
+2010
+6018
+f87c
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 18 0 0
+ATTRIBUTES 0x0258
+BITMAP
+0300
+0480
+0840
+0000
+3f00
+0300
+0780
+0680
+04c0
+0cc0
+0840
+1860
+1820
+1fe0
+3030
+2010
+6018
+f87c
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 18 0 0
+ATTRIBUTES 0x0258
+BITMAP
+0e20
+09c0
+0080
+0000
+3f00
+0300
+0780
+0680
+04c0
+0cc0
+0840
+1860
+1820
+1fe0
+3030
+2010
+6018
+f87c
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 18 0 0
+ATTRIBUTES 0x0258
+BITMAP
+06c0
+06c0
+06c0
+0000
+3f00
+0300
+0780
+0680
+04c0
+0cc0
+0840
+1860
+1820
+1fe0
+3030
+2010
+6018
+f87c
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 14 19 0 0
+ATTRIBUTES 0x0258
+BITMAP
+0300
+0480
+0480
+0300
+0000
+3f00
+0300
+0780
+0680
+04c0
+0cc0
+0840
+1860
+1820
+1fe0
+3030
+2010
+6018
+f87c
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 14 0 0
+ATTRIBUTES 0x0258
+BITMAP
+0ff8
+0308
+0308
+0508
+0528
+0d20
+09e0
+0920
+1920
+1f20
+3108
+3108
+6108
+f9f8
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 17 2 -3
+ATTRIBUTES 0x0258
+BITMAP
+1f20
+30e0
+4060
+4060
+8020
+8000
+8000
+8000
+8000
+8000
+c000
+4030
+20e0
+1f80
+0400
+0700
+0f00
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0400
+0200
+0100
+0000
+fff0
+1010
+1010
+1010
+1010
+1080
+1f80
+1080
+1080
+1000
+1010
+1010
+1010
+fff0
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0300
+0600
+0c00
+0000
+fff0
+1010
+1010
+1010
+1010
+1080
+1f80
+1080
+1080
+1000
+1010
+1010
+1010
+fff0
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0600
+0900
+1080
+0000
+fff0
+1010
+1010
+1010
+1010
+1080
+1f80
+1080
+1080
+1000
+1010
+1010
+1010
+fff0
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0d80
+0d80
+0d80
+0000
+fff0
+1010
+1010
+1010
+1010
+1080
+1f80
+1080
+1080
+1000
+1010
+1010
+1010
+fff0
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 18 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0800
+0400
+0200
+0000
+ffc0
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 18 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0600
+0c00
+1800
+0000
+ffc0
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 18 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0c00
+1200
+2100
+0000
+ffc0
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 18 2 0
+ATTRIBUTES 0x0258
+BITMAP
+1b00
+1b00
+1b00
+0000
+ffc0
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+ff00
+20c0
+2060
+2020
+2010
+2010
+fe10
+2010
+2010
+2010
+2020
+2060
+20c0
+ff80
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+1c40
+1380
+0100
+0000
+f0f8
+3810
+2810
+2810
+2410
+2410
+2210
+2210
+2110
+2110
+2090
+2090
+2050
+f870
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0400
+0200
+0100
+0000
+0f80
+30c0
+6060
+4020
+c010
+8010
+8010
+8010
+8010
+8010
+4020
+6020
+30c0
+0f80
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0300
+0600
+0c00
+0000
+0f80
+30c0
+6060
+4020
+c010
+8010
+8010
+8010
+8010
+8010
+4020
+6020
+30c0
+0f80
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0600
+0900
+1080
+0000
+0f80
+30c0
+6060
+4020
+c010
+8010
+8010
+8010
+8010
+8010
+4020
+6020
+30c0
+0f80
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+1c40
+1380
+0100
+0000
+0f80
+30c0
+6060
+4020
+c010
+8010
+8010
+8010
+8010
+8010
+4020
+6020
+30c0
+0f80
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0d80
+0d80
+0d80
+0000
+0f80
+30c0
+6060
+4020
+c010
+8010
+8010
+8010
+8010
+8010
+4020
+6020
+30c0
+0f80
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 9 9 3 3
+ATTRIBUTES 0x0258
+BITMAP
+4080
+c180
+6380
+3600
+1c00
+1c00
+3200
+4300
+8180
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 14 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0fa0
+30e0
+6060
+4070
+c090
+8110
+8310
+8210
+8410
+c810
+5820
+7020
+70c0
+5f80
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0400
+0200
+0100
+0000
+f9f8
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+6020
+6020
+3040
+1f80
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0300
+0600
+0c00
+0000
+f9f8
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+6020
+6020
+3040
+1f80
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0600
+0900
+1080
+0000
+f9f8
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+6020
+6020
+3040
+1f80
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0d80
+0d80
+0d80
+0000
+f9f8
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+4020
+6020
+6020
+3040
+1f80
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 18 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0300
+0600
+0c00
+0000
+f8f8
+2020
+3060
+1040
+0880
+0c80
+0500
+0700
+0200
+0200
+0200
+0200
+0200
+1fc0
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 14 2 0
+ATTRIBUTES 0x0258
+BITMAP
+fc00
+2000
+2000
+3f80
+20c0
+2060
+2020
+2020
+2060
+20c0
+3f80
+2000
+2000
+fc00
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+1e00
+3100
+6080
+4080
+4080
+4300
+4e00
+4180
+4080
+4040
+4040
+4040
+4040
+4880
+cf00
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0800
+0400
+0200
+0000
+0000
+3f00
+0180
+0080
+3f80
+4180
+8080
+8080
+8180
+c380
+7ce0
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0600
+0c00
+1800
+0000
+0000
+3f00
+0180
+0080
+3f80
+4180
+8080
+8080
+8180
+c380
+7ce0
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0c00
+1600
+2100
+0000
+0000
+3f00
+0180
+0080
+3f80
+4180
+8080
+8080
+8180
+c380
+7ce0
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+3880
+2700
+0200
+0000
+0000
+3f00
+0180
+0080
+3f80
+4180
+8080
+8080
+8180
+c380
+7ce0
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+1b00
+1b00
+1b00
+0000
+0000
+3f00
+0180
+0080
+3f80
+4180
+8080
+8080
+8180
+c380
+7ce0
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0e00
+1200
+0e00
+0000
+0000
+3f00
+0180
+0080
+3f80
+4180
+8080
+8080
+8180
+c380
+7ce0
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 10 1 0
+ATTRIBUTES 0x0258
+BITMAP
+7fe0
+0230
+0210
+0210
+3ff0
+4200
+8200
+8200
+8700
+78f0
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 13 2 -3
+ATTRIBUTES 0x0258
+BITMAP
+1f60
+60c0
+4040
+8000
+8000
+8000
+8000
+4020
+60c0
+1f00
+0400
+0600
+0e00
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0800
+0400
+0200
+0000
+0000
+1f00
+60c0
+c060
+8020
+ffe0
+8000
+8000
+4000
+6060
+1f80
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0600
+0c00
+1800
+0000
+0000
+1f00
+60c0
+c060
+8020
+ffe0
+8000
+8000
+4000
+6060
+1f80
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0c00
+1600
+2100
+0000
+0000
+1f00
+60c0
+c060
+8020
+ffe0
+8000
+8000
+4000
+6060
+1f80
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+1b00
+1b00
+1b00
+0000
+0000
+1f00
+60c0
+c060
+8020
+ffe0
+8000
+8000
+4000
+6060
+1f80
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0800
+0400
+0200
+0000
+0000
+7c00
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0600
+0c00
+1800
+0000
+0000
+7c00
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+0c00
+1600
+2100
+0000
+0000
+7c00
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 10 15 2 0
+ATTRIBUTES 0x0258
+BITMAP
+1b00
+1b00
+1b00
+0000
+0000
+7c00
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+0400
+ffc0
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 17 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0200
+3c00
+0e00
+0b00
+1980
+00c0
+0060
+1fe0
+6070
+4030
+8010
+8010
+8010
+8010
+4020
+3060
+1f80
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+1c40
+1380
+0100
+0000
+0000
+ef80
+3040
+2020
+2020
+2020
+2020
+2020
+2020
+2020
+f9f8
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0400
+0200
+0100
+0000
+0000
+1f80
+6060
+4020
+8010
+8010
+8010
+8010
+4020
+3060
+1f80
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0300
+0600
+0c00
+0000
+0000
+1f80
+6060
+4020
+8010
+8010
+8010
+8010
+4020
+3060
+1f80
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0600
+0b00
+1080
+0000
+0000
+1f80
+6060
+4020
+8010
+8010
+8010
+8010
+4020
+3060
+1f80
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+1c40
+1380
+0100
+0000
+0000
+1f80
+6060
+4020
+8010
+8010
+8010
+8010
+4020
+3060
+1f80
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0d80
+0d80
+0d80
+0000
+0000
+1f80
+6060
+4020
+8010
+8010
+8010
+8010
+4020
+3060
+1f80
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 11 11 2 2
+ATTRIBUTES 0x0258
+BITMAP
+0c00
+0c00
+0000
+0000
+0000
+ffe0
+0000
+0000
+0000
+0c00
+0c00
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 10 1 0
+ATTRIBUTES 0x0258
+BITMAP
+1fa0
+6060
+40b0
+8110
+8210
+8c10
+d810
+7020
+7060
+df80
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0400
+0200
+0100
+0000
+0000
+e1c0
+2040
+2040
+2040
+2040
+2040
+2040
+2040
+31c0
+1f70
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0300
+0600
+0c00
+0000
+0000
+e1c0
+2040
+2040
+2040
+2040
+2040
+2040
+2040
+31c0
+1f70
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0600
+0b00
+1080
+0000
+0000
+e1c0
+2040
+2040
+2040
+2040
+2040
+2040
+2040
+31c0
+1f70
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 12 15 1 0
+ATTRIBUTES 0x0258
+BITMAP
+0d80
+0d80
+0d80
+0000
+0000
+e1c0
+2040
+2040
+2040
+2040
+2040
+2040
+2040
+31c0
+1f70
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 19 1 -4
+ATTRIBUTES 0x0258
+BITMAP
+0300
+0600
+0c00
+0000
+0000
+f078
+2020
+2020
+1040
+10c0
+0880
+0980
+0500
+0600
+0600
+0400
+0400
+0800
+fe00
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 19 0 -4
+ATTRIBUTES 0x0258
+BITMAP
+f000
+1000
+1000
+1000
+1000
+17c0
+1c30
+1810
+1008
+1008
+1008
+1008
+1810
+1c20
+17c0
+1000
+1000
+1000
+fe00
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 584 0
+DWIDTH 14 0
+BBX 13 19 1 -4
+ATTRIBUTES 0x0258
+BITMAP
+0d80
+0d80
+0d80
+0000
+0000
+f078
+2020
+2020
+1040
+10c0
+0880
+0980
+0500
+0600
+0600
+0400
+0400
+0800
+fe00
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier24.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier24.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier24.h	(revision 15879)
@@ -0,0 +1,1068 @@
+static unsigned char courier24_0_bits[] = {
+0x00};
+static unsigned char courier24_1_bits[] = {
+0x00};
+static unsigned char courier24_2_bits[] = {
+0x00};
+static unsigned char courier24_3_bits[] = {
+0x00};
+static unsigned char courier24_4_bits[] = {
+0x00};
+static unsigned char courier24_5_bits[] = {
+0x00};
+static unsigned char courier24_6_bits[] = {
+0x00};
+static unsigned char courier24_7_bits[] = {
+0x00};
+static unsigned char courier24_8_bits[] = {
+0x00};
+static unsigned char courier24_9_bits[] = {
+0x00};
+static unsigned char courier24_10_bits[] = {
+0x00};
+static unsigned char courier24_11_bits[] = {
+0x00};
+static unsigned char courier24_12_bits[] = {
+0x00};
+static unsigned char courier24_13_bits[] = {
+0x00};
+static unsigned char courier24_14_bits[] = {
+0x00};
+static unsigned char courier24_15_bits[] = {
+0x00};
+static unsigned char courier24_16_bits[] = {
+0x00};
+static unsigned char courier24_17_bits[] = {
+0x00};
+static unsigned char courier24_18_bits[] = {
+0x00};
+static unsigned char courier24_19_bits[] = {
+0x00};
+static unsigned char courier24_20_bits[] = {
+0x00};
+static unsigned char courier24_21_bits[] = {
+0x00};
+static unsigned char courier24_22_bits[] = {
+0x00};
+static unsigned char courier24_23_bits[] = {
+0x00};
+static unsigned char courier24_24_bits[] = {
+0x00};
+static unsigned char courier24_25_bits[] = {
+0x00};
+static unsigned char courier24_26_bits[] = {
+0x00};
+static unsigned char courier24_27_bits[] = {
+0x00};
+static unsigned char courier24_28_bits[] = {
+0x00};
+static unsigned char courier24_29_bits[] = {
+0x00};
+static unsigned char courier24_30_bits[] = {
+0x00};
+static unsigned char courier24_31_bits[] = {
+0x00};
+static unsigned char courier24_32_bits[] = {
+0x00, 0x00};
+static unsigned char courier24_33_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x07, 
+0x07, 0x07};
+static unsigned char courier24_34_bits[] = {
+0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33};
+static unsigned char courier24_35_bits[] = {
+0x88, 0x01, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 
+0xff, 0x07, 0x84, 0x00, 0x84, 0x00, 0x84, 0x00, 0x84, 0x00, 0xff, 0x07, 
+0x84, 0x00, 0x84, 0x00, 0x84, 0x00, 0x84, 0x00, 0x84, 0x00};
+static unsigned char courier24_36_bits[] = {
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xf8, 0x01, 0xa4, 0x01, 0x22, 0x01, 
+0x22, 0x01, 0x26, 0x03, 0x3c, 0x00, 0xf0, 0x00, 0xa0, 0x01, 0x23, 0x02, 
+0x22, 0x02, 0x26, 0x02, 0x2e, 0x01, 0xfe, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00};
+static unsigned char courier24_37_bits[] = {
+0x1c, 0x00, 0x22, 0x00, 0x41, 0x00, 0x41, 0x00, 0x41, 0x00, 0x22, 0x06, 
+0x9c, 0x07, 0xf0, 0x01, 0x3e, 0x00, 0x8e, 0x03, 0x40, 0x04, 0x20, 0x08, 
+0x20, 0x08, 0x60, 0x0c, 0x80, 0x07};
+static unsigned char courier24_38_bits[] = {
+0xbc, 0x00, 0x46, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x0c, 0x00, 
+0x8a, 0x03, 0x93, 0x00, 0xb1, 0x00, 0x61, 0x00, 0x61, 0x00, 0xe3, 0x00, 
+0x9e, 0x03};
+static unsigned char courier24_39_bits[] = {
+0x0c, 0x0e, 0x06, 0x06, 0x03, 0x03};
+static unsigned char courier24_40_bits[] = {
+0x08, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x03, 0x02, 0x02, 0x04, 0x04, 0x08};
+static unsigned char courier24_41_bits[] = {
+0x02, 0x02, 0x06, 0x04, 0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x04, 0x04, 0x06, 0x02, 0x03};
+static unsigned char courier24_42_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x11, 0x01, 0xff, 0x01, 0x7c, 0x00, 0x38, 0x00, 
+0x6c, 0x00, 0xc6, 0x00, 0x44, 0x00};
+static unsigned char courier24_43_bits[] = {
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xff, 0x07, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00};
+static unsigned char courier24_44_bits[] = {
+0x0c, 0x06, 0x06, 0x06, 0x03, 0x03};
+static unsigned char courier24_45_bits[] = {
+0xff, 0x07};
+static unsigned char courier24_46_bits[] = {
+0x06, 0x0f, 0x0e};
+static unsigned char courier24_47_bits[] = {
+0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x80, 0x01, 0x80, 0x00, 0xc0, 0x00, 
+0x40, 0x00, 0x40, 0x00, 0x20, 0x00, 0x20, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x08, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 
+0x03, 0x00, 0x01, 0x00};
+static unsigned char courier24_48_bits[] = {
+0x3c, 0x00, 0x46, 0x00, 0x82, 0x00, 0x81, 0x00, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x81, 0x00, 
+0x82, 0x00, 0x46, 0x00, 0x3c, 0x00};
+static unsigned char courier24_49_bits[] = {
+0x30, 0x00, 0x3c, 0x00, 0x26, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0xfe, 0x03};
+static unsigned char courier24_50_bits[] = {
+0x78, 0x00, 0xc4, 0x00, 0x82, 0x01, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 
+0x80, 0x01, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x01, 
+0x06, 0x01, 0x01, 0x01, 0xff, 0x01};
+static unsigned char courier24_51_bits[] = {
+0x3c, 0x00, 0x46, 0x00, 0x82, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 
+0x60, 0x00, 0xf0, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 
+0x00, 0x01, 0xc1, 0x00, 0x7e, 0x00};
+static unsigned char courier24_52_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x50, 0x00, 0x50, 0x00, 0x48, 0x00, 0x48, 0x00, 
+0x44, 0x00, 0x42, 0x00, 0x42, 0x00, 0x41, 0x00, 0xff, 0x03, 0x40, 0x00, 
+0x40, 0x00, 0x40, 0x00, 0xf8, 0x03};
+static unsigned char courier24_53_bits[] = {
+0xfe, 0x01, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 
+0x7a, 0x00, 0x86, 0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 
+0x00, 0x01, 0x83, 0x01, 0x7e, 0x00};
+static unsigned char courier24_54_bits[] = {
+0xf0, 0x01, 0x1c, 0x00, 0x06, 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 
+0x3d, 0x00, 0x47, 0x00, 0xc3, 0x00, 0x81, 0x00, 0x81, 0x00, 0x81, 0x00, 
+0x82, 0x00, 0x46, 0x00, 0x3c, 0x00};
+static unsigned char courier24_55_bits[] = {
+0xff, 0x03, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x80, 0x00, 
+0x80, 0x00, 0xc0, 0x00, 0x40, 0x00, 0x40, 0x00, 0x60, 0x00, 0x20, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x10, 0x00};
+static unsigned char courier24_56_bits[] = {
+0x3c, 0x00, 0x46, 0x00, 0x83, 0x00, 0x81, 0x00, 0x81, 0x00, 0x81, 0x00, 
+0x46, 0x00, 0x3c, 0x00, 0xc2, 0x00, 0x83, 0x00, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0xc2, 0x00, 0x7c, 0x00};
+static unsigned char courier24_57_bits[] = {
+0x3c, 0x00, 0x46, 0x00, 0x82, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x83, 0x01, 0xc6, 0x01, 0x3c, 0x01, 0x00, 0x01, 0x80, 0x00, 0x80, 0x00, 
+0x40, 0x00, 0x20, 0x00, 0x1f, 0x00};
+static unsigned char courier24_58_bits[] = {
+0x06, 0x0f, 0x0e, 0x00, 0x00, 0x00, 0x06, 0x0f, 0x0e};
+static unsigned char courier24_59_bits[] = {
+0x0c, 0x1e, 0x1c, 0x00, 0x00, 0x00, 0x0c, 0x0e, 0x06, 0x06, 0x02, 0x03};
+static unsigned char courier24_60_bits[] = {
+0x00, 0x08, 0x00, 0x0e, 0x80, 0x01, 0x60, 0x00, 0x1c, 0x00, 0x07, 0x00, 
+0x1c, 0x00, 0xf0, 0x00, 0xc0, 0x07, 0x00, 0x0e, 0x00, 0x08};
+static unsigned char courier24_61_bits[] = {
+0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07};
+static unsigned char courier24_62_bits[] = {
+0x01, 0x00, 0x07, 0x00, 0x1c, 0x00, 0x60, 0x00, 0x80, 0x03, 0x00, 0x0e, 
+0xc0, 0x03, 0xf8, 0x00, 0x3f, 0x00, 0x0f, 0x00, 0x03, 0x00};
+static unsigned char courier24_63_bits[] = {
+0x3e, 0x43, 0x81, 0x81, 0x80, 0x80, 0x40, 0x38, 0x08, 0x08, 0x00, 0x1c, 
+0x1c, 0x1c};
+static unsigned char courier24_64_bits[] = {
+0xf0, 0x01, 0x0c, 0x06, 0x06, 0x08, 0x62, 0x19, 0xb1, 0x11, 0x91, 0x11, 
+0x89, 0x11, 0x89, 0x18, 0xc9, 0x08, 0x7b, 0x07, 0x22, 0x00, 0x0c, 0x0e, 
+0xf8, 0x03};
+static unsigned char courier24_65_bits[] = {
+0xfc, 0x00, 0xc0, 0x00, 0xe0, 0x01, 0x60, 0x01, 0x20, 0x03, 0x30, 0x03, 
+0x10, 0x02, 0x18, 0x06, 0x18, 0x04, 0xf8, 0x07, 0x0c, 0x0c, 0x04, 0x08, 
+0x06, 0x18, 0x1f, 0x3e};
+static unsigned char courier24_66_bits[] = {
+0xff, 0x01, 0x04, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 
+0xfc, 0x01, 0x04, 0x06, 0x04, 0x0c, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, 
+0x04, 0x06, 0xff, 0x03};
+static unsigned char courier24_67_bits[] = {
+0xf0, 0x04, 0x0c, 0x07, 0x06, 0x06, 0x02, 0x06, 0x01, 0x04, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x0c, 
+0x0c, 0x06, 0xf8, 0x01};
+static unsigned char courier24_68_bits[] = {
+0xff, 0x00, 0x04, 0x03, 0x04, 0x06, 0x04, 0x04, 0x04, 0x08, 0x04, 0x08, 
+0x04, 0x08, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, 0x04, 0x0c, 0x04, 0x04, 
+0x04, 0x03, 0xff, 0x01};
+static unsigned char courier24_69_bits[] = {
+0xff, 0x0f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x01, 
+0xf8, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0xff, 0x0f};
+static unsigned char courier24_70_bits[] = {
+0xff, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x84, 0x00, 
+0xfc, 0x00, 0x84, 0x00, 0x84, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 
+0x04, 0x00, 0x3f, 0x00};
+static unsigned char courier24_71_bits[] = {
+0xf0, 0x05, 0x0c, 0x07, 0x04, 0x06, 0x02, 0x04, 0x03, 0x04, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x81, 0x1f, 0x01, 0x08, 0x02, 0x08, 0x06, 0x08, 
+0x0c, 0x0c, 0xf0, 0x03};
+static unsigned char courier24_72_bits[] = {
+0x1f, 0x0f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0xfc, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0x1f, 0x0f};
+static unsigned char courier24_73_bits[] = {
+0xff, 0x03, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_74_bits[] = {
+0xf0, 0x1f, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 
+0x00, 0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 
+0x06, 0x01, 0xf8, 0x01};
+static unsigned char courier24_75_bits[] = {
+0x3f, 0x1f, 0x08, 0x04, 0x08, 0x02, 0x08, 0x01, 0x88, 0x00, 0x48, 0x00, 
+0x28, 0x00, 0x78, 0x00, 0x88, 0x01, 0x08, 0x01, 0x08, 0x02, 0x08, 0x06, 
+0x08, 0x04, 0x3f, 0x1c};
+static unsigned char courier24_76_bits[] = {
+0x7f, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 
+0x08, 0x00, 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0xff, 0x0f};
+static unsigned char courier24_77_bits[] = {
+0x0f, 0x3c, 0x14, 0x14, 0x14, 0x14, 0x14, 0x12, 0x24, 0x12, 0x24, 0x12, 
+0x24, 0x11, 0x44, 0x11, 0x44, 0x11, 0xc4, 0x10, 0x04, 0x10, 0x04, 0x10, 
+0x04, 0x10, 0x1f, 0x3e};
+static unsigned char courier24_78_bits[] = {
+0x0f, 0x1f, 0x1c, 0x08, 0x14, 0x08, 0x14, 0x08, 0x24, 0x08, 0x24, 0x08, 
+0x44, 0x08, 0x44, 0x08, 0x84, 0x08, 0x84, 0x08, 0x04, 0x09, 0x04, 0x09, 
+0x04, 0x0a, 0x1f, 0x0e};
+static unsigned char courier24_79_bits[] = {
+0xf0, 0x01, 0x0c, 0x03, 0x06, 0x06, 0x02, 0x04, 0x03, 0x08, 0x01, 0x08, 
+0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x02, 0x04, 0x06, 0x04, 
+0x0c, 0x03, 0xf0, 0x01};
+static unsigned char courier24_80_bits[] = {
+0xff, 0x00, 0x84, 0x03, 0x04, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x06, 0x84, 0x03, 0xfc, 0x01, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 
+0x04, 0x00, 0x3f, 0x00};
+static unsigned char courier24_81_bits[] = {
+0xf0, 0x00, 0x0c, 0x03, 0x06, 0x06, 0x02, 0x04, 0x03, 0x08, 0x01, 0x08, 
+0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x02, 0x04, 0x06, 0x04, 
+0x0c, 0x03, 0xf8, 0x01, 0x30, 0x00, 0xf8, 0x08, 0x08, 0x07};
+static unsigned char courier24_82_bits[] = {
+0xff, 0x01, 0x04, 0x03, 0x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x03, 0xfc, 0x01, 0xc4, 0x00, 0x84, 0x00, 0x04, 0x01, 0x04, 0x02, 
+0x04, 0x02, 0x1f, 0x1c};
+static unsigned char courier24_83_bits[] = {
+0x3c, 0x01, 0xc2, 0x01, 0x81, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 
+0x06, 0x00, 0xfc, 0x00, 0x80, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x83, 0x00, 0x7d, 0x00};
+static unsigned char courier24_84_bits[] = {
+0xfe, 0x0f, 0x42, 0x08, 0x42, 0x08, 0x42, 0x08, 0x42, 0x08, 0x43, 0x18, 
+0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 
+0x40, 0x00, 0xf8, 0x03};
+static unsigned char courier24_85_bits[] = {
+0x9f, 0x1f, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 
+0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x06, 0x04, 0x06, 0x04, 
+0x0c, 0x02, 0xf8, 0x01};
+static unsigned char courier24_86_bits[] = {
+0x1f, 0x3e, 0x04, 0x08, 0x04, 0x08, 0x08, 0x08, 0x08, 0x04, 0x08, 0x04, 
+0x10, 0x04, 0x10, 0x02, 0x30, 0x02, 0x20, 0x03, 0x20, 0x01, 0x40, 0x01, 
+0xc0, 0x01, 0xc0, 0x00};
+static unsigned char courier24_87_bits[] = {
+0x1f, 0x7c, 0x06, 0x20, 0x06, 0x20, 0x86, 0x10, 0xc4, 0x10, 0xc4, 0x11, 
+0x44, 0x11, 0x24, 0x11, 0x24, 0x13, 0x2c, 0x1a, 0x1c, 0x0a, 0x1c, 0x0c, 
+0x18, 0x0c, 0x08, 0x0c};
+static unsigned char courier24_88_bits[] = {
+0x1f, 0x0f, 0x04, 0x02, 0x0c, 0x02, 0x18, 0x01, 0x90, 0x00, 0xa0, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0xb0, 0x00, 0x10, 0x01, 0x08, 0x03, 0x0c, 0x06, 
+0x04, 0x04, 0x1f, 0x1f};
+static unsigned char courier24_89_bits[] = {
+0x1f, 0x1f, 0x04, 0x04, 0x0c, 0x06, 0x08, 0x02, 0x10, 0x01, 0x30, 0x01, 
+0xa0, 0x00, 0xe0, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 
+0x40, 0x00, 0xf8, 0x03};
+static unsigned char courier24_90_bits[] = {
+0xff, 0x01, 0x01, 0x01, 0x81, 0x00, 0x81, 0x00, 0x41, 0x00, 0x20, 0x00, 
+0x30, 0x00, 0x10, 0x00, 0x08, 0x00, 0x0c, 0x02, 0x04, 0x02, 0x02, 0x02, 
+0x03, 0x02, 0xff, 0x03};
+static unsigned char courier24_91_bits[] = {
+0x0f, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x0f};
+static unsigned char courier24_92_bits[] = {
+0x01, 0x00, 0x03, 0x00, 0x02, 0x00, 0x06, 0x00, 0x04, 0x00, 0x0c, 0x00, 
+0x08, 0x00, 0x08, 0x00, 0x10, 0x00, 0x10, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x40, 0x00, 0x40, 0x00, 0xc0, 0x00, 0x80, 0x00, 0x80, 0x01, 0x00, 0x01, 
+0x00, 0x03, 0x00, 0x02};
+static unsigned char courier24_93_bits[] = {
+0x0f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x08, 0x0f};
+static unsigned char courier24_94_bits[] = {
+0x70, 0x00, 0x50, 0x00, 0x58, 0x00, 0x98, 0x00, 0x88, 0x00, 0x8c, 0x01, 
+0x04, 0x01, 0x06, 0x03, 0x06, 0x03, 0x03, 0x02, 0x03, 0x06};
+static unsigned char courier24_95_bits[] = {
+0xff, 0xff, 0x01};
+static unsigned char courier24_96_bits[] = {
+0x0c, 0x0c, 0x06, 0x06, 0x07, 0x03};
+static unsigned char courier24_97_bits[] = {
+0xfc, 0x00, 0x80, 0x01, 0x00, 0x01, 0xfc, 0x01, 0x82, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x81, 0x01, 0xc3, 0x01, 0x3e, 0x07};
+static unsigned char courier24_98_bits[] = {
+0x07, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0xe4, 0x03, 
+0x34, 0x0c, 0x0c, 0x08, 0x0c, 0x10, 0x0c, 0x10, 0x0c, 0x10, 0x0c, 0x10, 
+0x1c, 0x08, 0x3c, 0x0c, 0xe7, 0x03};
+static unsigned char courier24_99_bits[] = {
+0xf8, 0x07, 0x06, 0x03, 0x02, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x02, 0x04, 0x06, 0x03, 0xf8, 0x00};
+static unsigned char courier24_100_bits[] = {
+0x00, 0x07, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0xf8, 0x04, 
+0x04, 0x07, 0x02, 0x06, 0x01, 0x06, 0x01, 0x04, 0x01, 0x04, 0x01, 0x06, 
+0x02, 0x06, 0x8c, 0x05, 0xf8, 0x1c};
+static unsigned char courier24_101_bits[] = {
+0xf8, 0x00, 0x06, 0x03, 0x03, 0x06, 0x01, 0x04, 0xff, 0x07, 0x01, 0x00, 
+0x01, 0x00, 0x02, 0x00, 0x06, 0x06, 0xf8, 0x01};
+static unsigned char courier24_102_bits[] = {
+0xf0, 0x03, 0x18, 0x02, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0xff, 0x01, 
+0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 
+0x08, 0x00, 0x08, 0x00, 0xff, 0x01};
+static unsigned char courier24_103_bits[] = {
+0xf8, 0x0e, 0x86, 0x03, 0x02, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 
+0x03, 0x02, 0x02, 0x03, 0x8c, 0x03, 0x78, 0x02, 0x00, 0x02, 0x00, 0x02, 
+0x00, 0x01, 0xf8, 0x00};
+static unsigned char courier24_104_bits[] = {
+0x07, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0xf4, 0x01, 
+0x1c, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0x04, 0x04, 0x1f, 0x1f};
+static unsigned char courier24_105_bits[] = {
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x3e, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_106_bits[] = {
+0xc0, 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x7f, 0x40, 0x40, 0x40, 0x40, 0x40, 
+0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x21, 0x1f};
+static unsigned char courier24_107_bits[] = {
+0x07, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x84, 0x0f, 
+0x84, 0x01, 0xc4, 0x00, 0x34, 0x00, 0x3c, 0x00, 0x44, 0x00, 0x84, 0x01, 
+0x04, 0x03, 0x04, 0x06, 0x07, 0x1f};
+static unsigned char courier24_108_bits[] = {
+0x3e, 0x00, 0x22, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_109_bits[] = {
+0x77, 0x0f, 0x8c, 0x11, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 
+0x84, 0x10, 0x84, 0x10, 0x84, 0x10, 0x9f, 0x73};
+static unsigned char courier24_110_bits[] = {
+0xf7, 0x01, 0x0c, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x9f, 0x1f};
+static unsigned char courier24_111_bits[] = {
+0xf8, 0x01, 0x06, 0x06, 0x02, 0x04, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x01, 0x08, 0x02, 0x04, 0x0c, 0x06, 0xf8, 0x01};
+static unsigned char courier24_112_bits[] = {
+0xef, 0x03, 0x38, 0x0c, 0x18, 0x08, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 
+0x08, 0x10, 0x18, 0x08, 0x38, 0x04, 0xe8, 0x03, 0x08, 0x00, 0x08, 0x00, 
+0x08, 0x00, 0x7f, 0x00};
+static unsigned char courier24_113_bits[] = {
+0xf8, 0x1d, 0x06, 0x07, 0x02, 0x06, 0x01, 0x04, 0x01, 0x04, 0x01, 0x04, 
+0x01, 0x04, 0x02, 0x06, 0x0c, 0x05, 0xf8, 0x04, 0x00, 0x04, 0x00, 0x04, 
+0x00, 0x04, 0xc0, 0x1f};
+static unsigned char courier24_114_bits[] = {
+0xcf, 0x07, 0x68, 0x04, 0x18, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 
+0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0xff, 0x01};
+static unsigned char courier24_115_bits[] = {
+0x7c, 0x01, 0x82, 0x01, 0x02, 0x01, 0x06, 0x00, 0xfc, 0x00, 0xc1, 0x01, 
+0x01, 0x02, 0x03, 0x02, 0x07, 0x03, 0xf9, 0x00};
+static unsigned char courier24_116_bits[] = {
+0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0xff, 0x00, 0x02, 0x00, 
+0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 
+0x04, 0x03, 0xf8, 0x00};
+static unsigned char courier24_117_bits[] = {
+0x87, 0x03, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 
+0x04, 0x02, 0x04, 0x02, 0x8c, 0x03, 0xf8, 0x0e};
+static unsigned char courier24_118_bits[] = {
+0x1f, 0x1f, 0x04, 0x04, 0x0c, 0x02, 0x08, 0x02, 0x08, 0x01, 0x10, 0x01, 
+0x90, 0x01, 0xa0, 0x00, 0xe0, 0x00, 0x60, 0x00};
+static unsigned char courier24_119_bits[] = {
+0x0f, 0x3c, 0x02, 0x10, 0x82, 0x10, 0xc4, 0x08, 0xc4, 0x09, 0x44, 0x09, 
+0x28, 0x09, 0x28, 0x06, 0x28, 0x06, 0x10, 0x06};
+static unsigned char courier24_120_bits[] = {
+0x3e, 0x1e, 0x18, 0x04, 0x30, 0x02, 0x60, 0x01, 0xc0, 0x00, 0xe0, 0x01, 
+0x30, 0x03, 0x18, 0x06, 0x0c, 0x0c, 0x1f, 0x3e};
+static unsigned char courier24_121_bits[] = {
+0x0f, 0x1e, 0x04, 0x04, 0x04, 0x04, 0x08, 0x02, 0x08, 0x03, 0x10, 0x01, 
+0x90, 0x01, 0xa0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x10, 0x00, 0x7f, 0x00};
+static unsigned char courier24_122_bits[] = {
+0xfe, 0x03, 0x02, 0x01, 0x82, 0x00, 0x40, 0x00, 0x20, 0x00, 0x30, 0x00, 
+0x18, 0x00, 0x0c, 0x02, 0x06, 0x02, 0xff, 0x03};
+static unsigned char courier24_123_bits[] = {
+0x18, 0x04, 0x02, 0x02, 0x02, 0x06, 0x04, 0x04, 0x06, 0x03, 0x06, 0x04, 
+0x04, 0x06, 0x02, 0x02, 0x06, 0x1c};
+static unsigned char courier24_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char courier24_125_bits[] = {
+0x07, 0x0c, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x18, 0x30, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x08, 0x07};
+static unsigned char courier24_126_bits[] = {
+0x04, 0x02, 0x3e, 0x03, 0xe1, 0x01, 0x01, 0x00};
+static unsigned char courier24_127_bits[] = {
+0x00};
+static unsigned char courier24_128_bits[] = {
+0x00};
+static unsigned char courier24_129_bits[] = {
+0x00};
+static unsigned char courier24_130_bits[] = {
+0x00};
+static unsigned char courier24_131_bits[] = {
+0x00};
+static unsigned char courier24_132_bits[] = {
+0x00};
+static unsigned char courier24_133_bits[] = {
+0x00};
+static unsigned char courier24_134_bits[] = {
+0x00};
+static unsigned char courier24_135_bits[] = {
+0x00};
+static unsigned char courier24_136_bits[] = {
+0x00};
+static unsigned char courier24_137_bits[] = {
+0x00};
+static unsigned char courier24_138_bits[] = {
+0x00};
+static unsigned char courier24_139_bits[] = {
+0x00};
+static unsigned char courier24_140_bits[] = {
+0x00};
+static unsigned char courier24_141_bits[] = {
+0x00};
+static unsigned char courier24_142_bits[] = {
+0x00};
+static unsigned char courier24_143_bits[] = {
+0x00};
+static unsigned char courier24_144_bits[] = {
+0x00};
+static unsigned char courier24_145_bits[] = {
+0x00};
+static unsigned char courier24_146_bits[] = {
+0x00};
+static unsigned char courier24_147_bits[] = {
+0x00};
+static unsigned char courier24_148_bits[] = {
+0x00};
+static unsigned char courier24_149_bits[] = {
+0x00};
+static unsigned char courier24_150_bits[] = {
+0x00};
+static unsigned char courier24_151_bits[] = {
+0x00};
+static unsigned char courier24_152_bits[] = {
+0x00};
+static unsigned char courier24_153_bits[] = {
+0x00};
+static unsigned char courier24_154_bits[] = {
+0x00};
+static unsigned char courier24_155_bits[] = {
+0x00};
+static unsigned char courier24_156_bits[] = {
+0x00};
+static unsigned char courier24_157_bits[] = {
+0x00};
+static unsigned char courier24_158_bits[] = {
+0x00};
+static unsigned char courier24_159_bits[] = {
+0x00};
+static unsigned char courier24_160_bits[] = {
+0x00};
+static unsigned char courier24_161_bits[] = {
+0x07, 0x07, 0x07, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06};
+static unsigned char courier24_162_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x7c, 0x01, 0x92, 0x01, 
+0x11, 0x01, 0x11, 0x00, 0x11, 0x00, 0x11, 0x00, 0x12, 0x01, 0xd6, 0x00, 
+0x38, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char courier24_163_bits[] = {
+0xf0, 0x00, 0x18, 0x03, 0x0c, 0x02, 0x04, 0x02, 0x04, 0x00, 0x04, 0x00, 
+0x0c, 0x00, 0xff, 0x03, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 
+0x04, 0x00, 0x3c, 0x04, 0xc6, 0x03};
+static unsigned char courier24_164_bits[] = {
+0x01, 0x02, 0x7a, 0x03, 0x8c, 0x00, 0x06, 0x01, 0x02, 0x01, 0x02, 0x01, 
+0x02, 0x01, 0x84, 0x00, 0x7a, 0x01, 0x01, 0x02, 0x01, 0x02};
+static unsigned char courier24_165_bits[] = {
+0x1f, 0x1f, 0x04, 0x06, 0x08, 0x02, 0x18, 0x03, 0xb0, 0x01, 0xe0, 0x00, 
+0x40, 0x00, 0xf8, 0x07, 0x40, 0x00, 0xf8, 0x07, 0x40, 0x00, 0x40, 0x00, 
+0x40, 0x00, 0xf8, 0x03};
+static unsigned char courier24_166_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char courier24_167_bits[] = {
+0xfc, 0x00, 0x86, 0x00, 0x82, 0x00, 0x82, 0x00, 0x0c, 0x00, 0x1f, 0x00, 
+0x31, 0x00, 0x61, 0x00, 0x82, 0x00, 0x0c, 0x01, 0x98, 0x01, 0xf0, 0x00, 
+0x60, 0x00, 0x41, 0x00, 0x41, 0x00, 0x3f, 0x00};
+static unsigned char courier24_168_bits[] = {
+0x1b, 0x1b, 0x1b};
+static unsigned char courier24_169_bits[] = {
+0xe0, 0x03, 0x18, 0x04, 0x04, 0x08, 0xe2, 0x11, 0x32, 0x32, 0x09, 0x22, 
+0x09, 0x20, 0x09, 0x20, 0x19, 0x20, 0x32, 0x22, 0xe2, 0x11, 0x04, 0x08, 
+0x18, 0x04, 0xe0, 0x03};
+static unsigned char courier24_170_bits[] = {
+0x1e, 0x10, 0x1e, 0x11, 0x19, 0x3e, 0x00, 0x3f};
+static unsigned char courier24_171_bits[] = {
+0x20, 0x02, 0x98, 0x01, 0xcc, 0x00, 0x66, 0x00, 0x33, 0x00, 0x33, 0x00, 
+0x46, 0x00, 0x88, 0x00, 0x30, 0x03, 0x20, 0x02};
+static unsigned char courier24_172_bits[] = {
+0xff, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02};
+static unsigned char courier24_173_bits[] = {
+0x1f};
+static unsigned char courier24_174_bits[] = {
+0xe0, 0x03, 0x18, 0x04, 0x04, 0x08, 0xe2, 0x11, 0x23, 0x22, 0x21, 0x23, 
+0xe1, 0x20, 0x21, 0x21, 0x21, 0x21, 0xf2, 0x32, 0x02, 0x10, 0x04, 0x08, 
+0x18, 0x04, 0xe0, 0x03};
+static unsigned char courier24_175_bits[] = {
+0xff};
+static unsigned char courier24_176_bits[] = {
+0x1c, 0x22, 0x41, 0x41, 0x41, 0x23, 0x1e};
+static unsigned char courier24_177_bits[] = {
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xff, 0x07, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0xff, 0x07};
+static unsigned char courier24_178_bits[] = {
+0x1e, 0x33, 0x21, 0x20, 0x10, 0x08, 0x04, 0x22, 0x3f};
+static unsigned char courier24_179_bits[] = {
+0x0e, 0x11, 0x10, 0x10, 0x1c, 0x10, 0x20, 0x30, 0x1e};
+static unsigned char courier24_180_bits[] = {
+0x0c, 0x06, 0x03};
+static unsigned char courier24_181_bits[] = {
+0x87, 0x03, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 
+0x04, 0x02, 0x04, 0x02, 0x0c, 0x03, 0xf4, 0x0f, 0x04, 0x00, 0x04, 0x00, 
+0x04, 0x00, 0x04, 0x00};
+static unsigned char courier24_182_bits[] = {
+0xfc, 0x01, 0x92, 0x00, 0x91, 0x00, 0x91, 0x00, 0x91, 0x00, 0x91, 0x00, 
+0x92, 0x00, 0x9c, 0x00, 0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 
+0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0xdc, 0x01};
+static unsigned char courier24_183_bits[] = {
+0x06, 0x0f, 0x0e};
+static unsigned char courier24_184_bits[] = {
+0x04, 0x0c, 0x0c, 0x0f};
+static unsigned char courier24_185_bits[] = {
+0x0c, 0x0f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x3f};
+static unsigned char courier24_186_bits[] = {
+0x1e, 0x23, 0x21, 0x21, 0x33, 0x1c, 0x00, 0x3f};
+static unsigned char courier24_187_bits[] = {
+0x11, 0x00, 0x66, 0x00, 0xcc, 0x00, 0x98, 0x01, 0x30, 0x03, 0x30, 0x03, 
+0x98, 0x01, 0x44, 0x00, 0x33, 0x00, 0x22, 0x00};
+static unsigned char courier24_188_bits[] = {
+0x06, 0x10, 0x05, 0x18, 0x04, 0x08, 0x04, 0x04, 0x04, 0x02, 0x04, 0x02, 
+0x04, 0x01, 0x84, 0x00, 0x4f, 0x0c, 0x40, 0x0c, 0x20, 0x0a, 0x10, 0x0a, 
+0x18, 0x09, 0x88, 0x08, 0x84, 0x1f, 0x02, 0x08, 0x02, 0x1e};
+static unsigned char courier24_189_bits[] = {
+0x0c, 0x20, 0x0a, 0x10, 0x08, 0x08, 0x08, 0x0c, 0x08, 0x04, 0x08, 0x02, 
+0x08, 0x03, 0x08, 0x01, 0x9e, 0x1c, 0x40, 0x22, 0x60, 0x20, 0x20, 0x20, 
+0x10, 0x10, 0x08, 0x18, 0x08, 0x0c, 0x04, 0x22, 0x02, 0x3e};
+static unsigned char courier24_190_bits[] = {
+0x0e, 0x30, 0x11, 0x10, 0x10, 0x08, 0x18, 0x04, 0x0c, 0x06, 0x10, 0x02, 
+0x10, 0x01, 0x90, 0x00, 0x8f, 0x0c, 0x40, 0x0c, 0x20, 0x0a, 0x10, 0x0a, 
+0x10, 0x09, 0x88, 0x09, 0x84, 0x1f, 0x02, 0x08, 0x02, 0x1e};
+static unsigned char courier24_191_bits[] = {
+0x38, 0x38, 0x38, 0x00, 0x10, 0x18, 0x06, 0x02, 0x01, 0x01, 0x81, 0x82, 
+0x7c};
+static unsigned char courier24_192_bits[] = {
+0x40, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0xfc, 0x00, 0xc0, 0x00, 
+0xe0, 0x01, 0x60, 0x01, 0x20, 0x03, 0x30, 0x03, 0x10, 0x02, 0x18, 0x06, 
+0x18, 0x04, 0xf8, 0x07, 0x0c, 0x0c, 0x04, 0x08, 0x06, 0x18, 0x1f, 0x3e};
+static unsigned char courier24_193_bits[] = {
+0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x00, 0x00, 0xfc, 0x00, 0xc0, 0x00, 
+0xe0, 0x01, 0x60, 0x01, 0x20, 0x03, 0x30, 0x03, 0x10, 0x02, 0x18, 0x06, 
+0x18, 0x04, 0xf8, 0x07, 0x0c, 0x0c, 0x04, 0x08, 0x06, 0x18, 0x1f, 0x3e};
+static unsigned char courier24_194_bits[] = {
+0xc0, 0x00, 0x20, 0x01, 0x10, 0x02, 0x00, 0x00, 0xfc, 0x00, 0xc0, 0x00, 
+0xe0, 0x01, 0x60, 0x01, 0x20, 0x03, 0x30, 0x03, 0x10, 0x02, 0x18, 0x06, 
+0x18, 0x04, 0xf8, 0x07, 0x0c, 0x0c, 0x04, 0x08, 0x06, 0x18, 0x1f, 0x3e};
+static unsigned char courier24_195_bits[] = {
+0x70, 0x04, 0x90, 0x03, 0x00, 0x01, 0x00, 0x00, 0xfc, 0x00, 0xc0, 0x00, 
+0xe0, 0x01, 0x60, 0x01, 0x20, 0x03, 0x30, 0x03, 0x10, 0x02, 0x18, 0x06, 
+0x18, 0x04, 0xf8, 0x07, 0x0c, 0x0c, 0x04, 0x08, 0x06, 0x18, 0x1f, 0x3e};
+static unsigned char courier24_196_bits[] = {
+0x60, 0x03, 0x60, 0x03, 0x60, 0x03, 0x00, 0x00, 0xfc, 0x00, 0xc0, 0x00, 
+0xe0, 0x01, 0x60, 0x01, 0x20, 0x03, 0x30, 0x03, 0x10, 0x02, 0x18, 0x06, 
+0x18, 0x04, 0xf8, 0x07, 0x0c, 0x0c, 0x04, 0x08, 0x06, 0x18, 0x1f, 0x3e};
+static unsigned char courier24_197_bits[] = {
+0xc0, 0x00, 0x20, 0x01, 0x20, 0x01, 0xc0, 0x00, 0x00, 0x00, 0xfc, 0x00, 
+0xc0, 0x00, 0xe0, 0x01, 0x60, 0x01, 0x20, 0x03, 0x30, 0x03, 0x10, 0x02, 
+0x18, 0x06, 0x18, 0x04, 0xf8, 0x07, 0x0c, 0x0c, 0x04, 0x08, 0x06, 0x18, 
+0x1f, 0x3e};
+static unsigned char courier24_198_bits[] = {
+0xf0, 0x1f, 0xc0, 0x10, 0xc0, 0x10, 0xa0, 0x10, 0xa0, 0x14, 0xb0, 0x04, 
+0x90, 0x07, 0x90, 0x04, 0x98, 0x04, 0xf8, 0x04, 0x8c, 0x10, 0x8c, 0x10, 
+0x86, 0x10, 0x9f, 0x1f};
+static unsigned char courier24_199_bits[] = {
+0xf8, 0x04, 0x0c, 0x07, 0x02, 0x06, 0x02, 0x06, 0x01, 0x04, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x02, 0x0c, 
+0x04, 0x07, 0xf8, 0x01, 0x20, 0x00, 0xe0, 0x00, 0xf0, 0x00};
+static unsigned char courier24_200_bits[] = {
+0x20, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x01, 0xf8, 0x01, 0x08, 0x01, 
+0x08, 0x01, 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xff, 0x0f};
+static unsigned char courier24_201_bits[] = {
+0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x01, 0xf8, 0x01, 0x08, 0x01, 
+0x08, 0x01, 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xff, 0x0f};
+static unsigned char courier24_202_bits[] = {
+0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x00, 0xff, 0x0f, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x01, 0xf8, 0x01, 0x08, 0x01, 
+0x08, 0x01, 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xff, 0x0f};
+static unsigned char courier24_203_bits[] = {
+0xb0, 0x01, 0xb0, 0x01, 0xb0, 0x01, 0x00, 0x00, 0xff, 0x0f, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x01, 0xf8, 0x01, 0x08, 0x01, 
+0x08, 0x01, 0x08, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0xff, 0x0f};
+static unsigned char courier24_204_bits[] = {
+0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0xff, 0x03, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_205_bits[] = {
+0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x00, 0x00, 0xff, 0x03, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_206_bits[] = {
+0x30, 0x00, 0x48, 0x00, 0x84, 0x00, 0x00, 0x00, 0xff, 0x03, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_207_bits[] = {
+0xd8, 0x00, 0xd8, 0x00, 0xd8, 0x00, 0x00, 0x00, 0xff, 0x03, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_208_bits[] = {
+0xff, 0x00, 0x04, 0x03, 0x04, 0x06, 0x04, 0x04, 0x04, 0x08, 0x04, 0x08, 
+0x7f, 0x08, 0x04, 0x08, 0x04, 0x08, 0x04, 0x08, 0x04, 0x04, 0x04, 0x06, 
+0x04, 0x03, 0xff, 0x01};
+static unsigned char courier24_209_bits[] = {
+0x38, 0x02, 0xc8, 0x01, 0x80, 0x00, 0x00, 0x00, 0x0f, 0x1f, 0x1c, 0x08, 
+0x14, 0x08, 0x14, 0x08, 0x24, 0x08, 0x24, 0x08, 0x44, 0x08, 0x44, 0x08, 
+0x84, 0x08, 0x84, 0x08, 0x04, 0x09, 0x04, 0x09, 0x04, 0x0a, 0x1f, 0x0e};
+static unsigned char courier24_210_bits[] = {
+0x20, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x0c, 0x03, 
+0x06, 0x06, 0x02, 0x04, 0x03, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x01, 0x08, 0x01, 0x08, 0x02, 0x04, 0x06, 0x04, 0x0c, 0x03, 0xf0, 0x01};
+static unsigned char courier24_211_bits[] = {
+0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x0c, 0x03, 
+0x06, 0x06, 0x02, 0x04, 0x03, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x01, 0x08, 0x01, 0x08, 0x02, 0x04, 0x06, 0x04, 0x0c, 0x03, 0xf0, 0x01};
+static unsigned char courier24_212_bits[] = {
+0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x0c, 0x03, 
+0x06, 0x06, 0x02, 0x04, 0x03, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x01, 0x08, 0x01, 0x08, 0x02, 0x04, 0x06, 0x04, 0x0c, 0x03, 0xf0, 0x01};
+static unsigned char courier24_213_bits[] = {
+0x38, 0x02, 0xc8, 0x01, 0x80, 0x00, 0x00, 0x00, 0xf0, 0x01, 0x0c, 0x03, 
+0x06, 0x06, 0x02, 0x04, 0x03, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x01, 0x08, 0x01, 0x08, 0x02, 0x04, 0x06, 0x04, 0x0c, 0x03, 0xf0, 0x01};
+static unsigned char courier24_214_bits[] = {
+0xb0, 0x01, 0xb0, 0x01, 0xb0, 0x01, 0x00, 0x00, 0xf0, 0x01, 0x0c, 0x03, 
+0x06, 0x06, 0x02, 0x04, 0x03, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x01, 0x08, 0x01, 0x08, 0x02, 0x04, 0x06, 0x04, 0x0c, 0x03, 0xf0, 0x01};
+static unsigned char courier24_215_bits[] = {
+0x02, 0x01, 0x83, 0x01, 0xc6, 0x01, 0x6c, 0x00, 0x38, 0x00, 0x38, 0x00, 
+0x4c, 0x00, 0xc2, 0x00, 0x81, 0x01};
+static unsigned char courier24_216_bits[] = {
+0xf0, 0x05, 0x0c, 0x07, 0x06, 0x06, 0x02, 0x0e, 0x03, 0x09, 0x81, 0x08, 
+0xc1, 0x08, 0x41, 0x08, 0x21, 0x08, 0x13, 0x08, 0x1a, 0x04, 0x0e, 0x04, 
+0x0e, 0x03, 0xfa, 0x01};
+static unsigned char courier24_217_bits[] = {
+0x20, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0x9f, 0x1f, 0x02, 0x04, 
+0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 
+0x02, 0x04, 0x02, 0x04, 0x06, 0x04, 0x06, 0x04, 0x0c, 0x02, 0xf8, 0x01};
+static unsigned char courier24_218_bits[] = {
+0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0x9f, 0x1f, 0x02, 0x04, 
+0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 
+0x02, 0x04, 0x02, 0x04, 0x06, 0x04, 0x06, 0x04, 0x0c, 0x02, 0xf8, 0x01};
+static unsigned char courier24_219_bits[] = {
+0x60, 0x00, 0x90, 0x00, 0x08, 0x01, 0x00, 0x00, 0x9f, 0x1f, 0x02, 0x04, 
+0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 
+0x02, 0x04, 0x02, 0x04, 0x06, 0x04, 0x06, 0x04, 0x0c, 0x02, 0xf8, 0x01};
+static unsigned char courier24_220_bits[] = {
+0xb0, 0x01, 0xb0, 0x01, 0xb0, 0x01, 0x00, 0x00, 0x9f, 0x1f, 0x02, 0x04, 
+0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 
+0x02, 0x04, 0x02, 0x04, 0x06, 0x04, 0x06, 0x04, 0x0c, 0x02, 0xf8, 0x01};
+static unsigned char courier24_221_bits[] = {
+0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0x1f, 0x1f, 0x04, 0x04, 
+0x0c, 0x06, 0x08, 0x02, 0x10, 0x01, 0x30, 0x01, 0xa0, 0x00, 0xe0, 0x00, 
+0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0xf8, 0x03};
+static unsigned char courier24_222_bits[] = {
+0x3f, 0x00, 0x04, 0x00, 0x04, 0x00, 0xfc, 0x01, 0x04, 0x03, 0x04, 0x06, 
+0x04, 0x04, 0x04, 0x04, 0x04, 0x06, 0x04, 0x03, 0xfc, 0x01, 0x04, 0x00, 
+0x04, 0x00, 0x3f, 0x00};
+static unsigned char courier24_223_bits[] = {
+0x78, 0x00, 0x8c, 0x00, 0x06, 0x01, 0x02, 0x01, 0x02, 0x01, 0xc2, 0x00, 
+0x72, 0x00, 0x82, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 
+0x02, 0x02, 0x12, 0x01, 0xf3, 0x00};
+static unsigned char courier24_224_bits[] = {
+0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 
+0x80, 0x01, 0x00, 0x01, 0xfc, 0x01, 0x82, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x81, 0x01, 0xc3, 0x01, 0x3e, 0x07};
+static unsigned char courier24_225_bits[] = {
+0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 
+0x80, 0x01, 0x00, 0x01, 0xfc, 0x01, 0x82, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x81, 0x01, 0xc3, 0x01, 0x3e, 0x07};
+static unsigned char courier24_226_bits[] = {
+0x30, 0x00, 0x68, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 
+0x80, 0x01, 0x00, 0x01, 0xfc, 0x01, 0x82, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x81, 0x01, 0xc3, 0x01, 0x3e, 0x07};
+static unsigned char courier24_227_bits[] = {
+0x1c, 0x01, 0xe4, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 
+0x80, 0x01, 0x00, 0x01, 0xfc, 0x01, 0x82, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x81, 0x01, 0xc3, 0x01, 0x3e, 0x07};
+static unsigned char courier24_228_bits[] = {
+0xd8, 0x00, 0xd8, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 
+0x80, 0x01, 0x00, 0x01, 0xfc, 0x01, 0x82, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x81, 0x01, 0xc3, 0x01, 0x3e, 0x07};
+static unsigned char courier24_229_bits[] = {
+0x70, 0x00, 0x48, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x00, 
+0x80, 0x01, 0x00, 0x01, 0xfc, 0x01, 0x82, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x81, 0x01, 0xc3, 0x01, 0x3e, 0x07};
+static unsigned char courier24_230_bits[] = {
+0xfe, 0x07, 0x40, 0x0c, 0x40, 0x08, 0x40, 0x08, 0xfc, 0x0f, 0x42, 0x00, 
+0x41, 0x00, 0x41, 0x00, 0xe1, 0x00, 0x1e, 0x0f};
+static unsigned char courier24_231_bits[] = {
+0xf8, 0x06, 0x06, 0x03, 0x02, 0x02, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x02, 0x04, 0x06, 0x03, 0xf8, 0x00, 0x20, 0x00, 0x60, 0x00, 
+0x70, 0x00};
+static unsigned char courier24_232_bits[] = {
+0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 
+0x06, 0x03, 0x03, 0x06, 0x01, 0x04, 0xff, 0x07, 0x01, 0x00, 0x01, 0x00, 
+0x02, 0x00, 0x06, 0x06, 0xf8, 0x01};
+static unsigned char courier24_233_bits[] = {
+0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 
+0x06, 0x03, 0x03, 0x06, 0x01, 0x04, 0xff, 0x07, 0x01, 0x00, 0x01, 0x00, 
+0x02, 0x00, 0x06, 0x06, 0xf8, 0x01};
+static unsigned char courier24_234_bits[] = {
+0x30, 0x00, 0x68, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 
+0x06, 0x03, 0x03, 0x06, 0x01, 0x04, 0xff, 0x07, 0x01, 0x00, 0x01, 0x00, 
+0x02, 0x00, 0x06, 0x06, 0xf8, 0x01};
+static unsigned char courier24_235_bits[] = {
+0xd8, 0x00, 0xd8, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 
+0x06, 0x03, 0x03, 0x06, 0x01, 0x04, 0xff, 0x07, 0x01, 0x00, 0x01, 0x00, 
+0x02, 0x00, 0x06, 0x06, 0xf8, 0x01};
+static unsigned char courier24_236_bits[] = {
+0x10, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_237_bits[] = {
+0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_238_bits[] = {
+0x30, 0x00, 0x68, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_239_bits[] = {
+0xd8, 0x00, 0xd8, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0xff, 0x03};
+static unsigned char courier24_240_bits[] = {
+0x40, 0x00, 0x3c, 0x00, 0x70, 0x00, 0xd0, 0x00, 0x98, 0x01, 0x00, 0x03, 
+0x00, 0x06, 0xf8, 0x07, 0x06, 0x0e, 0x02, 0x0c, 0x01, 0x08, 0x01, 0x08, 
+0x01, 0x08, 0x01, 0x08, 0x02, 0x04, 0x0c, 0x06, 0xf8, 0x01};
+static unsigned char courier24_241_bits[] = {
+0x38, 0x02, 0xc8, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x01, 
+0x0c, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0x04, 0x04, 0x9f, 0x1f};
+static unsigned char courier24_242_bits[] = {
+0x20, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 
+0x06, 0x06, 0x02, 0x04, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x02, 0x04, 0x0c, 0x06, 0xf8, 0x01};
+static unsigned char courier24_243_bits[] = {
+0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 
+0x06, 0x06, 0x02, 0x04, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x02, 0x04, 0x0c, 0x06, 0xf8, 0x01};
+static unsigned char courier24_244_bits[] = {
+0x60, 0x00, 0xd0, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 
+0x06, 0x06, 0x02, 0x04, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x02, 0x04, 0x0c, 0x06, 0xf8, 0x01};
+static unsigned char courier24_245_bits[] = {
+0x38, 0x02, 0xc8, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 
+0x06, 0x06, 0x02, 0x04, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x02, 0x04, 0x0c, 0x06, 0xf8, 0x01};
+static unsigned char courier24_246_bits[] = {
+0xb0, 0x01, 0xb0, 0x01, 0xb0, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 
+0x06, 0x06, 0x02, 0x04, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 0x01, 0x08, 
+0x02, 0x04, 0x0c, 0x06, 0xf8, 0x01};
+static unsigned char courier24_247_bits[] = {
+0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00};
+static unsigned char courier24_248_bits[] = {
+0xf8, 0x05, 0x06, 0x06, 0x02, 0x0d, 0x81, 0x08, 0x41, 0x08, 0x31, 0x08, 
+0x1b, 0x08, 0x0e, 0x04, 0x0e, 0x06, 0xfb, 0x01};
+static unsigned char courier24_249_bits[] = {
+0x20, 0x00, 0x40, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x03, 
+0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 
+0x04, 0x02, 0x8c, 0x03, 0xf8, 0x0e};
+static unsigned char courier24_250_bits[] = {
+0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x03, 
+0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 
+0x04, 0x02, 0x8c, 0x03, 0xf8, 0x0e};
+static unsigned char courier24_251_bits[] = {
+0x60, 0x00, 0xd0, 0x00, 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x87, 0x03, 
+0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 
+0x04, 0x02, 0x8c, 0x03, 0xf8, 0x0e};
+static unsigned char courier24_252_bits[] = {
+0xb0, 0x01, 0xb0, 0x01, 0xb0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x87, 0x03, 
+0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 
+0x04, 0x02, 0x8c, 0x03, 0xf8, 0x0e};
+static unsigned char courier24_253_bits[] = {
+0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x1e, 
+0x04, 0x04, 0x04, 0x04, 0x08, 0x02, 0x08, 0x03, 0x10, 0x01, 0x90, 0x01, 
+0xa0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x20, 0x00, 0x20, 0x00, 0x10, 0x00, 
+0x7f, 0x00};
+static unsigned char courier24_254_bits[] = {
+0x0f, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 0xe8, 0x03, 
+0x38, 0x0c, 0x18, 0x08, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 
+0x18, 0x08, 0x38, 0x04, 0xe8, 0x03, 0x08, 0x00, 0x08, 0x00, 0x08, 0x00, 
+0x7f, 0x00};
+static unsigned char courier24_255_bits[] = {
+0xb0, 0x01, 0xb0, 0x01, 0xb0, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x1e, 
+0x04, 0x04, 0x04, 0x04, 0x08, 0x02, 0x08, 0x03, 0x10, 0x01, 0x90, 0x01, 
+0xa0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x20, 0x00, 0x20, 0x00, 0x10, 0x00, 
+0x7f, 0x00};
+static RotFont courier24font[] = {
+{5, 1, 1, courier24_0_bits},
+{5, 1, 1, courier24_1_bits},
+{5, 1, 1, courier24_2_bits},
+{5, 1, 1, courier24_3_bits},
+{5, 1, 1, courier24_4_bits},
+{5, 1, 1, courier24_5_bits},
+{5, 1, 1, courier24_6_bits},
+{5, 1, 1, courier24_7_bits},
+{5, 1, 1, courier24_8_bits},
+{5, 1, 1, courier24_9_bits},
+{5, 1, 1, courier24_10_bits},
+{5, 1, 1, courier24_11_bits},
+{5, 1, 1, courier24_12_bits},
+{5, 1, 1, courier24_13_bits},
+{5, 1, 1, courier24_14_bits},
+{5, 1, 1, courier24_15_bits},
+{5, 1, 1, courier24_16_bits},
+{5, 1, 1, courier24_17_bits},
+{5, 1, 1, courier24_18_bits},
+{5, 1, 1, courier24_19_bits},
+{5, 1, 1, courier24_20_bits},
+{5, 1, 1, courier24_21_bits},
+{5, 1, 1, courier24_22_bits},
+{5, 1, 1, courier24_23_bits},
+{5, 1, 1, courier24_24_bits},
+{5, 1, 1, courier24_25_bits},
+{5, 1, 1, courier24_26_bits},
+{5, 1, 1, courier24_27_bits},
+{5, 1, 1, courier24_28_bits},
+{5, 1, 1, courier24_29_bits},
+{5, 1, 1, courier24_30_bits},
+{5, 1, 1, courier24_31_bits},
+{10, 1, 1, courier24_32_bits},
+{3, 14, 14, courier24_33_bits},
+{6, 7, 14, courier24_34_bits},
+{11, 17, 16, courier24_35_bits},
+{10, 19, 16, courier24_36_bits},
+{12, 15, 15, courier24_37_bits},
+{10, 13, 13, courier24_38_bits},
+{4, 6, 14, courier24_39_bits},
+{4, 18, 16, courier24_40_bits},
+{4, 18, 16, courier24_41_bits},
+{9, 9, 14, courier24_42_bits},
+{11, 11, 13, courier24_43_bits},
+{4, 6, 3, courier24_44_bits},
+{11, 1, 8, courier24_45_bits},
+{4, 3, 3, courier24_46_bits},
+{10, 20, 17, courier24_47_bits},
+{9, 15, 15, courier24_48_bits},
+{10, 15, 15, courier24_49_bits},
+{9, 15, 15, courier24_50_bits},
+{9, 15, 15, courier24_51_bits},
+{10, 15, 15, courier24_52_bits},
+{10, 15, 15, courier24_53_bits},
+{9, 15, 15, courier24_54_bits},
+{10, 15, 15, courier24_55_bits},
+{9, 15, 15, courier24_56_bits},
+{9, 15, 15, courier24_57_bits},
+{4, 9, 9, courier24_58_bits},
+{5, 12, 9, courier24_59_bits},
+{12, 11, 13, courier24_60_bits},
+{11, 5, 10, courier24_61_bits},
+{12, 11, 13, courier24_62_bits},
+{8, 14, 14, courier24_63_bits},
+{13, 13, 13, courier24_64_bits},
+{14, 14, 14, courier24_65_bits},
+{12, 14, 14, courier24_66_bits},
+{12, 14, 14, courier24_67_bits},
+{12, 14, 14, courier24_68_bits},
+{12, 14, 14, courier24_69_bits},
+{11, 14, 14, courier24_70_bits},
+{13, 14, 14, courier24_71_bits},
+{12, 14, 14, courier24_72_bits},
+{10, 14, 14, courier24_73_bits},
+{13, 14, 14, courier24_74_bits},
+{13, 14, 14, courier24_75_bits},
+{12, 14, 14, courier24_76_bits},
+{14, 14, 14, courier24_77_bits},
+{13, 14, 14, courier24_78_bits},
+{12, 14, 14, courier24_79_bits},
+{11, 14, 14, courier24_80_bits},
+{12, 17, 14, courier24_81_bits},
+{13, 14, 14, courier24_82_bits},
+{9, 14, 14, courier24_83_bits},
+{13, 14, 14, courier24_84_bits},
+{13, 14, 14, courier24_85_bits},
+{14, 14, 14, courier24_86_bits},
+{15, 14, 14, courier24_87_bits},
+{13, 14, 14, courier24_88_bits},
+{13, 14, 14, courier24_89_bits},
+{10, 14, 14, courier24_90_bits},
+{4, 18, 16, courier24_91_bits},
+{10, 20, 17, courier24_92_bits},
+{4, 18, 16, courier24_93_bits},
+{11, 11, 14, courier24_94_bits},
+{17, 1, -2, courier24_95_bits},
+{4, 6, 14, courier24_96_bits},
+{11, 10, 10, courier24_97_bits},
+{13, 15, 15, courier24_98_bits},
+{11, 10, 10, courier24_99_bits},
+{13, 15, 15, courier24_100_bits},
+{11, 10, 10, courier24_101_bits},
+{10, 15, 15, courier24_102_bits},
+{12, 14, 10, courier24_103_bits},
+{13, 15, 15, courier24_104_bits},
+{10, 16, 16, courier24_105_bits},
+{8, 20, 16, courier24_106_bits},
+{13, 15, 15, courier24_107_bits},
+{10, 15, 15, courier24_108_bits},
+{15, 10, 10, courier24_109_bits},
+{13, 10, 10, courier24_110_bits},
+{12, 10, 10, courier24_111_bits},
+{13, 14, 10, courier24_112_bits},
+{13, 14, 10, courier24_113_bits},
+{12, 10, 10, courier24_114_bits},
+{10, 10, 10, courier24_115_bits},
+{10, 14, 14, courier24_116_bits},
+{12, 10, 10, courier24_117_bits},
+{13, 10, 10, courier24_118_bits},
+{14, 10, 10, courier24_119_bits},
+{14, 10, 10, courier24_120_bits},
+{13, 14, 10, courier24_121_bits},
+{10, 10, 10, courier24_122_bits},
+{5, 18, 16, courier24_123_bits},
+{1, 21, 16, courier24_124_bits},
+{6, 18, 16, courier24_125_bits},
+{10, 4, 9, courier24_126_bits},
+{5, 1, 1, courier24_127_bits},
+{5, 1, 1, courier24_128_bits},
+{5, 1, 1, courier24_129_bits},
+{5, 1, 1, courier24_130_bits},
+{5, 1, 1, courier24_131_bits},
+{5, 1, 1, courier24_132_bits},
+{5, 1, 1, courier24_133_bits},
+{5, 1, 1, courier24_134_bits},
+{5, 1, 1, courier24_135_bits},
+{5, 1, 1, courier24_136_bits},
+{5, 1, 1, courier24_137_bits},
+{5, 1, 1, courier24_138_bits},
+{5, 1, 1, courier24_139_bits},
+{5, 1, 1, courier24_140_bits},
+{5, 1, 1, courier24_141_bits},
+{5, 1, 1, courier24_142_bits},
+{5, 1, 1, courier24_143_bits},
+{5, 1, 1, courier24_144_bits},
+{5, 1, 1, courier24_145_bits},
+{5, 1, 1, courier24_146_bits},
+{5, 1, 1, courier24_147_bits},
+{5, 1, 1, courier24_148_bits},
+{5, 1, 1, courier24_149_bits},
+{5, 1, 1, courier24_150_bits},
+{5, 1, 1, courier24_151_bits},
+{5, 1, 1, courier24_152_bits},
+{5, 1, 1, courier24_153_bits},
+{5, 1, 1, courier24_154_bits},
+{5, 1, 1, courier24_155_bits},
+{5, 1, 1, courier24_156_bits},
+{5, 1, 1, courier24_157_bits},
+{5, 1, 1, courier24_158_bits},
+{5, 1, 1, courier24_159_bits},
+{5, 1, 1, courier24_160_bits},
+{3, 13, 10, courier24_161_bits},
+{9, 16, 15, courier24_162_bits},
+{11, 15, 15, courier24_163_bits},
+{11, 11, 12, courier24_164_bits},
+{13, 14, 14, courier24_165_bits},
+{1, 21, 16, courier24_166_bits},
+{9, 16, 14, courier24_167_bits},
+{5, 3, 15, courier24_168_bits},
+{14, 14, 14, courier24_169_bits},
+{6, 8, 14, courier24_170_bits},
+{10, 10, 10, courier24_171_bits},
+{10, 6, 10, courier24_172_bits},
+{5, 1, 7, courier24_173_bits},
+{14, 14, 14, courier24_174_bits},
+{8, 1, 14, courier24_175_bits},
+{7, 7, 15, courier24_176_bits},
+{11, 13, 14, courier24_177_bits},
+{6, 9, 15, courier24_178_bits},
+{6, 9, 15, courier24_179_bits},
+{5, 3, 15, courier24_180_bits},
+{12, 14, 10, courier24_181_bits},
+{9, 16, 14, courier24_182_bits},
+{4, 3, 9, courier24_183_bits},
+{4, 4, 1, courier24_184_bits},
+{6, 9, 15, courier24_185_bits},
+{6, 8, 14, courier24_186_bits},
+{10, 10, 10, courier24_187_bits},
+{13, 17, 15, courier24_188_bits},
+{14, 17, 15, courier24_189_bits},
+{14, 17, 15, courier24_190_bits},
+{8, 13, 10, courier24_191_bits},
+{14, 18, 18, courier24_192_bits},
+{14, 18, 18, courier24_193_bits},
+{14, 18, 18, courier24_194_bits},
+{14, 18, 18, courier24_195_bits},
+{14, 18, 18, courier24_196_bits},
+{14, 19, 19, courier24_197_bits},
+{13, 14, 14, courier24_198_bits},
+{12, 17, 14, courier24_199_bits},
+{12, 18, 18, courier24_200_bits},
+{12, 18, 18, courier24_201_bits},
+{12, 18, 18, courier24_202_bits},
+{12, 18, 18, courier24_203_bits},
+{10, 18, 18, courier24_204_bits},
+{10, 18, 18, courier24_205_bits},
+{10, 18, 18, courier24_206_bits},
+{10, 18, 18, courier24_207_bits},
+{12, 14, 14, courier24_208_bits},
+{13, 18, 18, courier24_209_bits},
+{12, 18, 18, courier24_210_bits},
+{12, 18, 18, courier24_211_bits},
+{12, 18, 18, courier24_212_bits},
+{12, 18, 18, courier24_213_bits},
+{12, 18, 18, courier24_214_bits},
+{9, 9, 12, courier24_215_bits},
+{12, 14, 14, courier24_216_bits},
+{13, 18, 18, courier24_217_bits},
+{13, 18, 18, courier24_218_bits},
+{13, 18, 18, courier24_219_bits},
+{13, 18, 18, courier24_220_bits},
+{13, 18, 18, courier24_221_bits},
+{11, 14, 14, courier24_222_bits},
+{10, 15, 15, courier24_223_bits},
+{11, 15, 15, courier24_224_bits},
+{11, 15, 15, courier24_225_bits},
+{11, 15, 15, courier24_226_bits},
+{11, 15, 15, courier24_227_bits},
+{11, 15, 15, courier24_228_bits},
+{11, 15, 15, courier24_229_bits},
+{13, 10, 10, courier24_230_bits},
+{11, 13, 10, courier24_231_bits},
+{11, 15, 15, courier24_232_bits},
+{11, 15, 15, courier24_233_bits},
+{11, 15, 15, courier24_234_bits},
+{11, 15, 15, courier24_235_bits},
+{10, 15, 15, courier24_236_bits},
+{10, 15, 15, courier24_237_bits},
+{10, 15, 15, courier24_238_bits},
+{10, 15, 15, courier24_239_bits},
+{12, 17, 17, courier24_240_bits},
+{13, 15, 15, courier24_241_bits},
+{12, 15, 15, courier24_242_bits},
+{12, 15, 15, courier24_243_bits},
+{12, 15, 15, courier24_244_bits},
+{12, 15, 15, courier24_245_bits},
+{12, 15, 15, courier24_246_bits},
+{11, 11, 13, courier24_247_bits},
+{12, 10, 10, courier24_248_bits},
+{12, 15, 15, courier24_249_bits},
+{12, 15, 15, courier24_250_bits},
+{12, 15, 15, courier24_251_bits},
+{12, 15, 15, courier24_252_bits},
+{13, 19, 15, courier24_253_bits},
+{13, 19, 15, courier24_254_bits},
+{13, 19, 15, courier24_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier8.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier8.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier8.bdf	(revision 15879)
@@ -0,0 +1,2404 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) IBM Corporation 1990,1991. IBM Courier is a Trademark of the IBM Corporation.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -adobe-courier-medium-r-normal--8-77-75-75-m-50-iso8859-1
+SIZE 8 75 75
+FONTBOUNDINGBOX 7 9 -1 -2
+STARTPROPERTIES 25
+FOUNDRY "adobe"
+FAMILY_NAME "courier"
+WEIGHT_NAME "medium"
+SLANT "r"
+SETWIDTH_NAME "normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 8
+POINT_SIZE 77
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "m"
+AVERAGE_WIDTH 50
+CHARSET_REGISTRY "iso8859"
+CHARSET_ENCODING "1"
+FONT "-adobe-courier-medium-r-normal--8-77-75-75-m-50-iso8859-1"
+COPYRIGHT "Copyright (c) IBM Corporation 1990,1991. IBM Courier is a Trademark of the IBM Corporation."
+RAW_PIXEL_SIZE 1000
+RAW_POINT_SIZE 964
+RAW_ASCENT 841
+RAW_DESCENT 288
+RAW_AVERAGE_WIDTH 6000
+FACE_NAME "Couriere."
+DEFAULT_CHAR 0
+FONT_ASCENT 7
+FONT_DESCENT 2
+ENDPROPERTIES
+CHARS 190
+STARTCHAR space
+ENCODING 32
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 0 0 0 0
+ATTRIBUTES 0x0258
+BITMAP
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 4 2 0
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 2 1 2
+ATTRIBUTES 0x0258
+BITMAP
+a0
+a0
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+a0
+a0
+e0
+e0
+a0
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 6 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+e0
+e0
+c0
+e0
+e0
+40
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+e0
+f8
+38
+38
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+80
+a0
+e0
+e0
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 2 2 2
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 6 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 6 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+80
+40
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 3 1 1
+ATTRIBUTES 0x0258
+BITMAP
+40
+40
+a0
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 3 1 1
+ATTRIBUTES 0x0258
+BITMAP
+40
+e0
+40
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 2 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 1 0 2
+ATTRIBUTES 0x0258
+BITMAP
+f0
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 1 2 0
+ATTRIBUTES 0x0258
+BITMAP
+80
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 7 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+20
+20
+20
+40
+40
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+a0
+a0
+a0
+c0
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+10
+30
+40
+f0
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+60
+20
+c0
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+60
+60
+f0
+30
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+80
+e0
+20
+e0
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+80
+e0
+a0
+e0
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+10
+20
+20
+20
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+a0
+c0
+a0
+e0
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+90
+70
+10
+60
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 3 2 0
+ATTRIBUTES 0x0258
+BITMAP
+80
+00
+80
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 4 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+40
+40
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 3 0 1
+ATTRIBUTES 0x0258
+BITMAP
+60
+c0
+20
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 3 0 1
+ATTRIBUTES 0x0258
+BITMAP
+f0
+00
+f0
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 3 0 1
+ATTRIBUTES 0x0258
+BITMAP
+60
+30
+c0
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 4 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+20
+40
+40
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+a8
+e8
+f8
+70
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+50
+70
+d8
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+70
+48
+f0
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+80
+80
+70
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+48
+48
+f0
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+70
+40
+f8
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+e0
+80
+c0
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+80
+98
+78
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+d0
+70
+50
+d0
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 4 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+40
+40
+e0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+38
+10
+90
+f0
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+d8
+60
+50
+c8
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+40
+48
+f8
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 6 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+dc
+d8
+a8
+d8
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+d8
+68
+68
+d8
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+88
+88
+70
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+90
+e0
+c0
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 -1
+ATTRIBUTES 0x0258
+BITMAP
+70
+88
+88
+70
+70
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+60
+50
+d8
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 1 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+c0
+20
+e0
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+20
+20
+70
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+d8
+90
+90
+f0
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+d8
+50
+50
+20
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+d8
+d8
+50
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+d0
+20
+50
+d8
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+50
+20
+70
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+20
+50
+70
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 7 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+c0
+80
+80
+80
+80
+80
+c0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 7 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+40
+40
+40
+20
+20
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 7 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+40
+40
+40
+40
+c0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 3 0 1
+ATTRIBUTES 0x0258
+BITMAP
+60
+e0
+90
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 6 1 -1 -1
+ATTRIBUTES 0x0258
+BITMAP
+fc
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 2 2 2
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+90
+e8
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+f0
+88
+f0
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+80
+70
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+30
+10
+f0
+90
+78
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+a8
+78
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+e0
+80
+80
+e0
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+70
+90
+70
+10
+60
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+70
+50
+d8
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+c0
+40
+e0
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 7 1 -2
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+c0
+40
+40
+40
+c0
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+70
+60
+d8
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+a8
+e8
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+50
+d8
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+88
+70
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+f0
+48
+70
+40
+c0
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+78
+90
+70
+10
+38
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 3 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+80
+e0
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+70
+f0
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 4 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+80
+80
+e0
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+d0
+50
+70
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+d8
+50
+20
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+a8
+b8
+50
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f0
+60
+d8
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+d0
+50
+20
+20
+e0
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 3 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+40
+e0
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 7 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+40
+80
+80
+80
+80
+80
+40
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 7 2 -2
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 7 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+80
+40
+40
+40
+40
+40
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 1 1 2
+ATTRIBUTES 0x0258
+BITMAP
+e0
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 4 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+e0
+c0
+f0
+40
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+80
+e0
+80
+e0
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+a0
+c0
+b0
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+50
+70
+70
+70
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 7 2 -2
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+80
+00
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+e0
+c0
+e0
+20
+e0
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 1 1 4
+ATTRIBUTES 0x0258
+BITMAP
+c0
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+e8
+88
+70
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 2 1 2
+ATTRIBUTES 0x0258
+BITMAP
+c0
+e0
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 3 1 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+c0
+c0
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 2 1 1
+ATTRIBUTES 0x0258
+BITMAP
+e0
+20
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 1 1 2
+ATTRIBUTES 0x0258
+BITMAP
+c0
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+f8
+f8
+70
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 1 1 4
+ATTRIBUTES 0x0258
+BITMAP
+e0
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 3 1 2
+ATTRIBUTES 0x0258
+BITMAP
+e0
+a0
+40
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 4 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+40
+40
+e0
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 3 1 2
+ATTRIBUTES 0x0258
+BITMAP
+e0
+20
+e0
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 3 1 2
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+e0
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 1 1 4
+ATTRIBUTES 0x0258
+BITMAP
+80
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 -1
+ATTRIBUTES 0x0258
+BITMAP
+d0
+50
+70
+40
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+e0
+e0
+60
+60
+60
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 1 2 2
+ATTRIBUTES 0x0258
+BITMAP
+80
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 2 2 -1
+ATTRIBUTES 0x0258
+BITMAP
+80
+80
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 3 1 2
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+c0
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 2 1 2
+ATTRIBUTES 0x0258
+BITMAP
+e0
+e0
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 3 1 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+60
+60
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 -1
+ATTRIBUTES 0x0258
+BITMAP
+c8
+50
+d8
+38
+58
+58
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 -1
+ATTRIBUTES 0x0258
+BITMAP
+c8
+50
+f8
+28
+48
+98
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 -1
+ATTRIBUTES 0x0258
+BITMAP
+c8
+50
+d0
+38
+58
+58
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 4 1 -1
+ATTRIBUTES 0x0258
+BITMAP
+40
+40
+80
+e0
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+70
+50
+70
+d8
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+70
+50
+70
+d8
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+50
+70
+d8
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+30
+00
+70
+50
+70
+d8
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+50
+70
+d8
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 7 0 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+60
+00
+70
+50
+70
+d8
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+30
+78
+f8
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 -1
+ATTRIBUTES 0x0258
+BITMAP
+78
+80
+80
+70
+30
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+f8
+70
+40
+f8
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+f8
+70
+40
+f8
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+f8
+70
+40
+f8
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+f8
+70
+40
+f8
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 6 1 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+00
+e0
+40
+40
+e0
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 6 1 0
+ATTRIBUTES 0x0258
+BITMAP
+80
+00
+e0
+40
+40
+e0
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 6 1 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+00
+e0
+40
+40
+e0
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 6 1 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+00
+e0
+40
+40
+e0
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+f8
+e8
+48
+f0
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+30
+00
+d8
+68
+68
+d8
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+70
+88
+88
+70
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+70
+88
+88
+70
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+88
+88
+70
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+30
+00
+70
+88
+88
+70
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+88
+88
+70
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 3 1 1
+ATTRIBUTES 0x0258
+BITMAP
+a0
+60
+a0
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+a8
+a8
+f0
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+d8
+90
+90
+f0
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+d8
+90
+90
+f0
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+d8
+90
+90
+f0
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+d8
+90
+90
+f0
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+f8
+50
+20
+70
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+90
+e0
+c0
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+e0
+a0
+e0
+a0
+e0
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+70
+90
+e8
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+70
+90
+e8
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+90
+e8
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+30
+00
+70
+90
+e8
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+90
+e8
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+90
+e8
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+70
+f8
+f8
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 4 0 -1
+ATTRIBUTES 0x0258
+BITMAP
+78
+80
+70
+20
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+70
+a8
+78
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+70
+a8
+78
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+a8
+78
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+a8
+78
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+00
+c0
+40
+e0
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+80
+00
+c0
+40
+e0
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+00
+c0
+40
+e0
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+ATTRIBUTES 0x0258
+BITMAP
+c0
+00
+c0
+40
+e0
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+ATTRIBUTES 0x0258
+BITMAP
+20
+20
+10
+f8
+88
+70
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+30
+00
+f0
+50
+d8
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+70
+88
+70
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+70
+88
+70
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+88
+70
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+30
+00
+70
+88
+70
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+70
+88
+70
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 4 2 0
+ATTRIBUTES 0x0258
+BITMAP
+80
+00
+00
+80
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 0
+ATTRIBUTES 0x0258
+BITMAP
+78
+e8
+b0
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+10
+00
+d0
+50
+70
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+d0
+50
+70
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+d0
+50
+70
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+d0
+50
+70
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 7 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+40
+00
+d0
+50
+20
+20
+e0
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 7 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+c0
+40
+70
+48
+70
+40
+c0
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 7 0 -2
+ATTRIBUTES 0x0258
+BITMAP
+60
+00
+d0
+50
+20
+20
+e0
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier8.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier8.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/courier8.h	(revision 15879)
@@ -0,0 +1,769 @@
+static unsigned char courier8_0_bits[] = {
+0x00};
+static unsigned char courier8_1_bits[] = {
+0x00};
+static unsigned char courier8_2_bits[] = {
+0x00};
+static unsigned char courier8_3_bits[] = {
+0x00};
+static unsigned char courier8_4_bits[] = {
+0x00};
+static unsigned char courier8_5_bits[] = {
+0x00};
+static unsigned char courier8_6_bits[] = {
+0x00};
+static unsigned char courier8_7_bits[] = {
+0x00};
+static unsigned char courier8_8_bits[] = {
+0x00};
+static unsigned char courier8_9_bits[] = {
+0x00};
+static unsigned char courier8_10_bits[] = {
+0x00};
+static unsigned char courier8_11_bits[] = {
+0x00};
+static unsigned char courier8_12_bits[] = {
+0x00};
+static unsigned char courier8_13_bits[] = {
+0x00};
+static unsigned char courier8_14_bits[] = {
+0x00};
+static unsigned char courier8_15_bits[] = {
+0x00};
+static unsigned char courier8_16_bits[] = {
+0x00};
+static unsigned char courier8_17_bits[] = {
+0x00};
+static unsigned char courier8_18_bits[] = {
+0x00};
+static unsigned char courier8_19_bits[] = {
+0x00};
+static unsigned char courier8_20_bits[] = {
+0x00};
+static unsigned char courier8_21_bits[] = {
+0x00};
+static unsigned char courier8_22_bits[] = {
+0x00};
+static unsigned char courier8_23_bits[] = {
+0x00};
+static unsigned char courier8_24_bits[] = {
+0x00};
+static unsigned char courier8_25_bits[] = {
+0x00};
+static unsigned char courier8_26_bits[] = {
+0x00};
+static unsigned char courier8_27_bits[] = {
+0x00};
+static unsigned char courier8_28_bits[] = {
+0x00};
+static unsigned char courier8_29_bits[] = {
+0x00};
+static unsigned char courier8_30_bits[] = {
+0x00};
+static unsigned char courier8_31_bits[] = {
+0x00};
+static unsigned char courier8_32_bits[] = {
+0x00};
+static unsigned char courier8_33_bits[] = {
+0x01, 0x01, 0x01, 0x01};
+static unsigned char courier8_34_bits[] = {
+0x05, 0x05};
+static unsigned char courier8_35_bits[] = {
+0x05, 0x05, 0x07, 0x07, 0x05};
+static unsigned char courier8_36_bits[] = {
+0x07, 0x07, 0x03, 0x07, 0x07, 0x02};
+static unsigned char courier8_37_bits[] = {
+0x07, 0x07, 0x1f, 0x1c, 0x1c};
+static unsigned char courier8_38_bits[] = {
+0x02, 0x01, 0x05, 0x07, 0x07};
+static unsigned char courier8_39_bits[] = {
+0x01, 0x01};
+static unsigned char courier8_40_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char courier8_41_bits[] = {
+0x01, 0x02, 0x02, 0x02, 0x02, 0x01};
+static unsigned char courier8_42_bits[] = {
+0x02, 0x02, 0x05};
+static unsigned char courier8_43_bits[] = {
+0x02, 0x07, 0x02};
+static unsigned char courier8_44_bits[] = {
+0x01, 0x01};
+static unsigned char courier8_45_bits[] = {
+0x0f};
+static unsigned char courier8_46_bits[] = {
+0x01};
+static unsigned char courier8_47_bits[] = {
+0x04, 0x04, 0x04, 0x02, 0x02, 0x01, 0x01};
+static unsigned char courier8_48_bits[] = {
+0x03, 0x05, 0x05, 0x05, 0x03};
+static unsigned char courier8_49_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x07};
+static unsigned char courier8_50_bits[] = {
+0x06, 0x08, 0x0c, 0x02, 0x0f};
+static unsigned char courier8_51_bits[] = {
+0x03, 0x02, 0x06, 0x04, 0x03};
+static unsigned char courier8_52_bits[] = {
+0x04, 0x06, 0x06, 0x0f, 0x0c};
+static unsigned char courier8_53_bits[] = {
+0x03, 0x01, 0x07, 0x04, 0x07};
+static unsigned char courier8_54_bits[] = {
+0x06, 0x01, 0x07, 0x05, 0x07};
+static unsigned char courier8_55_bits[] = {
+0x0f, 0x08, 0x04, 0x04, 0x04};
+static unsigned char courier8_56_bits[] = {
+0x07, 0x05, 0x03, 0x05, 0x07};
+static unsigned char courier8_57_bits[] = {
+0x06, 0x09, 0x0e, 0x08, 0x06};
+static unsigned char courier8_58_bits[] = {
+0x01, 0x00, 0x01};
+static unsigned char courier8_59_bits[] = {
+0x02, 0x00, 0x02, 0x02};
+static unsigned char courier8_60_bits[] = {
+0x06, 0x03, 0x04};
+static unsigned char courier8_61_bits[] = {
+0x0f, 0x00, 0x0f};
+static unsigned char courier8_62_bits[] = {
+0x06, 0x0c, 0x03};
+static unsigned char courier8_63_bits[] = {
+0x07, 0x04, 0x02, 0x02};
+static unsigned char courier8_64_bits[] = {
+0x0e, 0x15, 0x17, 0x1f, 0x0e};
+static unsigned char courier8_65_bits[] = {
+0x0e, 0x0a, 0x0e, 0x1b};
+static unsigned char courier8_66_bits[] = {
+0x0f, 0x0e, 0x12, 0x0f};
+static unsigned char courier8_67_bits[] = {
+0x1e, 0x01, 0x01, 0x0e};
+static unsigned char courier8_68_bits[] = {
+0x1f, 0x12, 0x12, 0x0f};
+static unsigned char courier8_69_bits[] = {
+0x1f, 0x0e, 0x02, 0x1f};
+static unsigned char courier8_70_bits[] = {
+0x0f, 0x07, 0x01, 0x03};
+static unsigned char courier8_71_bits[] = {
+0x1e, 0x01, 0x19, 0x1e};
+static unsigned char courier8_72_bits[] = {
+0x0b, 0x0e, 0x0a, 0x0b};
+static unsigned char courier8_73_bits[] = {
+0x07, 0x02, 0x02, 0x07};
+static unsigned char courier8_74_bits[] = {
+0x1c, 0x08, 0x09, 0x0f};
+static unsigned char courier8_75_bits[] = {
+0x1b, 0x06, 0x0a, 0x13};
+static unsigned char courier8_76_bits[] = {
+0x07, 0x02, 0x12, 0x1f};
+static unsigned char courier8_77_bits[] = {
+0x3b, 0x1b, 0x15, 0x1b};
+static unsigned char courier8_78_bits[] = {
+0x1b, 0x16, 0x16, 0x1b};
+static unsigned char courier8_79_bits[] = {
+0x0e, 0x11, 0x11, 0x0e};
+static unsigned char courier8_80_bits[] = {
+0x0f, 0x09, 0x07, 0x03};
+static unsigned char courier8_81_bits[] = {
+0x0e, 0x11, 0x11, 0x0e, 0x0e};
+static unsigned char courier8_82_bits[] = {
+0x0f, 0x06, 0x0a, 0x1b};
+static unsigned char courier8_83_bits[] = {
+0x0f, 0x03, 0x04, 0x07};
+static unsigned char courier8_84_bits[] = {
+0x1f, 0x04, 0x04, 0x0e};
+static unsigned char courier8_85_bits[] = {
+0x1b, 0x09, 0x09, 0x0f};
+static unsigned char courier8_86_bits[] = {
+0x1b, 0x0a, 0x0a, 0x04};
+static unsigned char courier8_87_bits[] = {
+0x1f, 0x1b, 0x1b, 0x0a};
+static unsigned char courier8_88_bits[] = {
+0x0b, 0x04, 0x0a, 0x1b};
+static unsigned char courier8_89_bits[] = {
+0x1f, 0x0a, 0x04, 0x0e};
+static unsigned char courier8_90_bits[] = {
+0x0f, 0x04, 0x0a, 0x0e};
+static unsigned char courier8_91_bits[] = {
+0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03};
+static unsigned char courier8_92_bits[] = {
+0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04};
+static unsigned char courier8_93_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03};
+static unsigned char courier8_94_bits[] = {
+0x06, 0x07, 0x09};
+static unsigned char courier8_95_bits[] = {
+0x3f};
+static unsigned char courier8_96_bits[] = {
+0x01, 0x01};
+static unsigned char courier8_97_bits[] = {
+0x0e, 0x09, 0x17};
+static unsigned char courier8_98_bits[] = {
+0x01, 0x01, 0x0f, 0x11, 0x0f};
+static unsigned char courier8_99_bits[] = {
+0x1e, 0x01, 0x0e};
+static unsigned char courier8_100_bits[] = {
+0x0c, 0x08, 0x0f, 0x09, 0x1e};
+static unsigned char courier8_101_bits[] = {
+0x0e, 0x15, 0x1e};
+static unsigned char courier8_102_bits[] = {
+0x07, 0x07, 0x01, 0x01, 0x07};
+static unsigned char courier8_103_bits[] = {
+0x0e, 0x09, 0x0e, 0x08, 0x06};
+static unsigned char courier8_104_bits[] = {
+0x03, 0x02, 0x0e, 0x0a, 0x1b};
+static unsigned char courier8_105_bits[] = {
+0x02, 0x00, 0x03, 0x02, 0x07};
+static unsigned char courier8_106_bits[] = {
+0x02, 0x00, 0x03, 0x02, 0x02, 0x02, 0x03};
+static unsigned char courier8_107_bits[] = {
+0x03, 0x02, 0x0e, 0x06, 0x1b};
+static unsigned char courier8_108_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x07};
+static unsigned char courier8_109_bits[] = {
+0x1f, 0x15, 0x17};
+static unsigned char courier8_110_bits[] = {
+0x0f, 0x0a, 0x1b};
+static unsigned char courier8_111_bits[] = {
+0x0e, 0x11, 0x0e};
+static unsigned char courier8_112_bits[] = {
+0x0f, 0x12, 0x0e, 0x02, 0x03};
+static unsigned char courier8_113_bits[] = {
+0x1e, 0x09, 0x0e, 0x08, 0x1c};
+static unsigned char courier8_114_bits[] = {
+0x07, 0x01, 0x07};
+static unsigned char courier8_115_bits[] = {
+0x1e, 0x0e, 0x0f};
+static unsigned char courier8_116_bits[] = {
+0x07, 0x01, 0x01, 0x07};
+static unsigned char courier8_117_bits[] = {
+0x0b, 0x0a, 0x0e};
+static unsigned char courier8_118_bits[] = {
+0x1b, 0x0a, 0x04};
+static unsigned char courier8_119_bits[] = {
+0x15, 0x1d, 0x0a};
+static unsigned char courier8_120_bits[] = {
+0x0f, 0x06, 0x1b};
+static unsigned char courier8_121_bits[] = {
+0x0b, 0x0a, 0x04, 0x04, 0x07};
+static unsigned char courier8_122_bits[] = {
+0x07, 0x02, 0x07};
+static unsigned char courier8_123_bits[] = {
+0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02};
+static unsigned char courier8_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char courier8_125_bits[] = {
+0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03};
+static unsigned char courier8_126_bits[] = {
+0x07};
+static unsigned char courier8_127_bits[] = {
+0x00};
+static unsigned char courier8_128_bits[] = {
+0x00};
+static unsigned char courier8_129_bits[] = {
+0x00};
+static unsigned char courier8_130_bits[] = {
+0x00};
+static unsigned char courier8_131_bits[] = {
+0x00};
+static unsigned char courier8_132_bits[] = {
+0x00};
+static unsigned char courier8_133_bits[] = {
+0x00};
+static unsigned char courier8_134_bits[] = {
+0x00};
+static unsigned char courier8_135_bits[] = {
+0x00};
+static unsigned char courier8_136_bits[] = {
+0x00};
+static unsigned char courier8_137_bits[] = {
+0x00};
+static unsigned char courier8_138_bits[] = {
+0x00};
+static unsigned char courier8_139_bits[] = {
+0x00};
+static unsigned char courier8_140_bits[] = {
+0x00};
+static unsigned char courier8_141_bits[] = {
+0x00};
+static unsigned char courier8_142_bits[] = {
+0x00};
+static unsigned char courier8_143_bits[] = {
+0x00};
+static unsigned char courier8_144_bits[] = {
+0x00};
+static unsigned char courier8_145_bits[] = {
+0x00};
+static unsigned char courier8_146_bits[] = {
+0x00};
+static unsigned char courier8_147_bits[] = {
+0x00};
+static unsigned char courier8_148_bits[] = {
+0x00};
+static unsigned char courier8_149_bits[] = {
+0x00};
+static unsigned char courier8_150_bits[] = {
+0x00};
+static unsigned char courier8_151_bits[] = {
+0x00};
+static unsigned char courier8_152_bits[] = {
+0x00};
+static unsigned char courier8_153_bits[] = {
+0x00};
+static unsigned char courier8_154_bits[] = {
+0x00};
+static unsigned char courier8_155_bits[] = {
+0x00};
+static unsigned char courier8_156_bits[] = {
+0x00};
+static unsigned char courier8_157_bits[] = {
+0x00};
+static unsigned char courier8_158_bits[] = {
+0x00};
+static unsigned char courier8_159_bits[] = {
+0x00};
+static unsigned char courier8_160_bits[] = {
+0x00};
+static unsigned char courier8_161_bits[] = {
+0x01, 0x01, 0x01, 0x01};
+static unsigned char courier8_162_bits[] = {
+0x02, 0x07, 0x03, 0x0f, 0x02};
+static unsigned char courier8_163_bits[] = {
+0x06, 0x01, 0x07, 0x01, 0x07};
+static unsigned char courier8_164_bits[] = {
+0x07, 0x05, 0x03, 0x0d};
+static unsigned char courier8_165_bits[] = {
+0x1f, 0x0a, 0x0e, 0x0e, 0x0e};
+static unsigned char courier8_166_bits[] = {
+0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01};
+static unsigned char courier8_167_bits[] = {
+0x07, 0x03, 0x07, 0x04, 0x07};
+static unsigned char courier8_168_bits[] = {
+0x03};
+static unsigned char courier8_169_bits[] = {
+0x0e, 0x17, 0x11, 0x0e};
+static unsigned char courier8_170_bits[] = {
+0x03, 0x07};
+static unsigned char courier8_171_bits[] = {
+0x06, 0x03, 0x03};
+static unsigned char courier8_172_bits[] = {
+0x07, 0x04};
+static unsigned char courier8_173_bits[] = {
+0x03};
+static unsigned char courier8_174_bits[] = {
+0x1e, 0x1f, 0x1f, 0x0e};
+static unsigned char courier8_175_bits[] = {
+0x07};
+static unsigned char courier8_176_bits[] = {
+0x07, 0x05, 0x02};
+static unsigned char courier8_177_bits[] = {
+0x07, 0x02, 0x02, 0x07};
+static unsigned char courier8_178_bits[] = {
+0x07, 0x04, 0x07};
+static unsigned char courier8_179_bits[] = {
+0x03, 0x02, 0x07};
+static unsigned char courier8_180_bits[] = {
+0x01};
+static unsigned char courier8_181_bits[] = {
+0x0b, 0x0a, 0x0e, 0x02};
+static unsigned char courier8_182_bits[] = {
+0x07, 0x07, 0x06, 0x06, 0x06};
+static unsigned char courier8_183_bits[] = {
+0x01};
+static unsigned char courier8_184_bits[] = {
+0x01, 0x01};
+static unsigned char courier8_185_bits[] = {
+0x03, 0x02, 0x03};
+static unsigned char courier8_186_bits[] = {
+0x07, 0x07};
+static unsigned char courier8_187_bits[] = {
+0x03, 0x06, 0x06};
+static unsigned char courier8_188_bits[] = {
+0x13, 0x0a, 0x1b, 0x1c, 0x1a, 0x1a};
+static unsigned char courier8_189_bits[] = {
+0x13, 0x0a, 0x1f, 0x14, 0x12, 0x19};
+static unsigned char courier8_190_bits[] = {
+0x13, 0x0a, 0x0b, 0x1c, 0x1a, 0x1a};
+static unsigned char courier8_191_bits[] = {
+0x02, 0x02, 0x01, 0x07};
+static unsigned char courier8_192_bits[] = {
+0x08, 0x00, 0x0e, 0x0a, 0x0e, 0x1b};
+static unsigned char courier8_193_bits[] = {
+0x02, 0x00, 0x0e, 0x0a, 0x0e, 0x1b};
+static unsigned char courier8_194_bits[] = {
+0x06, 0x00, 0x0e, 0x0a, 0x0e, 0x1b};
+static unsigned char courier8_195_bits[] = {
+0x0c, 0x00, 0x0e, 0x0a, 0x0e, 0x1b};
+static unsigned char courier8_196_bits[] = {
+0x06, 0x00, 0x0e, 0x0a, 0x0e, 0x1b};
+static unsigned char courier8_197_bits[] = {
+0x04, 0x06, 0x00, 0x0e, 0x0a, 0x0e, 0x1b};
+static unsigned char courier8_198_bits[] = {
+0x1e, 0x0c, 0x1e, 0x1f};
+static unsigned char courier8_199_bits[] = {
+0x1e, 0x01, 0x01, 0x0e, 0x0c};
+static unsigned char courier8_200_bits[] = {
+0x08, 0x00, 0x1f, 0x0e, 0x02, 0x1f};
+static unsigned char courier8_201_bits[] = {
+0x02, 0x00, 0x1f, 0x0e, 0x02, 0x1f};
+static unsigned char courier8_202_bits[] = {
+0x06, 0x00, 0x1f, 0x0e, 0x02, 0x1f};
+static unsigned char courier8_203_bits[] = {
+0x06, 0x00, 0x1f, 0x0e, 0x02, 0x1f};
+static unsigned char courier8_204_bits[] = {
+0x04, 0x00, 0x07, 0x02, 0x02, 0x07};
+static unsigned char courier8_205_bits[] = {
+0x01, 0x00, 0x07, 0x02, 0x02, 0x07};
+static unsigned char courier8_206_bits[] = {
+0x03, 0x00, 0x07, 0x02, 0x02, 0x07};
+static unsigned char courier8_207_bits[] = {
+0x03, 0x00, 0x07, 0x02, 0x02, 0x07};
+static unsigned char courier8_208_bits[] = {
+0x1f, 0x17, 0x12, 0x0f};
+static unsigned char courier8_209_bits[] = {
+0x0c, 0x00, 0x1b, 0x16, 0x16, 0x1b};
+static unsigned char courier8_210_bits[] = {
+0x08, 0x00, 0x0e, 0x11, 0x11, 0x0e};
+static unsigned char courier8_211_bits[] = {
+0x02, 0x00, 0x0e, 0x11, 0x11, 0x0e};
+static unsigned char courier8_212_bits[] = {
+0x06, 0x00, 0x0e, 0x11, 0x11, 0x0e};
+static unsigned char courier8_213_bits[] = {
+0x0c, 0x00, 0x0e, 0x11, 0x11, 0x0e};
+static unsigned char courier8_214_bits[] = {
+0x06, 0x00, 0x0e, 0x11, 0x11, 0x0e};
+static unsigned char courier8_215_bits[] = {
+0x05, 0x06, 0x05};
+static unsigned char courier8_216_bits[] = {
+0x1e, 0x15, 0x15, 0x0f};
+static unsigned char courier8_217_bits[] = {
+0x08, 0x00, 0x1b, 0x09, 0x09, 0x0f};
+static unsigned char courier8_218_bits[] = {
+0x02, 0x00, 0x1b, 0x09, 0x09, 0x0f};
+static unsigned char courier8_219_bits[] = {
+0x06, 0x00, 0x1b, 0x09, 0x09, 0x0f};
+static unsigned char courier8_220_bits[] = {
+0x06, 0x00, 0x1b, 0x09, 0x09, 0x0f};
+static unsigned char courier8_221_bits[] = {
+0x02, 0x00, 0x1f, 0x0a, 0x04, 0x0e};
+static unsigned char courier8_222_bits[] = {
+0x07, 0x09, 0x07, 0x03};
+static unsigned char courier8_223_bits[] = {
+0x07, 0x05, 0x07, 0x05, 0x07};
+static unsigned char courier8_224_bits[] = {
+0x08, 0x00, 0x0e, 0x09, 0x17};
+static unsigned char courier8_225_bits[] = {
+0x02, 0x00, 0x0e, 0x09, 0x17};
+static unsigned char courier8_226_bits[] = {
+0x06, 0x00, 0x0e, 0x09, 0x17};
+static unsigned char courier8_227_bits[] = {
+0x0c, 0x00, 0x0e, 0x09, 0x17};
+static unsigned char courier8_228_bits[] = {
+0x06, 0x00, 0x0e, 0x09, 0x17};
+static unsigned char courier8_229_bits[] = {
+0x06, 0x00, 0x0e, 0x09, 0x17};
+static unsigned char courier8_230_bits[] = {
+0x0e, 0x1f, 0x1f};
+static unsigned char courier8_231_bits[] = {
+0x1e, 0x01, 0x0e, 0x04};
+static unsigned char courier8_232_bits[] = {
+0x08, 0x00, 0x0e, 0x15, 0x1e};
+static unsigned char courier8_233_bits[] = {
+0x02, 0x00, 0x0e, 0x15, 0x1e};
+static unsigned char courier8_234_bits[] = {
+0x06, 0x00, 0x0e, 0x15, 0x1e};
+static unsigned char courier8_235_bits[] = {
+0x06, 0x00, 0x0e, 0x15, 0x1e};
+static unsigned char courier8_236_bits[] = {
+0x04, 0x00, 0x03, 0x02, 0x07};
+static unsigned char courier8_237_bits[] = {
+0x01, 0x00, 0x03, 0x02, 0x07};
+static unsigned char courier8_238_bits[] = {
+0x03, 0x00, 0x03, 0x02, 0x07};
+static unsigned char courier8_239_bits[] = {
+0x03, 0x00, 0x03, 0x02, 0x07};
+static unsigned char courier8_240_bits[] = {
+0x04, 0x04, 0x08, 0x1f, 0x11, 0x0e};
+static unsigned char courier8_241_bits[] = {
+0x0c, 0x00, 0x0f, 0x0a, 0x1b};
+static unsigned char courier8_242_bits[] = {
+0x08, 0x00, 0x0e, 0x11, 0x0e};
+static unsigned char courier8_243_bits[] = {
+0x02, 0x00, 0x0e, 0x11, 0x0e};
+static unsigned char courier8_244_bits[] = {
+0x06, 0x00, 0x0e, 0x11, 0x0e};
+static unsigned char courier8_245_bits[] = {
+0x0c, 0x00, 0x0e, 0x11, 0x0e};
+static unsigned char courier8_246_bits[] = {
+0x06, 0x00, 0x0e, 0x11, 0x0e};
+static unsigned char courier8_247_bits[] = {
+0x01, 0x00, 0x00, 0x01};
+static unsigned char courier8_248_bits[] = {
+0x1e, 0x17, 0x0d};
+static unsigned char courier8_249_bits[] = {
+0x08, 0x00, 0x0b, 0x0a, 0x0e};
+static unsigned char courier8_250_bits[] = {
+0x02, 0x00, 0x0b, 0x0a, 0x0e};
+static unsigned char courier8_251_bits[] = {
+0x06, 0x00, 0x0b, 0x0a, 0x0e};
+static unsigned char courier8_252_bits[] = {
+0x06, 0x00, 0x0b, 0x0a, 0x0e};
+static unsigned char courier8_253_bits[] = {
+0x02, 0x00, 0x0b, 0x0a, 0x04, 0x04, 0x07};
+static unsigned char courier8_254_bits[] = {
+0x03, 0x02, 0x0e, 0x12, 0x0e, 0x02, 0x03};
+static unsigned char courier8_255_bits[] = {
+0x06, 0x00, 0x0b, 0x0a, 0x04, 0x04, 0x07};
+static RotFont courier8font[] = {
+{5, 1, 1, courier8_0_bits},
+{5, 1, 1, courier8_1_bits},
+{5, 1, 1, courier8_2_bits},
+{5, 1, 1, courier8_3_bits},
+{5, 1, 1, courier8_4_bits},
+{5, 1, 1, courier8_5_bits},
+{5, 1, 1, courier8_6_bits},
+{5, 1, 1, courier8_7_bits},
+{5, 1, 1, courier8_8_bits},
+{5, 1, 1, courier8_9_bits},
+{5, 1, 1, courier8_10_bits},
+{5, 1, 1, courier8_11_bits},
+{5, 1, 1, courier8_12_bits},
+{5, 1, 1, courier8_13_bits},
+{5, 1, 1, courier8_14_bits},
+{5, 1, 1, courier8_15_bits},
+{5, 1, 1, courier8_16_bits},
+{5, 1, 1, courier8_17_bits},
+{5, 1, 1, courier8_18_bits},
+{5, 1, 1, courier8_19_bits},
+{5, 1, 1, courier8_20_bits},
+{5, 1, 1, courier8_21_bits},
+{5, 1, 1, courier8_22_bits},
+{5, 1, 1, courier8_23_bits},
+{5, 1, 1, courier8_24_bits},
+{5, 1, 1, courier8_25_bits},
+{5, 1, 1, courier8_26_bits},
+{5, 1, 1, courier8_27_bits},
+{5, 1, 1, courier8_28_bits},
+{5, 1, 1, courier8_29_bits},
+{5, 1, 1, courier8_30_bits},
+{5, 1, 1, courier8_31_bits},
+{5, 1, 1, courier8_32_bits},
+{1, 4, 4, courier8_33_bits},
+{3, 2, 4, courier8_34_bits},
+{3, 5, 5, courier8_35_bits},
+{3, 6, 5, courier8_36_bits},
+{5, 5, 5, courier8_37_bits},
+{3, 5, 5, courier8_38_bits},
+{1, 2, 4, courier8_39_bits},
+{2, 6, 5, courier8_40_bits},
+{2, 6, 5, courier8_41_bits},
+{3, 3, 4, courier8_42_bits},
+{3, 3, 4, courier8_43_bits},
+{1, 2, 1, courier8_44_bits},
+{4, 1, 3, courier8_45_bits},
+{1, 1, 1, courier8_46_bits},
+{3, 7, 6, courier8_47_bits},
+{3, 5, 5, courier8_48_bits},
+{3, 5, 5, courier8_49_bits},
+{4, 5, 5, courier8_50_bits},
+{3, 5, 5, courier8_51_bits},
+{4, 5, 5, courier8_52_bits},
+{3, 5, 5, courier8_53_bits},
+{3, 5, 5, courier8_54_bits},
+{4, 5, 5, courier8_55_bits},
+{3, 5, 5, courier8_56_bits},
+{4, 5, 5, courier8_57_bits},
+{1, 3, 3, courier8_58_bits},
+{2, 4, 3, courier8_59_bits},
+{4, 3, 4, courier8_60_bits},
+{4, 3, 4, courier8_61_bits},
+{4, 3, 4, courier8_62_bits},
+{3, 4, 4, courier8_63_bits},
+{5, 5, 5, courier8_64_bits},
+{5, 4, 4, courier8_65_bits},
+{5, 4, 4, courier8_66_bits},
+{5, 4, 4, courier8_67_bits},
+{5, 4, 4, courier8_68_bits},
+{5, 4, 4, courier8_69_bits},
+{4, 4, 4, courier8_70_bits},
+{5, 4, 4, courier8_71_bits},
+{4, 4, 4, courier8_72_bits},
+{3, 4, 4, courier8_73_bits},
+{5, 4, 4, courier8_74_bits},
+{5, 4, 4, courier8_75_bits},
+{5, 4, 4, courier8_76_bits},
+{6, 4, 4, courier8_77_bits},
+{5, 4, 4, courier8_78_bits},
+{5, 4, 4, courier8_79_bits},
+{4, 4, 4, courier8_80_bits},
+{5, 5, 4, courier8_81_bits},
+{5, 4, 4, courier8_82_bits},
+{4, 4, 4, courier8_83_bits},
+{5, 4, 4, courier8_84_bits},
+{5, 4, 4, courier8_85_bits},
+{5, 4, 4, courier8_86_bits},
+{5, 4, 4, courier8_87_bits},
+{5, 4, 4, courier8_88_bits},
+{5, 4, 4, courier8_89_bits},
+{4, 4, 4, courier8_90_bits},
+{2, 7, 6, courier8_91_bits},
+{3, 7, 6, courier8_92_bits},
+{2, 7, 6, courier8_93_bits},
+{4, 3, 4, courier8_94_bits},
+{6, 1, 0, courier8_95_bits},
+{1, 2, 4, courier8_96_bits},
+{5, 3, 3, courier8_97_bits},
+{5, 5, 5, courier8_98_bits},
+{5, 3, 3, courier8_99_bits},
+{5, 5, 5, courier8_100_bits},
+{5, 3, 3, courier8_101_bits},
+{3, 5, 5, courier8_102_bits},
+{4, 5, 3, courier8_103_bits},
+{5, 5, 5, courier8_104_bits},
+{3, 5, 5, courier8_105_bits},
+{2, 7, 5, courier8_106_bits},
+{5, 5, 5, courier8_107_bits},
+{3, 5, 5, courier8_108_bits},
+{5, 3, 3, courier8_109_bits},
+{5, 3, 3, courier8_110_bits},
+{5, 3, 3, courier8_111_bits},
+{5, 5, 3, courier8_112_bits},
+{5, 5, 3, courier8_113_bits},
+{3, 3, 3, courier8_114_bits},
+{5, 3, 3, courier8_115_bits},
+{3, 4, 4, courier8_116_bits},
+{4, 3, 3, courier8_117_bits},
+{5, 3, 3, courier8_118_bits},
+{5, 3, 3, courier8_119_bits},
+{5, 3, 3, courier8_120_bits},
+{4, 5, 3, courier8_121_bits},
+{3, 3, 3, courier8_122_bits},
+{2, 7, 6, courier8_123_bits},
+{1, 7, 5, courier8_124_bits},
+{2, 7, 6, courier8_125_bits},
+{3, 1, 3, courier8_126_bits},
+{5, 1, 1, courier8_127_bits},
+{5, 1, 1, courier8_128_bits},
+{5, 1, 1, courier8_129_bits},
+{5, 1, 1, courier8_130_bits},
+{5, 1, 1, courier8_131_bits},
+{5, 1, 1, courier8_132_bits},
+{5, 1, 1, courier8_133_bits},
+{5, 1, 1, courier8_134_bits},
+{5, 1, 1, courier8_135_bits},
+{5, 1, 1, courier8_136_bits},
+{5, 1, 1, courier8_137_bits},
+{5, 1, 1, courier8_138_bits},
+{5, 1, 1, courier8_139_bits},
+{5, 1, 1, courier8_140_bits},
+{5, 1, 1, courier8_141_bits},
+{5, 1, 1, courier8_142_bits},
+{5, 1, 1, courier8_143_bits},
+{5, 1, 1, courier8_144_bits},
+{5, 1, 1, courier8_145_bits},
+{5, 1, 1, courier8_146_bits},
+{5, 1, 1, courier8_147_bits},
+{5, 1, 1, courier8_148_bits},
+{5, 1, 1, courier8_149_bits},
+{5, 1, 1, courier8_150_bits},
+{5, 1, 1, courier8_151_bits},
+{5, 1, 1, courier8_152_bits},
+{5, 1, 1, courier8_153_bits},
+{5, 1, 1, courier8_154_bits},
+{5, 1, 1, courier8_155_bits},
+{5, 1, 1, courier8_156_bits},
+{5, 1, 1, courier8_157_bits},
+{5, 1, 1, courier8_158_bits},
+{5, 1, 1, courier8_159_bits},
+{5, 1, 1, courier8_160_bits},
+{1, 4, 3, courier8_161_bits},
+{4, 5, 5, courier8_162_bits},
+{3, 5, 5, courier8_163_bits},
+{4, 4, 4, courier8_164_bits},
+{5, 5, 5, courier8_165_bits},
+{1, 7, 5, courier8_166_bits},
+{3, 5, 4, courier8_167_bits},
+{2, 1, 5, courier8_168_bits},
+{5, 4, 4, courier8_169_bits},
+{3, 2, 4, courier8_170_bits},
+{3, 3, 3, courier8_171_bits},
+{3, 2, 3, courier8_172_bits},
+{2, 1, 3, courier8_173_bits},
+{5, 4, 4, courier8_174_bits},
+{3, 1, 5, courier8_175_bits},
+{3, 3, 5, courier8_176_bits},
+{3, 4, 4, courier8_177_bits},
+{3, 3, 5, courier8_178_bits},
+{3, 3, 5, courier8_179_bits},
+{2, 1, 5, courier8_180_bits},
+{4, 4, 3, courier8_181_bits},
+{3, 5, 4, courier8_182_bits},
+{1, 1, 3, courier8_183_bits},
+{1, 2, 1, courier8_184_bits},
+{2, 3, 5, courier8_185_bits},
+{3, 2, 4, courier8_186_bits},
+{3, 3, 3, courier8_187_bits},
+{5, 6, 5, courier8_188_bits},
+{5, 6, 5, courier8_189_bits},
+{5, 6, 5, courier8_190_bits},
+{3, 4, 3, courier8_191_bits},
+{5, 6, 6, courier8_192_bits},
+{5, 6, 6, courier8_193_bits},
+{5, 6, 6, courier8_194_bits},
+{5, 6, 6, courier8_195_bits},
+{5, 6, 6, courier8_196_bits},
+{5, 7, 7, courier8_197_bits},
+{5, 4, 4, courier8_198_bits},
+{5, 5, 4, courier8_199_bits},
+{5, 6, 6, courier8_200_bits},
+{5, 6, 6, courier8_201_bits},
+{5, 6, 6, courier8_202_bits},
+{5, 6, 6, courier8_203_bits},
+{3, 6, 6, courier8_204_bits},
+{3, 6, 6, courier8_205_bits},
+{3, 6, 6, courier8_206_bits},
+{3, 6, 6, courier8_207_bits},
+{5, 4, 4, courier8_208_bits},
+{5, 6, 6, courier8_209_bits},
+{5, 6, 6, courier8_210_bits},
+{5, 6, 6, courier8_211_bits},
+{5, 6, 6, courier8_212_bits},
+{5, 6, 6, courier8_213_bits},
+{5, 6, 6, courier8_214_bits},
+{3, 3, 4, courier8_215_bits},
+{5, 4, 4, courier8_216_bits},
+{5, 6, 6, courier8_217_bits},
+{5, 6, 6, courier8_218_bits},
+{5, 6, 6, courier8_219_bits},
+{5, 6, 6, courier8_220_bits},
+{5, 6, 6, courier8_221_bits},
+{4, 4, 4, courier8_222_bits},
+{3, 5, 5, courier8_223_bits},
+{5, 5, 5, courier8_224_bits},
+{5, 5, 5, courier8_225_bits},
+{5, 5, 5, courier8_226_bits},
+{5, 5, 5, courier8_227_bits},
+{5, 5, 5, courier8_228_bits},
+{5, 5, 5, courier8_229_bits},
+{5, 3, 3, courier8_230_bits},
+{5, 4, 3, courier8_231_bits},
+{5, 5, 5, courier8_232_bits},
+{5, 5, 5, courier8_233_bits},
+{5, 5, 5, courier8_234_bits},
+{5, 5, 5, courier8_235_bits},
+{3, 5, 5, courier8_236_bits},
+{3, 5, 5, courier8_237_bits},
+{3, 5, 5, courier8_238_bits},
+{3, 5, 5, courier8_239_bits},
+{5, 6, 6, courier8_240_bits},
+{5, 5, 5, courier8_241_bits},
+{5, 5, 5, courier8_242_bits},
+{5, 5, 5, courier8_243_bits},
+{5, 5, 5, courier8_244_bits},
+{5, 5, 5, courier8_245_bits},
+{5, 5, 5, courier8_246_bits},
+{1, 4, 4, courier8_247_bits},
+{5, 3, 3, courier8_248_bits},
+{4, 5, 5, courier8_249_bits},
+{4, 5, 5, courier8_250_bits},
+{4, 5, 5, courier8_251_bits},
+{4, 5, 5, courier8_252_bits},
+{4, 7, 5, courier8_253_bits},
+{5, 7, 5, courier8_254_bits},
+{4, 7, 5, courier8_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/fixed.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/fixed.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/fixed.h	(revision 15879)
@@ -0,0 +1,765 @@
+static unsigned char fixed_0_bits[] = {};
+static unsigned char fixed_1_bits[] = {
+0x4, 0xe, 0xe, 0x1f, 0xe, 0xe, 0x04};
+static unsigned char fixed_2_bits[] = {
+0x15, 0xa, 0x15, 0xa, 0x15, 0xa, 0x15};
+static unsigned char fixed_3_bits[] = {
+0x9, 0x9, 0xf, 0x9, 0x9, 0x1e, 0x8, 0x8, 0x08};
+static unsigned char fixed_4_bits[] = {
+0x7, 0x1, 0x3, 0x1, 0x1d, 0x4, 0xc, 0x4, 0x04};
+static unsigned char fixed_5_bits[] = {
+0xe, 0x1, 0x1, 0xe, 0xe, 0x12, 0xe, 0x12, 0x12};
+static unsigned char fixed_6_bits[] = {
+0x1, 0x1, 0x1, 0xf, 0x1e, 0x2, 0xe, 0x2, 0x02};
+static unsigned char fixed_7_bits[] = {
+0x2, 0x5, 0x02};
+static unsigned char fixed_8_bits[] = {
+0x4, 0x4, 0x1f, 0x4, 0x4, 0x1f};
+static unsigned char fixed_9_bits[] = {
+0x9, 0xb, 0xb, 0xd, 0x9, 0x2, 0x2, 0x2, 0x1e};
+static unsigned char fixed_10_bits[] = {
+0x9, 0x9, 0x6, 0x2, 0x1e, 0x8, 0x8, 0x8, 0x08};
+static unsigned char fixed_11_bits[] = {
+0x8, 0x8, 0x8, 0x8, 0x0f};
+static unsigned char fixed_12_bits[] = {
+0xf, 0x8, 0x8, 0x8, 0x8, 0x08};
+static unsigned char fixed_13_bits[] = {
+0x7, 0x1, 0x1, 0x1, 0x1, 0x01};
+static unsigned char fixed_14_bits[] = {
+0x1, 0x1, 0x1, 0x1, 0x07};
+static unsigned char fixed_15_bits[] = {
+0x8, 0x8, 0x8, 0x8, 0x3f, 0x8, 0x8, 0x8, 0x8, 0x08};
+static unsigned char fixed_16_bits[] = {
+0x3f};
+static unsigned char fixed_17_bits[] = {
+0x3f};
+static unsigned char fixed_18_bits[] = {
+0x3f};
+static unsigned char fixed_19_bits[] = {
+0x3f};
+static unsigned char fixed_20_bits[] = {
+0x3f};
+static unsigned char fixed_21_bits[] = {
+0x1, 0x1, 0x1, 0x1, 0x7, 0x1, 0x1, 0x1, 0x1, 0x01};
+static unsigned char fixed_22_bits[] = {
+0x8, 0x8, 0x8, 0x8, 0xf, 0x8, 0x8, 0x8, 0x8, 0x08};
+static unsigned char fixed_23_bits[] = {
+0x8, 0x8, 0x8, 0x8, 0x3f};
+static unsigned char fixed_24_bits[] = {
+0x3f, 0x8, 0x8, 0x8, 0x8, 0x08};
+static unsigned char fixed_25_bits[] = {
+0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x01};
+static unsigned char fixed_26_bits[] = {
+0x10, 0x8, 0x2, 0x1, 0x2, 0x8, 0x10, 0x1f};
+static unsigned char fixed_27_bits[] = {
+0x1, 0x2, 0x8, 0x10, 0x8, 0x2, 0x1, 0x1f};
+static unsigned char fixed_28_bits[] = {
+0x1f, 0xa, 0xa, 0xa, 0x0a};
+static unsigned char fixed_29_bits[] = {
+0x10, 0x8, 0x1f, 0x4, 0x1f, 0x2, 0x01};
+static unsigned char fixed_30_bits[] = {
+0xc, 0x12, 0x2, 0x7, 0x2, 0x12, 0x0d};
+static unsigned char fixed_31_bits[] = {
+0x01};
+static unsigned char fixed_32_bits[] = {};
+static unsigned char fixed_33_bits[] = {
+0x1, 0x1, 0x1, 0x1, 0x1, 0x0, 0x01};
+static unsigned char fixed_34_bits[] = {
+0x5, 0x5, 0x05};
+static unsigned char fixed_35_bits[] = {
+0xa, 0xa, 0x1f, 0xa, 0x1f, 0xa, 0x0a};
+static unsigned char fixed_36_bits[] = {
+0x4, 0xe, 0x5, 0xe, 0x14, 0xe, 0x04};
+static unsigned char fixed_37_bits[] = {
+0x12, 0x15, 0xa, 0x4, 0xa, 0x15, 0x09};
+static unsigned char fixed_38_bits[] = {
+0x2, 0x5, 0x5, 0x2, 0x15, 0x9, 0x16};
+static unsigned char fixed_39_bits[] = {
+0x6, 0x2, 0x01};
+static unsigned char fixed_40_bits[] = {
+0x4, 0x2, 0x1, 0x1, 0x1, 0x2, 0x04};
+static unsigned char fixed_41_bits[] = {
+0x1, 0x2, 0x4, 0x4, 0x4, 0x2, 0x01};
+static unsigned char fixed_42_bits[] = {
+0x11, 0xa, 0x1f, 0xa, 0x11};
+static unsigned char fixed_43_bits[] = {
+0x4, 0x4, 0x1f, 0x4, 0x04};
+static unsigned char fixed_44_bits[] = {
+0x6, 0x2, 0x01};
+static unsigned char fixed_45_bits[] = {
+0x1f};
+static unsigned char fixed_46_bits[] = {
+0x2, 0x7, 0x02};
+static unsigned char fixed_47_bits[] = {
+0x10, 0x10, 0x8, 0x4, 0x2, 0x1, 0x01};
+static unsigned char fixed_48_bits[] = {
+0x4, 0xa, 0x11, 0x11, 0x11, 0xa, 0x04};
+static unsigned char fixed_49_bits[] = {
+0x4, 0x6, 0x5, 0x4, 0x4, 0x4, 0x1f};
+static unsigned char fixed_50_bits[] = {
+0xe, 0x11, 0x10, 0xc, 0x2, 0x1, 0x1f};
+static unsigned char fixed_51_bits[] = {
+0x1f, 0x10, 0x8, 0xc, 0x10, 0x11, 0x0e};
+static unsigned char fixed_52_bits[] = {
+0x8, 0xc, 0xa, 0x9, 0x1f, 0x8, 0x08};
+static unsigned char fixed_53_bits[] = {
+0x1f, 0x1, 0xd, 0x13, 0x10, 0x11, 0x0e};
+static unsigned char fixed_54_bits[] = {
+0xc, 0x2, 0x1, 0xd, 0x13, 0x11, 0x0e};
+static unsigned char fixed_55_bits[] = {
+0x1f, 0x10, 0x8, 0x8, 0x4, 0x2, 0x02};
+static unsigned char fixed_56_bits[] = {
+0xe, 0x11, 0x11, 0xe, 0x11, 0x11, 0x0e};
+static unsigned char fixed_57_bits[] = {
+0xe, 0x11, 0x19, 0x16, 0x10, 0x8, 0x06};
+static unsigned char fixed_58_bits[] = {
+0x2, 0x7, 0x2, 0x0, 0x2, 0x7, 0x02};
+static unsigned char fixed_59_bits[] = {
+0x2, 0x7, 0x2, 0x0, 0x6, 0x2, 0x01};
+static unsigned char fixed_60_bits[] = {
+0x8, 0x4, 0x2, 0x1, 0x2, 0x4, 0x08};
+static unsigned char fixed_61_bits[] = {
+0x1f, 0x0, 0x1f};
+static unsigned char fixed_62_bits[] = {
+0x1, 0x2, 0x4, 0x8, 0x4, 0x2, 0x01};
+static unsigned char fixed_63_bits[] = {
+0xe, 0x11, 0x8, 0x4, 0x4, 0x0, 0x04};
+static unsigned char fixed_64_bits[] = {
+0xe, 0x11, 0x19, 0x15, 0xd, 0x1, 0x0e};
+static unsigned char fixed_65_bits[] = {
+0x4, 0xa, 0x11, 0x11, 0x1f, 0x11, 0x11};
+static unsigned char fixed_66_bits[] = {
+0xf, 0x12, 0x12, 0xe, 0x12, 0x12, 0x0f};
+static unsigned char fixed_67_bits[] = {
+0xe, 0x11, 0x1, 0x1, 0x1, 0x11, 0x0e};
+static unsigned char fixed_68_bits[] = {
+0xf, 0x12, 0x12, 0x12, 0x12, 0x12, 0x0f};
+static unsigned char fixed_69_bits[] = {
+0x1f, 0x1, 0x1, 0xf, 0x1, 0x1, 0x1f};
+static unsigned char fixed_70_bits[] = {
+0x1f, 0x1, 0x1, 0xf, 0x1, 0x1, 0x01};
+static unsigned char fixed_71_bits[] = {
+0xe, 0x11, 0x1, 0x1, 0x19, 0x11, 0x0e};
+static unsigned char fixed_72_bits[] = {
+0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11};
+static unsigned char fixed_73_bits[] = {
+0x7, 0x2, 0x2, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_74_bits[] = {
+0x1c, 0x10, 0x10, 0x10, 0x10, 0x11, 0x0e};
+static unsigned char fixed_75_bits[] = {
+0x11, 0x9, 0x5, 0x3, 0x5, 0x9, 0x11};
+static unsigned char fixed_76_bits[] = {
+0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1f};
+static unsigned char fixed_77_bits[] = {
+0x11, 0x11, 0x1b, 0x15, 0x11, 0x11, 0x11};
+static unsigned char fixed_78_bits[] = {
+0x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11};
+static unsigned char fixed_79_bits[] = {
+0xe, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_80_bits[] = {
+0xf, 0x11, 0x11, 0xf, 0x1, 0x1, 0x01};
+static unsigned char fixed_81_bits[] = {
+0xe, 0x11, 0x11, 0x11, 0x11, 0x15, 0xe, 0x10};
+static unsigned char fixed_82_bits[] = {
+0xf, 0x11, 0x11, 0xf, 0x5, 0x9, 0x11};
+static unsigned char fixed_83_bits[] = {
+0xe, 0x11, 0x1, 0xe, 0x10, 0x11, 0x0e};
+static unsigned char fixed_84_bits[] = {
+0x1f, 0x4, 0x4, 0x4, 0x4, 0x4, 0x04};
+static unsigned char fixed_85_bits[] = {
+0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_86_bits[] = {
+0x11, 0x11, 0x11, 0xa, 0xa, 0xa, 0x04};
+static unsigned char fixed_87_bits[] = {
+0x11, 0x11, 0x11, 0x15, 0x15, 0x1b, 0x11};
+static unsigned char fixed_88_bits[] = {
+0x11, 0x11, 0xa, 0x4, 0xa, 0x11, 0x11};
+static unsigned char fixed_89_bits[] = {
+0x11, 0x11, 0xa, 0x4, 0x4, 0x4, 0x04};
+static unsigned char fixed_90_bits[] = {
+0x1f, 0x10, 0x8, 0x4, 0x2, 0x1, 0x1f};
+static unsigned char fixed_91_bits[] = {
+0x7, 0x1, 0x1, 0x1, 0x1, 0x1, 0x07};
+static unsigned char fixed_92_bits[] = {
+0x1, 0x1, 0x2, 0x4, 0x8, 0x10, 0x10};
+static unsigned char fixed_93_bits[] = {
+0x7, 0x4, 0x4, 0x4, 0x4, 0x4, 0x07};
+static unsigned char fixed_94_bits[] = {
+0x4, 0xa, 0x11};
+static unsigned char fixed_95_bits[] = {
+0x1f};
+static unsigned char fixed_96_bits[] = {
+0x3, 0x2, 0x04};
+static unsigned char fixed_97_bits[] = {
+0xe, 0x10, 0x1e, 0x11, 0x1e};
+static unsigned char fixed_98_bits[] = {
+0x1, 0x1, 0xd, 0x13, 0x11, 0x13, 0x0d};
+static unsigned char fixed_99_bits[] = {
+0xe, 0x11, 0x1, 0x11, 0x0e};
+static unsigned char fixed_100_bits[] = {
+0x10, 0x10, 0x16, 0x19, 0x11, 0x19, 0x16};
+static unsigned char fixed_101_bits[] = {
+0xe, 0x11, 0x1f, 0x1, 0x0e};
+static unsigned char fixed_102_bits[] = {
+0xc, 0x12, 0x2, 0xf, 0x2, 0x2, 0x02};
+static unsigned char fixed_103_bits[] = {
+0x16, 0x9, 0x6, 0x1, 0xe, 0x11, 0x0e};
+static unsigned char fixed_104_bits[] = {
+0x1, 0x1, 0xd, 0x13, 0x11, 0x11, 0x11};
+static unsigned char fixed_105_bits[] = {
+0x2, 0x0, 0x3, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_106_bits[] = {
+0x8, 0x0, 0xc, 0x8, 0x8, 0x8, 0x9, 0x9, 0x06};
+static unsigned char fixed_107_bits[] = {
+0x1, 0x1, 0x11, 0x9, 0x7, 0x9, 0x11};
+static unsigned char fixed_108_bits[] = {
+0x3, 0x2, 0x2, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_109_bits[] = {
+0xb, 0x15, 0x15, 0x15, 0x11};
+static unsigned char fixed_110_bits[] = {
+0xd, 0x13, 0x11, 0x11, 0x11};
+static unsigned char fixed_111_bits[] = {
+0xe, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_112_bits[] = {
+0xd, 0x13, 0x13, 0xd, 0x1, 0x1, 0x01};
+static unsigned char fixed_113_bits[] = {
+0x16, 0x19, 0x19, 0x16, 0x10, 0x10, 0x10};
+static unsigned char fixed_114_bits[] = {
+0xd, 0x13, 0x1, 0x1, 0x01};
+static unsigned char fixed_115_bits[] = {
+0xe, 0x1, 0xe, 0x10, 0x0f};
+static unsigned char fixed_116_bits[] = {
+0x2, 0x2, 0xf, 0x2, 0x2, 0x12, 0x0c};
+static unsigned char fixed_117_bits[] = {
+0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char fixed_118_bits[] = {
+0x11, 0x11, 0xa, 0xa, 0x04};
+static unsigned char fixed_119_bits[] = {
+0x11, 0x11, 0x15, 0x15, 0x0a};
+static unsigned char fixed_120_bits[] = {
+0x11, 0xa, 0x4, 0xa, 0x11};
+static unsigned char fixed_121_bits[] = {
+0x11, 0x11, 0x19, 0x16, 0x10, 0x11, 0x0e};
+static unsigned char fixed_122_bits[] = {
+0x1f, 0x8, 0x4, 0x2, 0x1f};
+static unsigned char fixed_123_bits[] = {
+0xc, 0x2, 0x4, 0x3, 0x4, 0x2, 0x0c};
+static unsigned char fixed_124_bits[] = {
+0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x01};
+static unsigned char fixed_125_bits[] = {
+0x3, 0x4, 0x2, 0xc, 0x2, 0x4, 0x03};
+static unsigned char fixed_126_bits[] = {
+0x12, 0x15, 0x09};
+static unsigned char fixed_127_bits[] = {};
+static unsigned char fixed_128_bits[] = {
+0x00};
+static unsigned char fixed_129_bits[] = {
+0x00};
+static unsigned char fixed_130_bits[] = {
+0x00};
+static unsigned char fixed_131_bits[] = {
+0x00};
+static unsigned char fixed_132_bits[] = {
+0x00};
+static unsigned char fixed_133_bits[] = {
+0x00};
+static unsigned char fixed_134_bits[] = {
+0x00};
+static unsigned char fixed_135_bits[] = {
+0x00};
+static unsigned char fixed_136_bits[] = {
+0x00};
+static unsigned char fixed_137_bits[] = {
+0x00};
+static unsigned char fixed_138_bits[] = {
+0x00};
+static unsigned char fixed_139_bits[] = {
+0x00};
+static unsigned char fixed_140_bits[] = {
+0x00};
+static unsigned char fixed_141_bits[] = {
+0x00};
+static unsigned char fixed_142_bits[] = {
+0x00};
+static unsigned char fixed_143_bits[] = {
+0x00};
+static unsigned char fixed_144_bits[] = {
+0x00};
+static unsigned char fixed_145_bits[] = {
+0x00};
+static unsigned char fixed_146_bits[] = {
+0x00};
+static unsigned char fixed_147_bits[] = {
+0x00};
+static unsigned char fixed_148_bits[] = {
+0x00};
+static unsigned char fixed_149_bits[] = {
+0x00};
+static unsigned char fixed_150_bits[] = {
+0x00};
+static unsigned char fixed_151_bits[] = {
+0x00};
+static unsigned char fixed_152_bits[] = {
+0x00};
+static unsigned char fixed_153_bits[] = {
+0x00};
+static unsigned char fixed_154_bits[] = {
+0x00};
+static unsigned char fixed_155_bits[] = {
+0x00};
+static unsigned char fixed_156_bits[] = {
+0x00};
+static unsigned char fixed_157_bits[] = {
+0x00};
+static unsigned char fixed_158_bits[] = {
+0x00};
+static unsigned char fixed_159_bits[] = {
+0x00};
+static unsigned char fixed_160_bits[] = {};
+static unsigned char fixed_161_bits[] = {
+0x1, 0x0, 0x1, 0x1, 0x1, 0x1, 0x01};
+static unsigned char fixed_162_bits[] = {
+0x4, 0x1e, 0x5, 0x5, 0x5, 0x1e, 0x04};
+static unsigned char fixed_163_bits[] = {
+0xc, 0x12, 0x2, 0x7, 0x2, 0x12, 0x0d};
+static unsigned char fixed_164_bits[] = {
+0x11, 0xe, 0xa, 0xe, 0x11};
+static unsigned char fixed_165_bits[] = {
+0x11, 0x11, 0xa, 0x4, 0x1f, 0x4, 0x4, 0x04};
+static unsigned char fixed_166_bits[] = {
+0x1, 0x1, 0x1, 0x0, 0x1, 0x1, 0x01};
+static unsigned char fixed_167_bits[] = {
+0xe, 0x1, 0x7, 0x9, 0x12, 0x1c, 0x10, 0x0e};
+static unsigned char fixed_168_bits[] = {
+0x05};
+static unsigned char fixed_169_bits[] = {
+0xe, 0x11, 0x15, 0x13, 0x15, 0x11, 0x0e};
+static unsigned char fixed_170_bits[] = {
+0xe, 0x9, 0xd, 0xa, 0x0, 0x0f};
+static unsigned char fixed_171_bits[] = {
+0x24, 0x12, 0x9, 0x12, 0x24};
+static unsigned char fixed_172_bits[] = {
+0xf, 0x08};
+static unsigned char fixed_173_bits[] = {
+0x1f};
+static unsigned char fixed_174_bits[] = {
+0xe, 0x11, 0x17, 0x13, 0x13, 0x11, 0x0e};
+static unsigned char fixed_175_bits[] = {
+0x1f};
+static unsigned char fixed_176_bits[] = {
+0x2, 0x5, 0x02};
+static unsigned char fixed_177_bits[] = {
+0x4, 0x4, 0x1f, 0x4, 0x4, 0x1f};
+static unsigned char fixed_178_bits[] = {
+0x6, 0x9, 0x4, 0x2, 0x0f};
+static unsigned char fixed_179_bits[] = {
+0x7, 0x8, 0x6, 0x8, 0x07};
+static unsigned char fixed_180_bits[] = {
+0x6, 0x03};
+static unsigned char fixed_181_bits[] = {
+0x11, 0x11, 0x11, 0x13, 0xd, 0x01};
+static unsigned char fixed_182_bits[] = {
+0x1e, 0x17, 0x17, 0x16, 0x14, 0x14, 0x14};
+static unsigned char fixed_183_bits[] = {
+0x01};
+static unsigned char fixed_184_bits[] = {
+0x2, 0x01};
+static unsigned char fixed_185_bits[] = {
+0x2, 0x3, 0x2, 0x2, 0x07};
+static unsigned char fixed_186_bits[] = {
+0x6, 0x9, 0x9, 0x6, 0x0, 0x0f};
+static unsigned char fixed_187_bits[] = {
+0x9, 0x12, 0x24, 0x12, 0x09};
+static unsigned char fixed_188_bits[] = {
+0x2, 0x3, 0x2, 0x2, 0x27, 0x30, 0x28, 0x3c, 0x20};
+static unsigned char fixed_189_bits[] = {
+0x2, 0x3, 0x2, 0x2, 0x17, 0x28, 0x20, 0x10, 0x38};
+static unsigned char fixed_190_bits[] = {
+0x3, 0x4, 0x2, 0x4, 0x13, 0x18, 0x14, 0x1e, 0x10};
+static unsigned char fixed_191_bits[] = {
+0x4, 0x0, 0x4, 0x4, 0x2, 0x11, 0x0e};
+static unsigned char fixed_192_bits[] = {
+0x2, 0x4, 0xe, 0x11, 0x11, 0x1f, 0x11, 0x11};
+static unsigned char fixed_193_bits[] = {
+0x8, 0x4, 0xe, 0x11, 0x11, 0x1f, 0x11, 0x11};
+static unsigned char fixed_194_bits[] = {
+0x4, 0xa, 0xe, 0x11, 0x11, 0x1f, 0x11, 0x11};
+static unsigned char fixed_195_bits[] = {
+0x12, 0xd, 0xe, 0x11, 0x11, 0x1f, 0x11, 0x11};
+static unsigned char fixed_196_bits[] = {
+0xa, 0x0, 0xe, 0x11, 0x11, 0x1f, 0x11, 0x11};
+static unsigned char fixed_197_bits[] = {
+0x4, 0xa, 0xe, 0x11, 0x11, 0x1f, 0x11, 0x11};
+static unsigned char fixed_198_bits[] = {
+0x3c, 0xa, 0x9, 0x39, 0xf, 0x9, 0x39};
+static unsigned char fixed_199_bits[] = {
+0xe, 0x11, 0x1, 0x1, 0x1, 0x11, 0xe, 0x4, 0x02};
+static unsigned char fixed_200_bits[] = {
+0x2, 0x1f, 0x1, 0x1, 0xf, 0x1, 0x1, 0x1f};
+static unsigned char fixed_201_bits[] = {
+0x8, 0x1f, 0x1, 0x1, 0xf, 0x1, 0x1, 0x1f};
+static unsigned char fixed_202_bits[] = {
+0x4, 0x1f, 0x1, 0x1, 0xf, 0x1, 0x1, 0x1f};
+static unsigned char fixed_203_bits[] = {
+0xa, 0x1f, 0x1, 0x1, 0xf, 0x1, 0x1, 0x1f};
+static unsigned char fixed_204_bits[] = {
+0x1, 0x7, 0x2, 0x2, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_205_bits[] = {
+0x4, 0x7, 0x2, 0x2, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_206_bits[] = {
+0x2, 0x7, 0x2, 0x2, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_207_bits[] = {
+0x5, 0x7, 0x2, 0x2, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_208_bits[] = {
+0xf, 0x12, 0x12, 0x17, 0x12, 0x12, 0x0f};
+static unsigned char fixed_209_bits[] = {
+0xc, 0x11, 0x11, 0x13, 0x15, 0x19, 0x11, 0x11};
+static unsigned char fixed_210_bits[] = {
+0x2, 0xe, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_211_bits[] = {
+0x8, 0xe, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_212_bits[] = {
+0x4, 0xe, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_213_bits[] = {
+0xe, 0xe, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_214_bits[] = {
+0xa, 0xe, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_215_bits[] = {
+0x11, 0xa, 0x4, 0xa, 0x11};
+static unsigned char fixed_216_bits[] = {
+0xe, 0x19, 0x19, 0x15, 0x13, 0x13, 0x0e};
+static unsigned char fixed_217_bits[] = {
+0x2, 0x15, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_218_bits[] = {
+0x8, 0x15, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_219_bits[] = {
+0x4, 0x1b, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_220_bits[] = {
+0xa, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_221_bits[] = {
+0x8, 0x15, 0x11, 0xa, 0x4, 0x4, 0x4, 0x04};
+static unsigned char fixed_222_bits[] = {
+0x1, 0xf, 0x11, 0xf, 0x1, 0x1, 0x01};
+static unsigned char fixed_223_bits[] = {
+0xe, 0x11, 0x11, 0xf, 0x11, 0x11, 0xf, 0x01};
+static unsigned char fixed_224_bits[] = {
+0x2, 0x4, 0xe, 0x10, 0x1e, 0x11, 0x1e};
+static unsigned char fixed_225_bits[] = {
+0x8, 0x4, 0xe, 0x10, 0x1e, 0x11, 0x1e};
+static unsigned char fixed_226_bits[] = {
+0x4, 0xa, 0xe, 0x10, 0x1e, 0x11, 0x1e};
+static unsigned char fixed_227_bits[] = {
+0x14, 0xa, 0xe, 0x10, 0x1e, 0x11, 0x1e};
+static unsigned char fixed_228_bits[] = {
+0xa, 0x0, 0xe, 0x10, 0x1e, 0x11, 0x1e};
+static unsigned char fixed_229_bits[] = {
+0x4, 0xa, 0x4, 0xe, 0x10, 0x1e, 0x11, 0x1e};
+static unsigned char fixed_230_bits[] = {
+0x1e, 0x28, 0x3e, 0x9, 0x3e};
+static unsigned char fixed_231_bits[] = {
+0xe, 0x11, 0x1, 0x11, 0xe, 0x4, 0x02};
+static unsigned char fixed_232_bits[] = {
+0x2, 0x4, 0xe, 0x11, 0x1f, 0x1, 0x0e};
+static unsigned char fixed_233_bits[] = {
+0x8, 0x4, 0xe, 0x11, 0x1f, 0x1, 0x0e};
+static unsigned char fixed_234_bits[] = {
+0x4, 0xa, 0xe, 0x11, 0x1f, 0x1, 0x0e};
+static unsigned char fixed_235_bits[] = {
+0xa, 0x0, 0xe, 0x11, 0x1f, 0x1, 0x0e};
+static unsigned char fixed_236_bits[] = {
+0x1, 0x2, 0x0, 0x3, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_237_bits[] = {
+0x2, 0x1, 0x0, 0x3, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_238_bits[] = {
+0x2, 0x5, 0x0, 0x3, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_239_bits[] = {
+0x5, 0x0, 0x3, 0x2, 0x2, 0x2, 0x07};
+static unsigned char fixed_240_bits[] = {
+0x3, 0xc, 0xe, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_241_bits[] = {
+0x14, 0xa, 0xd, 0x13, 0x11, 0x11, 0x11};
+static unsigned char fixed_242_bits[] = {
+0x2, 0x4, 0xe, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_243_bits[] = {
+0x8, 0x4, 0xe, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_244_bits[] = {
+0x4, 0xa, 0xe, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_245_bits[] = {
+0x14, 0xa, 0xe, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_246_bits[] = {
+0xa, 0x0, 0xe, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char fixed_247_bits[] = {
+0x4, 0x0, 0x1f, 0x0, 0x04};
+static unsigned char fixed_248_bits[] = {
+0x1e, 0x19, 0x15, 0x13, 0x0f};
+static unsigned char fixed_249_bits[] = {
+0x2, 0x4, 0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char fixed_250_bits[] = {
+0x8, 0x4, 0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char fixed_251_bits[] = {
+0x4, 0xa, 0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char fixed_252_bits[] = {
+0xa, 0x0, 0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char fixed_253_bits[] = {
+0x8, 0x4, 0x11, 0x11, 0x19, 0x16, 0x10, 0x11, 0x0e};
+static unsigned char fixed_254_bits[] = {
+0x1, 0xf, 0x11, 0x11, 0x11, 0xf, 0x1, 0x01};
+static unsigned char fixed_255_bits[] = {
+0xa, 0x0, 0x11, 0x11, 0x19, 0x16, 0x10, 0x11, 0x0e};
+static RotFont fixedfont[] = {
+{0, 0, 0, fixed_0_bits},
+{5, 7, 7, fixed_1_bits},
+{5, 7, 7, fixed_2_bits},
+{5, 9, 7, fixed_3_bits},
+{5, 9, 7, fixed_4_bits},
+{5, 9, 7, fixed_5_bits},
+{5, 9, 7, fixed_6_bits},
+{3, 3, 7, fixed_7_bits},
+{5, 6, 6, fixed_8_bits},
+{5, 9, 7, fixed_9_bits},
+{5, 9, 7, fixed_10_bits},
+{4, 5, 8, fixed_11_bits},
+{4, 6, 4, fixed_12_bits},
+{3, 6, 4, fixed_13_bits},
+{3, 5, 8, fixed_14_bits},
+{6, 10, 8, fixed_15_bits},
+{6, 1, 8, fixed_16_bits},
+{6, 1, 6, fixed_17_bits},
+{6, 1, 4, fixed_18_bits},
+{6, 1, 2, fixed_19_bits},
+{6, 1, 0, fixed_20_bits},
+{3, 10, 8, fixed_21_bits},
+{4, 10, 8, fixed_22_bits},
+{6, 5, 8, fixed_23_bits},
+{6, 6, 4, fixed_24_bits},
+{1, 10, 8, fixed_25_bits},
+{5, 8, 7, fixed_26_bits},
+{5, 8, 7, fixed_27_bits},
+{5, 5, 5, fixed_28_bits},
+{5, 7, 7, fixed_29_bits},
+{5, 7, 7, fixed_30_bits},
+{1, 1, 4, fixed_31_bits},
+{0, 0, 0, fixed_32_bits},
+{1, 7, 7, fixed_33_bits},
+{3, 3, 7, fixed_34_bits},
+{5, 7, 7, fixed_35_bits},
+{5, 7, 7, fixed_36_bits},
+{5, 7, 7, fixed_37_bits},
+{5, 7, 7, fixed_38_bits},
+{3, 3, 7, fixed_39_bits},
+{3, 7, 7, fixed_40_bits},
+{3, 7, 7, fixed_41_bits},
+{5, 5, 6, fixed_42_bits},
+{5, 5, 6, fixed_43_bits},
+{3, 3, 2, fixed_44_bits},
+{5, 1, 4, fixed_45_bits},
+{3, 3, 2, fixed_46_bits},
+{5, 7, 7, fixed_47_bits},
+{5, 7, 7, fixed_48_bits},
+{5, 7, 7, fixed_49_bits},
+{5, 7, 7, fixed_50_bits},
+{5, 7, 7, fixed_51_bits},
+{5, 7, 7, fixed_52_bits},
+{5, 7, 7, fixed_53_bits},
+{5, 7, 7, fixed_54_bits},
+{5, 7, 7, fixed_55_bits},
+{5, 7, 7, fixed_56_bits},
+{5, 7, 7, fixed_57_bits},
+{3, 7, 6, fixed_58_bits},
+{3, 7, 6, fixed_59_bits},
+{4, 7, 7, fixed_60_bits},
+{5, 3, 5, fixed_61_bits},
+{4, 7, 7, fixed_62_bits},
+{5, 7, 7, fixed_63_bits},
+{5, 7, 7, fixed_64_bits},
+{5, 7, 7, fixed_65_bits},
+{5, 7, 7, fixed_66_bits},
+{5, 7, 7, fixed_67_bits},
+{5, 7, 7, fixed_68_bits},
+{5, 7, 7, fixed_69_bits},
+{5, 7, 7, fixed_70_bits},
+{5, 7, 7, fixed_71_bits},
+{5, 7, 7, fixed_72_bits},
+{3, 7, 7, fixed_73_bits},
+{5, 7, 7, fixed_74_bits},
+{5, 7, 7, fixed_75_bits},
+{5, 7, 7, fixed_76_bits},
+{5, 7, 7, fixed_77_bits},
+{5, 7, 7, fixed_78_bits},
+{5, 7, 7, fixed_79_bits},
+{5, 7, 7, fixed_80_bits},
+{5, 8, 7, fixed_81_bits},
+{5, 7, 7, fixed_82_bits},
+{5, 7, 7, fixed_83_bits},
+{5, 7, 7, fixed_84_bits},
+{5, 7, 7, fixed_85_bits},
+{5, 7, 7, fixed_86_bits},
+{5, 7, 7, fixed_87_bits},
+{5, 7, 7, fixed_88_bits},
+{5, 7, 7, fixed_89_bits},
+{5, 7, 7, fixed_90_bits},
+{3, 7, 7, fixed_91_bits},
+{5, 7, 7, fixed_92_bits},
+{3, 7, 7, fixed_93_bits},
+{5, 3, 7, fixed_94_bits},
+{5, 1, 0, fixed_95_bits},
+{3, 3, 7, fixed_96_bits},
+{5, 5, 5, fixed_97_bits},
+{5, 7, 7, fixed_98_bits},
+{5, 5, 5, fixed_99_bits},
+{5, 7, 7, fixed_100_bits},
+{5, 5, 5, fixed_101_bits},
+{5, 7, 7, fixed_102_bits},
+{5, 7, 5, fixed_103_bits},
+{5, 7, 7, fixed_104_bits},
+{3, 7, 7, fixed_105_bits},
+{4, 9, 7, fixed_106_bits},
+{5, 7, 7, fixed_107_bits},
+{3, 7, 7, fixed_108_bits},
+{5, 5, 5, fixed_109_bits},
+{5, 5, 5, fixed_110_bits},
+{5, 5, 5, fixed_111_bits},
+{5, 7, 5, fixed_112_bits},
+{5, 7, 5, fixed_113_bits},
+{5, 5, 5, fixed_114_bits},
+{5, 5, 5, fixed_115_bits},
+{5, 7, 7, fixed_116_bits},
+{5, 5, 5, fixed_117_bits},
+{5, 5, 5, fixed_118_bits},
+{5, 5, 5, fixed_119_bits},
+{5, 5, 5, fixed_120_bits},
+{5, 7, 5, fixed_121_bits},
+{5, 5, 5, fixed_122_bits},
+{4, 7, 7, fixed_123_bits},
+{1, 7, 7, fixed_124_bits},
+{4, 7, 7, fixed_125_bits},
+{5, 3, 7, fixed_126_bits},
+{0, 0, 0, fixed_127_bits},
+{5, 1, 1, fixed_128_bits},
+{5, 1, 1, fixed_129_bits},
+{5, 1, 1, fixed_130_bits},
+{5, 1, 1, fixed_131_bits},
+{5, 1, 1, fixed_132_bits},
+{5, 1, 1, fixed_133_bits},
+{5, 1, 1, fixed_134_bits},
+{5, 1, 1, fixed_135_bits},
+{5, 1, 1, fixed_136_bits},
+{5, 1, 1, fixed_137_bits},
+{5, 1, 1, fixed_138_bits},
+{5, 1, 1, fixed_139_bits},
+{5, 1, 1, fixed_140_bits},
+{5, 1, 1, fixed_141_bits},
+{5, 1, 1, fixed_142_bits},
+{5, 1, 1, fixed_143_bits},
+{5, 1, 1, fixed_144_bits},
+{5, 1, 1, fixed_145_bits},
+{5, 1, 1, fixed_146_bits},
+{5, 1, 1, fixed_147_bits},
+{5, 1, 1, fixed_148_bits},
+{5, 1, 1, fixed_149_bits},
+{5, 1, 1, fixed_150_bits},
+{5, 1, 1, fixed_151_bits},
+{5, 1, 1, fixed_152_bits},
+{5, 1, 1, fixed_153_bits},
+{5, 1, 1, fixed_154_bits},
+{5, 1, 1, fixed_155_bits},
+{5, 1, 1, fixed_156_bits},
+{5, 1, 1, fixed_157_bits},
+{5, 1, 1, fixed_158_bits},
+{5, 1, 1, fixed_159_bits},
+{0, 0, 0, fixed_160_bits},
+{1, 7, 7, fixed_161_bits},
+{5, 7, 6, fixed_162_bits},
+{5, 7, 7, fixed_163_bits},
+{5, 5, 5, fixed_164_bits},
+{5, 8, 7, fixed_165_bits},
+{1, 7, 7, fixed_166_bits},
+{5, 8, 7, fixed_167_bits},
+{3, 1, 8, fixed_168_bits},
+{5, 7, 7, fixed_169_bits},
+{4, 6, 7, fixed_170_bits},
+{6, 5, 5, fixed_171_bits},
+{4, 2, 4, fixed_172_bits},
+{5, 1, 4, fixed_173_bits},
+{5, 7, 7, fixed_174_bits},
+{5, 1, 8, fixed_175_bits},
+{3, 3, 7, fixed_176_bits},
+{5, 6, 6, fixed_177_bits},
+{4, 5, 8, fixed_178_bits},
+{4, 5, 8, fixed_179_bits},
+{3, 2, 8, fixed_180_bits},
+{5, 6, 5, fixed_181_bits},
+{5, 7, 7, fixed_182_bits},
+{1, 1, 4, fixed_183_bits},
+{2, 2, 0, fixed_184_bits},
+{3, 5, 8, fixed_185_bits},
+{4, 6, 7, fixed_186_bits},
+{6, 5, 5, fixed_187_bits},
+{6, 9, 8, fixed_188_bits},
+{6, 9, 8, fixed_189_bits},
+{5, 9, 8, fixed_190_bits},
+{5, 7, 7, fixed_191_bits},
+{5, 8, 8, fixed_192_bits},
+{5, 8, 8, fixed_193_bits},
+{5, 8, 8, fixed_194_bits},
+{5, 8, 8, fixed_195_bits},
+{5, 8, 8, fixed_196_bits},
+{5, 8, 8, fixed_197_bits},
+{6, 7, 7, fixed_198_bits},
+{5, 9, 7, fixed_199_bits},
+{5, 8, 8, fixed_200_bits},
+{5, 8, 8, fixed_201_bits},
+{5, 8, 8, fixed_202_bits},
+{5, 8, 8, fixed_203_bits},
+{3, 8, 8, fixed_204_bits},
+{3, 8, 8, fixed_205_bits},
+{3, 8, 8, fixed_206_bits},
+{3, 8, 8, fixed_207_bits},
+{5, 7, 7, fixed_208_bits},
+{5, 8, 8, fixed_209_bits},
+{5, 8, 8, fixed_210_bits},
+{5, 8, 8, fixed_211_bits},
+{5, 8, 8, fixed_212_bits},
+{5, 8, 8, fixed_213_bits},
+{5, 8, 8, fixed_214_bits},
+{5, 5, 5, fixed_215_bits},
+{5, 7, 7, fixed_216_bits},
+{5, 8, 8, fixed_217_bits},
+{5, 8, 8, fixed_218_bits},
+{5, 8, 8, fixed_219_bits},
+{5, 8, 8, fixed_220_bits},
+{5, 8, 8, fixed_221_bits},
+{5, 7, 7, fixed_222_bits},
+{5, 8, 7, fixed_223_bits},
+{5, 7, 7, fixed_224_bits},
+{5, 7, 7, fixed_225_bits},
+{5, 7, 7, fixed_226_bits},
+{5, 7, 7, fixed_227_bits},
+{5, 7, 7, fixed_228_bits},
+{5, 8, 8, fixed_229_bits},
+{6, 5, 5, fixed_230_bits},
+{5, 7, 5, fixed_231_bits},
+{5, 7, 7, fixed_232_bits},
+{5, 7, 7, fixed_233_bits},
+{5, 7, 7, fixed_234_bits},
+{5, 7, 7, fixed_235_bits},
+{3, 8, 8, fixed_236_bits},
+{3, 8, 8, fixed_237_bits},
+{3, 8, 8, fixed_238_bits},
+{3, 7, 7, fixed_239_bits},
+{5, 7, 7, fixed_240_bits},
+{5, 7, 7, fixed_241_bits},
+{5, 7, 7, fixed_242_bits},
+{5, 7, 7, fixed_243_bits},
+{5, 7, 7, fixed_244_bits},
+{5, 7, 7, fixed_245_bits},
+{5, 7, 7, fixed_246_bits},
+{5, 5, 6, fixed_247_bits},
+{5, 5, 5, fixed_248_bits},
+{5, 7, 7, fixed_249_bits},
+{5, 7, 7, fixed_250_bits},
+{5, 7, 7, fixed_251_bits},
+{5, 7, 7, fixed_252_bits},
+{5, 9, 7, fixed_253_bits},
+{5, 8, 6, fixed_254_bits},
+{5, 9, 7, fixed_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/fixfont.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/fixfont.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/fixfont.c	(revision 15879)
@@ -0,0 +1,180 @@
+# include <stdio.h>
+# include <math.h>
+# define TRUE 1
+# define FALSE 0
+
+# define ALLOCATE(X,T,S)  \
+  X=(T *)malloc((unsigned) ((S)*sizeof(T)));\
+  if(X==NULL) \
+    { \
+      fprintf(stderr,"failed to malloc X\n");\
+        exit(0);\
+    } 
+# define REALLOCATE(X,T,S) \
+  X=(T *)realloc(X,(unsigned) ((S)*sizeof(T))); \
+  if(X==NULL) \
+    { \
+       fprintf(stderr,"failed to realloc X\n"); \
+       exit(0); \
+    }
+
+#define blank_width 5
+#define blank_height 1
+static unsigned char blank_bits[] = {0x00};
+
+typedef struct {
+  int dx, dy, ascent, Nb;
+  unsigned char *bits;
+  char name[64];
+} RotFont;
+
+char flip_bits (char a);
+int scan_line (FILE *f, char *line);
+
+main (int argc, char **argv) {
+
+  int BitMap, Nvalue, code;
+  unsigned int bits;
+  int i, j, dx, dy, ddx, ddy;
+  char buffer[1000], name[1000], glyph[1000];
+  unsigned char value[1000], bitchar[3];
+  RotFont font[256];
+  
+  FILE *f;
+
+  if (argc != 3) {
+    fprintf (stderr, "USAGE: fixfont (file.bdf) (name)\n");
+    exit (0);
+  }
+
+  f = fopen (argv[1], "r");
+  if (f == (FILE *) NULL) {
+    fprintf (stderr, "failed to open file %s\n", argv[1]);
+    exit (0);
+  }
+
+  for (i = 0; i < 256; i++) {
+    font[i].bits = 0;
+  }
+
+  BitMap = FALSE;
+  Nvalue = 0;
+  while (scan_line (f, buffer) != EOF) {
+    sscanf (buffer, "%s", name);
+    if (!strcmp (name, "ENDCHAR")) {
+      BitMap = FALSE;
+      if ((code >= 0) && (code < 256)) {
+	font[code].dx = dx;
+	font[code].dy = dy;
+	font[code].ascent = dy + ddy;
+	font[code].Nb = Nvalue;
+	ALLOCATE (font[code].bits, unsigned char, Nvalue);
+	strcpy (font[code].name, glyph);
+	for (i = 0; i < Nvalue; i++) { 
+	  font[code].bits[i] = value[i];
+	}
+      }
+      fprintf (stderr, "found %s\n", glyph);
+    }
+    if (BitMap) {
+      bitchar[2] = 0;
+      for (j = 0; buffer[j] != 0; j+=2) {
+	bitchar[0] = buffer[j];
+	bitchar[1] = buffer[j+1];
+	sscanf (bitchar, "%x", &bits);
+	value[Nvalue] = flip_bits (bits);
+	Nvalue ++;
+      }
+      continue;
+    } 
+    if (!strcmp (name, "STARTCHAR")) {
+      sscanf (buffer, "%*s %s", glyph);
+    }
+    if (!strcmp (name, "ENCODING")) {
+      sscanf (buffer, "%*s %d", &code);
+    }
+    if (!strcmp (name, "BBX")) {
+      sscanf (buffer, "%*s %d %d %d %d", &dx, &dy, &ddx, &ddy);
+    }
+    if (!strcmp (name, "BITMAP")) {
+      BitMap = TRUE;
+      Nvalue = 0;
+    }
+  }    
+
+  for (i = 0; i < 256; i++) {
+    if (font[i].bits  == 0) {
+      font[i].bits = blank_bits;
+      font[i].dx = blank_width;
+      font[i].dy = blank_height;
+      font[i].Nb = 1;
+      font[i].ascent = blank_height;
+      strcpy (font[i].name, "blank");
+    }
+    fprintf (stdout, "static unsigned char %s_%d_bits[] = {", argv[2], i);
+    for (j = 0; j < font[i].Nb; j++) {
+      if (!(j % 12)) fprintf (stdout, "\n");
+      if (j == font[i].Nb - 1) fprintf (stdout, "0x%02x", font[i].bits[j]);
+      else fprintf (stdout, "0x%02x, ", font[i].bits[j]);
+    }
+    fprintf (stdout, "};\n");
+  }
+  
+  fprintf (stdout, "static RotFont %sfont[] = {\n", argv[2]);
+  for (i = 0; i < 255; i++) {
+    fprintf (stdout, "{%d, %d, %d, %s_%d_bits},\n", 
+	     font[i].dx, font[i].dy, font[i].ascent, argv[2], i);
+  }
+  fprintf (stdout, "{%d, %d, %d, %s_%d_bits}};\n", 
+	   font[i].dx, font[i].dy, font[i].ascent, argv[2], i);
+
+      
+}
+
+int scan_line (FILE *f, char *line) {
+
+  int i, status;
+  char c;
+  
+  status = EOF + 1;
+  
+  for (i = 0, c = 0; (c != '\n') && (status != EOF); i++) {
+    status = fscanf (f, "%c", &c);
+    line[i] = c;
+  }
+  line[i - 1] = 0;  /* this could make things crash! */
+
+  if (i > 1) {
+    status = EOF + 1;
+  }
+
+  return (status);
+
+}
+
+char flip_bits (char a) {
+
+  char b, c;
+  
+  c = 0;
+  b = (a & 0x01) << 7;
+  c = c | b;
+  b = (a & 0x02) << 5;
+  c = c | b;
+  b = (a & 0x04) << 3;
+  c = c | b;
+  b = (a & 0x08) << 1;
+  c = c | b;
+  b = (a & 0x10) >> 1;
+  c = c | b;
+  b = (a & 0x20) >> 3;
+  c = c | b;
+  b = (a & 0x40) >> 5;
+  c = c | b;
+  b = (a & 0x80) >> 7;
+  c = c | b;
+
+  return (c);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica12.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica12.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica12.bdf	(revision 15879)
@@ -0,0 +1,3020 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Helvetica-Medium-R-Normal--12-120-75-75-P-67-ISO8859-1
+SIZE 12 75 75
+FONTBOUNDINGBOX 11 15 0 -3
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Helvetica"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 12
+POINT_SIZE 120
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 67
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 9
+X_HEIGHT 7
+FACE_NAME "Helvetica"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.  "
+_DEC_DEVICE_FONTNAMES "PS=Helvetica"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Helvetica"
+FONT "-Adobe-Helvetica-Medium-R-Normal--12-120-75-75-P-67-ISO8859-1"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 7
+DEFAULT_CHAR 32
+FONT_ASCENT 11
+FONT_DESCENT 3
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 9 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+00
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 3 1 6
+BITMAP
+a0
+a0
+a0
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 8 0 0
+BITMAP
+28
+28
+fc
+28
+fc
+50
+50
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 -1
+BITMAP
+20
+70
+a8
+a0
+70
+28
+a8
+a8
+70
+20
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+6200
+9400
+9400
+6800
+0800
+1300
+1480
+1480
+2300
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+30
+48
+48
+30
+50
+8a
+84
+8c
+72
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 3 1 6
+BITMAP
+c0
+40
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 12 1 -3
+BITMAP
+20
+40
+40
+80
+80
+80
+80
+80
+80
+40
+40
+20
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 12 0 -3
+BITMAP
+80
+40
+40
+20
+20
+20
+20
+20
+20
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 3 1 6
+BITMAP
+a0
+40
+a0
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+20
+20
+f8
+20
+20
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 2 3 1 -2
+BITMAP
+40
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 5 1 1 3
+BITMAP
+f8
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 1 1 0
+BITMAP
+80
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 9 0 0
+BITMAP
+10
+10
+20
+20
+40
+40
+40
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+70
+88
+88
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 3 9 1 0
+BITMAP
+20
+e0
+20
+20
+20
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+70
+88
+08
+10
+20
+40
+80
+80
+f8
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+70
+88
+08
+30
+08
+08
+88
+88
+70
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 0 0
+BITMAP
+08
+18
+28
+28
+48
+88
+fc
+08
+08
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+f8
+80
+80
+f0
+08
+08
+88
+88
+70
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+70
+88
+80
+b0
+c8
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+f8
+08
+10
+10
+20
+20
+20
+40
+40
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+70
+88
+88
+70
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+70
+88
+88
+88
+78
+08
+08
+88
+70
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 6 1 0
+BITMAP
+80
+00
+00
+00
+00
+80
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 8 0 -2
+BITMAP
+40
+00
+00
+00
+00
+40
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 0 1
+BITMAP
+0c
+30
+c0
+30
+0c
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 3 1 2
+BITMAP
+f8
+00
+f8
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 1 1
+BITMAP
+c0
+30
+0c
+30
+c0
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+70
+88
+88
+10
+10
+20
+20
+00
+20
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 960 0
+DWIDTH 12 0
+BBX 10 10 1 -1
+BITMAP
+1f00
+6080
+4d40
+9240
+a240
+a240
+a680
+9b00
+4000
+3e00
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+10
+28
+28
+44
+44
+7c
+82
+82
+82
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+f8
+84
+84
+84
+f8
+84
+84
+84
+f8
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+3c
+42
+80
+80
+80
+80
+80
+42
+3c
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+f8
+84
+82
+82
+82
+82
+82
+84
+f8
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+fc
+80
+80
+80
+fc
+80
+80
+80
+fc
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+fc
+80
+80
+80
+f8
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+3c
+42
+80
+80
+8e
+82
+82
+46
+3a
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+82
+82
+82
+82
+fe
+82
+82
+82
+82
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 9 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+08
+08
+08
+08
+08
+08
+88
+88
+70
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 1 0
+BITMAP
+84
+88
+90
+a0
+e0
+90
+88
+84
+82
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+f8
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+8080
+c180
+c180
+a280
+a280
+9480
+9480
+8880
+8880
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+82
+c2
+a2
+a2
+92
+8a
+8a
+86
+82
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+f8
+84
+84
+84
+f8
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+3c
+42
+81
+81
+81
+89
+85
+42
+3d
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+f8
+84
+84
+84
+f8
+88
+84
+84
+84
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+78
+84
+80
+60
+18
+04
+84
+84
+78
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+BITMAP
+fe
+10
+10
+10
+10
+10
+10
+10
+10
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+84
+84
+84
+84
+84
+84
+84
+84
+78
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+82
+82
+44
+44
+44
+28
+28
+10
+10
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+8880
+8880
+8880
+4900
+5500
+5500
+2200
+2200
+2200
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+82
+44
+44
+28
+10
+28
+44
+44
+82
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+82
+82
+44
+44
+28
+10
+10
+10
+10
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+fe
+02
+04
+08
+10
+20
+40
+80
+fe
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 12 1 -3
+BITMAP
+c0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+c0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 9 0 0
+BITMAP
+80
+80
+40
+40
+20
+20
+20
+10
+10
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 12 0 -3
+BITMAP
+c0
+40
+40
+40
+40
+40
+40
+40
+40
+40
+40
+c0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 3 0 5
+BITMAP
+20
+50
+88
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 1 0 -2
+BITMAP
+fe
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 3 0 6
+BITMAP
+40
+80
+c0
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 0
+BITMAP
+70
+88
+08
+78
+88
+88
+74
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+80
+80
+b0
+c8
+88
+88
+88
+c8
+b0
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+70
+88
+80
+80
+80
+88
+70
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+08
+08
+68
+98
+88
+88
+88
+98
+68
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+70
+88
+88
+f8
+80
+88
+70
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 4 9 0 0
+BITMAP
+30
+40
+e0
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 -3
+BITMAP
+68
+98
+88
+88
+88
+98
+68
+08
+88
+70
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+80
+80
+b0
+c8
+88
+88
+88
+88
+88
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 9 1 0
+BITMAP
+80
+00
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 12 0 -3
+BITMAP
+40
+00
+40
+40
+40
+40
+40
+40
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+80
+80
+90
+a0
+c0
+c0
+a0
+90
+88
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 9 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 7 1 0
+BITMAP
+a4
+da
+92
+92
+92
+92
+92
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+b0
+c8
+88
+88
+88
+88
+88
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+70
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 -3
+BITMAP
+b0
+c8
+88
+88
+88
+c8
+b0
+80
+80
+80
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 -3
+BITMAP
+68
+98
+88
+88
+88
+98
+68
+08
+08
+08
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 7 1 0
+BITMAP
+a0
+c0
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 7 1 0
+BITMAP
+60
+90
+80
+60
+10
+90
+60
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 9 0 0
+BITMAP
+40
+40
+e0
+40
+40
+40
+40
+40
+60
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+88
+88
+88
+88
+88
+98
+68
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+88
+88
+88
+50
+50
+20
+20
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 7 0 0
+BITMAP
+8880
+8880
+4900
+4900
+5500
+2200
+2200
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 7 0 0
+BITMAP
+84
+48
+30
+30
+48
+84
+84
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 -3
+BITMAP
+88
+88
+88
+90
+50
+50
+20
+20
+40
+80
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 7 1 0
+BITMAP
+f0
+10
+20
+40
+40
+80
+f0
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 12 0 -3
+BITMAP
+30
+40
+40
+40
+40
+80
+40
+40
+40
+40
+40
+30
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 12 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 12 0 -3
+BITMAP
+c0
+20
+20
+20
+20
+10
+20
+20
+20
+20
+20
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 2 0 3
+BITMAP
+64
+98
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 10 1 -3
+BITMAP
+80
+00
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 -1
+BITMAP
+10
+70
+a8
+a0
+a0
+a0
+c8
+70
+40
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+30
+48
+40
+40
+f0
+20
+20
+48
+b0
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 6 0 1
+BITMAP
+84
+78
+48
+48
+78
+84
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+88
+88
+50
+20
+f8
+20
+f8
+20
+20
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 11 1 -2
+BITMAP
+80
+80
+80
+80
+00
+00
+00
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 12 0 -3
+BITMAP
+70
+88
+80
+60
+90
+88
+88
+48
+30
+08
+88
+70
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 1 0 8
+BITMAP
+a0
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+3e00
+4100
+9c80
+a280
+a080
+a280
+9c80
+4100
+3e00
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 5 1 4
+BITMAP
+e0
+20
+a0
+00
+e0
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+28
+50
+a0
+50
+28
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 4 1 2
+BITMAP
+fc
+04
+04
+04
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 1 0 3
+BITMAP
+f0
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+3e00
+4100
+9c80
+9480
+9880
+9480
+9480
+4100
+3e00
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 1 0 8
+BITMAP
+f0
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 4 0 4
+BITMAP
+60
+90
+90
+60
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+20
+20
+f8
+20
+20
+00
+f8
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 5 0 3
+BITMAP
+60
+90
+20
+40
+f0
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 5 0 3
+BITMAP
+e0
+20
+40
+20
+c0
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 160 0
+DWIDTH 2 0
+BBX 2 2 0 8
+BITMAP
+40
+80
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 -3
+BITMAP
+88
+88
+88
+88
+88
+98
+e8
+80
+80
+80
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 12 0 -3
+BITMAP
+3c
+68
+e8
+e8
+e8
+68
+28
+28
+28
+28
+28
+28
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 1 1 3
+BITMAP
+80
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 4 0 -3
+BITMAP
+40
+20
+20
+c0
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 2 5 1 3
+BITMAP
+40
+c0
+40
+40
+40
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 5 1 4
+BITMAP
+e0
+a0
+e0
+00
+e0
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+a0
+50
+28
+50
+a0
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+4100
+c200
+4400
+4400
+4900
+1300
+1500
+2780
+4100
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+4100
+c200
+4400
+4800
+4b00
+1480
+1100
+2200
+4780
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+e100
+2200
+4400
+2400
+c900
+0b00
+1500
+1780
+2100
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 -3
+BITMAP
+20
+00
+20
+20
+40
+40
+88
+88
+70
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+20
+10
+00
+10
+10
+28
+44
+44
+7c
+82
+82
+82
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+08
+10
+00
+10
+10
+28
+44
+44
+7c
+82
+82
+82
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+10
+28
+00
+10
+10
+28
+44
+44
+7c
+82
+82
+82
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+14
+28
+00
+10
+10
+28
+44
+44
+7c
+82
+82
+82
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 11 1 0
+BITMAP
+28
+00
+10
+10
+28
+44
+44
+7c
+82
+82
+82
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+10
+28
+10
+10
+10
+28
+44
+44
+7c
+82
+82
+82
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+1f80
+2800
+2800
+4800
+4f80
+7800
+8800
+8800
+8f80
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 12 1 -3
+BITMAP
+3c
+42
+80
+80
+80
+80
+80
+42
+3c
+08
+08
+30
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 12 1 0
+BITMAP
+20
+10
+00
+fc
+80
+80
+80
+fc
+80
+80
+80
+fc
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 12 1 0
+BITMAP
+08
+10
+00
+fc
+80
+80
+80
+fc
+80
+80
+80
+fc
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 12 1 0
+BITMAP
+10
+28
+00
+fc
+80
+80
+80
+fc
+80
+80
+80
+fc
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+28
+00
+fc
+80
+80
+80
+fc
+80
+80
+80
+fc
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 12 0 0
+BITMAP
+80
+40
+00
+40
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 12 1 0
+BITMAP
+40
+80
+00
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 12 0 0
+BITMAP
+40
+a0
+00
+40
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 11 0 0
+BITMAP
+a0
+00
+40
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+7c
+42
+41
+41
+f1
+41
+41
+42
+7c
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+14
+28
+00
+82
+c2
+a2
+a2
+92
+8a
+8a
+86
+82
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 12 1 0
+BITMAP
+10
+08
+00
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 12 1 0
+BITMAP
+04
+08
+00
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 12 1 0
+BITMAP
+08
+14
+00
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 12 1 0
+BITMAP
+14
+28
+00
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 11 1 0
+BITMAP
+24
+00
+3c
+42
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+88
+50
+20
+50
+88
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 10 11 0 -1
+BITMAP
+0040
+1e80
+2100
+4280
+4480
+4480
+4880
+5080
+2100
+5e00
+8000
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 12 1 0
+BITMAP
+20
+10
+00
+84
+84
+84
+84
+84
+84
+84
+84
+78
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 12 1 0
+BITMAP
+08
+10
+00
+84
+84
+84
+84
+84
+84
+84
+84
+78
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 12 1 0
+BITMAP
+10
+28
+00
+84
+84
+84
+84
+84
+84
+84
+84
+78
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+48
+00
+84
+84
+84
+84
+84
+84
+84
+84
+78
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+08
+10
+00
+82
+82
+44
+44
+28
+10
+10
+10
+10
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+80
+80
+f8
+84
+84
+84
+f8
+80
+80
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+70
+88
+88
+88
+b0
+88
+88
+88
+b0
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+20
+10
+00
+70
+88
+08
+78
+88
+88
+74
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+10
+20
+00
+70
+88
+08
+78
+88
+88
+74
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+20
+50
+00
+70
+88
+08
+78
+88
+88
+74
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+28
+50
+00
+70
+88
+08
+78
+88
+88
+74
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 1 0
+BITMAP
+50
+00
+70
+88
+08
+78
+88
+88
+74
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+30
+48
+30
+70
+88
+08
+78
+88
+88
+74
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 9 7 1 0
+BITMAP
+7700
+8880
+0880
+7f80
+8800
+8880
+7700
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 -3
+BITMAP
+70
+88
+80
+80
+80
+88
+70
+20
+10
+60
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+40
+20
+00
+70
+88
+88
+f8
+80
+88
+70
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+10
+20
+00
+70
+88
+88
+f8
+80
+88
+70
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+20
+50
+00
+70
+88
+88
+f8
+80
+88
+70
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+50
+00
+70
+88
+88
+f8
+80
+88
+70
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 10 0 0
+BITMAP
+80
+40
+00
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 10 1 0
+BITMAP
+40
+80
+00
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 10 0 0
+BITMAP
+40
+a0
+00
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 9 0 0
+BITMAP
+a0
+00
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+68
+30
+50
+08
+78
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+28
+50
+00
+b0
+c8
+88
+88
+88
+88
+88
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+40
+20
+00
+70
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+10
+20
+00
+70
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+20
+50
+00
+70
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+28
+50
+00
+70
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+50
+00
+70
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+20
+00
+f8
+00
+20
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 7 0 0
+BITMAP
+3a
+44
+4c
+54
+64
+44
+b8
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+40
+20
+00
+88
+88
+88
+88
+88
+98
+68
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+10
+20
+00
+88
+88
+88
+88
+88
+98
+68
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+20
+50
+00
+88
+88
+88
+88
+88
+98
+68
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+50
+00
+88
+88
+88
+88
+88
+98
+68
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 13 1 -3
+BITMAP
+10
+20
+00
+88
+88
+88
+90
+50
+50
+20
+20
+40
+80
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 12 1 -3
+BITMAP
+80
+80
+b0
+c8
+88
+88
+88
+c8
+b0
+80
+80
+80
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 12 1 -3
+BITMAP
+50
+00
+88
+88
+48
+50
+50
+30
+20
+20
+20
+c0
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica12.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica12.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica12.h	(revision 15879)
@@ -0,0 +1,783 @@
+static unsigned char helvetica12_0_bits[] = {
+0x00};
+static unsigned char helvetica12_1_bits[] = {
+0x00};
+static unsigned char helvetica12_2_bits[] = {
+0x00};
+static unsigned char helvetica12_3_bits[] = {
+0x00};
+static unsigned char helvetica12_4_bits[] = {
+0x00};
+static unsigned char helvetica12_5_bits[] = {
+0x00};
+static unsigned char helvetica12_6_bits[] = {
+0x00};
+static unsigned char helvetica12_7_bits[] = {
+0x00};
+static unsigned char helvetica12_8_bits[] = {
+0x00};
+static unsigned char helvetica12_9_bits[] = {
+0x00};
+static unsigned char helvetica12_10_bits[] = {
+0x00};
+static unsigned char helvetica12_11_bits[] = {
+0x00};
+static unsigned char helvetica12_12_bits[] = {
+0x00};
+static unsigned char helvetica12_13_bits[] = {
+0x00};
+static unsigned char helvetica12_14_bits[] = {
+0x00};
+static unsigned char helvetica12_15_bits[] = {
+0x00};
+static unsigned char helvetica12_16_bits[] = {
+0x00};
+static unsigned char helvetica12_17_bits[] = {
+0x00};
+static unsigned char helvetica12_18_bits[] = {
+0x00};
+static unsigned char helvetica12_19_bits[] = {
+0x00};
+static unsigned char helvetica12_20_bits[] = {
+0x00};
+static unsigned char helvetica12_21_bits[] = {
+0x00};
+static unsigned char helvetica12_22_bits[] = {
+0x00};
+static unsigned char helvetica12_23_bits[] = {
+0x00};
+static unsigned char helvetica12_24_bits[] = {
+0x00};
+static unsigned char helvetica12_25_bits[] = {
+0x00};
+static unsigned char helvetica12_26_bits[] = {
+0x00};
+static unsigned char helvetica12_27_bits[] = {
+0x00};
+static unsigned char helvetica12_28_bits[] = {
+0x00};
+static unsigned char helvetica12_29_bits[] = {
+0x00};
+static unsigned char helvetica12_30_bits[] = {
+0x00};
+static unsigned char helvetica12_31_bits[] = {
+0x00};
+static unsigned char helvetica12_32_bits[] = {
+0x00};
+static unsigned char helvetica12_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01};
+static unsigned char helvetica12_34_bits[] = {
+0x05, 0x05, 0x05};
+static unsigned char helvetica12_35_bits[] = {
+0x14, 0x14, 0x3f, 0x14, 0x3f, 0x0a, 0x0a, 0x0a};
+static unsigned char helvetica12_36_bits[] = {
+0x04, 0x0e, 0x15, 0x05, 0x0e, 0x14, 0x15, 0x15, 0x0e, 0x04};
+static unsigned char helvetica12_37_bits[] = {
+0x46, 0x00, 0x29, 0x00, 0x29, 0x00, 0x16, 0x00, 0x10, 0x00, 0xc8, 0x00, 
+0x28, 0x01, 0x28, 0x01, 0xc4, 0x00};
+static unsigned char helvetica12_38_bits[] = {
+0x0c, 0x12, 0x12, 0x0c, 0x0a, 0x51, 0x21, 0x31, 0x4e};
+static unsigned char helvetica12_39_bits[] = {
+0x03, 0x02, 0x01};
+static unsigned char helvetica12_40_bits[] = {
+0x04, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x04};
+static unsigned char helvetica12_41_bits[] = {
+0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x02, 0x01};
+static unsigned char helvetica12_42_bits[] = {
+0x05, 0x02, 0x05};
+static unsigned char helvetica12_43_bits[] = {
+0x04, 0x04, 0x1f, 0x04, 0x04};
+static unsigned char helvetica12_44_bits[] = {
+0x02, 0x02, 0x01};
+static unsigned char helvetica12_45_bits[] = {
+0x1f};
+static unsigned char helvetica12_46_bits[] = {
+0x01};
+static unsigned char helvetica12_47_bits[] = {
+0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01};
+static unsigned char helvetica12_48_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_49_bits[] = {
+0x04, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04};
+static unsigned char helvetica12_50_bits[] = {
+0x0e, 0x11, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01, 0x1f};
+static unsigned char helvetica12_51_bits[] = {
+0x0e, 0x11, 0x10, 0x0c, 0x10, 0x10, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_52_bits[] = {
+0x10, 0x18, 0x14, 0x14, 0x12, 0x11, 0x3f, 0x10, 0x10};
+static unsigned char helvetica12_53_bits[] = {
+0x1f, 0x01, 0x01, 0x0f, 0x10, 0x10, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_54_bits[] = {
+0x0e, 0x11, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_55_bits[] = {
+0x1f, 0x10, 0x08, 0x08, 0x04, 0x04, 0x04, 0x02, 0x02};
+static unsigned char helvetica12_56_bits[] = {
+0x0e, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_57_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x1e, 0x10, 0x10, 0x11, 0x0e};
+static unsigned char helvetica12_58_bits[] = {
+0x01, 0x00, 0x00, 0x00, 0x00, 0x01};
+static unsigned char helvetica12_59_bits[] = {
+0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x01};
+static unsigned char helvetica12_60_bits[] = {
+0x30, 0x0c, 0x03, 0x0c, 0x30};
+static unsigned char helvetica12_61_bits[] = {
+0x1f, 0x00, 0x1f};
+static unsigned char helvetica12_62_bits[] = {
+0x03, 0x0c, 0x30, 0x0c, 0x03};
+static unsigned char helvetica12_63_bits[] = {
+0x0e, 0x11, 0x11, 0x08, 0x08, 0x04, 0x04, 0x00, 0x04};
+static unsigned char helvetica12_64_bits[] = {
+0xf8, 0x00, 0x06, 0x01, 0xb2, 0x02, 0x49, 0x02, 0x45, 0x02, 0x45, 0x02, 
+0x65, 0x01, 0xd9, 0x00, 0x02, 0x00, 0x7c, 0x00};
+static unsigned char helvetica12_65_bits[] = {
+0x08, 0x14, 0x14, 0x22, 0x22, 0x3e, 0x41, 0x41, 0x41};
+static unsigned char helvetica12_66_bits[] = {
+0x1f, 0x21, 0x21, 0x21, 0x1f, 0x21, 0x21, 0x21, 0x1f};
+static unsigned char helvetica12_67_bits[] = {
+0x3c, 0x42, 0x01, 0x01, 0x01, 0x01, 0x01, 0x42, 0x3c};
+static unsigned char helvetica12_68_bits[] = {
+0x1f, 0x21, 0x41, 0x41, 0x41, 0x41, 0x41, 0x21, 0x1f};
+static unsigned char helvetica12_69_bits[] = {
+0x3f, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 0x3f};
+static unsigned char helvetica12_70_bits[] = {
+0x3f, 0x01, 0x01, 0x01, 0x1f, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_71_bits[] = {
+0x3c, 0x42, 0x01, 0x01, 0x71, 0x41, 0x41, 0x62, 0x5c};
+static unsigned char helvetica12_72_bits[] = {
+0x41, 0x41, 0x41, 0x41, 0x7f, 0x41, 0x41, 0x41, 0x41};
+static unsigned char helvetica12_73_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_74_bits[] = {
+0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_75_bits[] = {
+0x21, 0x11, 0x09, 0x05, 0x07, 0x09, 0x11, 0x21, 0x41};
+static unsigned char helvetica12_76_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x1f};
+static unsigned char helvetica12_77_bits[] = {
+0x01, 0x01, 0x83, 0x01, 0x83, 0x01, 0x45, 0x01, 0x45, 0x01, 0x29, 0x01, 
+0x29, 0x01, 0x11, 0x01, 0x11, 0x01};
+static unsigned char helvetica12_78_bits[] = {
+0x41, 0x43, 0x45, 0x45, 0x49, 0x51, 0x51, 0x61, 0x41};
+static unsigned char helvetica12_79_bits[] = {
+0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char helvetica12_80_bits[] = {
+0x1f, 0x21, 0x21, 0x21, 0x1f, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_81_bits[] = {
+0x3c, 0x42, 0x81, 0x81, 0x81, 0x91, 0xa1, 0x42, 0xbc};
+static unsigned char helvetica12_82_bits[] = {
+0x1f, 0x21, 0x21, 0x21, 0x1f, 0x11, 0x21, 0x21, 0x21};
+static unsigned char helvetica12_83_bits[] = {
+0x1e, 0x21, 0x01, 0x06, 0x18, 0x20, 0x21, 0x21, 0x1e};
+static unsigned char helvetica12_84_bits[] = {
+0x7f, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08};
+static unsigned char helvetica12_85_bits[] = {
+0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1e};
+static unsigned char helvetica12_86_bits[] = {
+0x41, 0x41, 0x22, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08};
+static unsigned char helvetica12_87_bits[] = {
+0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x92, 0x00, 0xaa, 0x00, 0xaa, 0x00, 
+0x44, 0x00, 0x44, 0x00, 0x44, 0x00};
+static unsigned char helvetica12_88_bits[] = {
+0x41, 0x22, 0x22, 0x14, 0x08, 0x14, 0x22, 0x22, 0x41};
+static unsigned char helvetica12_89_bits[] = {
+0x41, 0x41, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08};
+static unsigned char helvetica12_90_bits[] = {
+0x7f, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x7f};
+static unsigned char helvetica12_91_bits[] = {
+0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03};
+static unsigned char helvetica12_92_bits[] = {
+0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x08, 0x08};
+static unsigned char helvetica12_93_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03};
+static unsigned char helvetica12_94_bits[] = {
+0x04, 0x0a, 0x11};
+static unsigned char helvetica12_95_bits[] = {
+0x7f};
+static unsigned char helvetica12_96_bits[] = {
+0x02, 0x01, 0x03};
+static unsigned char helvetica12_97_bits[] = {
+0x0e, 0x11, 0x10, 0x1e, 0x11, 0x11, 0x2e};
+static unsigned char helvetica12_98_bits[] = {
+0x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11, 0x13, 0x0d};
+static unsigned char helvetica12_99_bits[] = {
+0x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e};
+static unsigned char helvetica12_100_bits[] = {
+0x10, 0x10, 0x16, 0x19, 0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char helvetica12_101_bits[] = {
+0x0e, 0x11, 0x11, 0x1f, 0x01, 0x11, 0x0e};
+static unsigned char helvetica12_102_bits[] = {
+0x0c, 0x02, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica12_103_bits[] = {
+0x16, 0x19, 0x11, 0x11, 0x11, 0x19, 0x16, 0x10, 0x11, 0x0e};
+static unsigned char helvetica12_104_bits[] = {
+0x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11, 0x11, 0x11};
+static unsigned char helvetica12_105_bits[] = {
+0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_106_bits[] = {
+0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01};
+static unsigned char helvetica12_107_bits[] = {
+0x01, 0x01, 0x09, 0x05, 0x03, 0x03, 0x05, 0x09, 0x11};
+static unsigned char helvetica12_108_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_109_bits[] = {
+0x25, 0x5b, 0x49, 0x49, 0x49, 0x49, 0x49};
+static unsigned char helvetica12_110_bits[] = {
+0x0d, 0x13, 0x11, 0x11, 0x11, 0x11, 0x11};
+static unsigned char helvetica12_111_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_112_bits[] = {
+0x0d, 0x13, 0x11, 0x11, 0x11, 0x13, 0x0d, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_113_bits[] = {
+0x16, 0x19, 0x11, 0x11, 0x11, 0x19, 0x16, 0x10, 0x10, 0x10};
+static unsigned char helvetica12_114_bits[] = {
+0x05, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_115_bits[] = {
+0x06, 0x09, 0x01, 0x06, 0x08, 0x09, 0x06};
+static unsigned char helvetica12_116_bits[] = {
+0x02, 0x02, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x06};
+static unsigned char helvetica12_117_bits[] = {
+0x11, 0x11, 0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char helvetica12_118_bits[] = {
+0x11, 0x11, 0x11, 0x0a, 0x0a, 0x04, 0x04};
+static unsigned char helvetica12_119_bits[] = {
+0x11, 0x01, 0x11, 0x01, 0x92, 0x00, 0x92, 0x00, 0xaa, 0x00, 0x44, 0x00, 
+0x44, 0x00};
+static unsigned char helvetica12_120_bits[] = {
+0x21, 0x12, 0x0c, 0x0c, 0x12, 0x21, 0x21};
+static unsigned char helvetica12_121_bits[] = {
+0x11, 0x11, 0x11, 0x09, 0x0a, 0x0a, 0x04, 0x04, 0x02, 0x01};
+static unsigned char helvetica12_122_bits[] = {
+0x0f, 0x08, 0x04, 0x02, 0x02, 0x01, 0x0f};
+static unsigned char helvetica12_123_bits[] = {
+0x0c, 0x02, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c};
+static unsigned char helvetica12_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_125_bits[] = {
+0x03, 0x04, 0x04, 0x04, 0x04, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03};
+static unsigned char helvetica12_126_bits[] = {
+0x26, 0x19};
+static unsigned char helvetica12_127_bits[] = {
+0x00};
+static unsigned char helvetica12_128_bits[] = {
+0x00};
+static unsigned char helvetica12_129_bits[] = {
+0x00};
+static unsigned char helvetica12_130_bits[] = {
+0x00};
+static unsigned char helvetica12_131_bits[] = {
+0x00};
+static unsigned char helvetica12_132_bits[] = {
+0x00};
+static unsigned char helvetica12_133_bits[] = {
+0x00};
+static unsigned char helvetica12_134_bits[] = {
+0x00};
+static unsigned char helvetica12_135_bits[] = {
+0x00};
+static unsigned char helvetica12_136_bits[] = {
+0x00};
+static unsigned char helvetica12_137_bits[] = {
+0x00};
+static unsigned char helvetica12_138_bits[] = {
+0x00};
+static unsigned char helvetica12_139_bits[] = {
+0x00};
+static unsigned char helvetica12_140_bits[] = {
+0x00};
+static unsigned char helvetica12_141_bits[] = {
+0x00};
+static unsigned char helvetica12_142_bits[] = {
+0x00};
+static unsigned char helvetica12_143_bits[] = {
+0x00};
+static unsigned char helvetica12_144_bits[] = {
+0x00};
+static unsigned char helvetica12_145_bits[] = {
+0x00};
+static unsigned char helvetica12_146_bits[] = {
+0x00};
+static unsigned char helvetica12_147_bits[] = {
+0x00};
+static unsigned char helvetica12_148_bits[] = {
+0x00};
+static unsigned char helvetica12_149_bits[] = {
+0x00};
+static unsigned char helvetica12_150_bits[] = {
+0x00};
+static unsigned char helvetica12_151_bits[] = {
+0x00};
+static unsigned char helvetica12_152_bits[] = {
+0x00};
+static unsigned char helvetica12_153_bits[] = {
+0x00};
+static unsigned char helvetica12_154_bits[] = {
+0x00};
+static unsigned char helvetica12_155_bits[] = {
+0x00};
+static unsigned char helvetica12_156_bits[] = {
+0x00};
+static unsigned char helvetica12_157_bits[] = {
+0x00};
+static unsigned char helvetica12_158_bits[] = {
+0x00};
+static unsigned char helvetica12_159_bits[] = {
+0x00};
+static unsigned char helvetica12_160_bits[] = {
+0x00};
+static unsigned char helvetica12_161_bits[] = {
+0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_162_bits[] = {
+0x08, 0x0e, 0x15, 0x05, 0x05, 0x05, 0x13, 0x0e, 0x02};
+static unsigned char helvetica12_163_bits[] = {
+0x0c, 0x12, 0x02, 0x02, 0x0f, 0x04, 0x04, 0x12, 0x0d};
+static unsigned char helvetica12_164_bits[] = {
+0x21, 0x1e, 0x12, 0x12, 0x1e, 0x21};
+static unsigned char helvetica12_165_bits[] = {
+0x11, 0x11, 0x0a, 0x04, 0x1f, 0x04, 0x1f, 0x04, 0x04};
+static unsigned char helvetica12_166_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_167_bits[] = {
+0x0e, 0x11, 0x01, 0x06, 0x09, 0x11, 0x11, 0x12, 0x0c, 0x10, 0x11, 0x0e};
+static unsigned char helvetica12_168_bits[] = {
+0x05};
+static unsigned char helvetica12_169_bits[] = {
+0x7c, 0x00, 0x82, 0x00, 0x39, 0x01, 0x45, 0x01, 0x05, 0x01, 0x45, 0x01, 
+0x39, 0x01, 0x82, 0x00, 0x7c, 0x00};
+static unsigned char helvetica12_170_bits[] = {
+0x07, 0x04, 0x05, 0x00, 0x07};
+static unsigned char helvetica12_171_bits[] = {
+0x14, 0x0a, 0x05, 0x0a, 0x14};
+static unsigned char helvetica12_172_bits[] = {
+0x3f, 0x20, 0x20, 0x20};
+static unsigned char helvetica12_173_bits[] = {
+0x0f};
+static unsigned char helvetica12_174_bits[] = {
+0x7c, 0x00, 0x82, 0x00, 0x39, 0x01, 0x29, 0x01, 0x19, 0x01, 0x29, 0x01, 
+0x29, 0x01, 0x82, 0x00, 0x7c, 0x00};
+static unsigned char helvetica12_175_bits[] = {
+0x0f};
+static unsigned char helvetica12_176_bits[] = {
+0x06, 0x09, 0x09, 0x06};
+static unsigned char helvetica12_177_bits[] = {
+0x04, 0x04, 0x1f, 0x04, 0x04, 0x00, 0x1f};
+static unsigned char helvetica12_178_bits[] = {
+0x06, 0x09, 0x04, 0x02, 0x0f};
+static unsigned char helvetica12_179_bits[] = {
+0x07, 0x04, 0x02, 0x04, 0x03};
+static unsigned char helvetica12_180_bits[] = {
+0x02, 0x01};
+static unsigned char helvetica12_181_bits[] = {
+0x11, 0x11, 0x11, 0x11, 0x11, 0x19, 0x17, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_182_bits[] = {
+0x3c, 0x16, 0x17, 0x17, 0x17, 0x16, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14};
+static unsigned char helvetica12_183_bits[] = {
+0x01};
+static unsigned char helvetica12_184_bits[] = {
+0x02, 0x04, 0x04, 0x03};
+static unsigned char helvetica12_185_bits[] = {
+0x02, 0x03, 0x02, 0x02, 0x02};
+static unsigned char helvetica12_186_bits[] = {
+0x07, 0x05, 0x07, 0x00, 0x07};
+static unsigned char helvetica12_187_bits[] = {
+0x05, 0x0a, 0x14, 0x0a, 0x05};
+static unsigned char helvetica12_188_bits[] = {
+0x82, 0x00, 0x43, 0x00, 0x22, 0x00, 0x22, 0x00, 0x92, 0x00, 0xc8, 0x00, 
+0xa8, 0x00, 0xe4, 0x01, 0x82, 0x00};
+static unsigned char helvetica12_189_bits[] = {
+0x82, 0x00, 0x43, 0x00, 0x22, 0x00, 0x12, 0x00, 0xd2, 0x00, 0x28, 0x01, 
+0x88, 0x00, 0x44, 0x00, 0xe2, 0x01};
+static unsigned char helvetica12_190_bits[] = {
+0x87, 0x00, 0x44, 0x00, 0x22, 0x00, 0x24, 0x00, 0x93, 0x00, 0xd0, 0x00, 
+0xa8, 0x00, 0xe8, 0x01, 0x84, 0x00};
+static unsigned char helvetica12_191_bits[] = {
+0x04, 0x00, 0x04, 0x04, 0x02, 0x02, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_192_bits[] = {
+0x04, 0x08, 0x00, 0x08, 0x08, 0x14, 0x22, 0x22, 0x3e, 0x41, 0x41, 0x41};
+static unsigned char helvetica12_193_bits[] = {
+0x10, 0x08, 0x00, 0x08, 0x08, 0x14, 0x22, 0x22, 0x3e, 0x41, 0x41, 0x41};
+static unsigned char helvetica12_194_bits[] = {
+0x08, 0x14, 0x00, 0x08, 0x08, 0x14, 0x22, 0x22, 0x3e, 0x41, 0x41, 0x41};
+static unsigned char helvetica12_195_bits[] = {
+0x28, 0x14, 0x00, 0x08, 0x08, 0x14, 0x22, 0x22, 0x3e, 0x41, 0x41, 0x41};
+static unsigned char helvetica12_196_bits[] = {
+0x14, 0x00, 0x08, 0x08, 0x14, 0x22, 0x22, 0x3e, 0x41, 0x41, 0x41};
+static unsigned char helvetica12_197_bits[] = {
+0x08, 0x14, 0x08, 0x08, 0x08, 0x14, 0x22, 0x22, 0x3e, 0x41, 0x41, 0x41};
+static unsigned char helvetica12_198_bits[] = {
+0xf8, 0x01, 0x14, 0x00, 0x14, 0x00, 0x12, 0x00, 0xf2, 0x01, 0x1e, 0x00, 
+0x11, 0x00, 0x11, 0x00, 0xf1, 0x01};
+static unsigned char helvetica12_199_bits[] = {
+0x3c, 0x42, 0x01, 0x01, 0x01, 0x01, 0x01, 0x42, 0x3c, 0x10, 0x10, 0x0c};
+static unsigned char helvetica12_200_bits[] = {
+0x04, 0x08, 0x00, 0x3f, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 0x3f};
+static unsigned char helvetica12_201_bits[] = {
+0x10, 0x08, 0x00, 0x3f, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 0x3f};
+static unsigned char helvetica12_202_bits[] = {
+0x08, 0x14, 0x00, 0x3f, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 0x3f};
+static unsigned char helvetica12_203_bits[] = {
+0x14, 0x00, 0x3f, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 0x3f};
+static unsigned char helvetica12_204_bits[] = {
+0x01, 0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica12_205_bits[] = {
+0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_206_bits[] = {
+0x02, 0x05, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica12_207_bits[] = {
+0x05, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica12_208_bits[] = {
+0x3e, 0x42, 0x82, 0x82, 0x8f, 0x82, 0x82, 0x42, 0x3e};
+static unsigned char helvetica12_209_bits[] = {
+0x28, 0x14, 0x00, 0x41, 0x43, 0x45, 0x45, 0x49, 0x51, 0x51, 0x61, 0x41};
+static unsigned char helvetica12_210_bits[] = {
+0x08, 0x10, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char helvetica12_211_bits[] = {
+0x20, 0x10, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char helvetica12_212_bits[] = {
+0x10, 0x28, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char helvetica12_213_bits[] = {
+0x28, 0x14, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char helvetica12_214_bits[] = {
+0x24, 0x00, 0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char helvetica12_215_bits[] = {
+0x11, 0x0a, 0x04, 0x0a, 0x11};
+static unsigned char helvetica12_216_bits[] = {
+0x00, 0x02, 0x78, 0x01, 0x84, 0x00, 0x42, 0x01, 0x22, 0x01, 0x22, 0x01, 
+0x12, 0x01, 0x0a, 0x01, 0x84, 0x00, 0x7a, 0x00, 0x01, 0x00};
+static unsigned char helvetica12_217_bits[] = {
+0x04, 0x08, 0x00, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1e};
+static unsigned char helvetica12_218_bits[] = {
+0x10, 0x08, 0x00, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1e};
+static unsigned char helvetica12_219_bits[] = {
+0x08, 0x14, 0x00, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1e};
+static unsigned char helvetica12_220_bits[] = {
+0x12, 0x00, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1e};
+static unsigned char helvetica12_221_bits[] = {
+0x10, 0x08, 0x00, 0x41, 0x41, 0x22, 0x22, 0x14, 0x08, 0x08, 0x08, 0x08};
+static unsigned char helvetica12_222_bits[] = {
+0x01, 0x01, 0x1f, 0x21, 0x21, 0x21, 0x1f, 0x01, 0x01};
+static unsigned char helvetica12_223_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x0d, 0x11, 0x11, 0x11, 0x0d};
+static unsigned char helvetica12_224_bits[] = {
+0x04, 0x08, 0x00, 0x0e, 0x11, 0x10, 0x1e, 0x11, 0x11, 0x2e};
+static unsigned char helvetica12_225_bits[] = {
+0x08, 0x04, 0x00, 0x0e, 0x11, 0x10, 0x1e, 0x11, 0x11, 0x2e};
+static unsigned char helvetica12_226_bits[] = {
+0x04, 0x0a, 0x00, 0x0e, 0x11, 0x10, 0x1e, 0x11, 0x11, 0x2e};
+static unsigned char helvetica12_227_bits[] = {
+0x14, 0x0a, 0x00, 0x0e, 0x11, 0x10, 0x1e, 0x11, 0x11, 0x2e};
+static unsigned char helvetica12_228_bits[] = {
+0x0a, 0x00, 0x0e, 0x11, 0x10, 0x1e, 0x11, 0x11, 0x2e};
+static unsigned char helvetica12_229_bits[] = {
+0x0c, 0x12, 0x0c, 0x0e, 0x11, 0x10, 0x1e, 0x11, 0x11, 0x2e};
+static unsigned char helvetica12_230_bits[] = {
+0xee, 0x00, 0x11, 0x01, 0x10, 0x01, 0xfe, 0x01, 0x11, 0x00, 0x11, 0x01, 
+0xee, 0x00};
+static unsigned char helvetica12_231_bits[] = {
+0x0e, 0x11, 0x01, 0x01, 0x01, 0x11, 0x0e, 0x04, 0x08, 0x06};
+static unsigned char helvetica12_232_bits[] = {
+0x02, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x1f, 0x01, 0x11, 0x0e};
+static unsigned char helvetica12_233_bits[] = {
+0x08, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x1f, 0x01, 0x11, 0x0e};
+static unsigned char helvetica12_234_bits[] = {
+0x04, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x1f, 0x01, 0x11, 0x0e};
+static unsigned char helvetica12_235_bits[] = {
+0x0a, 0x00, 0x0e, 0x11, 0x11, 0x1f, 0x01, 0x11, 0x0e};
+static unsigned char helvetica12_236_bits[] = {
+0x01, 0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica12_237_bits[] = {
+0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_238_bits[] = {
+0x02, 0x05, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica12_239_bits[] = {
+0x05, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica12_240_bits[] = {
+0x16, 0x0c, 0x0a, 0x10, 0x1e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_241_bits[] = {
+0x14, 0x0a, 0x00, 0x0d, 0x13, 0x11, 0x11, 0x11, 0x11, 0x11};
+static unsigned char helvetica12_242_bits[] = {
+0x02, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_243_bits[] = {
+0x08, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_244_bits[] = {
+0x04, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_245_bits[] = {
+0x14, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_246_bits[] = {
+0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica12_247_bits[] = {
+0x04, 0x00, 0x1f, 0x00, 0x04};
+static unsigned char helvetica12_248_bits[] = {
+0x5c, 0x22, 0x32, 0x2a, 0x26, 0x22, 0x1d};
+static unsigned char helvetica12_249_bits[] = {
+0x02, 0x04, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char helvetica12_250_bits[] = {
+0x08, 0x04, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char helvetica12_251_bits[] = {
+0x04, 0x0a, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char helvetica12_252_bits[] = {
+0x0a, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x19, 0x16};
+static unsigned char helvetica12_253_bits[] = {
+0x08, 0x04, 0x00, 0x11, 0x11, 0x11, 0x09, 0x0a, 0x0a, 0x04, 0x04, 0x02, 
+0x01};
+static unsigned char helvetica12_254_bits[] = {
+0x01, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11, 0x13, 0x0d, 0x01, 0x01, 0x01};
+static unsigned char helvetica12_255_bits[] = {
+0x0a, 0x00, 0x11, 0x11, 0x12, 0x0a, 0x0a, 0x0c, 0x04, 0x04, 0x04, 0x03};
+static RotFont helvetica12font[] = {
+{5, 1, 1, helvetica12_0_bits},
+{5, 1, 1, helvetica12_1_bits},
+{5, 1, 1, helvetica12_2_bits},
+{5, 1, 1, helvetica12_3_bits},
+{5, 1, 1, helvetica12_4_bits},
+{5, 1, 1, helvetica12_5_bits},
+{5, 1, 1, helvetica12_6_bits},
+{5, 1, 1, helvetica12_7_bits},
+{5, 1, 1, helvetica12_8_bits},
+{5, 1, 1, helvetica12_9_bits},
+{5, 1, 1, helvetica12_10_bits},
+{5, 1, 1, helvetica12_11_bits},
+{5, 1, 1, helvetica12_12_bits},
+{5, 1, 1, helvetica12_13_bits},
+{5, 1, 1, helvetica12_14_bits},
+{5, 1, 1, helvetica12_15_bits},
+{5, 1, 1, helvetica12_16_bits},
+{5, 1, 1, helvetica12_17_bits},
+{5, 1, 1, helvetica12_18_bits},
+{5, 1, 1, helvetica12_19_bits},
+{5, 1, 1, helvetica12_20_bits},
+{5, 1, 1, helvetica12_21_bits},
+{5, 1, 1, helvetica12_22_bits},
+{5, 1, 1, helvetica12_23_bits},
+{5, 1, 1, helvetica12_24_bits},
+{5, 1, 1, helvetica12_25_bits},
+{5, 1, 1, helvetica12_26_bits},
+{5, 1, 1, helvetica12_27_bits},
+{5, 1, 1, helvetica12_28_bits},
+{5, 1, 1, helvetica12_29_bits},
+{5, 1, 1, helvetica12_30_bits},
+{5, 1, 1, helvetica12_31_bits},
+{6, 1, 1, helvetica12_32_bits},
+{1, 9, 9, helvetica12_33_bits},
+{3, 3, 9, helvetica12_34_bits},
+{6, 8, 8, helvetica12_35_bits},
+{5, 10, 9, helvetica12_36_bits},
+{9, 9, 9, helvetica12_37_bits},
+{7, 9, 9, helvetica12_38_bits},
+{2, 3, 9, helvetica12_39_bits},
+{3, 12, 9, helvetica12_40_bits},
+{3, 12, 9, helvetica12_41_bits},
+{3, 3, 9, helvetica12_42_bits},
+{5, 5, 6, helvetica12_43_bits},
+{2, 3, 1, helvetica12_44_bits},
+{5, 1, 4, helvetica12_45_bits},
+{1, 1, 1, helvetica12_46_bits},
+{4, 9, 9, helvetica12_47_bits},
+{5, 9, 9, helvetica12_48_bits},
+{3, 9, 9, helvetica12_49_bits},
+{5, 9, 9, helvetica12_50_bits},
+{5, 9, 9, helvetica12_51_bits},
+{6, 9, 9, helvetica12_52_bits},
+{5, 9, 9, helvetica12_53_bits},
+{5, 9, 9, helvetica12_54_bits},
+{5, 9, 9, helvetica12_55_bits},
+{5, 9, 9, helvetica12_56_bits},
+{5, 9, 9, helvetica12_57_bits},
+{1, 6, 6, helvetica12_58_bits},
+{2, 8, 6, helvetica12_59_bits},
+{6, 5, 6, helvetica12_60_bits},
+{5, 3, 5, helvetica12_61_bits},
+{6, 5, 6, helvetica12_62_bits},
+{5, 9, 9, helvetica12_63_bits},
+{10, 10, 9, helvetica12_64_bits},
+{7, 9, 9, helvetica12_65_bits},
+{6, 9, 9, helvetica12_66_bits},
+{7, 9, 9, helvetica12_67_bits},
+{7, 9, 9, helvetica12_68_bits},
+{6, 9, 9, helvetica12_69_bits},
+{6, 9, 9, helvetica12_70_bits},
+{7, 9, 9, helvetica12_71_bits},
+{7, 9, 9, helvetica12_72_bits},
+{1, 9, 9, helvetica12_73_bits},
+{5, 9, 9, helvetica12_74_bits},
+{7, 9, 9, helvetica12_75_bits},
+{5, 9, 9, helvetica12_76_bits},
+{9, 9, 9, helvetica12_77_bits},
+{7, 9, 9, helvetica12_78_bits},
+{8, 9, 9, helvetica12_79_bits},
+{6, 9, 9, helvetica12_80_bits},
+{8, 9, 9, helvetica12_81_bits},
+{6, 9, 9, helvetica12_82_bits},
+{6, 9, 9, helvetica12_83_bits},
+{7, 9, 9, helvetica12_84_bits},
+{6, 9, 9, helvetica12_85_bits},
+{7, 9, 9, helvetica12_86_bits},
+{9, 9, 9, helvetica12_87_bits},
+{7, 9, 9, helvetica12_88_bits},
+{7, 9, 9, helvetica12_89_bits},
+{7, 9, 9, helvetica12_90_bits},
+{2, 12, 9, helvetica12_91_bits},
+{4, 9, 9, helvetica12_92_bits},
+{2, 12, 9, helvetica12_93_bits},
+{5, 3, 8, helvetica12_94_bits},
+{7, 1, -1, helvetica12_95_bits},
+{2, 3, 9, helvetica12_96_bits},
+{6, 7, 7, helvetica12_97_bits},
+{5, 9, 9, helvetica12_98_bits},
+{5, 7, 7, helvetica12_99_bits},
+{5, 9, 9, helvetica12_100_bits},
+{5, 7, 7, helvetica12_101_bits},
+{4, 9, 9, helvetica12_102_bits},
+{5, 10, 7, helvetica12_103_bits},
+{5, 9, 9, helvetica12_104_bits},
+{1, 9, 9, helvetica12_105_bits},
+{2, 12, 9, helvetica12_106_bits},
+{5, 9, 9, helvetica12_107_bits},
+{1, 9, 9, helvetica12_108_bits},
+{7, 7, 7, helvetica12_109_bits},
+{5, 7, 7, helvetica12_110_bits},
+{5, 7, 7, helvetica12_111_bits},
+{5, 10, 7, helvetica12_112_bits},
+{5, 10, 7, helvetica12_113_bits},
+{3, 7, 7, helvetica12_114_bits},
+{4, 7, 7, helvetica12_115_bits},
+{3, 9, 9, helvetica12_116_bits},
+{5, 7, 7, helvetica12_117_bits},
+{5, 7, 7, helvetica12_118_bits},
+{9, 7, 7, helvetica12_119_bits},
+{6, 7, 7, helvetica12_120_bits},
+{5, 10, 7, helvetica12_121_bits},
+{4, 7, 7, helvetica12_122_bits},
+{4, 12, 9, helvetica12_123_bits},
+{1, 12, 9, helvetica12_124_bits},
+{4, 12, 9, helvetica12_125_bits},
+{6, 2, 5, helvetica12_126_bits},
+{5, 1, 1, helvetica12_127_bits},
+{5, 1, 1, helvetica12_128_bits},
+{5, 1, 1, helvetica12_129_bits},
+{5, 1, 1, helvetica12_130_bits},
+{5, 1, 1, helvetica12_131_bits},
+{5, 1, 1, helvetica12_132_bits},
+{5, 1, 1, helvetica12_133_bits},
+{5, 1, 1, helvetica12_134_bits},
+{5, 1, 1, helvetica12_135_bits},
+{5, 1, 1, helvetica12_136_bits},
+{5, 1, 1, helvetica12_137_bits},
+{5, 1, 1, helvetica12_138_bits},
+{5, 1, 1, helvetica12_139_bits},
+{5, 1, 1, helvetica12_140_bits},
+{5, 1, 1, helvetica12_141_bits},
+{5, 1, 1, helvetica12_142_bits},
+{5, 1, 1, helvetica12_143_bits},
+{5, 1, 1, helvetica12_144_bits},
+{5, 1, 1, helvetica12_145_bits},
+{5, 1, 1, helvetica12_146_bits},
+{5, 1, 1, helvetica12_147_bits},
+{5, 1, 1, helvetica12_148_bits},
+{5, 1, 1, helvetica12_149_bits},
+{5, 1, 1, helvetica12_150_bits},
+{5, 1, 1, helvetica12_151_bits},
+{5, 1, 1, helvetica12_152_bits},
+{5, 1, 1, helvetica12_153_bits},
+{5, 1, 1, helvetica12_154_bits},
+{5, 1, 1, helvetica12_155_bits},
+{5, 1, 1, helvetica12_156_bits},
+{5, 1, 1, helvetica12_157_bits},
+{5, 1, 1, helvetica12_158_bits},
+{5, 1, 1, helvetica12_159_bits},
+{1, 1, 1, helvetica12_160_bits},
+{1, 10, 7, helvetica12_161_bits},
+{5, 9, 8, helvetica12_162_bits},
+{5, 9, 9, helvetica12_163_bits},
+{6, 6, 7, helvetica12_164_bits},
+{5, 9, 9, helvetica12_165_bits},
+{1, 11, 9, helvetica12_166_bits},
+{5, 12, 9, helvetica12_167_bits},
+{3, 1, 9, helvetica12_168_bits},
+{9, 9, 9, helvetica12_169_bits},
+{3, 5, 9, helvetica12_170_bits},
+{5, 5, 6, helvetica12_171_bits},
+{6, 4, 6, helvetica12_172_bits},
+{4, 1, 4, helvetica12_173_bits},
+{9, 9, 9, helvetica12_174_bits},
+{4, 1, 9, helvetica12_175_bits},
+{4, 4, 8, helvetica12_176_bits},
+{5, 7, 7, helvetica12_177_bits},
+{4, 5, 8, helvetica12_178_bits},
+{3, 5, 8, helvetica12_179_bits},
+{2, 2, 10, helvetica12_180_bits},
+{5, 10, 7, helvetica12_181_bits},
+{6, 12, 9, helvetica12_182_bits},
+{1, 1, 4, helvetica12_183_bits},
+{3, 4, 1, helvetica12_184_bits},
+{2, 5, 8, helvetica12_185_bits},
+{3, 5, 9, helvetica12_186_bits},
+{5, 5, 6, helvetica12_187_bits},
+{9, 9, 9, helvetica12_188_bits},
+{9, 9, 9, helvetica12_189_bits},
+{9, 9, 9, helvetica12_190_bits},
+{5, 9, 6, helvetica12_191_bits},
+{7, 12, 12, helvetica12_192_bits},
+{7, 12, 12, helvetica12_193_bits},
+{7, 12, 12, helvetica12_194_bits},
+{7, 12, 12, helvetica12_195_bits},
+{7, 11, 11, helvetica12_196_bits},
+{7, 12, 12, helvetica12_197_bits},
+{9, 9, 9, helvetica12_198_bits},
+{7, 12, 9, helvetica12_199_bits},
+{6, 12, 12, helvetica12_200_bits},
+{6, 12, 12, helvetica12_201_bits},
+{6, 12, 12, helvetica12_202_bits},
+{6, 11, 11, helvetica12_203_bits},
+{2, 12, 12, helvetica12_204_bits},
+{2, 12, 12, helvetica12_205_bits},
+{3, 12, 12, helvetica12_206_bits},
+{3, 11, 11, helvetica12_207_bits},
+{8, 9, 9, helvetica12_208_bits},
+{7, 12, 12, helvetica12_209_bits},
+{8, 12, 12, helvetica12_210_bits},
+{8, 12, 12, helvetica12_211_bits},
+{8, 12, 12, helvetica12_212_bits},
+{8, 12, 12, helvetica12_213_bits},
+{8, 11, 11, helvetica12_214_bits},
+{5, 5, 6, helvetica12_215_bits},
+{10, 11, 10, helvetica12_216_bits},
+{6, 12, 12, helvetica12_217_bits},
+{6, 12, 12, helvetica12_218_bits},
+{6, 12, 12, helvetica12_219_bits},
+{6, 11, 11, helvetica12_220_bits},
+{7, 12, 12, helvetica12_221_bits},
+{6, 9, 9, helvetica12_222_bits},
+{5, 9, 9, helvetica12_223_bits},
+{6, 10, 10, helvetica12_224_bits},
+{6, 10, 10, helvetica12_225_bits},
+{6, 10, 10, helvetica12_226_bits},
+{6, 10, 10, helvetica12_227_bits},
+{6, 9, 9, helvetica12_228_bits},
+{6, 10, 10, helvetica12_229_bits},
+{9, 7, 7, helvetica12_230_bits},
+{5, 10, 7, helvetica12_231_bits},
+{5, 10, 10, helvetica12_232_bits},
+{5, 10, 10, helvetica12_233_bits},
+{5, 10, 10, helvetica12_234_bits},
+{5, 9, 9, helvetica12_235_bits},
+{2, 10, 10, helvetica12_236_bits},
+{2, 10, 10, helvetica12_237_bits},
+{3, 10, 10, helvetica12_238_bits},
+{3, 9, 9, helvetica12_239_bits},
+{5, 10, 10, helvetica12_240_bits},
+{5, 10, 10, helvetica12_241_bits},
+{5, 10, 10, helvetica12_242_bits},
+{5, 10, 10, helvetica12_243_bits},
+{5, 10, 10, helvetica12_244_bits},
+{5, 10, 10, helvetica12_245_bits},
+{5, 9, 9, helvetica12_246_bits},
+{5, 5, 6, helvetica12_247_bits},
+{7, 7, 7, helvetica12_248_bits},
+{5, 10, 10, helvetica12_249_bits},
+{5, 10, 10, helvetica12_250_bits},
+{5, 10, 10, helvetica12_251_bits},
+{5, 9, 9, helvetica12_252_bits},
+{5, 13, 10, helvetica12_253_bits},
+{5, 12, 9, helvetica12_254_bits},
+{5, 12, 9, helvetica12_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica14.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica14.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica14.bdf	(revision 15879)
@@ -0,0 +1,3309 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Helvetica-Medium-R-Normal--14-100-100-100-P-76-ISO8859-1
+SIZE 10 100 100
+FONTBOUNDINGBOX 14 17 -1 -3
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Helvetica"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 14
+POINT_SIZE 100
+RESOLUTION_X 100
+RESOLUTION_Y 100
+SPACING "P"
+AVERAGE_WIDTH 76
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 11
+X_HEIGHT 8
+FACE_NAME "Helvetica"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.  "
+_DEC_DEVICE_FONTNAMES "PS=Helvetica"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Helvetica"
+FONT "-Adobe-Helvetica-Medium-R-Normal--14-100-100-100-P-76-ISO8859-1"
+WEIGHT 10
+RESOLUTION 138
+QUAD_WIDTH 8
+DEFAULT_CHAR 32
+FONT_ASCENT 13
+FONT_DESCENT 3
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 1 11 2 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+00
+80
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 3 1 8
+BITMAP
+a0
+a0
+a0
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 10 0 0
+BITMAP
+14
+14
+14
+7e
+28
+28
+fc
+50
+50
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 14 0 -2
+BITMAP
+10
+7c
+92
+92
+90
+50
+38
+14
+12
+92
+92
+7c
+10
+10
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 864 0
+DWIDTH 12 0
+BBX 11 11 0 0
+BITMAP
+7080
+8900
+8900
+7200
+0200
+0400
+0800
+09c0
+1220
+1220
+21c0
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+30
+48
+48
+30
+20
+52
+8a
+84
+8a
+71
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 2 3 1 8
+BITMAP
+c0
+40
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 14 1 -3
+BITMAP
+20
+40
+40
+80
+80
+80
+80
+80
+80
+80
+80
+40
+40
+20
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 14 1 -3
+BITMAP
+80
+40
+40
+20
+20
+20
+20
+20
+20
+20
+20
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 5 1 6
+BITMAP
+20
+a8
+70
+a8
+20
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 1
+BITMAP
+10
+10
+10
+fe
+10
+10
+10
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 2 4 0 -2
+BITMAP
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 1 1 4
+BITMAP
+fe
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 1 2 1 0
+BITMAP
+80
+80
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 11 0 0
+BITMAP
+10
+10
+20
+20
+20
+40
+40
+40
+80
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+78
+84
+84
+84
+84
+84
+84
+84
+84
+84
+78
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 3 11 2 0
+BITMAP
+20
+e0
+20
+20
+20
+20
+20
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+78
+84
+84
+04
+08
+10
+20
+40
+80
+80
+fc
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+78
+84
+84
+04
+04
+38
+04
+04
+84
+84
+78
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 11 1 0
+BITMAP
+04
+0c
+14
+24
+44
+84
+84
+fe
+04
+04
+04
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+fc
+80
+80
+80
+f8
+04
+04
+04
+84
+84
+78
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+78
+84
+80
+80
+b8
+c4
+84
+84
+84
+84
+78
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+fc
+04
+08
+08
+10
+10
+20
+20
+40
+40
+40
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+78
+84
+84
+84
+84
+78
+84
+84
+84
+84
+78
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+78
+84
+84
+84
+84
+7c
+04
+04
+84
+84
+78
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 1 8 1 0
+BITMAP
+80
+80
+00
+00
+00
+00
+80
+80
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 2 10 0 -2
+BITMAP
+40
+40
+00
+00
+00
+00
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 5 1 2
+BITMAP
+0c
+30
+c0
+30
+0c
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 3 1 3
+BITMAP
+fc
+00
+fc
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 5 1 2
+BITMAP
+c0
+30
+0c
+30
+c0
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+30
+cc
+84
+84
+04
+08
+10
+20
+00
+20
+20
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 936 0
+DWIDTH 13 0
+BBX 11 12 1 -1
+BITMAP
+0f00
+30c0
+4020
+46a0
+8920
+9120
+9120
+9340
+8d80
+4000
+6080
+1f00
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 11 0 0
+BITMAP
+0800
+1c00
+1400
+1400
+2200
+2200
+4100
+7f00
+4100
+8080
+8080
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 11 1 0
+BITMAP
+fc
+86
+82
+82
+84
+f8
+84
+82
+82
+86
+fc
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 11 1 0
+BITMAP
+1c
+63
+41
+80
+80
+80
+80
+80
+41
+63
+1c
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 11 1 0
+BITMAP
+f8
+86
+82
+81
+81
+81
+81
+81
+82
+86
+f8
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 11 1 0
+BITMAP
+fe
+80
+80
+80
+80
+fc
+80
+80
+80
+80
+fe
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 11 1 0
+BITMAP
+fe
+80
+80
+80
+80
+fc
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+1e00
+6180
+4080
+8000
+8000
+8780
+8080
+8080
+4080
+6380
+1c80
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 11 1 0
+BITMAP
+81
+81
+81
+81
+81
+ff
+81
+81
+81
+81
+81
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 1 11 2 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 0 0
+BITMAP
+04
+04
+04
+04
+04
+04
+04
+04
+84
+84
+78
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 8 11 1 0
+BITMAP
+82
+84
+88
+90
+a0
+e0
+90
+88
+84
+82
+81
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 2 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+fc
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 864 0
+DWIDTH 12 0
+BBX 11 11 0 0
+BITMAP
+8020
+c060
+c060
+a0a0
+a0a0
+9120
+9120
+8a20
+8a20
+8420
+8420
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 11 1 0
+BITMAP
+c1
+a1
+a1
+91
+91
+89
+89
+85
+85
+83
+83
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 11 1 0
+BITMAP
+fc
+86
+82
+82
+86
+fc
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 11 1 0
+BITMAP
+1c00
+6300
+4100
+8080
+8080
+8080
+8880
+8480
+4300
+6300
+1c80
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 11 1 0
+BITMAP
+fe
+83
+81
+81
+82
+fc
+82
+81
+81
+81
+81
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 11 1 0
+BITMAP
+38
+c6
+82
+80
+60
+18
+06
+02
+82
+c6
+38
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 11 0 0
+BITMAP
+ff80
+0800
+0800
+0800
+0800
+0800
+0800
+0800
+0800
+0800
+0800
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 11 1 0
+BITMAP
+81
+81
+81
+81
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 11 0 0
+BITMAP
+8080
+8080
+4100
+4100
+6300
+2200
+2200
+1400
+1400
+0800
+0800
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 936 0
+DWIDTH 13 0
+BBX 13 11 0 0
+BITMAP
+8208
+8208
+8508
+4510
+4510
+4510
+28a0
+28a0
+28a0
+1040
+1040
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 11 0 0
+BITMAP
+8080
+4100
+2200
+1400
+0800
+0800
+1400
+2200
+4100
+4100
+8080
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 11 0 0
+BITMAP
+8080
+c180
+4100
+2200
+2200
+1400
+1c00
+0800
+0800
+0800
+0800
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 11 1 0
+BITMAP
+fe
+02
+04
+08
+18
+10
+20
+60
+40
+80
+fe
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 3 14 1 -3
+BITMAP
+e0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+e0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 11 0 0
+BITMAP
+80
+80
+40
+40
+40
+20
+20
+20
+10
+10
+10
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 3 14 0 -3
+BITMAP
+e0
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+e0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 5 1 6
+BITMAP
+20
+50
+50
+88
+88
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 8 1 0 -3
+BITMAP
+ff
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 2 3 0 8
+BITMAP
+40
+80
+c0
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 8 1 0
+BITMAP
+78
+cc
+04
+7c
+c4
+84
+cc
+76
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 1 0
+BITMAP
+80
+80
+80
+b8
+cc
+84
+84
+84
+84
+cc
+b8
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 8 1 0
+BITMAP
+78
+cc
+80
+80
+80
+84
+cc
+78
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+04
+04
+04
+74
+cc
+84
+84
+84
+84
+cc
+74
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 8 1 0
+BITMAP
+78
+cc
+84
+fc
+80
+80
+cc
+78
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 11 0 0
+BITMAP
+30
+40
+40
+e0
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 -3
+BITMAP
+74
+cc
+84
+84
+84
+84
+cc
+74
+04
+cc
+78
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+80
+80
+80
+b8
+cc
+84
+84
+84
+84
+84
+84
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 1 11 1 0
+BITMAP
+80
+80
+00
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 3 14 -1 -3
+BITMAP
+20
+20
+00
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+c0
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 1 0
+BITMAP
+80
+80
+80
+88
+90
+a0
+c0
+a0
+90
+88
+84
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 1 11 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 8 1 0
+BITMAP
+b300
+cc80
+8880
+8880
+8880
+8880
+8880
+8880
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 8 1 0
+BITMAP
+b8
+cc
+84
+84
+84
+84
+84
+84
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 8 1 0
+BITMAP
+78
+cc
+84
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 -3
+BITMAP
+b8
+cc
+84
+84
+84
+84
+cc
+b8
+80
+80
+80
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 -3
+BITMAP
+74
+cc
+84
+84
+84
+84
+cc
+74
+04
+04
+04
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 4 8 1 0
+BITMAP
+b0
+c0
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 8 1 0
+BITMAP
+70
+88
+c0
+70
+18
+08
+88
+70
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 10 0 0
+BITMAP
+40
+40
+e0
+40
+40
+40
+40
+40
+40
+30
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 8 1 0
+BITMAP
+84
+84
+84
+84
+84
+84
+cc
+74
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 8 0 0
+BITMAP
+82
+82
+44
+44
+44
+28
+28
+10
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 9 8 0 0
+BITMAP
+8880
+8880
+8880
+4900
+4900
+5500
+2200
+2200
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 8 0 0
+BITMAP
+c6
+44
+28
+10
+10
+28
+44
+c6
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 11 0 -3
+BITMAP
+82
+c2
+44
+44
+24
+28
+18
+10
+10
+30
+60
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 8 0 0
+BITMAP
+fc
+04
+08
+10
+20
+40
+80
+fc
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 5 14 0 -3
+BITMAP
+18
+20
+20
+20
+20
+40
+80
+40
+20
+20
+20
+20
+20
+18
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 1 14 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 5 14 0 -3
+BITMAP
+c0
+20
+20
+20
+20
+10
+08
+10
+20
+20
+20
+20
+20
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 3 1 3
+BITMAP
+64
+b4
+98
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 1 11 1 -3
+BITMAP
+80
+80
+00
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 10 1 -1
+BITMAP
+04
+78
+cc
+90
+90
+a0
+a4
+cc
+78
+80
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 11 0 0
+BITMAP
+38
+44
+40
+40
+f8
+20
+20
+20
+40
+62
+dc
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 6 1 2
+BITMAP
+84
+78
+48
+48
+78
+84
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 11 0 0
+BITMAP
+82
+82
+82
+44
+44
+28
+fe
+10
+fe
+10
+10
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 1 14 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+00
+00
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 5 14 2 -3
+BITMAP
+70
+d8
+88
+c0
+70
+98
+88
+88
+c8
+70
+18
+88
+d8
+70
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 5 1 0 9
+BITMAP
+d8
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 864 0
+DWIDTH 12 0
+BBX 10 11 1 0
+BITMAP
+1e00
+6180
+5c80
+a2c0
+a240
+a040
+a240
+9c40
+4080
+6180
+1e00
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 432 0
+DWIDTH 6 0
+BBX 4 7 1 4
+BITMAP
+e0
+10
+70
+90
+d0
+00
+f0
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 5 1 2
+BITMAP
+24
+48
+90
+48
+24
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 4 1 2
+BITMAP
+fe
+02
+02
+02
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 3 1 0 4
+BITMAP
+e0
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 864 0
+DWIDTH 12 0
+BBX 10 11 1 0
+BITMAP
+1e00
+6180
+5c80
+9240
+9240
+9c40
+9240
+9240
+4080
+6180
+1e00
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 1 0 9
+BITMAP
+f0
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 432 0
+DWIDTH 6 0
+BBX 4 4 1 7
+BITMAP
+60
+90
+90
+60
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 9 1 0
+BITMAP
+10
+10
+10
+fe
+10
+10
+10
+00
+fe
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 4 6 0 5
+BITMAP
+60
+90
+10
+20
+40
+f0
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 4 6 0 5
+BITMAP
+60
+90
+20
+10
+90
+60
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 2 2 2 9
+BITMAP
+40
+80
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 -3
+BITMAP
+84
+84
+84
+84
+84
+84
+cc
+b4
+80
+80
+80
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 14 0 -3
+BITMAP
+3e
+74
+f4
+f4
+f4
+74
+34
+14
+14
+14
+14
+14
+14
+14
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 2 1 1 4
+BITMAP
+c0
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 4 3 0 -3
+BITMAP
+20
+90
+60
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 2 6 1 5
+BITMAP
+40
+c0
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 432 0
+DWIDTH 6 0
+BBX 4 7 1 4
+BITMAP
+60
+90
+90
+90
+60
+00
+f0
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 5 1 2
+BITMAP
+90
+48
+24
+48
+90
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 864 0
+DWIDTH 12 0
+BBX 10 11 1 0
+BITMAP
+4200
+c200
+4400
+4400
+4800
+4880
+0980
+1280
+1480
+27c0
+2080
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 864 0
+DWIDTH 12 0
+BBX 9 11 1 0
+BITMAP
+4200
+c200
+4400
+4400
+4800
+4b00
+1480
+1080
+1100
+2200
+2780
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 864 0
+DWIDTH 12 0
+BBX 11 11 0 0
+BITMAP
+6100
+9100
+2200
+1200
+9400
+6440
+04c0
+0940
+0a40
+13e0
+1040
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 -3
+BITMAP
+10
+10
+00
+10
+20
+40
+80
+84
+84
+cc
+30
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 14 0 0
+BITMAP
+1000
+0800
+0000
+0800
+1c00
+1400
+1400
+2200
+2200
+4100
+7f00
+4100
+8080
+8080
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 14 0 0
+BITMAP
+0400
+0800
+0000
+0800
+1c00
+1400
+1400
+2200
+2200
+4100
+7f00
+4100
+8080
+8080
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 14 0 0
+BITMAP
+0c00
+1200
+0000
+0800
+1c00
+1400
+1400
+2200
+2200
+4100
+7f00
+4100
+8080
+8080
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 14 0 0
+BITMAP
+1a00
+2c00
+0000
+0800
+1c00
+1400
+1400
+2200
+2200
+4100
+7f00
+4100
+8080
+8080
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 13 0 0
+BITMAP
+3600
+0000
+0800
+1c00
+1400
+1400
+2200
+2200
+4100
+7f00
+4100
+8080
+8080
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 14 0 0
+BITMAP
+0c00
+1200
+1200
+0c00
+0c00
+1400
+1400
+2200
+2200
+4100
+7f00
+4100
+8080
+8080
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 1008 0
+DWIDTH 14 0
+BBX 12 11 1 0
+BITMAP
+1ff0
+1200
+1200
+2200
+2200
+23f0
+7e00
+4200
+4200
+8200
+83f0
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 -3
+BITMAP
+1c
+63
+41
+80
+80
+80
+80
+80
+41
+63
+1c
+08
+24
+18
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+20
+10
+00
+fe
+80
+80
+80
+80
+fc
+80
+80
+80
+80
+fe
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+08
+10
+00
+fe
+80
+80
+80
+80
+fc
+80
+80
+80
+80
+fe
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+18
+24
+00
+fe
+80
+80
+80
+80
+fc
+80
+80
+80
+80
+fe
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+6c
+00
+fe
+80
+80
+80
+80
+fc
+80
+80
+80
+80
+fe
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 2 14 1 0
+BITMAP
+80
+40
+00
+40
+40
+40
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 2 14 2 0
+BITMAP
+40
+80
+00
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 14 1 0
+BITMAP
+60
+90
+00
+40
+40
+40
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 5 13 0 0
+BITMAP
+d8
+00
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 9 11 0 0
+BITMAP
+7c00
+4300
+4100
+4080
+4080
+f080
+4080
+4080
+4100
+4300
+7c00
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+1a
+2c
+00
+c1
+a1
+a1
+91
+91
+89
+89
+85
+85
+83
+83
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+1000
+0800
+0000
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+0400
+0800
+0000
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+0c00
+1200
+0000
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+1a00
+2c00
+0000
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 13 1 0
+BITMAP
+3300
+0000
+1c00
+6300
+4100
+8080
+8080
+8080
+8080
+8080
+4100
+6300
+1c00
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 1
+BITMAP
+82
+44
+28
+10
+28
+44
+82
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 11 11 0 0
+BITMAP
+0e20
+31c0
+2080
+4140
+4240
+4440
+4840
+5040
+2080
+7180
+8e00
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+10
+08
+00
+81
+81
+81
+81
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+04
+08
+00
+81
+81
+81
+81
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+18
+24
+00
+81
+81
+81
+81
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+66
+00
+81
+81
+81
+81
+81
+81
+81
+81
+81
+42
+3c
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 14 0 0
+BITMAP
+0400
+0800
+0000
+8080
+c180
+4100
+2200
+2200
+1400
+1c00
+0800
+0800
+0800
+0800
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 11 1 0
+BITMAP
+80
+80
+fc
+86
+82
+82
+86
+fc
+80
+80
+80
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 11 1 0
+BITMAP
+70
+88
+88
+88
+b0
+90
+88
+88
+88
+88
+b0
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 11 1 0
+BITMAP
+20
+10
+00
+78
+cc
+04
+7c
+c4
+84
+cc
+76
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 11 1 0
+BITMAP
+10
+20
+00
+78
+cc
+04
+7c
+c4
+84
+cc
+76
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 11 1 0
+BITMAP
+30
+48
+00
+78
+cc
+04
+7c
+c4
+84
+cc
+76
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 11 1 0
+BITMAP
+34
+58
+00
+78
+cc
+04
+7c
+c4
+84
+cc
+76
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 11 1 0
+BITMAP
+48
+48
+00
+78
+cc
+04
+7c
+c4
+84
+cc
+76
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 12 1 0
+BITMAP
+30
+48
+30
+00
+78
+cc
+04
+7c
+c4
+84
+cc
+76
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 936 0
+DWIDTH 13 0
+BBX 11 8 1 0
+BITMAP
+7bc0
+c660
+0420
+7fe0
+c400
+8400
+ce60
+7bc0
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 -3
+BITMAP
+78
+cc
+80
+80
+80
+84
+cc
+78
+10
+48
+30
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+20
+10
+00
+78
+cc
+84
+fc
+80
+80
+cc
+78
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+10
+20
+00
+78
+cc
+84
+fc
+80
+80
+cc
+78
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+30
+48
+00
+78
+cc
+84
+fc
+80
+80
+cc
+78
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+48
+48
+00
+78
+cc
+84
+fc
+80
+80
+cc
+78
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 2 11 1 0
+BITMAP
+80
+40
+00
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 2 11 1 0
+BITMAP
+40
+80
+00
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 4 11 0 0
+BITMAP
+60
+90
+00
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 3 11 0 0
+BITMAP
+a0
+a0
+00
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+d8
+70
+90
+78
+cc
+84
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+68
+b0
+00
+b8
+cc
+84
+84
+84
+84
+84
+84
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+20
+10
+00
+78
+cc
+84
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+10
+20
+00
+78
+cc
+84
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+30
+48
+00
+78
+cc
+84
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+68
+b0
+00
+78
+cc
+84
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+48
+48
+00
+78
+cc
+84
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 7 1 1
+BITMAP
+10
+10
+00
+fe
+00
+10
+10
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 8 8 0 0
+BITMAP
+3d
+62
+46
+4a
+52
+62
+46
+bc
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+20
+10
+00
+84
+84
+84
+84
+84
+84
+cc
+74
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+10
+20
+00
+84
+84
+84
+84
+84
+84
+cc
+74
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+30
+48
+00
+84
+84
+84
+84
+84
+84
+cc
+74
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 11 1 0
+BITMAP
+48
+48
+00
+84
+84
+84
+84
+84
+84
+cc
+74
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 14 0 -3
+BITMAP
+08
+10
+00
+82
+c2
+44
+44
+24
+28
+18
+10
+10
+30
+60
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 14 1 -3
+BITMAP
+80
+80
+80
+b8
+cc
+84
+84
+84
+84
+cc
+b8
+80
+80
+80
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 14 0 -3
+BITMAP
+24
+24
+00
+82
+c2
+44
+44
+24
+28
+18
+10
+10
+30
+60
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica14.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica14.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica14.h	(revision 15879)
@@ -0,0 +1,845 @@
+static unsigned char helvetica14_0_bits[] = {
+0x00};
+static unsigned char helvetica14_1_bits[] = {
+0x00};
+static unsigned char helvetica14_2_bits[] = {
+0x00};
+static unsigned char helvetica14_3_bits[] = {
+0x00};
+static unsigned char helvetica14_4_bits[] = {
+0x00};
+static unsigned char helvetica14_5_bits[] = {
+0x00};
+static unsigned char helvetica14_6_bits[] = {
+0x00};
+static unsigned char helvetica14_7_bits[] = {
+0x00};
+static unsigned char helvetica14_8_bits[] = {
+0x00};
+static unsigned char helvetica14_9_bits[] = {
+0x00};
+static unsigned char helvetica14_10_bits[] = {
+0x00};
+static unsigned char helvetica14_11_bits[] = {
+0x00};
+static unsigned char helvetica14_12_bits[] = {
+0x00};
+static unsigned char helvetica14_13_bits[] = {
+0x00};
+static unsigned char helvetica14_14_bits[] = {
+0x00};
+static unsigned char helvetica14_15_bits[] = {
+0x00};
+static unsigned char helvetica14_16_bits[] = {
+0x00};
+static unsigned char helvetica14_17_bits[] = {
+0x00};
+static unsigned char helvetica14_18_bits[] = {
+0x00};
+static unsigned char helvetica14_19_bits[] = {
+0x00};
+static unsigned char helvetica14_20_bits[] = {
+0x00};
+static unsigned char helvetica14_21_bits[] = {
+0x00};
+static unsigned char helvetica14_22_bits[] = {
+0x00};
+static unsigned char helvetica14_23_bits[] = {
+0x00};
+static unsigned char helvetica14_24_bits[] = {
+0x00};
+static unsigned char helvetica14_25_bits[] = {
+0x00};
+static unsigned char helvetica14_26_bits[] = {
+0x00};
+static unsigned char helvetica14_27_bits[] = {
+0x00};
+static unsigned char helvetica14_28_bits[] = {
+0x00};
+static unsigned char helvetica14_29_bits[] = {
+0x00};
+static unsigned char helvetica14_30_bits[] = {
+0x00};
+static unsigned char helvetica14_31_bits[] = {
+0x00};
+static unsigned char helvetica14_32_bits[] = {
+0x00};
+static unsigned char helvetica14_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01};
+static unsigned char helvetica14_34_bits[] = {
+0x05, 0x05, 0x05};
+static unsigned char helvetica14_35_bits[] = {
+0x28, 0x28, 0x28, 0x7e, 0x14, 0x14, 0x3f, 0x0a, 0x0a, 0x0a};
+static unsigned char helvetica14_36_bits[] = {
+0x08, 0x3e, 0x49, 0x49, 0x09, 0x0a, 0x1c, 0x28, 0x48, 0x49, 0x49, 0x3e, 
+0x08, 0x08};
+static unsigned char helvetica14_37_bits[] = {
+0x0e, 0x01, 0x91, 0x00, 0x91, 0x00, 0x4e, 0x00, 0x40, 0x00, 0x20, 0x00, 
+0x10, 0x00, 0x90, 0x03, 0x48, 0x04, 0x48, 0x04, 0x84, 0x03};
+static unsigned char helvetica14_38_bits[] = {
+0x0c, 0x12, 0x12, 0x0c, 0x04, 0x4a, 0x51, 0x21, 0x51, 0x8e};
+static unsigned char helvetica14_39_bits[] = {
+0x03, 0x02, 0x01};
+static unsigned char helvetica14_40_bits[] = {
+0x04, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 
+0x02, 0x04};
+static unsigned char helvetica14_41_bits[] = {
+0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 
+0x02, 0x01};
+static unsigned char helvetica14_42_bits[] = {
+0x04, 0x15, 0x0e, 0x15, 0x04};
+static unsigned char helvetica14_43_bits[] = {
+0x08, 0x08, 0x08, 0x7f, 0x08, 0x08, 0x08};
+static unsigned char helvetica14_44_bits[] = {
+0x02, 0x02, 0x02, 0x01};
+static unsigned char helvetica14_45_bits[] = {
+0x7f};
+static unsigned char helvetica14_46_bits[] = {
+0x01, 0x01};
+static unsigned char helvetica14_47_bits[] = {
+0x08, 0x08, 0x04, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_48_bits[] = {
+0x1e, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1e};
+static unsigned char helvetica14_49_bits[] = {
+0x04, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04};
+static unsigned char helvetica14_50_bits[] = {
+0x1e, 0x21, 0x21, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x01, 0x3f};
+static unsigned char helvetica14_51_bits[] = {
+0x1e, 0x21, 0x21, 0x20, 0x20, 0x1c, 0x20, 0x20, 0x21, 0x21, 0x1e};
+static unsigned char helvetica14_52_bits[] = {
+0x20, 0x30, 0x28, 0x24, 0x22, 0x21, 0x21, 0x7f, 0x20, 0x20, 0x20};
+static unsigned char helvetica14_53_bits[] = {
+0x3f, 0x01, 0x01, 0x01, 0x1f, 0x20, 0x20, 0x20, 0x21, 0x21, 0x1e};
+static unsigned char helvetica14_54_bits[] = {
+0x1e, 0x21, 0x01, 0x01, 0x1d, 0x23, 0x21, 0x21, 0x21, 0x21, 0x1e};
+static unsigned char helvetica14_55_bits[] = {
+0x3f, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x02};
+static unsigned char helvetica14_56_bits[] = {
+0x1e, 0x21, 0x21, 0x21, 0x21, 0x1e, 0x21, 0x21, 0x21, 0x21, 0x1e};
+static unsigned char helvetica14_57_bits[] = {
+0x1e, 0x21, 0x21, 0x21, 0x21, 0x3e, 0x20, 0x20, 0x21, 0x21, 0x1e};
+static unsigned char helvetica14_58_bits[] = {
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01};
+static unsigned char helvetica14_59_bits[] = {
+0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x01};
+static unsigned char helvetica14_60_bits[] = {
+0x30, 0x0c, 0x03, 0x0c, 0x30};
+static unsigned char helvetica14_61_bits[] = {
+0x3f, 0x00, 0x3f};
+static unsigned char helvetica14_62_bits[] = {
+0x03, 0x0c, 0x30, 0x0c, 0x03};
+static unsigned char helvetica14_63_bits[] = {
+0x0c, 0x33, 0x21, 0x21, 0x20, 0x10, 0x08, 0x04, 0x00, 0x04, 0x04};
+static unsigned char helvetica14_64_bits[] = {
+0xf0, 0x00, 0x0c, 0x03, 0x02, 0x04, 0x62, 0x05, 0x91, 0x04, 0x89, 0x04, 
+0x89, 0x04, 0xc9, 0x02, 0xb1, 0x01, 0x02, 0x00, 0x06, 0x01, 0xf8, 0x00};
+static unsigned char helvetica14_65_bits[] = {
+0x10, 0x00, 0x38, 0x00, 0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 
+0x82, 0x00, 0xfe, 0x00, 0x82, 0x00, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_66_bits[] = {
+0x3f, 0x61, 0x41, 0x41, 0x21, 0x1f, 0x21, 0x41, 0x41, 0x61, 0x3f};
+static unsigned char helvetica14_67_bits[] = {
+0x38, 0xc6, 0x82, 0x01, 0x01, 0x01, 0x01, 0x01, 0x82, 0xc6, 0x38};
+static unsigned char helvetica14_68_bits[] = {
+0x1f, 0x61, 0x41, 0x81, 0x81, 0x81, 0x81, 0x81, 0x41, 0x61, 0x1f};
+static unsigned char helvetica14_69_bits[] = {
+0x7f, 0x01, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 0x01, 0x7f};
+static unsigned char helvetica14_70_bits[] = {
+0x7f, 0x01, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_71_bits[] = {
+0x78, 0x00, 0x86, 0x01, 0x02, 0x01, 0x01, 0x00, 0x01, 0x00, 0xe1, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0xc6, 0x01, 0x38, 0x01};
+static unsigned char helvetica14_72_bits[] = {
+0x81, 0x81, 0x81, 0x81, 0x81, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81};
+static unsigned char helvetica14_73_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_74_bits[] = {
+0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x21, 0x21, 0x1e};
+static unsigned char helvetica14_75_bits[] = {
+0x41, 0x21, 0x11, 0x09, 0x05, 0x07, 0x09, 0x11, 0x21, 0x41, 0x81};
+static unsigned char helvetica14_76_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x3f};
+static unsigned char helvetica14_77_bits[] = {
+0x01, 0x04, 0x03, 0x06, 0x03, 0x06, 0x05, 0x05, 0x05, 0x05, 0x89, 0x04, 
+0x89, 0x04, 0x51, 0x04, 0x51, 0x04, 0x21, 0x04, 0x21, 0x04};
+static unsigned char helvetica14_78_bits[] = {
+0x83, 0x85, 0x85, 0x89, 0x89, 0x91, 0x91, 0xa1, 0xa1, 0xc1, 0xc1};
+static unsigned char helvetica14_79_bits[] = {
+0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 0xc6, 0x00, 0x38, 0x00};
+static unsigned char helvetica14_80_bits[] = {
+0x3f, 0x61, 0x41, 0x41, 0x61, 0x3f, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_81_bits[] = {
+0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x11, 0x01, 0x21, 0x01, 0xc2, 0x00, 0xc6, 0x00, 0x38, 0x01};
+static unsigned char helvetica14_82_bits[] = {
+0x7f, 0xc1, 0x81, 0x81, 0x41, 0x3f, 0x41, 0x81, 0x81, 0x81, 0x81};
+static unsigned char helvetica14_83_bits[] = {
+0x1c, 0x63, 0x41, 0x01, 0x06, 0x18, 0x60, 0x40, 0x41, 0x63, 0x1c};
+static unsigned char helvetica14_84_bits[] = {
+0xff, 0x01, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char helvetica14_85_bits[] = {
+0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
+static unsigned char helvetica14_86_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 0x82, 0x00, 0xc6, 0x00, 0x44, 0x00, 
+0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char helvetica14_87_bits[] = {
+0x41, 0x10, 0x41, 0x10, 0xa1, 0x10, 0xa2, 0x08, 0xa2, 0x08, 0xa2, 0x08, 
+0x14, 0x05, 0x14, 0x05, 0x14, 0x05, 0x08, 0x02, 0x08, 0x02};
+static unsigned char helvetica14_88_bits[] = {
+0x01, 0x01, 0x82, 0x00, 0x44, 0x00, 0x28, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x82, 0x00, 0x82, 0x00, 0x01, 0x01};
+static unsigned char helvetica14_89_bits[] = {
+0x01, 0x01, 0x83, 0x01, 0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 
+0x38, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char helvetica14_90_bits[] = {
+0x7f, 0x40, 0x20, 0x10, 0x18, 0x08, 0x04, 0x06, 0x02, 0x01, 0x7f};
+static unsigned char helvetica14_91_bits[] = {
+0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x07};
+static unsigned char helvetica14_92_bits[] = {
+0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08};
+static unsigned char helvetica14_93_bits[] = {
+0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x07};
+static unsigned char helvetica14_94_bits[] = {
+0x04, 0x0a, 0x0a, 0x11, 0x11};
+static unsigned char helvetica14_95_bits[] = {
+0xff};
+static unsigned char helvetica14_96_bits[] = {
+0x02, 0x01, 0x03};
+static unsigned char helvetica14_97_bits[] = {
+0x1e, 0x33, 0x20, 0x3e, 0x23, 0x21, 0x33, 0x6e};
+static unsigned char helvetica14_98_bits[] = {
+0x01, 0x01, 0x01, 0x1d, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1d};
+static unsigned char helvetica14_99_bits[] = {
+0x1e, 0x33, 0x01, 0x01, 0x01, 0x21, 0x33, 0x1e};
+static unsigned char helvetica14_100_bits[] = {
+0x20, 0x20, 0x20, 0x2e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x2e};
+static unsigned char helvetica14_101_bits[] = {
+0x1e, 0x33, 0x21, 0x3f, 0x01, 0x01, 0x33, 0x1e};
+static unsigned char helvetica14_102_bits[] = {
+0x0c, 0x02, 0x02, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica14_103_bits[] = {
+0x2e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x2e, 0x20, 0x33, 0x1e};
+static unsigned char helvetica14_104_bits[] = {
+0x01, 0x01, 0x01, 0x1d, 0x33, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21};
+static unsigned char helvetica14_105_bits[] = {
+0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_106_bits[] = {
+0x04, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x03};
+static unsigned char helvetica14_107_bits[] = {
+0x01, 0x01, 0x01, 0x11, 0x09, 0x05, 0x03, 0x05, 0x09, 0x11, 0x21};
+static unsigned char helvetica14_108_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_109_bits[] = {
+0xcd, 0x00, 0x33, 0x01, 0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 
+0x11, 0x01, 0x11, 0x01};
+static unsigned char helvetica14_110_bits[] = {
+0x1d, 0x33, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21};
+static unsigned char helvetica14_111_bits[] = {
+0x1e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char helvetica14_112_bits[] = {
+0x1d, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1d, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_113_bits[] = {
+0x2e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x2e, 0x20, 0x20, 0x20};
+static unsigned char helvetica14_114_bits[] = {
+0x0d, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_115_bits[] = {
+0x0e, 0x11, 0x03, 0x0e, 0x18, 0x10, 0x11, 0x0e};
+static unsigned char helvetica14_116_bits[] = {
+0x02, 0x02, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c};
+static unsigned char helvetica14_117_bits[] = {
+0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x33, 0x2e};
+static unsigned char helvetica14_118_bits[] = {
+0x41, 0x41, 0x22, 0x22, 0x22, 0x14, 0x14, 0x08};
+static unsigned char helvetica14_119_bits[] = {
+0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x92, 0x00, 0x92, 0x00, 0xaa, 0x00, 
+0x44, 0x00, 0x44, 0x00};
+static unsigned char helvetica14_120_bits[] = {
+0x63, 0x22, 0x14, 0x08, 0x08, 0x14, 0x22, 0x63};
+static unsigned char helvetica14_121_bits[] = {
+0x41, 0x43, 0x22, 0x22, 0x24, 0x14, 0x18, 0x08, 0x08, 0x0c, 0x06};
+static unsigned char helvetica14_122_bits[] = {
+0x3f, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x3f};
+static unsigned char helvetica14_123_bits[] = {
+0x18, 0x04, 0x04, 0x04, 0x04, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x18};
+static unsigned char helvetica14_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01};
+static unsigned char helvetica14_125_bits[] = {
+0x03, 0x04, 0x04, 0x04, 0x04, 0x08, 0x10, 0x08, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x03};
+static unsigned char helvetica14_126_bits[] = {
+0x26, 0x2d, 0x19};
+static unsigned char helvetica14_127_bits[] = {
+0x00};
+static unsigned char helvetica14_128_bits[] = {
+0x00};
+static unsigned char helvetica14_129_bits[] = {
+0x00};
+static unsigned char helvetica14_130_bits[] = {
+0x00};
+static unsigned char helvetica14_131_bits[] = {
+0x00};
+static unsigned char helvetica14_132_bits[] = {
+0x00};
+static unsigned char helvetica14_133_bits[] = {
+0x00};
+static unsigned char helvetica14_134_bits[] = {
+0x00};
+static unsigned char helvetica14_135_bits[] = {
+0x00};
+static unsigned char helvetica14_136_bits[] = {
+0x00};
+static unsigned char helvetica14_137_bits[] = {
+0x00};
+static unsigned char helvetica14_138_bits[] = {
+0x00};
+static unsigned char helvetica14_139_bits[] = {
+0x00};
+static unsigned char helvetica14_140_bits[] = {
+0x00};
+static unsigned char helvetica14_141_bits[] = {
+0x00};
+static unsigned char helvetica14_142_bits[] = {
+0x00};
+static unsigned char helvetica14_143_bits[] = {
+0x00};
+static unsigned char helvetica14_144_bits[] = {
+0x00};
+static unsigned char helvetica14_145_bits[] = {
+0x00};
+static unsigned char helvetica14_146_bits[] = {
+0x00};
+static unsigned char helvetica14_147_bits[] = {
+0x00};
+static unsigned char helvetica14_148_bits[] = {
+0x00};
+static unsigned char helvetica14_149_bits[] = {
+0x00};
+static unsigned char helvetica14_150_bits[] = {
+0x00};
+static unsigned char helvetica14_151_bits[] = {
+0x00};
+static unsigned char helvetica14_152_bits[] = {
+0x00};
+static unsigned char helvetica14_153_bits[] = {
+0x00};
+static unsigned char helvetica14_154_bits[] = {
+0x00};
+static unsigned char helvetica14_155_bits[] = {
+0x00};
+static unsigned char helvetica14_156_bits[] = {
+0x00};
+static unsigned char helvetica14_157_bits[] = {
+0x00};
+static unsigned char helvetica14_158_bits[] = {
+0x00};
+static unsigned char helvetica14_159_bits[] = {
+0x00};
+static unsigned char helvetica14_160_bits[] = {
+0x00};
+static unsigned char helvetica14_161_bits[] = {
+0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_162_bits[] = {
+0x20, 0x1e, 0x33, 0x09, 0x09, 0x05, 0x25, 0x33, 0x1e, 0x01};
+static unsigned char helvetica14_163_bits[] = {
+0x1c, 0x22, 0x02, 0x02, 0x1f, 0x04, 0x04, 0x04, 0x02, 0x46, 0x3b};
+static unsigned char helvetica14_164_bits[] = {
+0x21, 0x1e, 0x12, 0x12, 0x1e, 0x21};
+static unsigned char helvetica14_165_bits[] = {
+0x41, 0x41, 0x41, 0x22, 0x22, 0x14, 0x7f, 0x08, 0x7f, 0x08, 0x08};
+static unsigned char helvetica14_166_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01};
+static unsigned char helvetica14_167_bits[] = {
+0x0e, 0x1b, 0x11, 0x03, 0x0e, 0x19, 0x11, 0x11, 0x13, 0x0e, 0x18, 0x11, 
+0x1b, 0x0e};
+static unsigned char helvetica14_168_bits[] = {
+0x1b};
+static unsigned char helvetica14_169_bits[] = {
+0x78, 0x00, 0x86, 0x01, 0x3a, 0x01, 0x45, 0x03, 0x45, 0x02, 0x05, 0x02, 
+0x45, 0x02, 0x39, 0x02, 0x02, 0x01, 0x86, 0x01, 0x78, 0x00};
+static unsigned char helvetica14_170_bits[] = {
+0x07, 0x08, 0x0e, 0x09, 0x0b, 0x00, 0x0f};
+static unsigned char helvetica14_171_bits[] = {
+0x24, 0x12, 0x09, 0x12, 0x24};
+static unsigned char helvetica14_172_bits[] = {
+0x7f, 0x40, 0x40, 0x40};
+static unsigned char helvetica14_173_bits[] = {
+0x07};
+static unsigned char helvetica14_174_bits[] = {
+0x78, 0x00, 0x86, 0x01, 0x3a, 0x01, 0x49, 0x02, 0x49, 0x02, 0x39, 0x02, 
+0x49, 0x02, 0x49, 0x02, 0x02, 0x01, 0x86, 0x01, 0x78, 0x00};
+static unsigned char helvetica14_175_bits[] = {
+0x0f};
+static unsigned char helvetica14_176_bits[] = {
+0x06, 0x09, 0x09, 0x06};
+static unsigned char helvetica14_177_bits[] = {
+0x08, 0x08, 0x08, 0x7f, 0x08, 0x08, 0x08, 0x00, 0x7f};
+static unsigned char helvetica14_178_bits[] = {
+0x06, 0x09, 0x08, 0x04, 0x02, 0x0f};
+static unsigned char helvetica14_179_bits[] = {
+0x06, 0x09, 0x04, 0x08, 0x09, 0x06};
+static unsigned char helvetica14_180_bits[] = {
+0x02, 0x01};
+static unsigned char helvetica14_181_bits[] = {
+0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x33, 0x2d, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_182_bits[] = {
+0x7c, 0x2e, 0x2f, 0x2f, 0x2f, 0x2e, 0x2c, 0x28, 0x28, 0x28, 0x28, 0x28, 
+0x28, 0x28};
+static unsigned char helvetica14_183_bits[] = {
+0x03};
+static unsigned char helvetica14_184_bits[] = {
+0x04, 0x09, 0x06};
+static unsigned char helvetica14_185_bits[] = {
+0x02, 0x03, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica14_186_bits[] = {
+0x06, 0x09, 0x09, 0x09, 0x06, 0x00, 0x0f};
+static unsigned char helvetica14_187_bits[] = {
+0x09, 0x12, 0x24, 0x12, 0x09};
+static unsigned char helvetica14_188_bits[] = {
+0x42, 0x00, 0x43, 0x00, 0x22, 0x00, 0x22, 0x00, 0x12, 0x00, 0x12, 0x01, 
+0x90, 0x01, 0x48, 0x01, 0x28, 0x01, 0xe4, 0x03, 0x04, 0x01};
+static unsigned char helvetica14_189_bits[] = {
+0x42, 0x00, 0x43, 0x00, 0x22, 0x00, 0x22, 0x00, 0x12, 0x00, 0xd2, 0x00, 
+0x28, 0x01, 0x08, 0x01, 0x88, 0x00, 0x44, 0x00, 0xe4, 0x01};
+static unsigned char helvetica14_190_bits[] = {
+0x86, 0x00, 0x89, 0x00, 0x44, 0x00, 0x48, 0x00, 0x29, 0x00, 0x26, 0x02, 
+0x20, 0x03, 0x90, 0x02, 0x50, 0x02, 0xc8, 0x07, 0x08, 0x02};
+static unsigned char helvetica14_191_bits[] = {
+0x08, 0x08, 0x00, 0x08, 0x04, 0x02, 0x01, 0x21, 0x21, 0x33, 0x0c};
+static unsigned char helvetica14_192_bits[] = {
+0x08, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x38, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x82, 0x00, 0xfe, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_193_bits[] = {
+0x20, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x38, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x82, 0x00, 0xfe, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_194_bits[] = {
+0x30, 0x00, 0x48, 0x00, 0x00, 0x00, 0x10, 0x00, 0x38, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x82, 0x00, 0xfe, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_195_bits[] = {
+0x58, 0x00, 0x34, 0x00, 0x00, 0x00, 0x10, 0x00, 0x38, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x82, 0x00, 0xfe, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_196_bits[] = {
+0x6c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x38, 0x00, 0x28, 0x00, 0x28, 0x00, 
+0x44, 0x00, 0x44, 0x00, 0x82, 0x00, 0xfe, 0x00, 0x82, 0x00, 0x01, 0x01, 
+0x01, 0x01};
+static unsigned char helvetica14_197_bits[] = {
+0x30, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, 0x00, 0x30, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x82, 0x00, 0xfe, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_198_bits[] = {
+0xf8, 0x0f, 0x48, 0x00, 0x48, 0x00, 0x44, 0x00, 0x44, 0x00, 0xc4, 0x0f, 
+0x7e, 0x00, 0x42, 0x00, 0x42, 0x00, 0x41, 0x00, 0xc1, 0x0f};
+static unsigned char helvetica14_199_bits[] = {
+0x38, 0xc6, 0x82, 0x01, 0x01, 0x01, 0x01, 0x01, 0x82, 0xc6, 0x38, 0x10, 
+0x24, 0x18};
+static unsigned char helvetica14_200_bits[] = {
+0x04, 0x08, 0x00, 0x7f, 0x01, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 
+0x01, 0x7f};
+static unsigned char helvetica14_201_bits[] = {
+0x10, 0x08, 0x00, 0x7f, 0x01, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 
+0x01, 0x7f};
+static unsigned char helvetica14_202_bits[] = {
+0x18, 0x24, 0x00, 0x7f, 0x01, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 
+0x01, 0x7f};
+static unsigned char helvetica14_203_bits[] = {
+0x36, 0x00, 0x7f, 0x01, 0x01, 0x01, 0x01, 0x3f, 0x01, 0x01, 0x01, 0x01, 
+0x7f};
+static unsigned char helvetica14_204_bits[] = {
+0x01, 0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 
+0x02, 0x02};
+static unsigned char helvetica14_205_bits[] = {
+0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01};
+static unsigned char helvetica14_206_bits[] = {
+0x06, 0x09, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 
+0x02, 0x02};
+static unsigned char helvetica14_207_bits[] = {
+0x1b, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04};
+static unsigned char helvetica14_208_bits[] = {
+0x3e, 0x00, 0xc2, 0x00, 0x82, 0x00, 0x02, 0x01, 0x02, 0x01, 0x0f, 0x01, 
+0x02, 0x01, 0x02, 0x01, 0x82, 0x00, 0xc2, 0x00, 0x3e, 0x00};
+static unsigned char helvetica14_209_bits[] = {
+0x58, 0x34, 0x00, 0x83, 0x85, 0x85, 0x89, 0x89, 0x91, 0x91, 0xa1, 0xa1, 
+0xc1, 0xc1};
+static unsigned char helvetica14_210_bits[] = {
+0x08, 0x00, 0x10, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 
+0xc6, 0x00, 0x38, 0x00};
+static unsigned char helvetica14_211_bits[] = {
+0x20, 0x00, 0x10, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 
+0xc6, 0x00, 0x38, 0x00};
+static unsigned char helvetica14_212_bits[] = {
+0x30, 0x00, 0x48, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 
+0xc6, 0x00, 0x38, 0x00};
+static unsigned char helvetica14_213_bits[] = {
+0x58, 0x00, 0x34, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 
+0xc6, 0x00, 0x38, 0x00};
+static unsigned char helvetica14_214_bits[] = {
+0xcc, 0x00, 0x00, 0x00, 0x38, 0x00, 0xc6, 0x00, 0x82, 0x00, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x82, 0x00, 0xc6, 0x00, 
+0x38, 0x00};
+static unsigned char helvetica14_215_bits[] = {
+0x41, 0x22, 0x14, 0x08, 0x14, 0x22, 0x41};
+static unsigned char helvetica14_216_bits[] = {
+0x70, 0x04, 0x8c, 0x03, 0x04, 0x01, 0x82, 0x02, 0x42, 0x02, 0x22, 0x02, 
+0x12, 0x02, 0x0a, 0x02, 0x04, 0x01, 0x8e, 0x01, 0x71, 0x00};
+static unsigned char helvetica14_217_bits[] = {
+0x08, 0x10, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 
+0x42, 0x3c};
+static unsigned char helvetica14_218_bits[] = {
+0x20, 0x10, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 
+0x42, 0x3c};
+static unsigned char helvetica14_219_bits[] = {
+0x18, 0x24, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 
+0x42, 0x3c};
+static unsigned char helvetica14_220_bits[] = {
+0x66, 0x00, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x42, 
+0x3c};
+static unsigned char helvetica14_221_bits[] = {
+0x20, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x01, 0x83, 0x01, 0x82, 0x00, 
+0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x38, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00};
+static unsigned char helvetica14_222_bits[] = {
+0x01, 0x01, 0x3f, 0x61, 0x41, 0x41, 0x61, 0x3f, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_223_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x0d, 0x09, 0x11, 0x11, 0x11, 0x11, 0x0d};
+static unsigned char helvetica14_224_bits[] = {
+0x04, 0x08, 0x00, 0x1e, 0x33, 0x20, 0x3e, 0x23, 0x21, 0x33, 0x6e};
+static unsigned char helvetica14_225_bits[] = {
+0x08, 0x04, 0x00, 0x1e, 0x33, 0x20, 0x3e, 0x23, 0x21, 0x33, 0x6e};
+static unsigned char helvetica14_226_bits[] = {
+0x0c, 0x12, 0x00, 0x1e, 0x33, 0x20, 0x3e, 0x23, 0x21, 0x33, 0x6e};
+static unsigned char helvetica14_227_bits[] = {
+0x2c, 0x1a, 0x00, 0x1e, 0x33, 0x20, 0x3e, 0x23, 0x21, 0x33, 0x6e};
+static unsigned char helvetica14_228_bits[] = {
+0x12, 0x12, 0x00, 0x1e, 0x33, 0x20, 0x3e, 0x23, 0x21, 0x33, 0x6e};
+static unsigned char helvetica14_229_bits[] = {
+0x0c, 0x12, 0x0c, 0x00, 0x1e, 0x33, 0x20, 0x3e, 0x23, 0x21, 0x33, 0x6e};
+static unsigned char helvetica14_230_bits[] = {
+0xde, 0x03, 0x63, 0x06, 0x20, 0x04, 0xfe, 0x07, 0x23, 0x00, 0x21, 0x00, 
+0x73, 0x06, 0xde, 0x03};
+static unsigned char helvetica14_231_bits[] = {
+0x1e, 0x33, 0x01, 0x01, 0x01, 0x21, 0x33, 0x1e, 0x08, 0x12, 0x0c};
+static unsigned char helvetica14_232_bits[] = {
+0x04, 0x08, 0x00, 0x1e, 0x33, 0x21, 0x3f, 0x01, 0x01, 0x33, 0x1e};
+static unsigned char helvetica14_233_bits[] = {
+0x08, 0x04, 0x00, 0x1e, 0x33, 0x21, 0x3f, 0x01, 0x01, 0x33, 0x1e};
+static unsigned char helvetica14_234_bits[] = {
+0x0c, 0x12, 0x00, 0x1e, 0x33, 0x21, 0x3f, 0x01, 0x01, 0x33, 0x1e};
+static unsigned char helvetica14_235_bits[] = {
+0x12, 0x12, 0x00, 0x1e, 0x33, 0x21, 0x3f, 0x01, 0x01, 0x33, 0x1e};
+static unsigned char helvetica14_236_bits[] = {
+0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_237_bits[] = {
+0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica14_238_bits[] = {
+0x06, 0x09, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica14_239_bits[] = {
+0x05, 0x05, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica14_240_bits[] = {
+0x1b, 0x0e, 0x09, 0x1e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char helvetica14_241_bits[] = {
+0x16, 0x0d, 0x00, 0x1d, 0x33, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21};
+static unsigned char helvetica14_242_bits[] = {
+0x04, 0x08, 0x00, 0x1e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char helvetica14_243_bits[] = {
+0x08, 0x04, 0x00, 0x1e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char helvetica14_244_bits[] = {
+0x0c, 0x12, 0x00, 0x1e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char helvetica14_245_bits[] = {
+0x16, 0x0d, 0x00, 0x1e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char helvetica14_246_bits[] = {
+0x12, 0x12, 0x00, 0x1e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char helvetica14_247_bits[] = {
+0x08, 0x08, 0x00, 0x7f, 0x00, 0x08, 0x08};
+static unsigned char helvetica14_248_bits[] = {
+0xbc, 0x46, 0x62, 0x52, 0x4a, 0x46, 0x62, 0x3d};
+static unsigned char helvetica14_249_bits[] = {
+0x04, 0x08, 0x00, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x33, 0x2e};
+static unsigned char helvetica14_250_bits[] = {
+0x08, 0x04, 0x00, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x33, 0x2e};
+static unsigned char helvetica14_251_bits[] = {
+0x0c, 0x12, 0x00, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x33, 0x2e};
+static unsigned char helvetica14_252_bits[] = {
+0x12, 0x12, 0x00, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x33, 0x2e};
+static unsigned char helvetica14_253_bits[] = {
+0x10, 0x08, 0x00, 0x41, 0x43, 0x22, 0x22, 0x24, 0x14, 0x18, 0x08, 0x08, 
+0x0c, 0x06};
+static unsigned char helvetica14_254_bits[] = {
+0x01, 0x01, 0x01, 0x1d, 0x33, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1d, 0x01, 
+0x01, 0x01};
+static unsigned char helvetica14_255_bits[] = {
+0x24, 0x24, 0x00, 0x41, 0x43, 0x22, 0x22, 0x24, 0x14, 0x18, 0x08, 0x08, 
+0x0c, 0x06};
+static RotFont helvetica14font[] = {
+{5, 1, 1, helvetica14_0_bits},
+{5, 1, 1, helvetica14_1_bits},
+{5, 1, 1, helvetica14_2_bits},
+{5, 1, 1, helvetica14_3_bits},
+{5, 1, 1, helvetica14_4_bits},
+{5, 1, 1, helvetica14_5_bits},
+{5, 1, 1, helvetica14_6_bits},
+{5, 1, 1, helvetica14_7_bits},
+{5, 1, 1, helvetica14_8_bits},
+{5, 1, 1, helvetica14_9_bits},
+{5, 1, 1, helvetica14_10_bits},
+{5, 1, 1, helvetica14_11_bits},
+{5, 1, 1, helvetica14_12_bits},
+{5, 1, 1, helvetica14_13_bits},
+{5, 1, 1, helvetica14_14_bits},
+{5, 1, 1, helvetica14_15_bits},
+{5, 1, 1, helvetica14_16_bits},
+{5, 1, 1, helvetica14_17_bits},
+{5, 1, 1, helvetica14_18_bits},
+{5, 1, 1, helvetica14_19_bits},
+{5, 1, 1, helvetica14_20_bits},
+{5, 1, 1, helvetica14_21_bits},
+{5, 1, 1, helvetica14_22_bits},
+{5, 1, 1, helvetica14_23_bits},
+{5, 1, 1, helvetica14_24_bits},
+{5, 1, 1, helvetica14_25_bits},
+{5, 1, 1, helvetica14_26_bits},
+{5, 1, 1, helvetica14_27_bits},
+{5, 1, 1, helvetica14_28_bits},
+{5, 1, 1, helvetica14_29_bits},
+{5, 1, 1, helvetica14_30_bits},
+{5, 1, 1, helvetica14_31_bits},
+{7, 1, 1, helvetica14_32_bits},
+{1, 11, 11, helvetica14_33_bits},
+{3, 3, 11, helvetica14_34_bits},
+{7, 10, 10, helvetica14_35_bits},
+{7, 14, 12, helvetica14_36_bits},
+{11, 11, 11, helvetica14_37_bits},
+{8, 10, 10, helvetica14_38_bits},
+{2, 3, 11, helvetica14_39_bits},
+{3, 14, 11, helvetica14_40_bits},
+{3, 14, 11, helvetica14_41_bits},
+{5, 5, 11, helvetica14_42_bits},
+{7, 7, 8, helvetica14_43_bits},
+{2, 4, 2, helvetica14_44_bits},
+{7, 1, 5, helvetica14_45_bits},
+{1, 2, 2, helvetica14_46_bits},
+{4, 11, 11, helvetica14_47_bits},
+{6, 11, 11, helvetica14_48_bits},
+{3, 11, 11, helvetica14_49_bits},
+{6, 11, 11, helvetica14_50_bits},
+{6, 11, 11, helvetica14_51_bits},
+{7, 11, 11, helvetica14_52_bits},
+{6, 11, 11, helvetica14_53_bits},
+{6, 11, 11, helvetica14_54_bits},
+{6, 11, 11, helvetica14_55_bits},
+{6, 11, 11, helvetica14_56_bits},
+{6, 11, 11, helvetica14_57_bits},
+{1, 8, 8, helvetica14_58_bits},
+{2, 10, 8, helvetica14_59_bits},
+{6, 5, 7, helvetica14_60_bits},
+{6, 3, 6, helvetica14_61_bits},
+{6, 5, 7, helvetica14_62_bits},
+{6, 11, 11, helvetica14_63_bits},
+{11, 12, 11, helvetica14_64_bits},
+{9, 11, 11, helvetica14_65_bits},
+{7, 11, 11, helvetica14_66_bits},
+{8, 11, 11, helvetica14_67_bits},
+{8, 11, 11, helvetica14_68_bits},
+{7, 11, 11, helvetica14_69_bits},
+{7, 11, 11, helvetica14_70_bits},
+{9, 11, 11, helvetica14_71_bits},
+{8, 11, 11, helvetica14_72_bits},
+{1, 11, 11, helvetica14_73_bits},
+{6, 11, 11, helvetica14_74_bits},
+{8, 11, 11, helvetica14_75_bits},
+{6, 11, 11, helvetica14_76_bits},
+{11, 11, 11, helvetica14_77_bits},
+{8, 11, 11, helvetica14_78_bits},
+{9, 11, 11, helvetica14_79_bits},
+{7, 11, 11, helvetica14_80_bits},
+{9, 11, 11, helvetica14_81_bits},
+{8, 11, 11, helvetica14_82_bits},
+{7, 11, 11, helvetica14_83_bits},
+{9, 11, 11, helvetica14_84_bits},
+{8, 11, 11, helvetica14_85_bits},
+{9, 11, 11, helvetica14_86_bits},
+{13, 11, 11, helvetica14_87_bits},
+{9, 11, 11, helvetica14_88_bits},
+{9, 11, 11, helvetica14_89_bits},
+{7, 11, 11, helvetica14_90_bits},
+{3, 14, 11, helvetica14_91_bits},
+{4, 11, 11, helvetica14_92_bits},
+{3, 14, 11, helvetica14_93_bits},
+{5, 5, 11, helvetica14_94_bits},
+{8, 1, -2, helvetica14_95_bits},
+{2, 3, 11, helvetica14_96_bits},
+{7, 8, 8, helvetica14_97_bits},
+{6, 11, 11, helvetica14_98_bits},
+{6, 8, 8, helvetica14_99_bits},
+{6, 11, 11, helvetica14_100_bits},
+{6, 8, 8, helvetica14_101_bits},
+{4, 11, 11, helvetica14_102_bits},
+{6, 11, 8, helvetica14_103_bits},
+{6, 11, 11, helvetica14_104_bits},
+{1, 11, 11, helvetica14_105_bits},
+{3, 14, 11, helvetica14_106_bits},
+{6, 11, 11, helvetica14_107_bits},
+{1, 11, 11, helvetica14_108_bits},
+{9, 8, 8, helvetica14_109_bits},
+{6, 8, 8, helvetica14_110_bits},
+{6, 8, 8, helvetica14_111_bits},
+{6, 11, 8, helvetica14_112_bits},
+{6, 11, 8, helvetica14_113_bits},
+{4, 8, 8, helvetica14_114_bits},
+{5, 8, 8, helvetica14_115_bits},
+{4, 10, 10, helvetica14_116_bits},
+{6, 8, 8, helvetica14_117_bits},
+{7, 8, 8, helvetica14_118_bits},
+{9, 8, 8, helvetica14_119_bits},
+{7, 8, 8, helvetica14_120_bits},
+{7, 11, 8, helvetica14_121_bits},
+{6, 8, 8, helvetica14_122_bits},
+{5, 14, 11, helvetica14_123_bits},
+{1, 14, 11, helvetica14_124_bits},
+{5, 14, 11, helvetica14_125_bits},
+{6, 3, 6, helvetica14_126_bits},
+{5, 1, 1, helvetica14_127_bits},
+{5, 1, 1, helvetica14_128_bits},
+{5, 1, 1, helvetica14_129_bits},
+{5, 1, 1, helvetica14_130_bits},
+{5, 1, 1, helvetica14_131_bits},
+{5, 1, 1, helvetica14_132_bits},
+{5, 1, 1, helvetica14_133_bits},
+{5, 1, 1, helvetica14_134_bits},
+{5, 1, 1, helvetica14_135_bits},
+{5, 1, 1, helvetica14_136_bits},
+{5, 1, 1, helvetica14_137_bits},
+{5, 1, 1, helvetica14_138_bits},
+{5, 1, 1, helvetica14_139_bits},
+{5, 1, 1, helvetica14_140_bits},
+{5, 1, 1, helvetica14_141_bits},
+{5, 1, 1, helvetica14_142_bits},
+{5, 1, 1, helvetica14_143_bits},
+{5, 1, 1, helvetica14_144_bits},
+{5, 1, 1, helvetica14_145_bits},
+{5, 1, 1, helvetica14_146_bits},
+{5, 1, 1, helvetica14_147_bits},
+{5, 1, 1, helvetica14_148_bits},
+{5, 1, 1, helvetica14_149_bits},
+{5, 1, 1, helvetica14_150_bits},
+{5, 1, 1, helvetica14_151_bits},
+{5, 1, 1, helvetica14_152_bits},
+{5, 1, 1, helvetica14_153_bits},
+{5, 1, 1, helvetica14_154_bits},
+{5, 1, 1, helvetica14_155_bits},
+{5, 1, 1, helvetica14_156_bits},
+{5, 1, 1, helvetica14_157_bits},
+{5, 1, 1, helvetica14_158_bits},
+{5, 1, 1, helvetica14_159_bits},
+{1, 1, 1, helvetica14_160_bits},
+{1, 11, 8, helvetica14_161_bits},
+{6, 10, 9, helvetica14_162_bits},
+{7, 11, 11, helvetica14_163_bits},
+{6, 6, 8, helvetica14_164_bits},
+{7, 11, 11, helvetica14_165_bits},
+{1, 14, 11, helvetica14_166_bits},
+{5, 14, 11, helvetica14_167_bits},
+{5, 1, 10, helvetica14_168_bits},
+{10, 11, 11, helvetica14_169_bits},
+{4, 7, 11, helvetica14_170_bits},
+{6, 5, 7, helvetica14_171_bits},
+{7, 4, 6, helvetica14_172_bits},
+{3, 1, 5, helvetica14_173_bits},
+{10, 11, 11, helvetica14_174_bits},
+{4, 1, 10, helvetica14_175_bits},
+{4, 4, 11, helvetica14_176_bits},
+{7, 9, 9, helvetica14_177_bits},
+{4, 6, 11, helvetica14_178_bits},
+{4, 6, 11, helvetica14_179_bits},
+{2, 2, 11, helvetica14_180_bits},
+{6, 11, 8, helvetica14_181_bits},
+{7, 14, 11, helvetica14_182_bits},
+{2, 1, 5, helvetica14_183_bits},
+{4, 3, 0, helvetica14_184_bits},
+{2, 6, 11, helvetica14_185_bits},
+{4, 7, 11, helvetica14_186_bits},
+{6, 5, 7, helvetica14_187_bits},
+{10, 11, 11, helvetica14_188_bits},
+{9, 11, 11, helvetica14_189_bits},
+{11, 11, 11, helvetica14_190_bits},
+{6, 11, 8, helvetica14_191_bits},
+{9, 14, 14, helvetica14_192_bits},
+{9, 14, 14, helvetica14_193_bits},
+{9, 14, 14, helvetica14_194_bits},
+{9, 14, 14, helvetica14_195_bits},
+{9, 13, 13, helvetica14_196_bits},
+{9, 14, 14, helvetica14_197_bits},
+{12, 11, 11, helvetica14_198_bits},
+{8, 14, 11, helvetica14_199_bits},
+{7, 14, 14, helvetica14_200_bits},
+{7, 14, 14, helvetica14_201_bits},
+{7, 14, 14, helvetica14_202_bits},
+{7, 13, 13, helvetica14_203_bits},
+{2, 14, 14, helvetica14_204_bits},
+{2, 14, 14, helvetica14_205_bits},
+{4, 14, 14, helvetica14_206_bits},
+{5, 13, 13, helvetica14_207_bits},
+{9, 11, 11, helvetica14_208_bits},
+{8, 14, 14, helvetica14_209_bits},
+{9, 14, 14, helvetica14_210_bits},
+{9, 14, 14, helvetica14_211_bits},
+{9, 14, 14, helvetica14_212_bits},
+{9, 14, 14, helvetica14_213_bits},
+{9, 13, 13, helvetica14_214_bits},
+{7, 7, 8, helvetica14_215_bits},
+{11, 11, 11, helvetica14_216_bits},
+{8, 14, 14, helvetica14_217_bits},
+{8, 14, 14, helvetica14_218_bits},
+{8, 14, 14, helvetica14_219_bits},
+{8, 13, 13, helvetica14_220_bits},
+{9, 14, 14, helvetica14_221_bits},
+{7, 11, 11, helvetica14_222_bits},
+{5, 11, 11, helvetica14_223_bits},
+{7, 11, 11, helvetica14_224_bits},
+{7, 11, 11, helvetica14_225_bits},
+{7, 11, 11, helvetica14_226_bits},
+{7, 11, 11, helvetica14_227_bits},
+{7, 11, 11, helvetica14_228_bits},
+{7, 12, 12, helvetica14_229_bits},
+{11, 8, 8, helvetica14_230_bits},
+{6, 11, 8, helvetica14_231_bits},
+{6, 11, 11, helvetica14_232_bits},
+{6, 11, 11, helvetica14_233_bits},
+{6, 11, 11, helvetica14_234_bits},
+{6, 11, 11, helvetica14_235_bits},
+{2, 11, 11, helvetica14_236_bits},
+{2, 11, 11, helvetica14_237_bits},
+{4, 11, 11, helvetica14_238_bits},
+{3, 11, 11, helvetica14_239_bits},
+{6, 11, 11, helvetica14_240_bits},
+{6, 11, 11, helvetica14_241_bits},
+{6, 11, 11, helvetica14_242_bits},
+{6, 11, 11, helvetica14_243_bits},
+{6, 11, 11, helvetica14_244_bits},
+{6, 11, 11, helvetica14_245_bits},
+{6, 11, 11, helvetica14_246_bits},
+{7, 7, 8, helvetica14_247_bits},
+{8, 8, 8, helvetica14_248_bits},
+{6, 11, 11, helvetica14_249_bits},
+{6, 11, 11, helvetica14_250_bits},
+{6, 11, 11, helvetica14_251_bits},
+{6, 11, 11, helvetica14_252_bits},
+{7, 14, 11, helvetica14_253_bits},
+{6, 14, 11, helvetica14_254_bits},
+{7, 14, 11, helvetica14_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica18.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica18.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica18.bdf	(revision 15879)
@@ -0,0 +1,3830 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Helvetica-Medium-R-Normal--18-180-75-75-P-98-ISO8859-1
+SIZE 18 75 75
+FONTBOUNDINGBOX 18 22 -1 -4
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Helvetica"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 18
+POINT_SIZE 180
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 98
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 14
+X_HEIGHT 10
+FACE_NAME "Helvetica"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.  "
+_DEC_DEVICE_FONTNAMES "PS=Helvetica"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2, 11-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Helvetica"
+FONT "-Adobe-Helvetica-Medium-R-Normal--18-180-75-75-P-98-ISO8859-1"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 11
+DEFAULT_CHAR 32
+FONT_ASCENT 16
+FONT_DESCENT 5
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 2 14 2 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+80
+80
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 5 0 9
+BITMAP
+d8
+d8
+d8
+90
+90
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 10 13 0 0
+BITMAP
+0900
+0900
+0900
+7fc0
+7fc0
+1200
+1200
+1200
+ff80
+ff80
+2400
+2400
+2400
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 16 1 -2
+BITMAP
+0800
+3e00
+7f00
+cb00
+c800
+e800
+7800
+3e00
+0f00
+0980
+c980
+eb80
+7f00
+3e00
+0800
+0800
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 853 0
+DWIDTH 16 0
+BBX 14 13 1 0
+BITMAP
+7860
+fcc0
+ccc0
+cd80
+fd80
+7b00
+0300
+0678
+06fc
+0ccc
+0ccc
+18fc
+1878
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 13 1 0
+BITMAP
+3c00
+7e00
+6600
+6600
+3c00
+7c00
+eec0
+c6c0
+c3c0
+c380
+e7c0
+7ee0
+3c70
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 5 1 9
+BITMAP
+c0
+c0
+40
+40
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 18 1 -4
+BITMAP
+10
+30
+60
+60
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+60
+60
+30
+10
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 18 1 -4
+BITMAP
+80
+c0
+60
+60
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+60
+60
+c0
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 6 1 8
+BITMAP
+20
+20
+f8
+70
+70
+88
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+18
+18
+18
+18
+ff
+ff
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 2 5 1 -3
+BITMAP
+c0
+c0
+40
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 8 2 1 4
+BITMAP
+ff
+ff
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 2 2 1 0
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 14 0 0
+BITMAP
+18
+18
+10
+10
+30
+30
+20
+20
+60
+60
+40
+40
+c0
+c0
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+3c
+7e
+66
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+66
+7e
+3c
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 5 13 2 0
+BITMAP
+18
+f8
+f8
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+3c
+fe
+c3
+03
+07
+0e
+1c
+38
+70
+e0
+c0
+ff
+ff
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+3c
+7e
+c3
+c3
+06
+1c
+1e
+07
+03
+c3
+c7
+7e
+3c
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 13 1 0
+BITMAP
+0300
+0700
+0f00
+1b00
+3300
+3300
+6300
+c300
+ff80
+ff80
+0300
+0300
+0300
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+fe
+fe
+c0
+c0
+fc
+fe
+c7
+03
+03
+c3
+c7
+fe
+7c
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+3c
+7f
+63
+c0
+c0
+dc
+fe
+c3
+c3
+c3
+e3
+7e
+3c
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+ff
+ff
+03
+06
+0c
+0c
+18
+18
+30
+30
+30
+60
+60
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+3c
+7e
+e7
+c3
+c3
+66
+7e
+66
+c3
+c3
+e7
+7e
+3c
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+3c
+7e
+c7
+c3
+c3
+c3
+7f
+3b
+03
+03
+c6
+fe
+7c
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 2 10 1 0
+BITMAP
+c0
+c0
+00
+00
+00
+00
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 2 13 1 -3
+BITMAP
+c0
+c0
+00
+00
+00
+00
+00
+00
+c0
+c0
+40
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+03
+0f
+3c
+70
+c0
+70
+3c
+0f
+03
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 7 6 2 2
+BITMAP
+fe
+fe
+00
+00
+fe
+fe
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+c0
+f0
+3c
+0e
+03
+0e
+3c
+f0
+c0
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 7 14 1 0
+BITMAP
+7c
+fe
+c6
+c6
+0e
+1c
+38
+30
+30
+30
+00
+00
+30
+30
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 960 0
+DWIDTH 18 0
+BBX 16 17 1 -3
+BITMAP
+03f0
+0ffc
+1c0e
+3006
+63b3
+6773
+c633
+cc63
+cc66
+cc66
+cccc
+cff8
+6770
+7000
+3800
+1ff0
+07e0
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 12 14 0 0
+BITMAP
+0600
+0600
+0f00
+0f00
+1980
+1980
+30c0
+30c0
+3fc0
+7fe0
+6060
+6060
+c030
+c030
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+ff00
+ff80
+c1c0
+c0c0
+c0c0
+c180
+ff80
+ffc0
+c0e0
+c060
+c060
+c0e0
+ffc0
+ff80
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 14 1 0
+BITMAP
+0f80
+3fe0
+7070
+6030
+e000
+c000
+c000
+c000
+c000
+e000
+6030
+7070
+3fe0
+0f80
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+ff00
+ff80
+c1c0
+c0c0
+c060
+c060
+c060
+c060
+c060
+c060
+c0c0
+c1c0
+ff80
+ff00
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+ff80
+ff80
+c000
+c000
+c000
+c000
+ff00
+ff00
+c000
+c000
+c000
+c000
+ff80
+ff80
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+ff80
+ff80
+c000
+c000
+c000
+c000
+ff00
+ff00
+c000
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 14 1 0
+BITMAP
+0f80
+3fe0
+7070
+6030
+e030
+c000
+c000
+c1f0
+c1f0
+e030
+6030
+7070
+3ff0
+0fb0
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+c060
+c060
+c060
+c060
+c060
+c060
+ffe0
+ffe0
+c060
+c060
+c060
+c060
+c060
+c060
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 2 14 2 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+03
+03
+03
+03
+03
+03
+03
+03
+03
+c3
+c3
+e7
+7e
+3c
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 14 1 0
+BITMAP
+c0e0
+c1c0
+c380
+c700
+ce00
+dc00
+f800
+fc00
+ce00
+c700
+c380
+c1c0
+c0e0
+c070
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ff
+ff
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 853 0
+DWIDTH 16 0
+BBX 14 14 1 0
+BITMAP
+c00c
+c00c
+e01c
+e01c
+f03c
+f03c
+d86c
+d86c
+cccc
+cccc
+c48c
+c78c
+c30c
+c30c
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+c060
+e060
+f060
+f060
+d860
+cc60
+cc60
+c660
+c660
+c360
+c1e0
+c1e0
+c0e0
+c060
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 14 1 0
+BITMAP
+0f80
+3fe0
+7070
+6030
+e038
+c018
+c018
+c018
+c018
+e038
+6030
+7070
+3fe0
+0f80
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 14 1 0
+BITMAP
+ff00
+ff80
+c1c0
+c0c0
+c0c0
+c1c0
+ff80
+ff00
+c000
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 15 1 -1
+BITMAP
+0f80
+3fe0
+7070
+6030
+e038
+c018
+c018
+c018
+c018
+e1b8
+61b0
+70f0
+3fe0
+0fb0
+0030
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 14 1 0
+BITMAP
+ff00
+ff80
+c1c0
+c0c0
+c0c0
+c1c0
+ff80
+ff00
+c180
+c180
+c0c0
+c0c0
+c0c0
+c0c0
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+1f00
+7fc0
+e0e0
+c060
+e000
+7c00
+1f00
+03c0
+00e0
+0060
+c060
+e0e0
+7fc0
+3f00
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 14 1 0
+BITMAP
+ffc0
+ffc0
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+7fc0
+1f00
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 14 1 0
+BITMAP
+c030
+c030
+6060
+6060
+6060
+30c0
+30c0
+30c0
+1980
+1980
+1980
+0f00
+0f00
+0600
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 960 0
+DWIDTH 18 0
+BBX 16 14 1 0
+BITMAP
+c183
+c183
+c183
+c3c3
+63c6
+6246
+6666
+6666
+366c
+366c
+342c
+1c38
+1818
+1818
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+c060
+e0e0
+60c0
+71c0
+3180
+1b00
+0e00
+0e00
+1b00
+3180
+71c0
+60c0
+e0e0
+c060
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 14 1 0
+BITMAP
+c030
+c030
+6060
+6060
+30c0
+30c0
+1980
+0f00
+0600
+0600
+0600
+0600
+0600
+0600
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 14 1 0
+BITMAP
+ffc0
+ffc0
+00c0
+0180
+0300
+0600
+0c00
+1c00
+1800
+3000
+6000
+c000
+ffc0
+ffc0
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 4 18 1 -4
+BITMAP
+f0
+f0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+f0
+f0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 14 0 0
+BITMAP
+c0
+c0
+40
+40
+60
+60
+20
+20
+30
+30
+10
+10
+18
+18
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 4 18 0 -4
+BITMAP
+f0
+f0
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+f0
+f0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 5 1 8
+BITMAP
+10
+38
+6c
+c6
+82
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 10 2 0 -4
+BITMAP
+ffc0
+ffc0
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 5 1 9
+BITMAP
+40
+80
+80
+c0
+c0
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+7c
+ee
+c6
+0e
+7e
+e6
+c6
+c6
+ee
+76
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+c000
+c000
+c000
+c000
+de00
+ff00
+e300
+c180
+c180
+c180
+c180
+e300
+ff00
+de00
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+3e
+7f
+63
+c0
+c0
+c0
+c0
+63
+7f
+3e
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+0180
+0180
+0180
+0180
+3d80
+7f80
+6380
+c180
+c180
+c180
+c180
+6380
+7f80
+3d80
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+3c
+7e
+c3
+c3
+ff
+c0
+c0
+e3
+7f
+3c
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 6 14 0 0
+BITMAP
+1c
+3c
+30
+30
+fc
+fc
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 -4
+BITMAP
+3d80
+7f80
+6180
+c180
+c180
+c180
+c180
+6380
+7f80
+3d80
+0180
+6300
+7f00
+1c00
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+c0
+c0
+c0
+c0
+ce
+df
+e3
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 14 1 0
+BITMAP
+c0
+c0
+00
+00
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 4 18 -1 -4
+BITMAP
+30
+30
+00
+00
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+f0
+e0
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 14 1 0
+BITMAP
+c0
+c0
+c0
+c0
+c6
+cc
+d8
+f0
+f8
+d8
+cc
+ce
+c6
+c7
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 14 1 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 10 1 0
+BITMAP
+cc60
+def0
+e730
+c630
+c630
+c630
+c630
+c630
+c630
+c630
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+ce
+df
+e3
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+3e00
+7f00
+6300
+c180
+c180
+c180
+c180
+6300
+7f00
+3e00
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 -4
+BITMAP
+de00
+ff00
+e300
+c180
+c180
+c180
+c180
+e300
+ff00
+de00
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 -4
+BITMAP
+3d80
+7f80
+6380
+c180
+c180
+c180
+c180
+6380
+7f80
+3d80
+0180
+0180
+0180
+0180
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 5 10 1 0
+BITMAP
+d8
+d8
+e0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+3c
+7e
+c6
+c0
+fc
+3e
+06
+c6
+fc
+78
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 6 13 0 0
+BITMAP
+30
+30
+30
+fc
+fc
+30
+30
+30
+30
+30
+30
+38
+18
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+c7
+fb
+73
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+c3
+c3
+c3
+66
+66
+66
+24
+3c
+18
+18
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 10 1 0
+BITMAP
+c630
+c630
+c630
+6660
+6660
+6960
+2940
+39c0
+1980
+1980
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+c3
+e7
+66
+3c
+18
+18
+3c
+66
+e7
+c3
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 -4
+BITMAP
+c3
+c3
+c3
+66
+66
+66
+24
+3c
+18
+18
+18
+18
+70
+70
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+fe
+fe
+06
+0c
+18
+30
+60
+c0
+fe
+fe
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 6 18 0 -4
+BITMAP
+0c
+18
+30
+30
+30
+30
+30
+60
+c0
+60
+30
+30
+30
+30
+30
+30
+18
+0c
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 18 1 -4
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 6 18 0 -4
+BITMAP
+c0
+60
+30
+30
+30
+30
+30
+18
+0c
+18
+30
+30
+30
+30
+30
+30
+60
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 3 1 4
+BITMAP
+33
+7e
+cc
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 2 14 2 -4
+BITMAP
+c0
+c0
+00
+00
+40
+40
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 -2
+BITMAP
+04
+04
+3e
+7f
+6b
+c8
+c8
+c8
+c8
+6b
+7f
+3e
+10
+10
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 13 0 0
+BITMAP
+1e00
+3f00
+6180
+6180
+6000
+3000
+7e00
+1800
+1800
+3000
+6080
+ff80
+df00
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 7 1 3
+BITMAP
+c3
+ff
+66
+66
+66
+ff
+c3
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+c3
+c3
+66
+66
+66
+3c
+ff
+18
+ff
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 17 1 -3
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+00
+00
+00
+00
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 18 1 -4
+BITMAP
+3c
+7e
+c3
+c3
+f0
+7c
+6e
+c7
+c3
+e3
+73
+3e
+0e
+07
+c3
+c3
+7e
+3c
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 5 2 0 11
+BITMAP
+d8
+d8
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+0f80
+3060
+4010
+4710
+8888
+9008
+9008
+9008
+8888
+4710
+4010
+3060
+0f80
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 8 1 6
+BITMAP
+70
+c8
+38
+48
+d8
+68
+00
+f8
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 8 1 1
+BITMAP
+12
+36
+6c
+d8
+d8
+6c
+36
+12
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 5 1 3
+BITMAP
+ff80
+ff80
+0180
+0180
+0180
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 2 1 4
+BITMAP
+f8
+f8
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 13 13 1 0
+BITMAP
+0f80
+3060
+4010
+4f90
+8848
+8848
+8f88
+8908
+8888
+4850
+4010
+3060
+0f80
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 1 0 12
+BITMAP
+f8
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 5 1 8
+BITMAP
+70
+d8
+88
+d8
+70
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 11 1 0
+BITMAP
+18
+18
+18
+ff
+ff
+18
+18
+18
+00
+ff
+ff
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 5 8 0 5
+BITMAP
+70
+f8
+98
+18
+30
+60
+f8
+f8
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 5 8 0 5
+BITMAP
+70
+f8
+98
+30
+30
+98
+f8
+70
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 4 3 0 11
+BITMAP
+30
+60
+c0
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 -4
+BITMAP
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+e7
+ff
+db
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 18 1 -4
+BITMAP
+3f
+72
+f2
+f2
+f2
+f2
+72
+32
+12
+12
+12
+12
+12
+12
+12
+12
+12
+12
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 2 1 4
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 5 0 -4
+BITMAP
+60
+70
+18
+d8
+f0
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 3 8 1 5
+BITMAP
+60
+e0
+e0
+60
+60
+60
+60
+60
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 8 1 6
+BITMAP
+70
+d8
+88
+88
+d8
+70
+00
+f8
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 8 1 1
+BITMAP
+90
+d8
+6c
+36
+36
+6c
+d8
+90
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+6060
+e060
+e0c0
+6180
+6180
+6310
+6230
+6670
+0cf0
+0db0
+19f8
+3030
+3030
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+6060
+e060
+e0c0
+6180
+6180
+6370
+62f8
+6698
+0c18
+0c30
+1860
+30f8
+30f8
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 14 13 0 0
+BITMAP
+7030
+f830
+9860
+30c0
+30c0
+9988
+f918
+7338
+0678
+06d8
+0cfc
+1818
+1818
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 7 14 1 -4
+BITMAP
+18
+18
+00
+00
+18
+18
+18
+38
+70
+e0
+c6
+c6
+fe
+7c
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 12 18 0 0
+BITMAP
+1800
+0c00
+0600
+0000
+0600
+0600
+0f00
+0f00
+1980
+1980
+30c0
+30c0
+3fc0
+7fe0
+6060
+6060
+c030
+c030
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 12 18 0 0
+BITMAP
+0180
+0300
+0600
+0000
+0600
+0600
+0f00
+0f00
+1980
+1980
+30c0
+30c0
+3fc0
+7fe0
+6060
+6060
+c030
+c030
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 12 18 0 0
+BITMAP
+0600
+0f00
+1980
+0000
+0600
+0600
+0f00
+0f00
+1980
+1980
+30c0
+30c0
+3fc0
+7fe0
+6060
+6060
+c030
+c030
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 12 18 0 0
+BITMAP
+0c80
+1680
+1300
+0000
+0600
+0600
+0f00
+0f00
+1980
+1980
+30c0
+30c0
+3fc0
+7fe0
+6060
+6060
+c030
+c030
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 12 17 0 0
+BITMAP
+1980
+1980
+0000
+0600
+0600
+0f00
+0f00
+1980
+1980
+30c0
+30c0
+3fc0
+7fe0
+6060
+6060
+c030
+c030
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 12 18 0 0
+BITMAP
+0f00
+1980
+1980
+0f00
+0600
+0600
+0f00
+0f00
+1980
+1980
+30c0
+30c0
+3fc0
+7fe0
+6060
+6060
+c030
+c030
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 960 0
+DWIDTH 18 0
+BBX 16 14 1 0
+BITMAP
+07ff
+07ff
+0d80
+0d80
+1980
+1980
+31fe
+31fe
+3f80
+7f80
+6180
+6180
+c1ff
+c1ff
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 18 1 -4
+BITMAP
+0f80
+3fe0
+7070
+6030
+e000
+c000
+c000
+c000
+c000
+e000
+6030
+7070
+3fe0
+0f80
+0e00
+0300
+1b00
+1e00
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 18 1 0
+BITMAP
+3000
+1800
+0c00
+0000
+ff80
+ff80
+c000
+c000
+c000
+c000
+ff00
+ff00
+c000
+c000
+c000
+c000
+ff80
+ff80
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 18 1 0
+BITMAP
+0300
+0600
+0c00
+0000
+ff80
+ff80
+c000
+c000
+c000
+c000
+ff00
+ff00
+c000
+c000
+c000
+c000
+ff80
+ff80
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 18 1 0
+BITMAP
+0c00
+1e00
+3300
+0000
+ff80
+ff80
+c000
+c000
+c000
+c000
+ff00
+ff00
+c000
+c000
+c000
+c000
+ff80
+ff80
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+3300
+3300
+0000
+ff80
+ff80
+c000
+c000
+c000
+c000
+ff00
+ff00
+c000
+c000
+c000
+c000
+ff80
+ff80
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 18 0 0
+BITMAP
+c0
+60
+30
+00
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 18 2 0
+BITMAP
+30
+60
+c0
+00
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 6 18 0 0
+BITMAP
+30
+78
+cc
+00
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 6 17 0 0
+BITMAP
+cc
+cc
+00
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 14 0 0
+BITMAP
+7f80
+7fc0
+60e0
+6060
+6030
+6030
+fc30
+fc30
+6030
+6030
+6060
+60e0
+7fc0
+7f80
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+0c80
+1680
+1300
+0000
+e060
+e060
+f060
+d860
+d860
+cc60
+cc60
+c660
+c660
+c360
+c1e0
+c1e0
+c0e0
+c060
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 18 1 0
+BITMAP
+0c00
+0600
+0300
+0000
+0f80
+3fe0
+7070
+6030
+e038
+c018
+c018
+c018
+c018
+e038
+6030
+7070
+3fe0
+0f80
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 18 1 0
+BITMAP
+00c0
+0180
+0300
+0000
+0f80
+3fe0
+7070
+6030
+e038
+c018
+c018
+c018
+c018
+e038
+6030
+7070
+3fe0
+0f80
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 18 1 0
+BITMAP
+0300
+0780
+0cc0
+0000
+0f80
+3fe0
+7070
+6030
+e038
+c018
+c018
+c018
+c018
+e038
+6030
+7070
+3fe0
+0f80
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 18 1 0
+BITMAP
+0640
+0b40
+0980
+0000
+0f80
+3fe0
+7070
+6030
+e038
+c018
+c018
+c018
+c018
+e038
+6030
+7070
+3fe0
+0f80
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+0d80
+0d80
+0000
+0f80
+3fe0
+7070
+6030
+e038
+c018
+c018
+c018
+c018
+e038
+6030
+7070
+3fe0
+0f80
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 10 9 0 0
+BITMAP
+c0c0
+6180
+3300
+1e00
+0c00
+1e00
+3300
+6180
+c0c0
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 14 14 0 0
+BITMAP
+07cc
+1ffc
+3838
+3078
+70dc
+61cc
+638c
+670c
+6e0c
+6c1c
+3818
+7838
+fff0
+c7c0
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+1800
+0c00
+0600
+0000
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+7fc0
+1f00
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+0300
+0600
+0c00
+0000
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+7fc0
+1f00
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+0600
+0f00
+1980
+0000
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+7fc0
+1f00
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+1980
+1980
+0000
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+7fc0
+1f00
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 18 1 0
+BITMAP
+0180
+0300
+0600
+0000
+c030
+c030
+6060
+6060
+30c0
+30c0
+1980
+0f00
+0600
+0600
+0600
+0600
+0600
+0600
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 14 1 0
+BITMAP
+c000
+c000
+c000
+ff00
+ff80
+c1c0
+c0c0
+c0c0
+c1c0
+ff80
+ff00
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+38
+7c
+c6
+c6
+c6
+c6
+dc
+dc
+c6
+c6
+c6
+c6
+de
+dc
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+60
+30
+18
+00
+7c
+ee
+c6
+0e
+7e
+e6
+c6
+c6
+ee
+76
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+0c
+18
+30
+00
+7c
+ee
+c6
+0e
+7e
+e6
+c6
+c6
+ee
+76
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+18
+3c
+66
+00
+7c
+ee
+c6
+0e
+7e
+e6
+c6
+c6
+ee
+76
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+32
+5a
+4c
+00
+7c
+ee
+c6
+0e
+7e
+e6
+c6
+c6
+ee
+76
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+6c
+6c
+00
+7c
+ee
+c6
+0e
+7e
+e6
+c6
+c6
+ee
+76
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+38
+6c
+6c
+38
+7c
+ee
+c6
+0e
+7e
+e6
+c6
+c6
+ee
+76
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 10 1 0
+BITMAP
+7de0
+eff0
+c618
+0e18
+7ff8
+e600
+c600
+c718
+eff8
+75e0
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 -4
+BITMAP
+3e
+7f
+63
+c0
+c0
+c0
+c0
+63
+7f
+3e
+38
+0c
+6c
+78
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+60
+30
+18
+00
+3c
+7e
+c3
+c3
+ff
+c0
+c0
+e3
+7f
+3c
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+06
+0c
+18
+00
+3c
+7e
+c3
+c3
+ff
+c0
+c0
+e3
+7f
+3c
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+18
+3c
+66
+00
+3c
+7e
+c3
+c3
+ff
+c0
+c0
+e3
+7f
+3c
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+36
+36
+00
+3c
+7e
+c3
+c3
+ff
+c0
+c0
+e3
+7f
+3c
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 4 14 0 0
+BITMAP
+c0
+60
+30
+00
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 4 14 0 0
+BITMAP
+30
+60
+c0
+00
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 6 14 -1 0
+BITMAP
+30
+78
+cc
+00
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 5 13 0 0
+BITMAP
+d8
+d8
+00
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+6000
+3600
+3800
+4c00
+3e00
+7f00
+6300
+c180
+c180
+c180
+c180
+6300
+7f00
+3e00
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+32
+5a
+4c
+00
+ce
+df
+e3
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+3000
+1800
+0c00
+0000
+3e00
+7f00
+6300
+c180
+c180
+c180
+c180
+6300
+7f00
+3e00
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+0600
+0c00
+1800
+0000
+3e00
+7f00
+6300
+c180
+c180
+c180
+c180
+6300
+7f00
+3e00
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+0c00
+1e00
+3300
+0000
+3e00
+7f00
+6300
+c180
+c180
+c180
+c180
+6300
+7f00
+3e00
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+1900
+2d00
+2600
+0000
+3e00
+7f00
+6300
+c180
+c180
+c180
+c180
+6300
+7f00
+3e00
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 1 0
+BITMAP
+3600
+3600
+0000
+3e00
+7f00
+6300
+c180
+c180
+c180
+c180
+6300
+7f00
+3e00
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 8 1 1
+BITMAP
+18
+18
+00
+ff
+ff
+00
+18
+18
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 10 0 0
+BITMAP
+0e60
+3fc0
+3180
+63c0
+66c0
+6cc0
+78c0
+3180
+7f80
+ce00
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+30
+18
+0c
+00
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+c7
+fb
+73
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+06
+0c
+18
+00
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+c7
+fb
+73
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+18
+3c
+66
+00
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+c7
+fb
+73
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+66
+66
+00
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+c7
+fb
+73
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 18 1 -4
+BITMAP
+06
+0c
+18
+00
+c3
+c3
+c3
+66
+66
+66
+24
+3c
+18
+18
+18
+18
+70
+70
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 18 1 -4
+BITMAP
+c000
+c000
+c000
+c000
+de00
+ff00
+e300
+c180
+c180
+c180
+c180
+e300
+ff00
+de00
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 17 1 -4
+BITMAP
+66
+66
+00
+c3
+c3
+c3
+66
+66
+66
+24
+3c
+18
+18
+18
+18
+70
+70
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica18.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica18.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica18.h	(revision 15879)
@@ -0,0 +1,988 @@
+static unsigned char helvetica18_0_bits[] = {
+0x00};
+static unsigned char helvetica18_1_bits[] = {
+0x00};
+static unsigned char helvetica18_2_bits[] = {
+0x00};
+static unsigned char helvetica18_3_bits[] = {
+0x00};
+static unsigned char helvetica18_4_bits[] = {
+0x00};
+static unsigned char helvetica18_5_bits[] = {
+0x00};
+static unsigned char helvetica18_6_bits[] = {
+0x00};
+static unsigned char helvetica18_7_bits[] = {
+0x00};
+static unsigned char helvetica18_8_bits[] = {
+0x00};
+static unsigned char helvetica18_9_bits[] = {
+0x00};
+static unsigned char helvetica18_10_bits[] = {
+0x00};
+static unsigned char helvetica18_11_bits[] = {
+0x00};
+static unsigned char helvetica18_12_bits[] = {
+0x00};
+static unsigned char helvetica18_13_bits[] = {
+0x00};
+static unsigned char helvetica18_14_bits[] = {
+0x00};
+static unsigned char helvetica18_15_bits[] = {
+0x00};
+static unsigned char helvetica18_16_bits[] = {
+0x00};
+static unsigned char helvetica18_17_bits[] = {
+0x00};
+static unsigned char helvetica18_18_bits[] = {
+0x00};
+static unsigned char helvetica18_19_bits[] = {
+0x00};
+static unsigned char helvetica18_20_bits[] = {
+0x00};
+static unsigned char helvetica18_21_bits[] = {
+0x00};
+static unsigned char helvetica18_22_bits[] = {
+0x00};
+static unsigned char helvetica18_23_bits[] = {
+0x00};
+static unsigned char helvetica18_24_bits[] = {
+0x00};
+static unsigned char helvetica18_25_bits[] = {
+0x00};
+static unsigned char helvetica18_26_bits[] = {
+0x00};
+static unsigned char helvetica18_27_bits[] = {
+0x00};
+static unsigned char helvetica18_28_bits[] = {
+0x00};
+static unsigned char helvetica18_29_bits[] = {
+0x00};
+static unsigned char helvetica18_30_bits[] = {
+0x00};
+static unsigned char helvetica18_31_bits[] = {
+0x00};
+static unsigned char helvetica18_32_bits[] = {
+0x00};
+static unsigned char helvetica18_33_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 
+0x03, 0x03};
+static unsigned char helvetica18_34_bits[] = {
+0x1b, 0x1b, 0x1b, 0x09, 0x09};
+static unsigned char helvetica18_35_bits[] = {
+0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0xfe, 0x03, 0xfe, 0x03, 0x48, 0x00, 
+0x48, 0x00, 0x48, 0x00, 0xff, 0x01, 0xff, 0x01, 0x24, 0x00, 0x24, 0x00, 
+0x24, 0x00};
+static unsigned char helvetica18_36_bits[] = {
+0x10, 0x00, 0x7c, 0x00, 0xfe, 0x00, 0xd3, 0x00, 0x13, 0x00, 0x17, 0x00, 
+0x1e, 0x00, 0x7c, 0x00, 0xf0, 0x00, 0x90, 0x01, 0x93, 0x01, 0xd7, 0x01, 
+0xfe, 0x00, 0x7c, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char helvetica18_37_bits[] = {
+0x1e, 0x06, 0x3f, 0x03, 0x33, 0x03, 0xb3, 0x01, 0xbf, 0x01, 0xde, 0x00, 
+0xc0, 0x00, 0x60, 0x1e, 0x60, 0x3f, 0x30, 0x33, 0x30, 0x33, 0x18, 0x3f, 
+0x18, 0x1e};
+static unsigned char helvetica18_38_bits[] = {
+0x3c, 0x00, 0x7e, 0x00, 0x66, 0x00, 0x66, 0x00, 0x3c, 0x00, 0x3e, 0x00, 
+0x77, 0x03, 0x63, 0x03, 0xc3, 0x03, 0xc3, 0x01, 0xe7, 0x03, 0x7e, 0x07, 
+0x3c, 0x0e};
+static unsigned char helvetica18_39_bits[] = {
+0x03, 0x03, 0x02, 0x02, 0x01};
+static unsigned char helvetica18_40_bits[] = {
+0x08, 0x0c, 0x06, 0x06, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x06, 0x06, 0x0c, 0x08};
+static unsigned char helvetica18_41_bits[] = {
+0x01, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x06, 0x06, 0x03, 0x01};
+static unsigned char helvetica18_42_bits[] = {
+0x04, 0x04, 0x1f, 0x0e, 0x0e, 0x11};
+static unsigned char helvetica18_43_bits[] = {
+0x18, 0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, 0x18};
+static unsigned char helvetica18_44_bits[] = {
+0x03, 0x03, 0x02, 0x02, 0x01};
+static unsigned char helvetica18_45_bits[] = {
+0xff, 0xff};
+static unsigned char helvetica18_46_bits[] = {
+0x03, 0x03};
+static unsigned char helvetica18_47_bits[] = {
+0x18, 0x18, 0x08, 0x08, 0x0c, 0x0c, 0x04, 0x04, 0x06, 0x06, 0x02, 0x02, 
+0x03, 0x03};
+static unsigned char helvetica18_48_bits[] = {
+0x3c, 0x7e, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x7e, 
+0x3c};
+static unsigned char helvetica18_49_bits[] = {
+0x18, 0x1f, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18};
+static unsigned char helvetica18_50_bits[] = {
+0x3c, 0x7f, 0xc3, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0x0e, 0x07, 0x03, 0xff, 
+0xff};
+static unsigned char helvetica18_51_bits[] = {
+0x3c, 0x7e, 0xc3, 0xc3, 0x60, 0x38, 0x78, 0xe0, 0xc0, 0xc3, 0xe3, 0x7e, 
+0x3c};
+static unsigned char helvetica18_52_bits[] = {
+0xc0, 0x00, 0xe0, 0x00, 0xf0, 0x00, 0xd8, 0x00, 0xcc, 0x00, 0xcc, 0x00, 
+0xc6, 0x00, 0xc3, 0x00, 0xff, 0x01, 0xff, 0x01, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00};
+static unsigned char helvetica18_53_bits[] = {
+0x7f, 0x7f, 0x03, 0x03, 0x3f, 0x7f, 0xe3, 0xc0, 0xc0, 0xc3, 0xe3, 0x7f, 
+0x3e};
+static unsigned char helvetica18_54_bits[] = {
+0x3c, 0xfe, 0xc6, 0x03, 0x03, 0x3b, 0x7f, 0xc3, 0xc3, 0xc3, 0xc7, 0x7e, 
+0x3c};
+static unsigned char helvetica18_55_bits[] = {
+0xff, 0xff, 0xc0, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x0c, 0x06, 
+0x06};
+static unsigned char helvetica18_56_bits[] = {
+0x3c, 0x7e, 0xe7, 0xc3, 0xc3, 0x66, 0x7e, 0x66, 0xc3, 0xc3, 0xe7, 0x7e, 
+0x3c};
+static unsigned char helvetica18_57_bits[] = {
+0x3c, 0x7e, 0xe3, 0xc3, 0xc3, 0xc3, 0xfe, 0xdc, 0xc0, 0xc0, 0x63, 0x7f, 
+0x3e};
+static unsigned char helvetica18_58_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03};
+static unsigned char helvetica18_59_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x02, 0x02, 
+0x01};
+static unsigned char helvetica18_60_bits[] = {
+0xc0, 0xf0, 0x3c, 0x0e, 0x03, 0x0e, 0x3c, 0xf0, 0xc0};
+static unsigned char helvetica18_61_bits[] = {
+0x7f, 0x7f, 0x00, 0x00, 0x7f, 0x7f};
+static unsigned char helvetica18_62_bits[] = {
+0x03, 0x0f, 0x3c, 0x70, 0xc0, 0x70, 0x3c, 0x0f, 0x03};
+static unsigned char helvetica18_63_bits[] = {
+0x3e, 0x7f, 0x63, 0x63, 0x70, 0x38, 0x1c, 0x0c, 0x0c, 0x0c, 0x00, 0x00, 
+0x0c, 0x0c};
+static unsigned char helvetica18_64_bits[] = {
+0xc0, 0x0f, 0xf0, 0x3f, 0x38, 0x70, 0x0c, 0x60, 0xc6, 0xcd, 0xe6, 0xce, 
+0x63, 0xcc, 0x33, 0xc6, 0x33, 0x66, 0x33, 0x66, 0x33, 0x33, 0xf3, 0x1f, 
+0xe6, 0x0e, 0x0e, 0x00, 0x1c, 0x00, 0xf8, 0x0f, 0xe0, 0x07};
+static unsigned char helvetica18_65_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x98, 0x01, 
+0x0c, 0x03, 0x0c, 0x03, 0xfc, 0x03, 0xfe, 0x07, 0x06, 0x06, 0x06, 0x06, 
+0x03, 0x0c, 0x03, 0x0c};
+static unsigned char helvetica18_66_bits[] = {
+0xff, 0x00, 0xff, 0x01, 0x83, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x01, 
+0xff, 0x01, 0xff, 0x03, 0x03, 0x07, 0x03, 0x06, 0x03, 0x06, 0x03, 0x07, 
+0xff, 0x03, 0xff, 0x01};
+static unsigned char helvetica18_67_bits[] = {
+0xf0, 0x01, 0xfc, 0x07, 0x0e, 0x0e, 0x06, 0x0c, 0x07, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x07, 0x00, 0x06, 0x0c, 0x0e, 0x0e, 
+0xfc, 0x07, 0xf0, 0x01};
+static unsigned char helvetica18_68_bits[] = {
+0xff, 0x00, 0xff, 0x01, 0x83, 0x03, 0x03, 0x03, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x03, 0x83, 0x03, 
+0xff, 0x01, 0xff, 0x00};
+static unsigned char helvetica18_69_bits[] = {
+0xff, 0x01, 0xff, 0x01, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0xff, 0x00, 0xff, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0xff, 0x01, 0xff, 0x01};
+static unsigned char helvetica18_70_bits[] = {
+0xff, 0x01, 0xff, 0x01, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0xff, 0x00, 0xff, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00};
+static unsigned char helvetica18_71_bits[] = {
+0xf0, 0x01, 0xfc, 0x07, 0x0e, 0x0e, 0x06, 0x0c, 0x07, 0x0c, 0x03, 0x00, 
+0x03, 0x00, 0x83, 0x0f, 0x83, 0x0f, 0x07, 0x0c, 0x06, 0x0c, 0x0e, 0x0e, 
+0xfc, 0x0f, 0xf0, 0x0d};
+static unsigned char helvetica18_72_bits[] = {
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0xff, 0x07, 0xff, 0x07, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06};
+static unsigned char helvetica18_73_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03};
+static unsigned char helvetica18_74_bits[] = {
+0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc3, 0xc3, 0xe7, 
+0x7e, 0x3c};
+static unsigned char helvetica18_75_bits[] = {
+0x03, 0x07, 0x83, 0x03, 0xc3, 0x01, 0xe3, 0x00, 0x73, 0x00, 0x3b, 0x00, 
+0x1f, 0x00, 0x3f, 0x00, 0x73, 0x00, 0xe3, 0x00, 0xc3, 0x01, 0x83, 0x03, 
+0x03, 0x07, 0x03, 0x0e};
+static unsigned char helvetica18_76_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0xff, 0xff};
+static unsigned char helvetica18_77_bits[] = {
+0x03, 0x30, 0x03, 0x30, 0x07, 0x38, 0x07, 0x38, 0x0f, 0x3c, 0x0f, 0x3c, 
+0x1b, 0x36, 0x1b, 0x36, 0x33, 0x33, 0x33, 0x33, 0x23, 0x31, 0xe3, 0x31, 
+0xc3, 0x30, 0xc3, 0x30};
+static unsigned char helvetica18_78_bits[] = {
+0x03, 0x06, 0x07, 0x06, 0x0f, 0x06, 0x0f, 0x06, 0x1b, 0x06, 0x33, 0x06, 
+0x33, 0x06, 0x63, 0x06, 0x63, 0x06, 0xc3, 0x06, 0x83, 0x07, 0x83, 0x07, 
+0x03, 0x07, 0x03, 0x06};
+static unsigned char helvetica18_79_bits[] = {
+0xf0, 0x01, 0xfc, 0x07, 0x0e, 0x0e, 0x06, 0x0c, 0x07, 0x1c, 0x03, 0x18, 
+0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x07, 0x1c, 0x06, 0x0c, 0x0e, 0x0e, 
+0xfc, 0x07, 0xf0, 0x01};
+static unsigned char helvetica18_80_bits[] = {
+0xff, 0x00, 0xff, 0x01, 0x83, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 
+0xff, 0x01, 0xff, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00};
+static unsigned char helvetica18_81_bits[] = {
+0xf0, 0x01, 0xfc, 0x07, 0x0e, 0x0e, 0x06, 0x0c, 0x07, 0x1c, 0x03, 0x18, 
+0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x87, 0x1d, 0x86, 0x0d, 0x0e, 0x0f, 
+0xfc, 0x07, 0xf0, 0x0d, 0x00, 0x0c};
+static unsigned char helvetica18_82_bits[] = {
+0xff, 0x00, 0xff, 0x01, 0x83, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 
+0xff, 0x01, 0xff, 0x00, 0x83, 0x01, 0x83, 0x01, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica18_83_bits[] = {
+0xf8, 0x00, 0xfe, 0x03, 0x07, 0x07, 0x03, 0x06, 0x07, 0x00, 0x3e, 0x00, 
+0xf8, 0x00, 0xc0, 0x03, 0x00, 0x07, 0x00, 0x06, 0x03, 0x06, 0x07, 0x07, 
+0xfe, 0x03, 0xfc, 0x00};
+static unsigned char helvetica18_84_bits[] = {
+0xff, 0x03, 0xff, 0x03, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x30, 0x00};
+static unsigned char helvetica18_85_bits[] = {
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 
+0xfe, 0x03, 0xf8, 0x00};
+static unsigned char helvetica18_86_bits[] = {
+0x03, 0x0c, 0x03, 0x0c, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x03, 
+0x0c, 0x03, 0x0c, 0x03, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0xf0, 0x00, 
+0xf0, 0x00, 0x60, 0x00};
+static unsigned char helvetica18_87_bits[] = {
+0x83, 0xc1, 0x83, 0xc1, 0x83, 0xc1, 0xc3, 0xc3, 0xc6, 0x63, 0x46, 0x62, 
+0x66, 0x66, 0x66, 0x66, 0x6c, 0x36, 0x6c, 0x36, 0x2c, 0x34, 0x38, 0x1c, 
+0x18, 0x18, 0x18, 0x18};
+static unsigned char helvetica18_88_bits[] = {
+0x03, 0x06, 0x07, 0x07, 0x06, 0x03, 0x8e, 0x03, 0x8c, 0x01, 0xd8, 0x00, 
+0x70, 0x00, 0x70, 0x00, 0xd8, 0x00, 0x8c, 0x01, 0x8e, 0x03, 0x06, 0x03, 
+0x07, 0x07, 0x03, 0x06};
+static unsigned char helvetica18_89_bits[] = {
+0x03, 0x0c, 0x03, 0x0c, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x03, 0x0c, 0x03, 
+0x98, 0x01, 0xf0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00};
+static unsigned char helvetica18_90_bits[] = {
+0xff, 0x03, 0xff, 0x03, 0x00, 0x03, 0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 
+0x30, 0x00, 0x38, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x03, 0x00, 
+0xff, 0x03, 0xff, 0x03};
+static unsigned char helvetica18_91_bits[] = {
+0x0f, 0x0f, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x0f, 0x0f};
+static unsigned char helvetica18_92_bits[] = {
+0x03, 0x03, 0x02, 0x02, 0x06, 0x06, 0x04, 0x04, 0x0c, 0x0c, 0x08, 0x08, 
+0x18, 0x18};
+static unsigned char helvetica18_93_bits[] = {
+0x0f, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0f, 0x0f};
+static unsigned char helvetica18_94_bits[] = {
+0x08, 0x1c, 0x36, 0x63, 0x41};
+static unsigned char helvetica18_95_bits[] = {
+0xff, 0x03, 0xff, 0x03};
+static unsigned char helvetica18_96_bits[] = {
+0x02, 0x01, 0x01, 0x03, 0x03};
+static unsigned char helvetica18_97_bits[] = {
+0x3e, 0x77, 0x63, 0x70, 0x7e, 0x67, 0x63, 0x63, 0x77, 0x6e};
+static unsigned char helvetica18_98_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x7b, 0x00, 0xff, 0x00, 
+0xc7, 0x00, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc7, 0x00, 
+0xff, 0x00, 0x7b, 0x00};
+static unsigned char helvetica18_99_bits[] = {
+0x7c, 0xfe, 0xc6, 0x03, 0x03, 0x03, 0x03, 0xc6, 0xfe, 0x7c};
+static unsigned char helvetica18_100_bits[] = {
+0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xbc, 0x01, 0xfe, 0x01, 
+0xc6, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc6, 0x01, 
+0xfe, 0x01, 0xbc, 0x01};
+static unsigned char helvetica18_101_bits[] = {
+0x3c, 0x7e, 0xc3, 0xc3, 0xff, 0x03, 0x03, 0xc7, 0xfe, 0x3c};
+static unsigned char helvetica18_102_bits[] = {
+0x38, 0x3c, 0x0c, 0x0c, 0x3f, 0x3f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c};
+static unsigned char helvetica18_103_bits[] = {
+0xbc, 0x01, 0xfe, 0x01, 0x86, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 
+0x83, 0x01, 0xc6, 0x01, 0xfe, 0x01, 0xbc, 0x01, 0x80, 0x01, 0xc6, 0x00, 
+0xfe, 0x00, 0x38, 0x00};
+static unsigned char helvetica18_104_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x73, 0xfb, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 
+0xc3, 0xc3};
+static unsigned char helvetica18_105_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03};
+static unsigned char helvetica18_106_bits[] = {
+0x0c, 0x0c, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0f, 0x07};
+static unsigned char helvetica18_107_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x63, 0x33, 0x1b, 0x0f, 0x1f, 0x1b, 0x33, 0x73, 
+0x63, 0xe3};
+static unsigned char helvetica18_108_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03};
+static unsigned char helvetica18_109_bits[] = {
+0x33, 0x06, 0x7b, 0x0f, 0xe7, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 
+0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c};
+static unsigned char helvetica18_110_bits[] = {
+0x73, 0xfb, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3};
+static unsigned char helvetica18_111_bits[] = {
+0x7c, 0x00, 0xfe, 0x00, 0xc6, 0x00, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 
+0x83, 0x01, 0xc6, 0x00, 0xfe, 0x00, 0x7c, 0x00};
+static unsigned char helvetica18_112_bits[] = {
+0x7b, 0x00, 0xff, 0x00, 0xc7, 0x00, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 
+0x83, 0x01, 0xc7, 0x00, 0xff, 0x00, 0x7b, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00};
+static unsigned char helvetica18_113_bits[] = {
+0xbc, 0x01, 0xfe, 0x01, 0xc6, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 
+0x83, 0x01, 0xc6, 0x01, 0xfe, 0x01, 0xbc, 0x01, 0x80, 0x01, 0x80, 0x01, 
+0x80, 0x01, 0x80, 0x01};
+static unsigned char helvetica18_114_bits[] = {
+0x1b, 0x1b, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica18_115_bits[] = {
+0x3c, 0x7e, 0x63, 0x03, 0x3f, 0x7c, 0x60, 0x63, 0x3f, 0x1e};
+static unsigned char helvetica18_116_bits[] = {
+0x0c, 0x0c, 0x0c, 0x3f, 0x3f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x1c, 
+0x18};
+static unsigned char helvetica18_117_bits[] = {
+0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe3, 0xdf, 0xce};
+static unsigned char helvetica18_118_bits[] = {
+0xc3, 0xc3, 0xc3, 0x66, 0x66, 0x66, 0x24, 0x3c, 0x18, 0x18};
+static unsigned char helvetica18_119_bits[] = {
+0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x66, 0x06, 0x66, 0x06, 0x96, 0x06, 
+0x94, 0x02, 0x9c, 0x03, 0x98, 0x01, 0x98, 0x01};
+static unsigned char helvetica18_120_bits[] = {
+0xc3, 0xe7, 0x66, 0x3c, 0x18, 0x18, 0x3c, 0x66, 0xe7, 0xc3};
+static unsigned char helvetica18_121_bits[] = {
+0xc3, 0xc3, 0xc3, 0x66, 0x66, 0x66, 0x24, 0x3c, 0x18, 0x18, 0x18, 0x18, 
+0x0e, 0x0e};
+static unsigned char helvetica18_122_bits[] = {
+0x7f, 0x7f, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x7f, 0x7f};
+static unsigned char helvetica18_123_bits[] = {
+0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x06, 0x03, 0x06, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30};
+static unsigned char helvetica18_124_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica18_125_bits[] = {
+0x03, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x18, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x06, 0x03};
+static unsigned char helvetica18_126_bits[] = {
+0xcc, 0x7e, 0x33};
+static unsigned char helvetica18_127_bits[] = {
+0x00};
+static unsigned char helvetica18_128_bits[] = {
+0x00};
+static unsigned char helvetica18_129_bits[] = {
+0x00};
+static unsigned char helvetica18_130_bits[] = {
+0x00};
+static unsigned char helvetica18_131_bits[] = {
+0x00};
+static unsigned char helvetica18_132_bits[] = {
+0x00};
+static unsigned char helvetica18_133_bits[] = {
+0x00};
+static unsigned char helvetica18_134_bits[] = {
+0x00};
+static unsigned char helvetica18_135_bits[] = {
+0x00};
+static unsigned char helvetica18_136_bits[] = {
+0x00};
+static unsigned char helvetica18_137_bits[] = {
+0x00};
+static unsigned char helvetica18_138_bits[] = {
+0x00};
+static unsigned char helvetica18_139_bits[] = {
+0x00};
+static unsigned char helvetica18_140_bits[] = {
+0x00};
+static unsigned char helvetica18_141_bits[] = {
+0x00};
+static unsigned char helvetica18_142_bits[] = {
+0x00};
+static unsigned char helvetica18_143_bits[] = {
+0x00};
+static unsigned char helvetica18_144_bits[] = {
+0x00};
+static unsigned char helvetica18_145_bits[] = {
+0x00};
+static unsigned char helvetica18_146_bits[] = {
+0x00};
+static unsigned char helvetica18_147_bits[] = {
+0x00};
+static unsigned char helvetica18_148_bits[] = {
+0x00};
+static unsigned char helvetica18_149_bits[] = {
+0x00};
+static unsigned char helvetica18_150_bits[] = {
+0x00};
+static unsigned char helvetica18_151_bits[] = {
+0x00};
+static unsigned char helvetica18_152_bits[] = {
+0x00};
+static unsigned char helvetica18_153_bits[] = {
+0x00};
+static unsigned char helvetica18_154_bits[] = {
+0x00};
+static unsigned char helvetica18_155_bits[] = {
+0x00};
+static unsigned char helvetica18_156_bits[] = {
+0x00};
+static unsigned char helvetica18_157_bits[] = {
+0x00};
+static unsigned char helvetica18_158_bits[] = {
+0x00};
+static unsigned char helvetica18_159_bits[] = {
+0x00};
+static unsigned char helvetica18_160_bits[] = {
+0x00};
+static unsigned char helvetica18_161_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03};
+static unsigned char helvetica18_162_bits[] = {
+0x20, 0x20, 0x7c, 0xfe, 0xd6, 0x13, 0x13, 0x13, 0x13, 0xd6, 0xfe, 0x7c, 
+0x08, 0x08};
+static unsigned char helvetica18_163_bits[] = {
+0x78, 0x00, 0xfc, 0x00, 0x86, 0x01, 0x86, 0x01, 0x06, 0x00, 0x0c, 0x00, 
+0x7e, 0x00, 0x18, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x06, 0x01, 0xff, 0x01, 
+0xfb, 0x00};
+static unsigned char helvetica18_164_bits[] = {
+0xc3, 0xff, 0x66, 0x66, 0x66, 0xff, 0xc3};
+static unsigned char helvetica18_165_bits[] = {
+0xc3, 0xc3, 0x66, 0x66, 0x66, 0x3c, 0xff, 0x18, 0xff, 0x18, 0x18, 0x18, 
+0x18};
+static unsigned char helvetica18_166_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica18_167_bits[] = {
+0x3c, 0x7e, 0xc3, 0xc3, 0x0f, 0x3e, 0x76, 0xe3, 0xc3, 0xc7, 0xce, 0x7c, 
+0x70, 0xe0, 0xc3, 0xc3, 0x7e, 0x3c};
+static unsigned char helvetica18_168_bits[] = {
+0x1b, 0x1b};
+static unsigned char helvetica18_169_bits[] = {
+0xf0, 0x01, 0x0c, 0x06, 0x02, 0x08, 0xe2, 0x08, 0x11, 0x11, 0x09, 0x10, 
+0x09, 0x10, 0x09, 0x10, 0x11, 0x11, 0xe2, 0x08, 0x02, 0x08, 0x0c, 0x06, 
+0xf0, 0x01};
+static unsigned char helvetica18_170_bits[] = {
+0x0e, 0x13, 0x1c, 0x12, 0x1b, 0x16, 0x00, 0x1f};
+static unsigned char helvetica18_171_bits[] = {
+0x48, 0x6c, 0x36, 0x1b, 0x1b, 0x36, 0x6c, 0x48};
+static unsigned char helvetica18_172_bits[] = {
+0xff, 0x01, 0xff, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01};
+static unsigned char helvetica18_173_bits[] = {
+0x1f, 0x1f};
+static unsigned char helvetica18_174_bits[] = {
+0xf0, 0x01, 0x0c, 0x06, 0x02, 0x08, 0xf2, 0x09, 0x11, 0x12, 0x11, 0x12, 
+0xf1, 0x11, 0x91, 0x10, 0x11, 0x11, 0x12, 0x0a, 0x02, 0x08, 0x0c, 0x06, 
+0xf0, 0x01};
+static unsigned char helvetica18_175_bits[] = {
+0x1f};
+static unsigned char helvetica18_176_bits[] = {
+0x0e, 0x1b, 0x11, 0x1b, 0x0e};
+static unsigned char helvetica18_177_bits[] = {
+0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18, 0x00, 0xff, 0xff};
+static unsigned char helvetica18_178_bits[] = {
+0x0e, 0x1f, 0x19, 0x18, 0x0c, 0x06, 0x1f, 0x1f};
+static unsigned char helvetica18_179_bits[] = {
+0x0e, 0x1f, 0x19, 0x0c, 0x0c, 0x19, 0x1f, 0x0e};
+static unsigned char helvetica18_180_bits[] = {
+0x0c, 0x06, 0x03};
+static unsigned char helvetica18_181_bits[] = {
+0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe7, 0xff, 0xdb, 0x03, 0x03, 
+0x03, 0x03};
+static unsigned char helvetica18_182_bits[] = {
+0xfc, 0x4e, 0x4f, 0x4f, 0x4f, 0x4f, 0x4e, 0x4c, 0x48, 0x48, 0x48, 0x48, 
+0x48, 0x48, 0x48, 0x48, 0x48, 0x48};
+static unsigned char helvetica18_183_bits[] = {
+0x03, 0x03};
+static unsigned char helvetica18_184_bits[] = {
+0x06, 0x0e, 0x18, 0x1b, 0x0f};
+static unsigned char helvetica18_185_bits[] = {
+0x06, 0x07, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06};
+static unsigned char helvetica18_186_bits[] = {
+0x0e, 0x1b, 0x11, 0x11, 0x1b, 0x0e, 0x00, 0x1f};
+static unsigned char helvetica18_187_bits[] = {
+0x09, 0x1b, 0x36, 0x6c, 0x6c, 0x36, 0x1b, 0x09};
+static unsigned char helvetica18_188_bits[] = {
+0x06, 0x06, 0x07, 0x06, 0x07, 0x03, 0x86, 0x01, 0x86, 0x01, 0xc6, 0x08, 
+0x46, 0x0c, 0x66, 0x0e, 0x30, 0x0f, 0xb0, 0x0d, 0x98, 0x1f, 0x0c, 0x0c, 
+0x0c, 0x0c};
+static unsigned char helvetica18_189_bits[] = {
+0x06, 0x06, 0x07, 0x06, 0x07, 0x03, 0x86, 0x01, 0x86, 0x01, 0xc6, 0x0e, 
+0x46, 0x1f, 0x66, 0x19, 0x30, 0x18, 0x30, 0x0c, 0x18, 0x06, 0x0c, 0x1f, 
+0x0c, 0x1f};
+static unsigned char helvetica18_190_bits[] = {
+0x0e, 0x0c, 0x1f, 0x0c, 0x19, 0x06, 0x0c, 0x03, 0x0c, 0x03, 0x99, 0x11, 
+0x9f, 0x18, 0xce, 0x1c, 0x60, 0x1e, 0x60, 0x1b, 0x30, 0x3f, 0x18, 0x18, 
+0x18, 0x18};
+static unsigned char helvetica18_191_bits[] = {
+0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x1c, 0x0e, 0x07, 0x63, 0x63, 
+0x7f, 0x3e};
+static unsigned char helvetica18_192_bits[] = {
+0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0xf0, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x98, 0x01, 0x0c, 0x03, 0x0c, 0x03, 
+0xfc, 0x03, 0xfe, 0x07, 0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c};
+static unsigned char helvetica18_193_bits[] = {
+0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0xf0, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x98, 0x01, 0x0c, 0x03, 0x0c, 0x03, 
+0xfc, 0x03, 0xfe, 0x07, 0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c};
+static unsigned char helvetica18_194_bits[] = {
+0x60, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0xf0, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x98, 0x01, 0x0c, 0x03, 0x0c, 0x03, 
+0xfc, 0x03, 0xfe, 0x07, 0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c};
+static unsigned char helvetica18_195_bits[] = {
+0x30, 0x01, 0x68, 0x01, 0xc8, 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0xf0, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x98, 0x01, 0x0c, 0x03, 0x0c, 0x03, 
+0xfc, 0x03, 0xfe, 0x07, 0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c};
+static unsigned char helvetica18_196_bits[] = {
+0x98, 0x01, 0x98, 0x01, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0xf0, 0x00, 
+0xf0, 0x00, 0x98, 0x01, 0x98, 0x01, 0x0c, 0x03, 0x0c, 0x03, 0xfc, 0x03, 
+0xfe, 0x07, 0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c};
+static unsigned char helvetica18_197_bits[] = {
+0xf0, 0x00, 0x98, 0x01, 0x98, 0x01, 0xf0, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0xf0, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x98, 0x01, 0x0c, 0x03, 0x0c, 0x03, 
+0xfc, 0x03, 0xfe, 0x07, 0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c};
+static unsigned char helvetica18_198_bits[] = {
+0xe0, 0xff, 0xe0, 0xff, 0xb0, 0x01, 0xb0, 0x01, 0x98, 0x01, 0x98, 0x01, 
+0x8c, 0x7f, 0x8c, 0x7f, 0xfc, 0x01, 0xfe, 0x01, 0x86, 0x01, 0x86, 0x01, 
+0x83, 0xff, 0x83, 0xff};
+static unsigned char helvetica18_199_bits[] = {
+0xf0, 0x01, 0xfc, 0x07, 0x0e, 0x0e, 0x06, 0x0c, 0x07, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x07, 0x00, 0x06, 0x0c, 0x0e, 0x0e, 
+0xfc, 0x07, 0xf0, 0x01, 0x70, 0x00, 0xc0, 0x00, 0xd8, 0x00, 0x78, 0x00};
+static unsigned char helvetica18_200_bits[] = {
+0x0c, 0x00, 0x18, 0x00, 0x30, 0x00, 0x00, 0x00, 0xff, 0x01, 0xff, 0x01, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x00, 0xff, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x01, 0xff, 0x01};
+static unsigned char helvetica18_201_bits[] = {
+0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0xff, 0x01, 0xff, 0x01, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x00, 0xff, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x01, 0xff, 0x01};
+static unsigned char helvetica18_202_bits[] = {
+0x30, 0x00, 0x78, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xff, 0x01, 0xff, 0x01, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x00, 0xff, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x01, 0xff, 0x01};
+static unsigned char helvetica18_203_bits[] = {
+0xcc, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xff, 0x01, 0xff, 0x01, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x00, 0xff, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x01, 0xff, 0x01};
+static unsigned char helvetica18_204_bits[] = {
+0x03, 0x06, 0x0c, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c};
+static unsigned char helvetica18_205_bits[] = {
+0x0c, 0x06, 0x03, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica18_206_bits[] = {
+0x0c, 0x1e, 0x33, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c};
+static unsigned char helvetica18_207_bits[] = {
+0x33, 0x33, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c};
+static unsigned char helvetica18_208_bits[] = {
+0xfe, 0x01, 0xfe, 0x03, 0x06, 0x07, 0x06, 0x06, 0x06, 0x0c, 0x06, 0x0c, 
+0x3f, 0x0c, 0x3f, 0x0c, 0x06, 0x0c, 0x06, 0x0c, 0x06, 0x06, 0x06, 0x07, 
+0xfe, 0x03, 0xfe, 0x01};
+static unsigned char helvetica18_209_bits[] = {
+0x30, 0x01, 0x68, 0x01, 0xc8, 0x00, 0x00, 0x00, 0x07, 0x06, 0x07, 0x06, 
+0x0f, 0x06, 0x1b, 0x06, 0x1b, 0x06, 0x33, 0x06, 0x33, 0x06, 0x63, 0x06, 
+0x63, 0x06, 0xc3, 0x06, 0x83, 0x07, 0x83, 0x07, 0x03, 0x07, 0x03, 0x06};
+static unsigned char helvetica18_210_bits[] = {
+0x30, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0x01, 0xfc, 0x07, 
+0x0e, 0x0e, 0x06, 0x0c, 0x07, 0x1c, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 
+0x03, 0x18, 0x07, 0x1c, 0x06, 0x0c, 0x0e, 0x0e, 0xfc, 0x07, 0xf0, 0x01};
+static unsigned char helvetica18_211_bits[] = {
+0x00, 0x03, 0x80, 0x01, 0xc0, 0x00, 0x00, 0x00, 0xf0, 0x01, 0xfc, 0x07, 
+0x0e, 0x0e, 0x06, 0x0c, 0x07, 0x1c, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 
+0x03, 0x18, 0x07, 0x1c, 0x06, 0x0c, 0x0e, 0x0e, 0xfc, 0x07, 0xf0, 0x01};
+static unsigned char helvetica18_212_bits[] = {
+0xc0, 0x00, 0xe0, 0x01, 0x30, 0x03, 0x00, 0x00, 0xf0, 0x01, 0xfc, 0x07, 
+0x0e, 0x0e, 0x06, 0x0c, 0x07, 0x1c, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 
+0x03, 0x18, 0x07, 0x1c, 0x06, 0x0c, 0x0e, 0x0e, 0xfc, 0x07, 0xf0, 0x01};
+static unsigned char helvetica18_213_bits[] = {
+0x60, 0x02, 0xd0, 0x02, 0x90, 0x01, 0x00, 0x00, 0xf0, 0x01, 0xfc, 0x07, 
+0x0e, 0x0e, 0x06, 0x0c, 0x07, 0x1c, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 
+0x03, 0x18, 0x07, 0x1c, 0x06, 0x0c, 0x0e, 0x0e, 0xfc, 0x07, 0xf0, 0x01};
+static unsigned char helvetica18_214_bits[] = {
+0xb0, 0x01, 0xb0, 0x01, 0x00, 0x00, 0xf0, 0x01, 0xfc, 0x07, 0x0e, 0x0e, 
+0x06, 0x0c, 0x07, 0x1c, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 
+0x07, 0x1c, 0x06, 0x0c, 0x0e, 0x0e, 0xfc, 0x07, 0xf0, 0x01};
+static unsigned char helvetica18_215_bits[] = {
+0x03, 0x03, 0x86, 0x01, 0xcc, 0x00, 0x78, 0x00, 0x30, 0x00, 0x78, 0x00, 
+0xcc, 0x00, 0x86, 0x01, 0x03, 0x03};
+static unsigned char helvetica18_216_bits[] = {
+0xe0, 0x33, 0xf8, 0x3f, 0x1c, 0x1c, 0x0c, 0x1e, 0x0e, 0x3b, 0x86, 0x33, 
+0xc6, 0x31, 0xe6, 0x30, 0x76, 0x30, 0x36, 0x38, 0x1c, 0x18, 0x1e, 0x1c, 
+0xff, 0x0f, 0xe3, 0x03};
+static unsigned char helvetica18_217_bits[] = {
+0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0xfe, 0x03, 0xf8, 0x00};
+static unsigned char helvetica18_218_bits[] = {
+0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0xfe, 0x03, 0xf8, 0x00};
+static unsigned char helvetica18_219_bits[] = {
+0x60, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x00, 0x00, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0xfe, 0x03, 0xf8, 0x00};
+static unsigned char helvetica18_220_bits[] = {
+0x98, 0x01, 0x98, 0x01, 0x00, 0x00, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0xfe, 0x03, 0xf8, 0x00};
+static unsigned char helvetica18_221_bits[] = {
+0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x03, 0x0c, 
+0x06, 0x06, 0x06, 0x06, 0x0c, 0x03, 0x0c, 0x03, 0x98, 0x01, 0xf0, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char helvetica18_222_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x00, 0xff, 0x01, 0x83, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0xff, 0x01, 0xff, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00};
+static unsigned char helvetica18_223_bits[] = {
+0x1c, 0x3e, 0x63, 0x63, 0x63, 0x63, 0x3b, 0x3b, 0x63, 0x63, 0x63, 0x63, 
+0x7b, 0x3b};
+static unsigned char helvetica18_224_bits[] = {
+0x06, 0x0c, 0x18, 0x00, 0x3e, 0x77, 0x63, 0x70, 0x7e, 0x67, 0x63, 0x63, 
+0x77, 0x6e};
+static unsigned char helvetica18_225_bits[] = {
+0x30, 0x18, 0x0c, 0x00, 0x3e, 0x77, 0x63, 0x70, 0x7e, 0x67, 0x63, 0x63, 
+0x77, 0x6e};
+static unsigned char helvetica18_226_bits[] = {
+0x18, 0x3c, 0x66, 0x00, 0x3e, 0x77, 0x63, 0x70, 0x7e, 0x67, 0x63, 0x63, 
+0x77, 0x6e};
+static unsigned char helvetica18_227_bits[] = {
+0x4c, 0x5a, 0x32, 0x00, 0x3e, 0x77, 0x63, 0x70, 0x7e, 0x67, 0x63, 0x63, 
+0x77, 0x6e};
+static unsigned char helvetica18_228_bits[] = {
+0x36, 0x36, 0x00, 0x3e, 0x77, 0x63, 0x70, 0x7e, 0x67, 0x63, 0x63, 0x77, 
+0x6e};
+static unsigned char helvetica18_229_bits[] = {
+0x1c, 0x36, 0x36, 0x1c, 0x3e, 0x77, 0x63, 0x70, 0x7e, 0x67, 0x63, 0x63, 
+0x77, 0x6e};
+static unsigned char helvetica18_230_bits[] = {
+0xbe, 0x07, 0xf7, 0x0f, 0x63, 0x18, 0x70, 0x18, 0xfe, 0x1f, 0x67, 0x00, 
+0x63, 0x00, 0xe3, 0x18, 0xf7, 0x1f, 0xae, 0x07};
+static unsigned char helvetica18_231_bits[] = {
+0x7c, 0xfe, 0xc6, 0x03, 0x03, 0x03, 0x03, 0xc6, 0xfe, 0x7c, 0x1c, 0x30, 
+0x36, 0x1e};
+static unsigned char helvetica18_232_bits[] = {
+0x06, 0x0c, 0x18, 0x00, 0x3c, 0x7e, 0xc3, 0xc3, 0xff, 0x03, 0x03, 0xc7, 
+0xfe, 0x3c};
+static unsigned char helvetica18_233_bits[] = {
+0x60, 0x30, 0x18, 0x00, 0x3c, 0x7e, 0xc3, 0xc3, 0xff, 0x03, 0x03, 0xc7, 
+0xfe, 0x3c};
+static unsigned char helvetica18_234_bits[] = {
+0x18, 0x3c, 0x66, 0x00, 0x3c, 0x7e, 0xc3, 0xc3, 0xff, 0x03, 0x03, 0xc7, 
+0xfe, 0x3c};
+static unsigned char helvetica18_235_bits[] = {
+0x6c, 0x6c, 0x00, 0x3c, 0x7e, 0xc3, 0xc3, 0xff, 0x03, 0x03, 0xc7, 0xfe, 
+0x3c};
+static unsigned char helvetica18_236_bits[] = {
+0x03, 0x06, 0x0c, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06};
+static unsigned char helvetica18_237_bits[] = {
+0x0c, 0x06, 0x03, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06};
+static unsigned char helvetica18_238_bits[] = {
+0x0c, 0x1e, 0x33, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c};
+static unsigned char helvetica18_239_bits[] = {
+0x1b, 0x1b, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06};
+static unsigned char helvetica18_240_bits[] = {
+0x06, 0x00, 0x6c, 0x00, 0x1c, 0x00, 0x32, 0x00, 0x7c, 0x00, 0xfe, 0x00, 
+0xc6, 0x00, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc6, 0x00, 
+0xfe, 0x00, 0x7c, 0x00};
+static unsigned char helvetica18_241_bits[] = {
+0x4c, 0x5a, 0x32, 0x00, 0x73, 0xfb, 0xc7, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 
+0xc3, 0xc3};
+static unsigned char helvetica18_242_bits[] = {
+0x0c, 0x00, 0x18, 0x00, 0x30, 0x00, 0x00, 0x00, 0x7c, 0x00, 0xfe, 0x00, 
+0xc6, 0x00, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc6, 0x00, 
+0xfe, 0x00, 0x7c, 0x00};
+static unsigned char helvetica18_243_bits[] = {
+0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x00, 0x00, 0x7c, 0x00, 0xfe, 0x00, 
+0xc6, 0x00, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc6, 0x00, 
+0xfe, 0x00, 0x7c, 0x00};
+static unsigned char helvetica18_244_bits[] = {
+0x30, 0x00, 0x78, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x7c, 0x00, 0xfe, 0x00, 
+0xc6, 0x00, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc6, 0x00, 
+0xfe, 0x00, 0x7c, 0x00};
+static unsigned char helvetica18_245_bits[] = {
+0x98, 0x00, 0xb4, 0x00, 0x64, 0x00, 0x00, 0x00, 0x7c, 0x00, 0xfe, 0x00, 
+0xc6, 0x00, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc6, 0x00, 
+0xfe, 0x00, 0x7c, 0x00};
+static unsigned char helvetica18_246_bits[] = {
+0x6c, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0xfe, 0x00, 0xc6, 0x00, 
+0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc6, 0x00, 0xfe, 0x00, 
+0x7c, 0x00};
+static unsigned char helvetica18_247_bits[] = {
+0x18, 0x18, 0x00, 0xff, 0xff, 0x00, 0x18, 0x18};
+static unsigned char helvetica18_248_bits[] = {
+0x70, 0x06, 0xfc, 0x03, 0x8c, 0x01, 0xc6, 0x03, 0x66, 0x03, 0x36, 0x03, 
+0x1e, 0x03, 0x8c, 0x01, 0xfe, 0x01, 0x73, 0x00};
+static unsigned char helvetica18_249_bits[] = {
+0x0c, 0x18, 0x30, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe3, 
+0xdf, 0xce};
+static unsigned char helvetica18_250_bits[] = {
+0x60, 0x30, 0x18, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe3, 
+0xdf, 0xce};
+static unsigned char helvetica18_251_bits[] = {
+0x18, 0x3c, 0x66, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe3, 
+0xdf, 0xce};
+static unsigned char helvetica18_252_bits[] = {
+0x66, 0x66, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xe3, 0xdf, 
+0xce};
+static unsigned char helvetica18_253_bits[] = {
+0x60, 0x30, 0x18, 0x00, 0xc3, 0xc3, 0xc3, 0x66, 0x66, 0x66, 0x24, 0x3c, 
+0x18, 0x18, 0x18, 0x18, 0x0e, 0x0e};
+static unsigned char helvetica18_254_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x7b, 0x00, 0xff, 0x00, 
+0xc7, 0x00, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc7, 0x00, 
+0xff, 0x00, 0x7b, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00};
+static unsigned char helvetica18_255_bits[] = {
+0x66, 0x66, 0x00, 0xc3, 0xc3, 0xc3, 0x66, 0x66, 0x66, 0x24, 0x3c, 0x18, 
+0x18, 0x18, 0x18, 0x0e, 0x0e};
+static RotFont helvetica18font[] = {
+{5, 1, 1, helvetica18_0_bits},
+{5, 1, 1, helvetica18_1_bits},
+{5, 1, 1, helvetica18_2_bits},
+{5, 1, 1, helvetica18_3_bits},
+{5, 1, 1, helvetica18_4_bits},
+{5, 1, 1, helvetica18_5_bits},
+{5, 1, 1, helvetica18_6_bits},
+{5, 1, 1, helvetica18_7_bits},
+{5, 1, 1, helvetica18_8_bits},
+{5, 1, 1, helvetica18_9_bits},
+{5, 1, 1, helvetica18_10_bits},
+{5, 1, 1, helvetica18_11_bits},
+{5, 1, 1, helvetica18_12_bits},
+{5, 1, 1, helvetica18_13_bits},
+{5, 1, 1, helvetica18_14_bits},
+{5, 1, 1, helvetica18_15_bits},
+{5, 1, 1, helvetica18_16_bits},
+{5, 1, 1, helvetica18_17_bits},
+{5, 1, 1, helvetica18_18_bits},
+{5, 1, 1, helvetica18_19_bits},
+{5, 1, 1, helvetica18_20_bits},
+{5, 1, 1, helvetica18_21_bits},
+{5, 1, 1, helvetica18_22_bits},
+{5, 1, 1, helvetica18_23_bits},
+{5, 1, 1, helvetica18_24_bits},
+{5, 1, 1, helvetica18_25_bits},
+{5, 1, 1, helvetica18_26_bits},
+{5, 1, 1, helvetica18_27_bits},
+{5, 1, 1, helvetica18_28_bits},
+{5, 1, 1, helvetica18_29_bits},
+{5, 1, 1, helvetica18_30_bits},
+{5, 1, 1, helvetica18_31_bits},
+{9, 1, 1, helvetica18_32_bits},
+{2, 14, 14, helvetica18_33_bits},
+{5, 5, 14, helvetica18_34_bits},
+{10, 13, 13, helvetica18_35_bits},
+{9, 16, 14, helvetica18_36_bits},
+{14, 13, 13, helvetica18_37_bits},
+{12, 13, 13, helvetica18_38_bits},
+{2, 5, 14, helvetica18_39_bits},
+{4, 18, 14, helvetica18_40_bits},
+{4, 18, 14, helvetica18_41_bits},
+{5, 6, 14, helvetica18_42_bits},
+{8, 10, 10, helvetica18_43_bits},
+{2, 5, 2, helvetica18_44_bits},
+{8, 2, 6, helvetica18_45_bits},
+{2, 2, 2, helvetica18_46_bits},
+{5, 14, 14, helvetica18_47_bits},
+{8, 13, 13, helvetica18_48_bits},
+{5, 13, 13, helvetica18_49_bits},
+{8, 13, 13, helvetica18_50_bits},
+{8, 13, 13, helvetica18_51_bits},
+{9, 13, 13, helvetica18_52_bits},
+{8, 13, 13, helvetica18_53_bits},
+{8, 13, 13, helvetica18_54_bits},
+{8, 13, 13, helvetica18_55_bits},
+{8, 13, 13, helvetica18_56_bits},
+{8, 13, 13, helvetica18_57_bits},
+{2, 10, 10, helvetica18_58_bits},
+{2, 13, 10, helvetica18_59_bits},
+{8, 9, 9, helvetica18_60_bits},
+{7, 6, 8, helvetica18_61_bits},
+{8, 9, 9, helvetica18_62_bits},
+{7, 14, 14, helvetica18_63_bits},
+{16, 17, 14, helvetica18_64_bits},
+{12, 14, 14, helvetica18_65_bits},
+{11, 14, 14, helvetica18_66_bits},
+{12, 14, 14, helvetica18_67_bits},
+{11, 14, 14, helvetica18_68_bits},
+{9, 14, 14, helvetica18_69_bits},
+{9, 14, 14, helvetica18_70_bits},
+{12, 14, 14, helvetica18_71_bits},
+{11, 14, 14, helvetica18_72_bits},
+{2, 14, 14, helvetica18_73_bits},
+{8, 14, 14, helvetica18_74_bits},
+{12, 14, 14, helvetica18_75_bits},
+{8, 14, 14, helvetica18_76_bits},
+{14, 14, 14, helvetica18_77_bits},
+{11, 14, 14, helvetica18_78_bits},
+{13, 14, 14, helvetica18_79_bits},
+{10, 14, 14, helvetica18_80_bits},
+{13, 15, 14, helvetica18_81_bits},
+{10, 14, 14, helvetica18_82_bits},
+{11, 14, 14, helvetica18_83_bits},
+{10, 14, 14, helvetica18_84_bits},
+{11, 14, 14, helvetica18_85_bits},
+{12, 14, 14, helvetica18_86_bits},
+{16, 14, 14, helvetica18_87_bits},
+{11, 14, 14, helvetica18_88_bits},
+{12, 14, 14, helvetica18_89_bits},
+{10, 14, 14, helvetica18_90_bits},
+{4, 18, 14, helvetica18_91_bits},
+{5, 14, 14, helvetica18_92_bits},
+{4, 18, 14, helvetica18_93_bits},
+{7, 5, 13, helvetica18_94_bits},
+{10, 2, -2, helvetica18_95_bits},
+{2, 5, 14, helvetica18_96_bits},
+{7, 10, 10, helvetica18_97_bits},
+{9, 14, 14, helvetica18_98_bits},
+{8, 10, 10, helvetica18_99_bits},
+{9, 14, 14, helvetica18_100_bits},
+{8, 10, 10, helvetica18_101_bits},
+{6, 14, 14, helvetica18_102_bits},
+{9, 14, 10, helvetica18_103_bits},
+{8, 14, 14, helvetica18_104_bits},
+{2, 14, 14, helvetica18_105_bits},
+{4, 18, 14, helvetica18_106_bits},
+{8, 14, 14, helvetica18_107_bits},
+{2, 14, 14, helvetica18_108_bits},
+{12, 10, 10, helvetica18_109_bits},
+{8, 10, 10, helvetica18_110_bits},
+{9, 10, 10, helvetica18_111_bits},
+{9, 14, 10, helvetica18_112_bits},
+{9, 14, 10, helvetica18_113_bits},
+{5, 10, 10, helvetica18_114_bits},
+{7, 10, 10, helvetica18_115_bits},
+{6, 13, 13, helvetica18_116_bits},
+{8, 10, 10, helvetica18_117_bits},
+{8, 10, 10, helvetica18_118_bits},
+{12, 10, 10, helvetica18_119_bits},
+{8, 10, 10, helvetica18_120_bits},
+{8, 14, 10, helvetica18_121_bits},
+{7, 10, 10, helvetica18_122_bits},
+{6, 18, 14, helvetica18_123_bits},
+{2, 18, 14, helvetica18_124_bits},
+{6, 18, 14, helvetica18_125_bits},
+{8, 3, 7, helvetica18_126_bits},
+{5, 1, 1, helvetica18_127_bits},
+{5, 1, 1, helvetica18_128_bits},
+{5, 1, 1, helvetica18_129_bits},
+{5, 1, 1, helvetica18_130_bits},
+{5, 1, 1, helvetica18_131_bits},
+{5, 1, 1, helvetica18_132_bits},
+{5, 1, 1, helvetica18_133_bits},
+{5, 1, 1, helvetica18_134_bits},
+{5, 1, 1, helvetica18_135_bits},
+{5, 1, 1, helvetica18_136_bits},
+{5, 1, 1, helvetica18_137_bits},
+{5, 1, 1, helvetica18_138_bits},
+{5, 1, 1, helvetica18_139_bits},
+{5, 1, 1, helvetica18_140_bits},
+{5, 1, 1, helvetica18_141_bits},
+{5, 1, 1, helvetica18_142_bits},
+{5, 1, 1, helvetica18_143_bits},
+{5, 1, 1, helvetica18_144_bits},
+{5, 1, 1, helvetica18_145_bits},
+{5, 1, 1, helvetica18_146_bits},
+{5, 1, 1, helvetica18_147_bits},
+{5, 1, 1, helvetica18_148_bits},
+{5, 1, 1, helvetica18_149_bits},
+{5, 1, 1, helvetica18_150_bits},
+{5, 1, 1, helvetica18_151_bits},
+{5, 1, 1, helvetica18_152_bits},
+{5, 1, 1, helvetica18_153_bits},
+{5, 1, 1, helvetica18_154_bits},
+{5, 1, 1, helvetica18_155_bits},
+{5, 1, 1, helvetica18_156_bits},
+{5, 1, 1, helvetica18_157_bits},
+{5, 1, 1, helvetica18_158_bits},
+{5, 1, 1, helvetica18_159_bits},
+{1, 1, 1, helvetica18_160_bits},
+{2, 14, 10, helvetica18_161_bits},
+{8, 14, 12, helvetica18_162_bits},
+{9, 13, 13, helvetica18_163_bits},
+{8, 7, 10, helvetica18_164_bits},
+{8, 13, 13, helvetica18_165_bits},
+{2, 17, 14, helvetica18_166_bits},
+{8, 18, 14, helvetica18_167_bits},
+{5, 2, 13, helvetica18_168_bits},
+{13, 13, 13, helvetica18_169_bits},
+{5, 8, 14, helvetica18_170_bits},
+{7, 8, 9, helvetica18_171_bits},
+{9, 5, 8, helvetica18_172_bits},
+{5, 2, 6, helvetica18_173_bits},
+{13, 13, 13, helvetica18_174_bits},
+{5, 1, 13, helvetica18_175_bits},
+{5, 5, 13, helvetica18_176_bits},
+{8, 11, 11, helvetica18_177_bits},
+{5, 8, 13, helvetica18_178_bits},
+{5, 8, 13, helvetica18_179_bits},
+{4, 3, 14, helvetica18_180_bits},
+{8, 14, 10, helvetica18_181_bits},
+{8, 18, 14, helvetica18_182_bits},
+{2, 2, 6, helvetica18_183_bits},
+{5, 5, 1, helvetica18_184_bits},
+{3, 8, 13, helvetica18_185_bits},
+{5, 8, 14, helvetica18_186_bits},
+{7, 8, 9, helvetica18_187_bits},
+{13, 13, 13, helvetica18_188_bits},
+{13, 13, 13, helvetica18_189_bits},
+{14, 13, 13, helvetica18_190_bits},
+{7, 14, 10, helvetica18_191_bits},
+{12, 18, 18, helvetica18_192_bits},
+{12, 18, 18, helvetica18_193_bits},
+{12, 18, 18, helvetica18_194_bits},
+{12, 18, 18, helvetica18_195_bits},
+{12, 17, 17, helvetica18_196_bits},
+{12, 18, 18, helvetica18_197_bits},
+{16, 14, 14, helvetica18_198_bits},
+{12, 18, 14, helvetica18_199_bits},
+{9, 18, 18, helvetica18_200_bits},
+{9, 18, 18, helvetica18_201_bits},
+{9, 18, 18, helvetica18_202_bits},
+{9, 17, 17, helvetica18_203_bits},
+{4, 18, 18, helvetica18_204_bits},
+{4, 18, 18, helvetica18_205_bits},
+{6, 18, 18, helvetica18_206_bits},
+{6, 17, 17, helvetica18_207_bits},
+{12, 14, 14, helvetica18_208_bits},
+{11, 18, 18, helvetica18_209_bits},
+{13, 18, 18, helvetica18_210_bits},
+{13, 18, 18, helvetica18_211_bits},
+{13, 18, 18, helvetica18_212_bits},
+{13, 18, 18, helvetica18_213_bits},
+{13, 17, 17, helvetica18_214_bits},
+{10, 9, 9, helvetica18_215_bits},
+{14, 14, 14, helvetica18_216_bits},
+{11, 18, 18, helvetica18_217_bits},
+{11, 18, 18, helvetica18_218_bits},
+{11, 18, 18, helvetica18_219_bits},
+{11, 17, 17, helvetica18_220_bits},
+{12, 18, 18, helvetica18_221_bits},
+{10, 14, 14, helvetica18_222_bits},
+{7, 14, 14, helvetica18_223_bits},
+{7, 14, 14, helvetica18_224_bits},
+{7, 14, 14, helvetica18_225_bits},
+{7, 14, 14, helvetica18_226_bits},
+{7, 14, 14, helvetica18_227_bits},
+{7, 13, 13, helvetica18_228_bits},
+{7, 14, 14, helvetica18_229_bits},
+{13, 10, 10, helvetica18_230_bits},
+{8, 14, 10, helvetica18_231_bits},
+{8, 14, 14, helvetica18_232_bits},
+{8, 14, 14, helvetica18_233_bits},
+{8, 14, 14, helvetica18_234_bits},
+{8, 13, 13, helvetica18_235_bits},
+{4, 14, 14, helvetica18_236_bits},
+{4, 14, 14, helvetica18_237_bits},
+{6, 14, 14, helvetica18_238_bits},
+{5, 13, 13, helvetica18_239_bits},
+{9, 14, 14, helvetica18_240_bits},
+{8, 14, 14, helvetica18_241_bits},
+{9, 14, 14, helvetica18_242_bits},
+{9, 14, 14, helvetica18_243_bits},
+{9, 14, 14, helvetica18_244_bits},
+{9, 14, 14, helvetica18_245_bits},
+{9, 13, 13, helvetica18_246_bits},
+{8, 8, 9, helvetica18_247_bits},
+{11, 10, 10, helvetica18_248_bits},
+{8, 14, 14, helvetica18_249_bits},
+{8, 14, 14, helvetica18_250_bits},
+{8, 14, 14, helvetica18_251_bits},
+{8, 13, 13, helvetica18_252_bits},
+{8, 18, 14, helvetica18_253_bits},
+{9, 18, 14, helvetica18_254_bits},
+{8, 17, 13, helvetica18_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica24.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica24.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica24.bdf	(revision 15879)
@@ -0,0 +1,4679 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Helvetica-Medium-R-Normal--24-240-75-75-P-130-ISO8859-1
+SIZE 24 75 75
+FONTBOUNDINGBOX 25 29 -1 -5
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Helvetica"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 24
+POINT_SIZE 240
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 130
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 19
+X_HEIGHT 14
+FACE_NAME "Helvetica"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.  "
+_DEC_DEVICE_FONTNAMES "PS=Helvetica"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Helvetica"
+FONT "-Adobe-Helvetica-Medium-R-Normal--24-240-75-75-P-130-ISO8859-1"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 15
+DEFAULT_CHAR 32
+FONT_ASCENT 22
+FONT_DESCENT 5
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 19 2 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+80
+80
+00
+00
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 6 1 13
+BITMAP
+cc
+cc
+cc
+cc
+cc
+44
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 11 17 2 0
+BITMAP
+0cc0
+0cc0
+0cc0
+1980
+ffe0
+ffe0
+1980
+1980
+3300
+3300
+ffe0
+ffe0
+3300
+3300
+6600
+6600
+6600
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 21 1 -2
+BITMAP
+0600
+0600
+3f80
+7fc0
+e6e0
+c660
+c600
+e600
+7600
+3e00
+0f80
+07c0
+06e0
+0660
+c660
+c660
+e6e0
+7fc0
+3f80
+0600
+0600
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 880 0
+DWIDTH 22 0
+BBX 19 18 1 0
+BITMAP
+000600
+3c0c00
+7e0c00
+c31800
+c31800
+c33000
+c33000
+7e6000
+3c6000
+00c000
+00c780
+018fc0
+019860
+031860
+031860
+061860
+060fc0
+040780
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 14 18 1 0
+BITMAP
+0f00
+1f80
+39c0
+30c0
+30c0
+30c0
+1980
+0f00
+1e00
+3f18
+7398
+61d8
+c0f0
+c060
+c0f0
+e1d8
+7f9c
+1e00
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 6 2 13
+BITMAP
+c0
+c0
+c0
+40
+40
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 5 24 2 -5
+BITMAP
+18
+18
+30
+30
+60
+60
+60
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+60
+60
+60
+30
+30
+18
+18
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 5 24 1 -5
+BITMAP
+c0
+c0
+60
+60
+30
+30
+30
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+30
+30
+30
+60
+60
+c0
+c0
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 7 7 1 12
+BITMAP
+10
+10
+d6
+7c
+38
+6c
+44
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 12 1 1
+BITMAP
+0600
+0600
+0600
+0600
+0600
+fff0
+fff0
+0600
+0600
+0600
+0600
+0600
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 6 2 -3
+BITMAP
+c0
+c0
+c0
+40
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 11 2 2 6
+BITMAP
+ffe0
+ffe0
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 3 2 0
+BITMAP
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 7 19 0 0
+BITMAP
+06
+06
+06
+0c
+0c
+0c
+18
+18
+18
+18
+30
+30
+30
+60
+60
+60
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+1f00
+3f80
+71c0
+60c0
+60c0
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+60c0
+71c0
+3f80
+1f00
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 6 18 2 0
+BITMAP
+0c
+0c
+1c
+fc
+fc
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+1e00
+7f80
+61c0
+c0c0
+c060
+c060
+0060
+00c0
+01c0
+0380
+0f00
+1c00
+3800
+7000
+e000
+c000
+ffe0
+ffe0
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+1f00
+7f80
+6180
+c0c0
+c0c0
+c0c0
+00c0
+0180
+0f00
+0fc0
+00c0
+0060
+0060
+c060
+c0c0
+61c0
+7f80
+1f00
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+0180
+0380
+0380
+0780
+0f80
+0d80
+1980
+3980
+3180
+6180
+e180
+c180
+ffe0
+ffe0
+0180
+0180
+0180
+0180
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+7fc0
+7fc0
+6000
+6000
+6000
+6000
+6e00
+7f80
+71c0
+00c0
+0060
+0060
+0060
+c060
+c0c0
+e1c0
+7f80
+1e00
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+0f00
+3fc0
+70c0
+6060
+e060
+c000
+c000
+cf00
+df80
+f1c0
+e0c0
+c060
+c060
+c060
+e060
+60c0
+7fc0
+1f00
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+ffe0
+ffe0
+00e0
+00c0
+0180
+0180
+0300
+0300
+0600
+0600
+0c00
+0c00
+1c00
+1800
+1800
+3800
+3000
+3000
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+0e00
+3f80
+3180
+60c0
+60c0
+60c0
+60c0
+3180
+1f00
+3f80
+60c0
+e0e0
+c060
+c060
+c060
+71c0
+7fc0
+1f00
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+1f00
+7fc0
+71c0
+e0c0
+c060
+c060
+c060
+c060
+e0e0
+71e0
+7f60
+1e60
+0060
+00e0
+c0c0
+e1c0
+7f80
+1e00
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 14 2 0
+BITMAP
+c0
+c0
+c0
+00
+00
+00
+00
+00
+00
+00
+00
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 17 2 -3
+BITMAP
+c0
+c0
+c0
+00
+00
+00
+00
+00
+00
+00
+00
+c0
+c0
+c0
+40
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 12 12 1 1
+BITMAP
+0030
+00f0
+03c0
+0f00
+3c00
+e000
+e000
+3c00
+0f00
+03c0
+00f0
+0030
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 10 6 2 5
+BITMAP
+ffc0
+ffc0
+0000
+0000
+ffc0
+ffc0
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 12 12 1 1
+BITMAP
+c000
+f000
+3c00
+0f00
+03c0
+0070
+0070
+03c0
+0f00
+3c00
+f000
+c000
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 19 1 0
+BITMAP
+1f00
+7f80
+71c0
+e0c0
+c0c0
+c1c0
+0180
+0380
+0700
+0600
+0c00
+0c00
+0c00
+0c00
+0000
+0000
+0c00
+0c00
+0c00
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 1000 0
+DWIDTH 25 0
+BBX 22 23 2 -4
+BITMAP
+00ff00
+03ffc0
+0f01e0
+1c0070
+380018
+300018
+60730c
+60fb0c
+c1c70c
+c3860c
+c3060c
+c6060c
+c60c1c
+c60c18
+c60c38
+e71c70
+63f7e0
+71e380
+380000
+1c0000
+0f0300
+07ff00
+00fc00
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 19 1 0
+BITMAP
+0380
+0380
+06c0
+06c0
+0c40
+0c60
+0c60
+1830
+1830
+1830
+3018
+3ff8
+3ff8
+600c
+600c
+600c
+c006
+c006
+c006
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 14 19 2 0
+BITMAP
+ffc0
+fff0
+c070
+c018
+c018
+c018
+c018
+c030
+ffe0
+fff0
+c018
+c00c
+c00c
+c00c
+c00c
+c01c
+c038
+fff0
+ffc0
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 19 1 0
+BITMAP
+07e0
+1ff8
+3c3c
+700e
+6006
+e006
+c000
+c000
+c000
+c000
+c000
+c000
+c003
+e003
+6006
+700e
+3c3c
+1ff8
+07e0
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 15 19 2 0
+BITMAP
+ffc0
+fff0
+c078
+c01c
+c00c
+c00e
+c006
+c006
+c006
+c006
+c006
+c006
+c006
+c00e
+c00c
+c01c
+c078
+fff0
+ffc0
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 12 19 2 0
+BITMAP
+fff0
+fff0
+c000
+c000
+c000
+c000
+c000
+c000
+ffe0
+ffe0
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+fff0
+fff0
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 11 19 2 0
+BITMAP
+ffe0
+ffe0
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+ffc0
+ffc0
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 16 19 1 0
+BITMAP
+07e0
+1ff8
+3c3c
+700e
+6006
+e006
+c000
+c000
+c000
+c07f
+c07f
+c003
+c003
+e003
+6007
+700f
+3c3f
+1ffb
+07e3
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 14 19 2 0
+BITMAP
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+fffc
+fffc
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 2 19 3 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 10 19 1 0
+BITMAP
+00c0
+00c0
+00c0
+00c0
+00c0
+00c0
+00c0
+00c0
+00c0
+00c0
+00c0
+00c0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+7f80
+3f00
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 15 19 2 0
+BITMAP
+c038
+c070
+c0e0
+c1c0
+c380
+c700
+ce00
+dc00
+fc00
+fe00
+e700
+c380
+c1c0
+c0e0
+c070
+c038
+c01c
+c00e
+c006
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 11 19 2 0
+BITMAP
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+ffe0
+ffe0
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 840 0
+DWIDTH 21 0
+BBX 17 19 2 0
+BITMAP
+c00180
+e00380
+e00380
+f00780
+f00780
+d80d80
+d80d80
+d80d80
+cc1980
+cc1980
+cc1980
+c63180
+c63180
+c63180
+c36180
+c36180
+c36180
+c1c180
+c1c180
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 14 19 2 0
+BITMAP
+e00c
+f00c
+f00c
+d80c
+dc0c
+cc0c
+ce0c
+c60c
+c70c
+c30c
+c38c
+c18c
+c1cc
+c0cc
+c0ec
+c06c
+c03c
+c03c
+c01c
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 19 1 0
+BITMAP
+07e0
+1ff8
+3c3c
+700e
+6006
+e007
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+e007
+6006
+700e
+3c3c
+1ff8
+07e0
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 13 19 2 0
+BITMAP
+ffe0
+fff0
+c030
+c018
+c018
+c018
+c018
+c030
+fff0
+ffe0
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 19 1 0
+BITMAP
+07e0
+1ff8
+3c3c
+700e
+6006
+e007
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+e007
+60e6
+707e
+3c1c
+1ffe
+07e7
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 13 19 2 0
+BITMAP
+ffe0
+fff0
+c030
+c018
+c018
+c018
+c018
+c030
+fff0
+ffe0
+c070
+c030
+c018
+c018
+c018
+c018
+c018
+c018
+c018
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 19 1 0
+BITMAP
+07c0
+1ff0
+3838
+7018
+6018
+6000
+7000
+3e00
+0fc0
+01f0
+0078
+001c
+000c
+c00c
+c00c
+e01c
+7838
+3ff0
+0fc0
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 19 1 0
+BITMAP
+fffc
+fffc
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 14 19 2 0
+BITMAP
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+6018
+7038
+3ff0
+0fc0
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 19 1 0
+BITMAP
+c006
+c006
+e00e
+600c
+701c
+3018
+3018
+3838
+1830
+1830
+1c70
+0c60
+0c60
+0ee0
+06c0
+06c0
+0380
+0380
+0380
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 880 0
+DWIDTH 22 0
+BBX 20 19 1 0
+BITMAP
+c06030
+c06030
+c06030
+c0f030
+60f060
+619860
+619860
+619860
+619860
+3198c0
+330cc0
+330cc0
+330cc0
+1b0d80
+1b0d80
+1e0780
+0e0700
+0c0300
+0c0300
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 19 1 0
+BITMAP
+c006
+e00e
+701c
+3018
+1830
+1c70
+0ee0
+07c0
+0380
+0380
+07c0
+0ee0
+0c60
+1c70
+3838
+3018
+600c
+e00e
+c006
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 19 1 0
+BITMAP
+c00c
+e01c
+6018
+7038
+3030
+3870
+1860
+1ce0
+0cc0
+0fc0
+0780
+0780
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 19 1 0
+BITMAP
+fff8
+fff8
+0038
+0070
+00e0
+01c0
+01c0
+0380
+0700
+0700
+0e00
+1c00
+1c00
+3800
+7000
+7000
+e000
+fff8
+fff8
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 4 24 2 -5
+BITMAP
+f0
+f0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+f0
+f0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 7 19 0 0
+BITMAP
+c0
+c0
+c0
+60
+60
+60
+30
+30
+30
+30
+18
+18
+18
+0c
+0c
+0c
+06
+06
+06
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 4 24 1 -5
+BITMAP
+f0
+f0
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+f0
+f0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 9 1 10
+BITMAP
+0c00
+0c00
+1e00
+1200
+3300
+6180
+6180
+c0c0
+c0c0
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 14 2 0 -5
+BITMAP
+fffc
+fffc
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 6 2 13
+BITMAP
+40
+80
+80
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+1f00
+3f80
+61c0
+60c0
+00c0
+07c0
+3fc0
+78c0
+e0c0
+c0c0
+c1c0
+e3c0
+7ee0
+3c60
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 11 19 2 0
+BITMAP
+c000
+c000
+c000
+c000
+c000
+cf00
+df80
+f1c0
+e0c0
+c060
+c060
+c060
+c060
+c060
+c060
+e0c0
+f1c0
+df80
+cf00
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 14 1 0
+BITMAP
+1f00
+3f80
+71c0
+60c0
+c000
+c000
+c000
+c000
+c000
+c000
+60c0
+71c0
+3f80
+1f00
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 11 19 1 0
+BITMAP
+0060
+0060
+0060
+0060
+0060
+1e60
+3f60
+71e0
+60e0
+c060
+c060
+c060
+c060
+c060
+c060
+60e0
+71e0
+3f60
+1e60
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+0e00
+3f80
+71c0
+60c0
+c060
+c060
+ffe0
+ffe0
+c000
+c000
+6060
+70e0
+3fc0
+0f00
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 19 1 0
+BITMAP
+1c
+3c
+30
+30
+30
+fc
+fc
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 11 19 1 -5
+BITMAP
+1e60
+3f60
+71e0
+60e0
+c060
+c060
+c060
+c060
+c060
+c060
+60e0
+71e0
+3f60
+1e60
+0060
+c060
+e0c0
+7fc0
+1f00
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 10 19 2 0
+BITMAP
+c000
+c000
+c000
+c000
+c000
+ce00
+df80
+f180
+e0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 19 2 0
+BITMAP
+c0
+c0
+c0
+00
+00
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 4 24 0 -5
+BITMAP
+30
+30
+30
+00
+00
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+f0
+e0
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 19 2 0
+BITMAP
+c000
+c000
+c000
+c000
+c000
+c180
+c380
+c700
+ce00
+dc00
+f800
+fc00
+ce00
+c600
+c700
+c380
+c180
+c1c0
+c0c0
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 19 2 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 800 0
+DWIDTH 20 0
+BBX 16 14 2 0
+BITMAP
+ce3c
+ff7e
+e3c7
+c183
+c183
+c183
+c183
+c183
+c183
+c183
+c183
+c183
+c183
+c183
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 14 2 0
+BITMAP
+ce00
+df80
+f180
+e0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+1f00
+3f80
+71c0
+60c0
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+71c0
+3f80
+1f00
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 11 19 2 -5
+BITMAP
+cf00
+df80
+f1c0
+e0c0
+c060
+c060
+c060
+c060
+c060
+c060
+e0c0
+f1c0
+df80
+cf00
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 11 19 1 -5
+BITMAP
+1e60
+3f60
+71e0
+60e0
+c060
+c060
+c060
+c060
+c060
+c060
+60e0
+71e0
+3f60
+1e60
+0060
+0060
+0060
+0060
+0060
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 360 0
+DWIDTH 9 0
+BBX 6 14 2 0
+BITMAP
+cc
+dc
+fc
+e0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 14 1 0
+BITMAP
+3e00
+7f80
+e1c0
+c0c0
+c000
+f800
+7f00
+0f80
+01c0
+00c0
+c0c0
+c1c0
+ff80
+3f00
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 18 1 0
+BITMAP
+30
+30
+30
+30
+fc
+fc
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+3c
+1c
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 14 2 0
+BITMAP
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c1c0
+63c0
+7ec0
+1cc0
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 14 1 0
+BITMAP
+c060
+c060
+c060
+60c0
+60c0
+71c0
+3180
+3180
+1b00
+1b00
+1b00
+0e00
+0e00
+0e00
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 18 14 0 0
+BITMAP
+c0c0c0
+c0c0c0
+61e180
+61e180
+61e180
+312300
+333300
+333300
+1b3600
+1a1600
+1e1e00
+0e1c00
+0c0c00
+0c0c00
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 14 1 0
+BITMAP
+c0c0
+e1c0
+6180
+3300
+3f00
+1e00
+0c00
+1e00
+1e00
+3300
+7380
+6180
+e1c0
+c0c0
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 12 19 0 -5
+BITMAP
+c030
+c030
+6030
+7060
+3060
+38e0
+18c0
+18c0
+0d80
+0d80
+0780
+0700
+0300
+0300
+0600
+0600
+0c00
+3c00
+3800
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 14 1 0
+BITMAP
+ffc0
+ffc0
+0180
+0300
+0700
+0e00
+0c00
+1c00
+3800
+3000
+6000
+e000
+ffc0
+ffc0
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 24 1 -5
+BITMAP
+0c
+18
+30
+30
+30
+30
+30
+30
+30
+30
+60
+c0
+c0
+60
+30
+30
+30
+30
+30
+30
+30
+30
+18
+0c
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 24 2 -5
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 24 1 -5
+BITMAP
+c0
+60
+30
+30
+30
+30
+30
+30
+30
+30
+18
+0c
+0c
+18
+30
+30
+30
+30
+30
+30
+30
+30
+60
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 4 2 5
+BITMAP
+70c0
+fcc0
+cfc0
+c380
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 19 2 -5
+BITMAP
+c0
+c0
+c0
+00
+00
+40
+40
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 10 18 1 -2
+BITMAP
+0180
+0180
+1f00
+3f80
+73c0
+66c0
+c600
+cc00
+cc00
+cc00
+d800
+d800
+d8c0
+71c0
+7f80
+3f00
+6000
+6000
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 18 1 0
+BITMAP
+1f80
+3fe0
+7070
+6030
+6000
+7000
+3000
+1800
+ff80
+ff80
+1800
+1800
+1800
+3000
+3000
+6730
+fff0
+f0e0
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 12 1 3
+BITMAP
+c060
+eee0
+7fc0
+3180
+60c0
+60c0
+60c0
+60c0
+3180
+7fc0
+eee0
+c060
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 14 18 0 0
+BITMAP
+e01c
+6018
+7038
+3030
+3870
+1860
+1ce0
+0cc0
+3ff0
+3ff0
+0300
+3ff0
+3ff0
+0300
+0300
+0300
+0300
+0300
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 23 2 -4
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+00
+00
+00
+00
+00
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 24 1 -5
+BITMAP
+1f00
+3f80
+71c0
+60c0
+70c0
+3800
+1c00
+7e00
+e700
+c380
+c1c0
+c0c0
+6060
+7060
+3860
+1cc0
+0f80
+0700
+0380
+61c0
+60c0
+71c0
+3f80
+1f00
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 2 1 16
+BITMAP
+cc
+cc
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 17 17 1 0
+BITMAP
+07f000
+1c1c00
+300600
+600300
+43e100
+c63180
+8c1080
+880080
+880080
+880080
+8c1080
+c63180
+43e100
+600300
+300600
+1c1c00
+07f000
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 360 0
+DWIDTH 9 0
+BBX 7 12 1 7
+BITMAP
+78
+cc
+cc
+0c
+7c
+cc
+cc
+dc
+76
+00
+fe
+fe
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 9 8 2 3
+BITMAP
+1980
+3300
+6600
+cc00
+cc00
+6600
+3300
+1980
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 8 1 3
+BITMAP
+fff8
+fff8
+0018
+0018
+0018
+0018
+0018
+0018
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 2 1 6
+BITMAP
+fc
+fc
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 17 17 1 0
+BITMAP
+07f000
+1c1c00
+300600
+600300
+43e100
+c21180
+821080
+821080
+83e080
+824080
+822080
+c22180
+421100
+600300
+300600
+1c1c00
+07f000
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 2 1 16
+BITMAP
+fc
+fc
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 360 0
+DWIDTH 9 0
+BBX 8 7 0 11
+BITMAP
+3c
+66
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+0600
+0600
+0600
+0600
+fff0
+fff0
+0600
+0600
+0600
+0600
+0000
+fff0
+fff0
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 7 10 0 8
+BITMAP
+3c
+7e
+c6
+06
+0c
+18
+30
+60
+fe
+fe
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 7 10 0 8
+BITMAP
+7c
+fe
+c6
+06
+3c
+3c
+06
+c6
+fe
+7c
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 5 4 1 15
+BITMAP
+18
+30
+60
+c0
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 19 2 -5
+BITMAP
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c1c0
+e3c0
+fec0
+dcc0
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 23 1 -4
+BITMAP
+1fc0
+7fc0
+7980
+f980
+f980
+f980
+f980
+f980
+f980
+7980
+7980
+3980
+1980
+1980
+1980
+1980
+1980
+1980
+1980
+1980
+1980
+1980
+1980
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 3 2 6
+BITMAP
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 5 6 1 -5
+BITMAP
+60
+70
+18
+18
+f8
+70
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 4 10 1 8
+BITMAP
+30
+30
+f0
+f0
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 360 0
+DWIDTH 9 0
+BBX 7 12 1 7
+BITMAP
+38
+6c
+c6
+c6
+c6
+c6
+c6
+6c
+38
+00
+fe
+fe
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 9 8 3 3
+BITMAP
+cc00
+6600
+3300
+1980
+1980
+3300
+6600
+cc00
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 18 18 1 0
+BITMAP
+301800
+301800
+f03000
+f03000
+306000
+306000
+30c000
+30c000
+318300
+318700
+030f00
+030f00
+061b00
+063300
+0c7fc0
+0c7fc0
+180300
+180300
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 18 18 1 0
+BITMAP
+301800
+301800
+f03000
+f03000
+306000
+306000
+30c000
+30c000
+318780
+318fc0
+0318c0
+0300c0
+060180
+060300
+0c0600
+0c0c00
+181fc0
+181fc0
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 19 18 0 0
+BITMAP
+7c0c00
+fe0c00
+c61800
+061800
+3c3000
+3c3000
+066000
+c66000
+fec180
+7cc380
+018780
+018780
+030d80
+031980
+063fe0
+063fe0
+0c0180
+0c0180
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 19 1 -5
+BITMAP
+0c00
+0c00
+0c00
+0000
+0000
+0c00
+0c00
+0c00
+0c00
+1800
+3800
+7000
+6000
+e0c0
+c0c0
+c1c0
+e380
+7f80
+3e00
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 24 1 0
+BITMAP
+0c00
+0600
+0300
+0180
+0000
+0380
+0380
+06c0
+06c0
+0c40
+0c60
+0c60
+1830
+1830
+1830
+3018
+3ff8
+3ff8
+600c
+600c
+600c
+c006
+c006
+c006
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 24 1 0
+BITMAP
+0060
+00c0
+0180
+0300
+0000
+0380
+0380
+06c0
+06c0
+0c40
+0c60
+0c60
+1830
+1830
+1830
+3018
+3ff8
+3ff8
+600c
+600c
+600c
+c006
+c006
+c006
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 24 1 0
+BITMAP
+0180
+03c0
+0660
+0c30
+0000
+0380
+0380
+06c0
+06c0
+0c40
+0c60
+0c60
+1830
+1830
+1830
+3018
+3ff8
+3ff8
+600c
+600c
+600c
+c006
+c006
+c006
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 23 1 0
+BITMAP
+0710
+0db0
+08e0
+0000
+0380
+0380
+06c0
+06c0
+0c40
+0c60
+0c60
+1830
+1830
+1830
+3018
+3ff8
+3ff8
+600c
+600c
+600c
+c006
+c006
+c006
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 23 1 0
+BITMAP
+0c60
+0c60
+0000
+0000
+0380
+0380
+06c0
+06c0
+0c40
+0c60
+0c60
+1830
+1830
+1830
+3018
+3ff8
+3ff8
+600c
+600c
+600c
+c006
+c006
+c006
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 24 1 0
+BITMAP
+0380
+06c0
+06c0
+0380
+0000
+0380
+0380
+06c0
+06c0
+0c40
+0c60
+0c60
+1830
+1830
+1830
+3018
+3ff8
+3ff8
+600c
+600c
+600c
+c006
+c006
+c006
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 920 0
+DWIDTH 23 0
+BBX 21 19 1 0
+BITMAP
+03fff8
+03fff8
+066000
+066000
+0c6000
+0c6000
+0c6000
+186000
+187ff8
+187ff8
+306000
+3fe000
+3fe000
+606000
+606000
+606000
+c06000
+c07ff8
+c07ff8
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 24 1 -5
+BITMAP
+07e0
+1ff8
+3c3c
+700e
+6006
+e006
+c000
+c000
+c000
+c000
+c000
+c000
+c003
+e003
+6006
+700e
+3c3c
+1ff8
+07e0
+0380
+00c0
+00c0
+07c0
+0380
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 12 24 2 0
+BITMAP
+3000
+1800
+0c00
+0600
+0000
+fff0
+fff0
+c000
+c000
+c000
+c000
+c000
+c000
+ffe0
+ffe0
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+fff0
+fff0
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 12 24 2 0
+BITMAP
+0180
+0300
+0600
+0c00
+0000
+fff0
+fff0
+c000
+c000
+c000
+c000
+c000
+c000
+ffe0
+ffe0
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+fff0
+fff0
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 12 24 2 0
+BITMAP
+0600
+0f00
+1980
+30c0
+0000
+fff0
+fff0
+c000
+c000
+c000
+c000
+c000
+c000
+ffe0
+ffe0
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+fff0
+fff0
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 12 23 2 0
+BITMAP
+1980
+1980
+0000
+0000
+fff0
+fff0
+c000
+c000
+c000
+c000
+c000
+c000
+ffe0
+ffe0
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+fff0
+fff0
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 5 24 1 0
+BITMAP
+c0
+60
+30
+18
+00
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 5 24 2 0
+BITMAP
+18
+30
+60
+c0
+00
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 8 24 0 0
+BITMAP
+18
+3c
+66
+c3
+00
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 23 1 0
+BITMAP
+cc
+cc
+00
+00
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 17 19 0 0
+BITMAP
+3ff000
+3ffc00
+301e00
+300700
+300300
+300380
+300180
+300180
+ff0180
+ff0180
+300180
+300180
+300180
+300380
+300300
+300700
+301e00
+3ffc00
+3ff000
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 14 23 2 0
+BITMAP
+0710
+0db0
+08e0
+0000
+e00c
+f00c
+f00c
+d80c
+dc0c
+cc0c
+ce0c
+c60c
+c70c
+c30c
+c38c
+c18c
+c1cc
+c0cc
+c0ec
+c06c
+c03c
+c03c
+c01c
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 24 1 0
+BITMAP
+0600
+0300
+0180
+00c0
+0000
+07e0
+1ff8
+3c3c
+700e
+6006
+e007
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+e007
+6006
+700e
+3c3c
+1ff8
+07e0
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 24 1 0
+BITMAP
+0030
+0060
+00c0
+0180
+0000
+07e0
+1ff8
+3c3c
+700e
+6006
+e007
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+e007
+6006
+700e
+3c3c
+1ff8
+07e0
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 24 1 0
+BITMAP
+0180
+03c0
+0660
+0c30
+0000
+07e0
+1ff8
+3c3c
+700e
+6006
+e007
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+e007
+6006
+700e
+3c3c
+1ff8
+07e0
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 23 1 0
+BITMAP
+0710
+0db0
+08e0
+0000
+07e0
+1ff8
+3c3c
+700e
+6006
+e007
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+e007
+6006
+700e
+3c3c
+1ff8
+07e0
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 23 1 0
+BITMAP
+0660
+0660
+0000
+0000
+07e0
+1ff8
+3c3c
+700e
+6006
+e007
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+e007
+6006
+700e
+3c3c
+1ff8
+07e0
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 13 12 0 1
+BITMAP
+c018
+6030
+3060
+18c0
+0d80
+0700
+0700
+0d80
+18c0
+3060
+6030
+c018
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 18 19 0 0
+BITMAP
+03f040
+0ffcc0
+1e1f80
+380700
+300700
+700d80
+601980
+603180
+606180
+60c180
+618180
+630180
+660180
+6c0380
+380300
+380700
+7e1e00
+cffc00
+83f000
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 14 24 2 0
+BITMAP
+0c00
+0600
+0300
+0180
+0000
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+6018
+7038
+3ff0
+0fc0
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 14 24 2 0
+BITMAP
+0060
+00c0
+0180
+0300
+0000
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+6018
+7038
+3ff0
+0fc0
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 14 24 2 0
+BITMAP
+0300
+0780
+0cc0
+1860
+0000
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+6018
+7038
+3ff0
+0fc0
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 14 23 2 0
+BITMAP
+0cc0
+0cc0
+0000
+0000
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+c00c
+6018
+7038
+3ff0
+0fc0
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 24 1 0
+BITMAP
+0060
+00c0
+0180
+0300
+0000
+c00c
+e01c
+6018
+7038
+3030
+3870
+1860
+1ce0
+0cc0
+0fc0
+0780
+0780
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 13 19 2 0
+BITMAP
+c000
+c000
+c000
+c000
+ffe0
+fff0
+c030
+c018
+c018
+c018
+c018
+c030
+fff0
+ffe0
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 10 19 3 0
+BITMAP
+1c00
+7f00
+e300
+c180
+c180
+c180
+c300
+c700
+ce00
+cf00
+c380
+c180
+c0c0
+c0c0
+c0c0
+c180
+c380
+cf00
+ce00
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+1800
+0c00
+0600
+0300
+0000
+1f00
+3f80
+61c0
+60c0
+00c0
+07c0
+3fc0
+78c0
+e0c0
+c0c0
+c1c0
+e3c0
+7ee0
+3c60
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+0180
+0300
+0600
+0c00
+0000
+1f00
+3f80
+61c0
+60c0
+00c0
+07c0
+3fc0
+78c0
+e0c0
+c0c0
+c1c0
+e3c0
+7ee0
+3c60
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+0600
+0f00
+1980
+30c0
+0000
+1f00
+3f80
+61c0
+60c0
+00c0
+07c0
+3fc0
+78c0
+e0c0
+c0c0
+c1c0
+e3c0
+7ee0
+3c60
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+1c40
+36c0
+2380
+0000
+0000
+1f00
+3f80
+61c0
+60c0
+00c0
+07c0
+3fc0
+78c0
+e0c0
+c0c0
+c1c0
+e3c0
+7ee0
+3c60
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+1980
+1980
+0000
+0000
+1f00
+3f80
+61c0
+60c0
+00c0
+07c0
+3fc0
+78c0
+e0c0
+c0c0
+c1c0
+e3c0
+7ee0
+3c60
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+0e00
+1b00
+1100
+1b00
+0e00
+1f00
+3f80
+61c0
+60c0
+00c0
+07c0
+3fc0
+78c0
+e0c0
+c0c0
+c1c0
+e3c0
+7ee0
+3c60
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 840 0
+DWIDTH 21 0
+BBX 19 14 1 0
+BITMAP
+1f0e00
+3fbf80
+61f1c0
+60e0c0
+00c060
+07c060
+3fffe0
+78ffe0
+e0c000
+c0c000
+c1e060
+e3f0e0
+7e3fc0
+3c0f00
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 19 1 -5
+BITMAP
+1f00
+3f80
+71c0
+60c0
+c000
+c000
+c000
+c000
+c000
+c000
+60c0
+71c0
+3f80
+1f00
+1c00
+0600
+0600
+3e00
+1c00
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+1800
+0c00
+0600
+0300
+0000
+0e00
+3f80
+71c0
+60c0
+c060
+c060
+ffe0
+ffe0
+c000
+c000
+6060
+70e0
+3fc0
+0f00
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+0180
+0300
+0600
+0c00
+0000
+0e00
+3f80
+71c0
+60c0
+c060
+c060
+ffe0
+ffe0
+c000
+c000
+6060
+70e0
+3fc0
+0f00
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+0600
+0f00
+1980
+30c0
+0000
+0e00
+3f80
+71c0
+60c0
+c060
+c060
+ffe0
+ffe0
+c000
+c000
+6060
+70e0
+3fc0
+0f00
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+1980
+1980
+0000
+0000
+0e00
+3f80
+71c0
+60c0
+c060
+c060
+ffe0
+ffe0
+c000
+c000
+6060
+70e0
+3fc0
+0f00
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 5 19 0 0
+BITMAP
+c0
+60
+30
+18
+00
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 5 19 1 0
+BITMAP
+18
+30
+60
+c0
+00
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 8 19 -1 0
+BITMAP
+18
+3c
+66
+c3
+00
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 6 18 0 0
+BITMAP
+cc
+cc
+00
+00
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+e000
+7180
+1e00
+3c00
+c600
+1f00
+3f80
+71c0
+60c0
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+71c0
+3f80
+1f00
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 18 2 0
+BITMAP
+3880
+6d80
+4700
+0000
+ce00
+df80
+f180
+e0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+1800
+0c00
+0600
+0300
+0000
+1f00
+3f80
+71c0
+60c0
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+71c0
+3f80
+1f00
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+0180
+0300
+0600
+0c00
+0000
+1f00
+3f80
+71c0
+60c0
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+71c0
+3f80
+1f00
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 19 1 0
+BITMAP
+0600
+0f00
+1980
+30c0
+0000
+1f00
+3f80
+71c0
+60c0
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+71c0
+3f80
+1f00
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+1c40
+36c0
+2380
+0000
+1f00
+3f80
+71c0
+60c0
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+71c0
+3f80
+1f00
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 18 1 0
+BITMAP
+3180
+3180
+0000
+0000
+1f00
+3f80
+71c0
+60c0
+c060
+c060
+c060
+c060
+c060
+c060
+60c0
+71c0
+3f80
+1f00
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 12 1 1
+BITMAP
+0600
+0600
+0600
+0000
+0000
+fff0
+fff0
+0000
+0000
+0600
+0600
+0600
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 13 14 0 0
+BITMAP
+0f98
+1ff0
+38e0
+3060
+60f0
+61b0
+6330
+6630
+6630
+6c30
+3860
+30e0
+7fc0
+cf80
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 19 2 0
+BITMAP
+3000
+1800
+0c00
+0600
+0000
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c1c0
+63c0
+7ec0
+1cc0
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 19 2 0
+BITMAP
+0180
+0300
+0600
+0c00
+0000
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c1c0
+63c0
+7ec0
+1cc0
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 19 2 0
+BITMAP
+0c00
+1e00
+3300
+6180
+0000
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c1c0
+63c0
+7ec0
+1cc0
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 18 2 0
+BITMAP
+3300
+3300
+0000
+0000
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c1c0
+63c0
+7ec0
+1cc0
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 12 24 0 -5
+BITMAP
+00c0
+0180
+0300
+0600
+0000
+c030
+c030
+6030
+7060
+3060
+38e0
+18c0
+18c0
+0d80
+0d80
+0780
+0700
+0300
+0300
+0600
+0600
+0c00
+3c00
+3800
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 11 24 2 -5
+BITMAP
+c000
+c000
+c000
+c000
+c000
+cf00
+df80
+f1c0
+e0c0
+c060
+c060
+c060
+c060
+c060
+c060
+e0c0
+f1c0
+df80
+cf00
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 12 23 0 -5
+BITMAP
+1980
+1980
+0000
+0000
+c030
+c030
+6030
+7060
+3060
+38e0
+18c0
+18c0
+0d80
+0d80
+0780
+0700
+0300
+0300
+0600
+0600
+0c00
+3c00
+3800
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica24.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica24.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica24.h	(revision 15879)
@@ -0,0 +1,1170 @@
+static unsigned char helvetica24_0_bits[] = {
+0x00};
+static unsigned char helvetica24_1_bits[] = {
+0x00};
+static unsigned char helvetica24_2_bits[] = {
+0x00};
+static unsigned char helvetica24_3_bits[] = {
+0x00};
+static unsigned char helvetica24_4_bits[] = {
+0x00};
+static unsigned char helvetica24_5_bits[] = {
+0x00};
+static unsigned char helvetica24_6_bits[] = {
+0x00};
+static unsigned char helvetica24_7_bits[] = {
+0x00};
+static unsigned char helvetica24_8_bits[] = {
+0x00};
+static unsigned char helvetica24_9_bits[] = {
+0x00};
+static unsigned char helvetica24_10_bits[] = {
+0x00};
+static unsigned char helvetica24_11_bits[] = {
+0x00};
+static unsigned char helvetica24_12_bits[] = {
+0x00};
+static unsigned char helvetica24_13_bits[] = {
+0x00};
+static unsigned char helvetica24_14_bits[] = {
+0x00};
+static unsigned char helvetica24_15_bits[] = {
+0x00};
+static unsigned char helvetica24_16_bits[] = {
+0x00};
+static unsigned char helvetica24_17_bits[] = {
+0x00};
+static unsigned char helvetica24_18_bits[] = {
+0x00};
+static unsigned char helvetica24_19_bits[] = {
+0x00};
+static unsigned char helvetica24_20_bits[] = {
+0x00};
+static unsigned char helvetica24_21_bits[] = {
+0x00};
+static unsigned char helvetica24_22_bits[] = {
+0x00};
+static unsigned char helvetica24_23_bits[] = {
+0x00};
+static unsigned char helvetica24_24_bits[] = {
+0x00};
+static unsigned char helvetica24_25_bits[] = {
+0x00};
+static unsigned char helvetica24_26_bits[] = {
+0x00};
+static unsigned char helvetica24_27_bits[] = {
+0x00};
+static unsigned char helvetica24_28_bits[] = {
+0x00};
+static unsigned char helvetica24_29_bits[] = {
+0x00};
+static unsigned char helvetica24_30_bits[] = {
+0x00};
+static unsigned char helvetica24_31_bits[] = {
+0x00, 0x00};
+static unsigned char helvetica24_32_bits[] = {
+0x00, 0x00};
+static unsigned char helvetica24_33_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x01, 0x01, 0x00, 0x00, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_34_bits[] = {
+0x33, 0x33, 0x33, 0x33, 0x33, 0x22};
+static unsigned char helvetica24_35_bits[] = {
+0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x98, 0x01, 0xff, 0x07, 0xff, 0x07, 
+0x98, 0x01, 0x98, 0x01, 0xcc, 0x00, 0xcc, 0x00, 0xff, 0x07, 0xff, 0x07, 
+0xcc, 0x00, 0xcc, 0x00, 0x66, 0x00, 0x66, 0x00, 0x66, 0x00};
+static unsigned char helvetica24_36_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0xfc, 0x01, 0xfe, 0x03, 0x67, 0x07, 0x63, 0x06, 
+0x63, 0x00, 0x67, 0x00, 0x6e, 0x00, 0x7c, 0x00, 0xf0, 0x01, 0xe0, 0x03, 
+0x60, 0x07, 0x60, 0x06, 0x63, 0x06, 0x63, 0x06, 0x67, 0x07, 0xfe, 0x03, 
+0xfc, 0x01, 0x60, 0x00, 0x60, 0x00};
+static unsigned char helvetica24_37_bits[] = {
+0x00, 0x60, 0x00, 0x3c, 0x30, 0x00, 0x7e, 0x30, 0x00, 0xc3, 0x18, 0x00, 
+0xc3, 0x18, 0x00, 0xc3, 0x0c, 0x00, 0xc3, 0x0c, 0x00, 0x7e, 0x06, 0x00, 
+0x3c, 0x06, 0x00, 0x00, 0x03, 0x00, 0x00, 0xe3, 0x01, 0x80, 0xf1, 0x03, 
+0x80, 0x19, 0x06, 0xc0, 0x18, 0x06, 0xc0, 0x18, 0x06, 0x60, 0x18, 0x06, 
+0x60, 0xf0, 0x03, 0x20, 0xe0, 0x01};
+static unsigned char helvetica24_38_bits[] = {
+0xf0, 0x00, 0xf8, 0x01, 0x9c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 
+0x98, 0x01, 0xf0, 0x00, 0x78, 0x00, 0xfc, 0x18, 0xce, 0x19, 0x86, 0x1b, 
+0x03, 0x0f, 0x03, 0x06, 0x03, 0x0f, 0x87, 0x1b, 0xfe, 0x39, 0x78, 0x00};
+static unsigned char helvetica24_39_bits[] = {
+0x03, 0x03, 0x03, 0x02, 0x02, 0x01};
+static unsigned char helvetica24_40_bits[] = {
+0x18, 0x18, 0x0c, 0x0c, 0x06, 0x06, 0x06, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18};
+static unsigned char helvetica24_41_bits[] = {
+0x03, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x0c, 0x0c, 0x06, 0x06, 0x03, 0x03};
+static unsigned char helvetica24_42_bits[] = {
+0x08, 0x08, 0x6b, 0x3e, 0x1c, 0x36, 0x22};
+static unsigned char helvetica24_43_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xff, 0x0f, 
+0xff, 0x0f, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char helvetica24_44_bits[] = {
+0x03, 0x03, 0x03, 0x02, 0x02, 0x01};
+static unsigned char helvetica24_45_bits[] = {
+0xff, 0x07, 0xff, 0x07};
+static unsigned char helvetica24_46_bits[] = {
+0x03, 0x03, 0x03};
+static unsigned char helvetica24_47_bits[] = {
+0x60, 0x60, 0x60, 0x30, 0x30, 0x30, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x0c, 
+0x0c, 0x06, 0x06, 0x06, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_48_bits[] = {
+0xf8, 0x00, 0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x06, 0x03, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x06, 0x03, 0x06, 0x03, 0x8e, 0x03, 0xfc, 0x01, 0xf8, 0x00};
+static unsigned char helvetica24_49_bits[] = {
+0x30, 0x30, 0x38, 0x3f, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 
+0x30, 0x30, 0x30, 0x30, 0x30, 0x30};
+static unsigned char helvetica24_50_bits[] = {
+0x78, 0x00, 0xfe, 0x01, 0x86, 0x03, 0x03, 0x03, 0x03, 0x06, 0x03, 0x06, 
+0x00, 0x06, 0x00, 0x03, 0x80, 0x03, 0xc0, 0x01, 0xf0, 0x00, 0x38, 0x00, 
+0x1c, 0x00, 0x0e, 0x00, 0x07, 0x00, 0x03, 0x00, 0xff, 0x07, 0xff, 0x07};
+static unsigned char helvetica24_51_bits[] = {
+0xf8, 0x00, 0xfe, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x00, 0x03, 0x80, 0x01, 0xf0, 0x00, 0xf0, 0x03, 0x00, 0x03, 0x00, 0x06, 
+0x00, 0x06, 0x03, 0x06, 0x03, 0x03, 0x86, 0x03, 0xfe, 0x01, 0xf8, 0x00};
+static unsigned char helvetica24_52_bits[] = {
+0x80, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xe0, 0x01, 0xf0, 0x01, 0xb0, 0x01, 
+0x98, 0x01, 0x9c, 0x01, 0x8c, 0x01, 0x86, 0x01, 0x87, 0x01, 0x83, 0x01, 
+0xff, 0x07, 0xff, 0x07, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01};
+static unsigned char helvetica24_53_bits[] = {
+0xfe, 0x03, 0xfe, 0x03, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 
+0x76, 0x00, 0xfe, 0x01, 0x8e, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 0x06, 
+0x00, 0x06, 0x03, 0x06, 0x03, 0x03, 0x87, 0x03, 0xfe, 0x01, 0x78, 0x00};
+static unsigned char helvetica24_54_bits[] = {
+0xf0, 0x00, 0xfc, 0x03, 0x0e, 0x03, 0x06, 0x06, 0x07, 0x06, 0x03, 0x00, 
+0x03, 0x00, 0xf3, 0x00, 0xfb, 0x01, 0x8f, 0x03, 0x07, 0x03, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x07, 0x06, 0x06, 0x03, 0xfe, 0x03, 0xf8, 0x00};
+static unsigned char helvetica24_55_bits[] = {
+0xff, 0x07, 0xff, 0x07, 0x00, 0x07, 0x00, 0x03, 0x80, 0x01, 0x80, 0x01, 
+0xc0, 0x00, 0xc0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x38, 0x00, 0x18, 0x00, 0x18, 0x00, 0x1c, 0x00, 0x0c, 0x00, 0x0c, 0x00};
+static unsigned char helvetica24_56_bits[] = {
+0x70, 0x00, 0xfc, 0x01, 0x8c, 0x01, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x8c, 0x01, 0xf8, 0x00, 0xfc, 0x01, 0x06, 0x03, 0x07, 0x07, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x8e, 0x03, 0xfe, 0x03, 0xf8, 0x00};
+static unsigned char helvetica24_57_bits[] = {
+0xf8, 0x00, 0xfe, 0x03, 0x8e, 0x03, 0x07, 0x03, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x07, 0x07, 0x8e, 0x07, 0xfe, 0x06, 0x78, 0x06, 
+0x00, 0x06, 0x00, 0x07, 0x03, 0x03, 0x87, 0x03, 0xfe, 0x01, 0x78, 0x00};
+static unsigned char helvetica24_58_bits[] = {
+0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 
+0x03, 0x03};
+static unsigned char helvetica24_59_bits[] = {
+0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 
+0x03, 0x03, 0x02, 0x02, 0x01};
+static unsigned char helvetica24_60_bits[] = {
+0x00, 0x0c, 0x00, 0x0f, 0xc0, 0x03, 0xf0, 0x00, 0x3c, 0x00, 0x07, 0x00, 
+0x07, 0x00, 0x3c, 0x00, 0xf0, 0x00, 0xc0, 0x03, 0x00, 0x0f, 0x00, 0x0c};
+static unsigned char helvetica24_61_bits[] = {
+0xff, 0x03, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0xff, 0x03};
+static unsigned char helvetica24_62_bits[] = {
+0x03, 0x00, 0x0f, 0x00, 0x3c, 0x00, 0xf0, 0x00, 0xc0, 0x03, 0x00, 0x0e, 
+0x00, 0x0e, 0xc0, 0x03, 0xf0, 0x00, 0x3c, 0x00, 0x0f, 0x00, 0x03, 0x00};
+static unsigned char helvetica24_63_bits[] = {
+0xf8, 0x00, 0xfe, 0x01, 0x8e, 0x03, 0x07, 0x03, 0x03, 0x03, 0x83, 0x03, 
+0x80, 0x01, 0xc0, 0x01, 0xe0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x30, 0x00};
+static unsigned char helvetica24_64_bits[] = {
+0x00, 0xff, 0x00, 0xc0, 0xff, 0x03, 0xf0, 0x80, 0x07, 0x38, 0x00, 0x0e, 
+0x1c, 0x00, 0x18, 0x0c, 0x00, 0x18, 0x06, 0xce, 0x30, 0x06, 0xdf, 0x30, 
+0x83, 0xe3, 0x30, 0xc3, 0x61, 0x30, 0xc3, 0x60, 0x30, 0x63, 0x60, 0x30, 
+0x63, 0x30, 0x38, 0x63, 0x30, 0x18, 0x63, 0x30, 0x1c, 0xe7, 0x38, 0x0e, 
+0xc6, 0xef, 0x07, 0x8e, 0xc7, 0x01, 0x1c, 0x00, 0x00, 0x38, 0x00, 0x00, 
+0xf0, 0xc0, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x3f, 0x00};
+static unsigned char helvetica24_65_bits[] = {
+0xc0, 0x01, 0xc0, 0x01, 0x60, 0x03, 0x60, 0x03, 0x30, 0x02, 0x30, 0x06, 
+0x30, 0x06, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x0c, 0x18, 0xfc, 0x1f, 
+0xfc, 0x1f, 0x06, 0x30, 0x06, 0x30, 0x06, 0x30, 0x03, 0x60, 0x03, 0x60, 
+0x03, 0x60};
+static unsigned char helvetica24_66_bits[] = {
+0xff, 0x03, 0xff, 0x0f, 0x03, 0x0e, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 
+0x03, 0x18, 0x03, 0x0c, 0xff, 0x07, 0xff, 0x0f, 0x03, 0x18, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x38, 0x03, 0x1c, 0xff, 0x0f, 
+0xff, 0x03};
+static unsigned char helvetica24_67_bits[] = {
+0xe0, 0x07, 0xf8, 0x1f, 0x3c, 0x3c, 0x0e, 0x70, 0x06, 0x60, 0x07, 0x60, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0xc0, 0x07, 0xc0, 0x06, 0x60, 0x0e, 0x70, 0x3c, 0x3c, 0xf8, 0x1f, 
+0xe0, 0x07};
+static unsigned char helvetica24_68_bits[] = {
+0xff, 0x03, 0xff, 0x0f, 0x03, 0x1e, 0x03, 0x38, 0x03, 0x30, 0x03, 0x70, 
+0x03, 0x60, 0x03, 0x60, 0x03, 0x60, 0x03, 0x60, 0x03, 0x60, 0x03, 0x60, 
+0x03, 0x60, 0x03, 0x70, 0x03, 0x30, 0x03, 0x38, 0x03, 0x1e, 0xff, 0x0f, 
+0xff, 0x03};
+static unsigned char helvetica24_69_bits[] = {
+0xff, 0x0f, 0xff, 0x0f, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0xff, 0x07, 0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x0f, 
+0xff, 0x0f};
+static unsigned char helvetica24_70_bits[] = {
+0xff, 0x07, 0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x03, 0xff, 0x03, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00};
+static unsigned char helvetica24_71_bits[] = {
+0xe0, 0x07, 0xf8, 0x1f, 0x3c, 0x3c, 0x0e, 0x70, 0x06, 0x60, 0x07, 0x60, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0xfe, 0x03, 0xfe, 0x03, 0xc0, 
+0x03, 0xc0, 0x07, 0xc0, 0x06, 0xe0, 0x0e, 0xf0, 0x3c, 0xfc, 0xf8, 0xdf, 
+0xe0, 0xc7};
+static unsigned char helvetica24_72_bits[] = {
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0xff, 0x3f, 0xff, 0x3f, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30};
+static unsigned char helvetica24_73_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_74_bits[] = {
+0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 
+0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x86, 0x01, 0xfe, 0x01, 
+0xfc, 0x00};
+static unsigned char helvetica24_75_bits[] = {
+0x03, 0x1c, 0x03, 0x0e, 0x03, 0x07, 0x83, 0x03, 0xc3, 0x01, 0xe3, 0x00, 
+0x73, 0x00, 0x3b, 0x00, 0x3f, 0x00, 0x7f, 0x00, 0xe7, 0x00, 0xc3, 0x01, 
+0x83, 0x03, 0x03, 0x07, 0x03, 0x0e, 0x03, 0x1c, 0x03, 0x38, 0x03, 0x70, 
+0x03, 0x60};
+static unsigned char helvetica24_76_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x07, 
+0xff, 0x07};
+static unsigned char helvetica24_77_bits[] = {
+0x03, 0x80, 0x01, 0x07, 0xc0, 0x01, 0x07, 0xc0, 0x01, 0x0f, 0xe0, 0x01, 
+0x0f, 0xe0, 0x01, 0x1b, 0xb0, 0x01, 0x1b, 0xb0, 0x01, 0x1b, 0xb0, 0x01, 
+0x33, 0x98, 0x01, 0x33, 0x98, 0x01, 0x33, 0x98, 0x01, 0x63, 0x8c, 0x01, 
+0x63, 0x8c, 0x01, 0x63, 0x8c, 0x01, 0xc3, 0x86, 0x01, 0xc3, 0x86, 0x01, 
+0xc3, 0x86, 0x01, 0x83, 0x83, 0x01, 0x83, 0x83, 0x01};
+static unsigned char helvetica24_78_bits[] = {
+0x07, 0x30, 0x0f, 0x30, 0x0f, 0x30, 0x1b, 0x30, 0x3b, 0x30, 0x33, 0x30, 
+0x73, 0x30, 0x63, 0x30, 0xe3, 0x30, 0xc3, 0x30, 0xc3, 0x31, 0x83, 0x31, 
+0x83, 0x33, 0x03, 0x33, 0x03, 0x37, 0x03, 0x36, 0x03, 0x3c, 0x03, 0x3c, 
+0x03, 0x38};
+static unsigned char helvetica24_79_bits[] = {
+0xe0, 0x07, 0xf8, 0x1f, 0x3c, 0x3c, 0x0e, 0x70, 0x06, 0x60, 0x07, 0xe0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x03, 0xc0, 0x07, 0xe0, 0x06, 0x60, 0x0e, 0x70, 0x3c, 0x3c, 0xf8, 0x1f, 
+0xe0, 0x07};
+static unsigned char helvetica24_80_bits[] = {
+0xff, 0x07, 0xff, 0x0f, 0x03, 0x0c, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 
+0x03, 0x18, 0x03, 0x0c, 0xff, 0x0f, 0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00};
+static unsigned char helvetica24_81_bits[] = {
+0xe0, 0x07, 0xf8, 0x1f, 0x3c, 0x3c, 0x0e, 0x70, 0x06, 0x60, 0x07, 0xe0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x03, 0xc0, 0x07, 0xe0, 0x06, 0x67, 0x0e, 0x7e, 0x3c, 0x38, 0xf8, 0x7f, 
+0xe0, 0xe7};
+static unsigned char helvetica24_82_bits[] = {
+0xff, 0x07, 0xff, 0x0f, 0x03, 0x0c, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 
+0x03, 0x18, 0x03, 0x0c, 0xff, 0x0f, 0xff, 0x07, 0x03, 0x0e, 0x03, 0x0c, 
+0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 
+0x03, 0x18};
+static unsigned char helvetica24_83_bits[] = {
+0xe0, 0x03, 0xf8, 0x0f, 0x1c, 0x1c, 0x0e, 0x18, 0x06, 0x18, 0x06, 0x00, 
+0x0e, 0x00, 0x7c, 0x00, 0xf0, 0x03, 0x80, 0x0f, 0x00, 0x1e, 0x00, 0x38, 
+0x00, 0x30, 0x03, 0x30, 0x03, 0x30, 0x07, 0x38, 0x1e, 0x1c, 0xfc, 0x0f, 
+0xf0, 0x03};
+static unsigned char helvetica24_84_bits[] = {
+0xff, 0x3f, 0xff, 0x3f, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00};
+static unsigned char helvetica24_85_bits[] = {
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x06, 0x18, 0x0e, 0x1c, 0xfc, 0x0f, 
+0xf0, 0x03};
+static unsigned char helvetica24_86_bits[] = {
+0x03, 0x60, 0x03, 0x60, 0x07, 0x70, 0x06, 0x30, 0x0e, 0x38, 0x0c, 0x18, 
+0x0c, 0x18, 0x1c, 0x1c, 0x18, 0x0c, 0x18, 0x0c, 0x38, 0x0e, 0x30, 0x06, 
+0x30, 0x06, 0x70, 0x07, 0x60, 0x03, 0x60, 0x03, 0xc0, 0x01, 0xc0, 0x01, 
+0xc0, 0x01};
+static unsigned char helvetica24_87_bits[] = {
+0x03, 0x06, 0x0c, 0x03, 0x06, 0x0c, 0x03, 0x06, 0x0c, 0x03, 0x0f, 0x0c, 
+0x06, 0x0f, 0x06, 0x86, 0x19, 0x06, 0x86, 0x19, 0x06, 0x86, 0x19, 0x06, 
+0x86, 0x19, 0x06, 0x8c, 0x19, 0x03, 0xcc, 0x30, 0x03, 0xcc, 0x30, 0x03, 
+0xcc, 0x30, 0x03, 0xd8, 0xb0, 0x01, 0xd8, 0xb0, 0x01, 0x78, 0xe0, 0x01, 
+0x70, 0xe0, 0x00, 0x30, 0xc0, 0x00, 0x30, 0xc0, 0x00};
+static unsigned char helvetica24_88_bits[] = {
+0x03, 0x60, 0x07, 0x70, 0x0e, 0x38, 0x0c, 0x18, 0x18, 0x0c, 0x38, 0x0e, 
+0x70, 0x07, 0xe0, 0x03, 0xc0, 0x01, 0xc0, 0x01, 0xe0, 0x03, 0x70, 0x07, 
+0x30, 0x06, 0x38, 0x0e, 0x1c, 0x1c, 0x0c, 0x18, 0x06, 0x30, 0x07, 0x70, 
+0x03, 0x60};
+static unsigned char helvetica24_89_bits[] = {
+0x03, 0x30, 0x07, 0x38, 0x06, 0x18, 0x0e, 0x1c, 0x0c, 0x0c, 0x1c, 0x0e, 
+0x18, 0x06, 0x38, 0x07, 0x30, 0x03, 0xf0, 0x03, 0xe0, 0x01, 0xe0, 0x01, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00};
+static unsigned char helvetica24_90_bits[] = {
+0xff, 0x1f, 0xff, 0x1f, 0x00, 0x1c, 0x00, 0x0e, 0x00, 0x07, 0x80, 0x03, 
+0x80, 0x03, 0xc0, 0x01, 0xe0, 0x00, 0xe0, 0x00, 0x70, 0x00, 0x38, 0x00, 
+0x38, 0x00, 0x1c, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x07, 0x00, 0xff, 0x1f, 
+0xff, 0x1f};
+static unsigned char helvetica24_91_bits[] = {
+0x0f, 0x0f, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x0f, 0x0f};
+static unsigned char helvetica24_92_bits[] = {
+0x03, 0x03, 0x03, 0x06, 0x06, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x18, 
+0x18, 0x30, 0x30, 0x30, 0x60, 0x60, 0x60};
+static unsigned char helvetica24_93_bits[] = {
+0x0f, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0f, 0x0f};
+static unsigned char helvetica24_94_bits[] = {
+0x30, 0x00, 0x30, 0x00, 0x78, 0x00, 0x48, 0x00, 0xcc, 0x00, 0x86, 0x01, 
+0x86, 0x01, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_95_bits[] = {
+0xff, 0x3f, 0xff, 0x3f};
+static unsigned char helvetica24_96_bits[] = {
+0x02, 0x01, 0x01, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_97_bits[] = {
+0xf8, 0x00, 0xfc, 0x01, 0x86, 0x03, 0x06, 0x03, 0x00, 0x03, 0xe0, 0x03, 
+0xfc, 0x03, 0x1e, 0x03, 0x07, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc7, 0x03, 
+0x7e, 0x07, 0x3c, 0x06};
+static unsigned char helvetica24_98_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xf3, 0x00, 
+0xfb, 0x01, 0x8f, 0x03, 0x07, 0x03, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x07, 0x03, 0x8f, 0x03, 0xfb, 0x01, 
+0xf3, 0x00};
+static unsigned char helvetica24_99_bits[] = {
+0xf8, 0x00, 0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x03, 0x8e, 0x03, 
+0xfc, 0x01, 0xf8, 0x00};
+static unsigned char helvetica24_100_bits[] = {
+0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x78, 0x06, 
+0xfc, 0x06, 0x8e, 0x07, 0x06, 0x07, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x07, 0x8e, 0x07, 0xfc, 0x06, 
+0x78, 0x06};
+static unsigned char helvetica24_101_bits[] = {
+0x70, 0x00, 0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 
+0xff, 0x07, 0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 0x06, 0x06, 0x0e, 0x07, 
+0xfc, 0x03, 0xf0, 0x00};
+static unsigned char helvetica24_102_bits[] = {
+0x38, 0x3c, 0x0c, 0x0c, 0x0c, 0x3f, 0x3f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c};
+static unsigned char helvetica24_103_bits[] = {
+0x78, 0x06, 0xfc, 0x06, 0x8e, 0x07, 0x06, 0x07, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x07, 0x8e, 0x07, 
+0xfc, 0x06, 0x78, 0x06, 0x00, 0x06, 0x03, 0x06, 0x07, 0x03, 0xfe, 0x03, 
+0xf8, 0x00};
+static unsigned char helvetica24_104_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x73, 0x00, 
+0xfb, 0x01, 0x8f, 0x01, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03};
+static unsigned char helvetica24_105_bits[] = {
+0x03, 0x03, 0x03, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_106_bits[] = {
+0x0c, 0x0c, 0x0c, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0f, 0x07};
+static unsigned char helvetica24_107_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x83, 0x01, 
+0xc3, 0x01, 0xe3, 0x00, 0x73, 0x00, 0x3b, 0x00, 0x1f, 0x00, 0x3f, 0x00, 
+0x73, 0x00, 0x63, 0x00, 0xe3, 0x00, 0xc3, 0x01, 0x83, 0x01, 0x83, 0x03, 
+0x03, 0x03};
+static unsigned char helvetica24_108_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_109_bits[] = {
+0x73, 0x3c, 0xff, 0x7e, 0xc7, 0xe3, 0x83, 0xc1, 0x83, 0xc1, 0x83, 0xc1, 
+0x83, 0xc1, 0x83, 0xc1, 0x83, 0xc1, 0x83, 0xc1, 0x83, 0xc1, 0x83, 0xc1, 
+0x83, 0xc1, 0x83, 0xc1};
+static unsigned char helvetica24_110_bits[] = {
+0x73, 0x00, 0xfb, 0x01, 0x8f, 0x01, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_111_bits[] = {
+0xf8, 0x00, 0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0x8e, 0x03, 
+0xfc, 0x01, 0xf8, 0x00};
+static unsigned char helvetica24_112_bits[] = {
+0xf3, 0x00, 0xfb, 0x01, 0x8f, 0x03, 0x07, 0x03, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x07, 0x03, 0x8f, 0x03, 
+0xfb, 0x01, 0xf3, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00};
+static unsigned char helvetica24_113_bits[] = {
+0x78, 0x06, 0xfc, 0x06, 0x8e, 0x07, 0x06, 0x07, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x07, 0x8e, 0x07, 
+0xfc, 0x06, 0x78, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 
+0x00, 0x06};
+static unsigned char helvetica24_114_bits[] = {
+0x33, 0x3b, 0x3f, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03};
+static unsigned char helvetica24_115_bits[] = {
+0x7c, 0x00, 0xfe, 0x01, 0x87, 0x03, 0x03, 0x03, 0x03, 0x00, 0x1f, 0x00, 
+0xfe, 0x00, 0xf0, 0x01, 0x80, 0x03, 0x00, 0x03, 0x03, 0x03, 0x83, 0x03, 
+0xff, 0x01, 0xfc, 0x00};
+static unsigned char helvetica24_116_bits[] = {
+0x0c, 0x0c, 0x0c, 0x0c, 0x3f, 0x3f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 0x38};
+static unsigned char helvetica24_117_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc6, 0x03, 
+0x7e, 0x03, 0x38, 0x03};
+static unsigned char helvetica24_118_bits[] = {
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0x06, 0x03, 0x8e, 0x03, 
+0x8c, 0x01, 0x8c, 0x01, 0xd8, 0x00, 0xd8, 0x00, 0xd8, 0x00, 0x70, 0x00, 
+0x70, 0x00, 0x70, 0x00};
+static unsigned char helvetica24_119_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x86, 0x87, 0x01, 0x86, 0x87, 0x01, 
+0x86, 0x87, 0x01, 0x8c, 0xc4, 0x00, 0xcc, 0xcc, 0x00, 0xcc, 0xcc, 0x00, 
+0xd8, 0x6c, 0x00, 0x58, 0x68, 0x00, 0x78, 0x78, 0x00, 0x70, 0x38, 0x00, 
+0x30, 0x30, 0x00, 0x30, 0x30, 0x00};
+static unsigned char helvetica24_120_bits[] = {
+0x03, 0x03, 0x87, 0x03, 0x86, 0x01, 0xcc, 0x00, 0xfc, 0x00, 0x78, 0x00, 
+0x30, 0x00, 0x78, 0x00, 0x78, 0x00, 0xcc, 0x00, 0xce, 0x01, 0x86, 0x01, 
+0x87, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_121_bits[] = {
+0x03, 0x0c, 0x03, 0x0c, 0x06, 0x0c, 0x0e, 0x06, 0x0c, 0x06, 0x1c, 0x07, 
+0x18, 0x03, 0x18, 0x03, 0xb0, 0x01, 0xb0, 0x01, 0xe0, 0x01, 0xe0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 0x3c, 0x00, 
+0x1c, 0x00};
+static unsigned char helvetica24_122_bits[] = {
+0xff, 0x03, 0xff, 0x03, 0x80, 0x01, 0xc0, 0x00, 0xe0, 0x00, 0x70, 0x00, 
+0x30, 0x00, 0x38, 0x00, 0x1c, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x07, 0x00, 
+0xff, 0x03, 0xff, 0x03};
+static unsigned char helvetica24_123_bits[] = {
+0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x06, 0x03, 
+0x03, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30};
+static unsigned char helvetica24_124_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_125_bits[] = {
+0x03, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 
+0x30, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x06, 0x03};
+static unsigned char helvetica24_126_bits[] = {
+0x0e, 0x03, 0x3f, 0x03, 0xf3, 0x03, 0xc3, 0x01};
+static unsigned char helvetica24_127_bits[] = {
+0x00};
+static unsigned char helvetica24_128_bits[] = {
+0x00};
+static unsigned char helvetica24_129_bits[] = {
+0x00};
+static unsigned char helvetica24_130_bits[] = {
+0x00};
+static unsigned char helvetica24_131_bits[] = {
+0x00};
+static unsigned char helvetica24_132_bits[] = {
+0x00};
+static unsigned char helvetica24_133_bits[] = {
+0x00};
+static unsigned char helvetica24_134_bits[] = {
+0x00};
+static unsigned char helvetica24_135_bits[] = {
+0x00};
+static unsigned char helvetica24_136_bits[] = {
+0x00};
+static unsigned char helvetica24_137_bits[] = {
+0x00};
+static unsigned char helvetica24_138_bits[] = {
+0x00};
+static unsigned char helvetica24_139_bits[] = {
+0x00};
+static unsigned char helvetica24_140_bits[] = {
+0x00};
+static unsigned char helvetica24_141_bits[] = {
+0x00};
+static unsigned char helvetica24_142_bits[] = {
+0x00};
+static unsigned char helvetica24_143_bits[] = {
+0x00};
+static unsigned char helvetica24_144_bits[] = {
+0x00};
+static unsigned char helvetica24_145_bits[] = {
+0x00};
+static unsigned char helvetica24_146_bits[] = {
+0x00};
+static unsigned char helvetica24_147_bits[] = {
+0x00};
+static unsigned char helvetica24_148_bits[] = {
+0x00};
+static unsigned char helvetica24_149_bits[] = {
+0x00};
+static unsigned char helvetica24_150_bits[] = {
+0x00};
+static unsigned char helvetica24_151_bits[] = {
+0x00};
+static unsigned char helvetica24_152_bits[] = {
+0x00};
+static unsigned char helvetica24_153_bits[] = {
+0x00};
+static unsigned char helvetica24_154_bits[] = {
+0x00};
+static unsigned char helvetica24_155_bits[] = {
+0x00};
+static unsigned char helvetica24_156_bits[] = {
+0x00};
+static unsigned char helvetica24_157_bits[] = {
+0x00};
+static unsigned char helvetica24_158_bits[] = {
+0x00};
+static unsigned char helvetica24_159_bits[] = {
+0x00};
+static unsigned char helvetica24_160_bits[] = {
+0x00};
+static unsigned char helvetica24_161_bits[] = {
+0x03, 0x03, 0x03, 0x00, 0x00, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_162_bits[] = {
+0x80, 0x01, 0x80, 0x01, 0xf8, 0x00, 0xfc, 0x01, 0xce, 0x03, 0x66, 0x03, 
+0x63, 0x00, 0x33, 0x00, 0x33, 0x00, 0x33, 0x00, 0x1b, 0x00, 0x1b, 0x00, 
+0x1b, 0x03, 0x8e, 0x03, 0xfe, 0x01, 0xfc, 0x00, 0x06, 0x00, 0x06, 0x00};
+static unsigned char helvetica24_163_bits[] = {
+0xf8, 0x01, 0xfc, 0x07, 0x0e, 0x0e, 0x06, 0x0c, 0x06, 0x00, 0x0e, 0x00, 
+0x0c, 0x00, 0x18, 0x00, 0xff, 0x01, 0xff, 0x01, 0x18, 0x00, 0x18, 0x00, 
+0x18, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xe6, 0x0c, 0xff, 0x0f, 0x0f, 0x07};
+static unsigned char helvetica24_164_bits[] = {
+0x03, 0x06, 0x77, 0x07, 0xfe, 0x03, 0x8c, 0x01, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x8c, 0x01, 0xfe, 0x03, 0x77, 0x07, 0x03, 0x06};
+static unsigned char helvetica24_165_bits[] = {
+0x07, 0x38, 0x06, 0x18, 0x0e, 0x1c, 0x0c, 0x0c, 0x1c, 0x0e, 0x18, 0x06, 
+0x38, 0x07, 0x30, 0x03, 0xfc, 0x0f, 0xfc, 0x0f, 0xc0, 0x00, 0xfc, 0x0f, 
+0xfc, 0x0f, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00};
+static unsigned char helvetica24_166_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_167_bits[] = {
+0xf8, 0x00, 0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x0e, 0x03, 0x1c, 0x00, 
+0x38, 0x00, 0x7e, 0x00, 0xe7, 0x00, 0xc3, 0x01, 0x83, 0x03, 0x03, 0x03, 
+0x06, 0x06, 0x0e, 0x06, 0x1c, 0x06, 0x38, 0x03, 0xf0, 0x01, 0xe0, 0x00, 
+0xc0, 0x01, 0x86, 0x03, 0x06, 0x03, 0x8e, 0x03, 0xfc, 0x01, 0xf8, 0x00};
+static unsigned char helvetica24_168_bits[] = {
+0x33, 0x33};
+static unsigned char helvetica24_169_bits[] = {
+0xe0, 0x0f, 0x00, 0x38, 0x38, 0x00, 0x0c, 0x60, 0x00, 0x06, 0xc0, 0x00, 
+0xc2, 0x87, 0x00, 0x63, 0x8c, 0x01, 0x31, 0x08, 0x01, 0x11, 0x00, 0x01, 
+0x11, 0x00, 0x01, 0x11, 0x00, 0x01, 0x31, 0x08, 0x01, 0x63, 0x8c, 0x01, 
+0xc2, 0x87, 0x00, 0x06, 0xc0, 0x00, 0x0c, 0x60, 0x00, 0x38, 0x38, 0x00, 
+0xe0, 0x0f, 0x00};
+static unsigned char helvetica24_170_bits[] = {
+0x1e, 0x33, 0x33, 0x30, 0x3e, 0x33, 0x33, 0x3b, 0x6e, 0x00, 0x7f, 0x7f};
+static unsigned char helvetica24_171_bits[] = {
+0x98, 0x01, 0xcc, 0x00, 0x66, 0x00, 0x33, 0x00, 0x33, 0x00, 0x66, 0x00, 
+0xcc, 0x00, 0x98, 0x01};
+static unsigned char helvetica24_172_bits[] = {
+0xff, 0x1f, 0xff, 0x1f, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 
+0x00, 0x18, 0x00, 0x18};
+static unsigned char helvetica24_173_bits[] = {
+0x3f, 0x3f};
+static unsigned char helvetica24_174_bits[] = {
+0xe0, 0x0f, 0x00, 0x38, 0x38, 0x00, 0x0c, 0x60, 0x00, 0x06, 0xc0, 0x00, 
+0xc2, 0x87, 0x00, 0x43, 0x88, 0x01, 0x41, 0x08, 0x01, 0x41, 0x08, 0x01, 
+0xc1, 0x07, 0x01, 0x41, 0x02, 0x01, 0x41, 0x04, 0x01, 0x43, 0x84, 0x01, 
+0x42, 0x88, 0x00, 0x06, 0xc0, 0x00, 0x0c, 0x60, 0x00, 0x38, 0x38, 0x00, 
+0xe0, 0x0f, 0x00};
+static unsigned char helvetica24_175_bits[] = {
+0x3f, 0x3f};
+static unsigned char helvetica24_176_bits[] = {
+0x3c, 0x66, 0xc3, 0xc3, 0xc3, 0x66, 0x3c};
+static unsigned char helvetica24_177_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xff, 0x0f, 0xff, 0x0f, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 0xff, 0x0f, 
+0xff, 0x0f};
+static unsigned char helvetica24_178_bits[] = {
+0x3c, 0x7e, 0x63, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x7f, 0x7f};
+static unsigned char helvetica24_179_bits[] = {
+0x3e, 0x7f, 0x63, 0x60, 0x3c, 0x3c, 0x60, 0x63, 0x7f, 0x3e};
+static unsigned char helvetica24_180_bits[] = {
+0x18, 0x0c, 0x06, 0x03};
+static unsigned char helvetica24_181_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc7, 0x03, 
+0x7f, 0x03, 0x3b, 0x03, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00};
+static unsigned char helvetica24_182_bits[] = {
+0xf8, 0x03, 0xfe, 0x03, 0x9e, 0x01, 0x9f, 0x01, 0x9f, 0x01, 0x9f, 0x01, 
+0x9f, 0x01, 0x9f, 0x01, 0x9f, 0x01, 0x9e, 0x01, 0x9e, 0x01, 0x9c, 0x01, 
+0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 
+0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01};
+static unsigned char helvetica24_183_bits[] = {
+0x03, 0x03, 0x03};
+static unsigned char helvetica24_184_bits[] = {
+0x06, 0x0e, 0x18, 0x18, 0x1f, 0x0e};
+static unsigned char helvetica24_185_bits[] = {
+0x0c, 0x0c, 0x0f, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c};
+static unsigned char helvetica24_186_bits[] = {
+0x1c, 0x36, 0x63, 0x63, 0x63, 0x63, 0x63, 0x36, 0x1c, 0x00, 0x7f, 0x7f};
+static unsigned char helvetica24_187_bits[] = {
+0x33, 0x00, 0x66, 0x00, 0xcc, 0x00, 0x98, 0x01, 0x98, 0x01, 0xcc, 0x00, 
+0x66, 0x00, 0x33, 0x00};
+static unsigned char helvetica24_188_bits[] = {
+0x0c, 0x18, 0x00, 0x0c, 0x18, 0x00, 0x0f, 0x0c, 0x00, 0x0f, 0x0c, 0x00, 
+0x0c, 0x06, 0x00, 0x0c, 0x06, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 
+0x8c, 0xc1, 0x00, 0x8c, 0xe1, 0x00, 0xc0, 0xf0, 0x00, 0xc0, 0xf0, 0x00, 
+0x60, 0xd8, 0x00, 0x60, 0xcc, 0x00, 0x30, 0xfe, 0x03, 0x30, 0xfe, 0x03, 
+0x18, 0xc0, 0x00, 0x18, 0xc0, 0x00};
+static unsigned char helvetica24_189_bits[] = {
+0x0c, 0x18, 0x00, 0x0c, 0x18, 0x00, 0x0f, 0x0c, 0x00, 0x0f, 0x0c, 0x00, 
+0x0c, 0x06, 0x00, 0x0c, 0x06, 0x00, 0x0c, 0x03, 0x00, 0x0c, 0x03, 0x00, 
+0x8c, 0xe1, 0x01, 0x8c, 0xf1, 0x03, 0xc0, 0x18, 0x03, 0xc0, 0x00, 0x03, 
+0x60, 0x80, 0x01, 0x60, 0xc0, 0x00, 0x30, 0x60, 0x00, 0x30, 0x30, 0x00, 
+0x18, 0xf8, 0x03, 0x18, 0xf8, 0x03};
+static unsigned char helvetica24_190_bits[] = {
+0x3e, 0x30, 0x00, 0x7f, 0x30, 0x00, 0x63, 0x18, 0x00, 0x60, 0x18, 0x00, 
+0x3c, 0x0c, 0x00, 0x3c, 0x0c, 0x00, 0x60, 0x06, 0x00, 0x63, 0x06, 0x00, 
+0x7f, 0x83, 0x01, 0x3e, 0xc3, 0x01, 0x80, 0xe1, 0x01, 0x80, 0xe1, 0x01, 
+0xc0, 0xb0, 0x01, 0xc0, 0x98, 0x01, 0x60, 0xfc, 0x07, 0x60, 0xfc, 0x07, 
+0x30, 0x80, 0x01, 0x30, 0x80, 0x01};
+static unsigned char helvetica24_191_bits[] = {
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x18, 0x00, 0x1c, 0x00, 0x0e, 0x00, 
+0x06, 0x00, 0x07, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc7, 0x01, 0xfe, 0x01, 
+0x7c, 0x00};
+static unsigned char helvetica24_192_bits[] = {
+0x30, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x01, 
+0xc0, 0x01, 0x60, 0x03, 0x60, 0x03, 0x30, 0x02, 0x30, 0x06, 0x30, 0x06, 
+0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x0c, 0x18, 0xfc, 0x1f, 0xfc, 0x1f, 
+0x06, 0x30, 0x06, 0x30, 0x06, 0x30, 0x03, 0x60, 0x03, 0x60, 0x03, 0x60};
+static unsigned char helvetica24_193_bits[] = {
+0x00, 0x06, 0x00, 0x03, 0x80, 0x01, 0xc0, 0x00, 0x00, 0x00, 0xc0, 0x01, 
+0xc0, 0x01, 0x60, 0x03, 0x60, 0x03, 0x30, 0x02, 0x30, 0x06, 0x30, 0x06, 
+0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x0c, 0x18, 0xfc, 0x1f, 0xfc, 0x1f, 
+0x06, 0x30, 0x06, 0x30, 0x06, 0x30, 0x03, 0x60, 0x03, 0x60, 0x03, 0x60};
+static unsigned char helvetica24_194_bits[] = {
+0x80, 0x01, 0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x00, 0x00, 0xc0, 0x01, 
+0xc0, 0x01, 0x60, 0x03, 0x60, 0x03, 0x30, 0x02, 0x30, 0x06, 0x30, 0x06, 
+0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x0c, 0x18, 0xfc, 0x1f, 0xfc, 0x1f, 
+0x06, 0x30, 0x06, 0x30, 0x06, 0x30, 0x03, 0x60, 0x03, 0x60, 0x03, 0x60};
+static unsigned char helvetica24_195_bits[] = {
+0xe0, 0x08, 0xb0, 0x0d, 0x10, 0x07, 0x00, 0x00, 0xc0, 0x01, 0xc0, 0x01, 
+0x60, 0x03, 0x60, 0x03, 0x30, 0x02, 0x30, 0x06, 0x30, 0x06, 0x18, 0x0c, 
+0x18, 0x0c, 0x18, 0x0c, 0x0c, 0x18, 0xfc, 0x1f, 0xfc, 0x1f, 0x06, 0x30, 
+0x06, 0x30, 0x06, 0x30, 0x03, 0x60, 0x03, 0x60, 0x03, 0x60};
+static unsigned char helvetica24_196_bits[] = {
+0x30, 0x06, 0x30, 0x06, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0xc0, 0x01, 
+0x60, 0x03, 0x60, 0x03, 0x30, 0x02, 0x30, 0x06, 0x30, 0x06, 0x18, 0x0c, 
+0x18, 0x0c, 0x18, 0x0c, 0x0c, 0x18, 0xfc, 0x1f, 0xfc, 0x1f, 0x06, 0x30, 
+0x06, 0x30, 0x06, 0x30, 0x03, 0x60, 0x03, 0x60, 0x03, 0x60};
+static unsigned char helvetica24_197_bits[] = {
+0xc0, 0x01, 0x60, 0x03, 0x60, 0x03, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 
+0xc0, 0x01, 0x60, 0x03, 0x60, 0x03, 0x30, 0x02, 0x30, 0x06, 0x30, 0x06, 
+0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x0c, 0x18, 0xfc, 0x1f, 0xfc, 0x1f, 
+0x06, 0x30, 0x06, 0x30, 0x06, 0x30, 0x03, 0x60, 0x03, 0x60, 0x03, 0x60};
+static unsigned char helvetica24_198_bits[] = {
+0xc0, 0xff, 0x1f, 0xc0, 0xff, 0x1f, 0x60, 0x06, 0x00, 0x60, 0x06, 0x00, 
+0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x30, 0x06, 0x00, 0x18, 0x06, 0x00, 
+0x18, 0xfe, 0x1f, 0x18, 0xfe, 0x1f, 0x0c, 0x06, 0x00, 0xfc, 0x07, 0x00, 
+0xfc, 0x07, 0x00, 0x06, 0x06, 0x00, 0x06, 0x06, 0x00, 0x06, 0x06, 0x00, 
+0x03, 0x06, 0x00, 0x03, 0xfe, 0x1f, 0x03, 0xfe, 0x1f};
+static unsigned char helvetica24_199_bits[] = {
+0xe0, 0x07, 0xf8, 0x1f, 0x3c, 0x3c, 0x0e, 0x70, 0x06, 0x60, 0x07, 0x60, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0xc0, 0x07, 0xc0, 0x06, 0x60, 0x0e, 0x70, 0x3c, 0x3c, 0xf8, 0x1f, 
+0xe0, 0x07, 0xc0, 0x01, 0x00, 0x03, 0x00, 0x03, 0xe0, 0x03, 0xc0, 0x01};
+static unsigned char helvetica24_200_bits[] = {
+0x0c, 0x00, 0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0x00, 0x00, 0xff, 0x0f, 
+0xff, 0x0f, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0xff, 0x07, 0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x0f, 0xff, 0x0f};
+static unsigned char helvetica24_201_bits[] = {
+0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0xff, 0x0f, 
+0xff, 0x0f, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0xff, 0x07, 0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x0f, 0xff, 0x0f};
+static unsigned char helvetica24_202_bits[] = {
+0x60, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x0c, 0x03, 0x00, 0x00, 0xff, 0x0f, 
+0xff, 0x0f, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0xff, 0x07, 0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x0f, 0xff, 0x0f};
+static unsigned char helvetica24_203_bits[] = {
+0x98, 0x01, 0x98, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0xff, 0x0f, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0xff, 0x07, 0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x0f, 0xff, 0x0f};
+static unsigned char helvetica24_204_bits[] = {
+0x03, 0x06, 0x0c, 0x18, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c};
+static unsigned char helvetica24_205_bits[] = {
+0x18, 0x0c, 0x06, 0x03, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06};
+static unsigned char helvetica24_206_bits[] = {
+0x18, 0x3c, 0x66, 0xc3, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18};
+static unsigned char helvetica24_207_bits[] = {
+0x33, 0x33, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c};
+static unsigned char helvetica24_208_bits[] = {
+0xfc, 0x0f, 0x00, 0xfc, 0x3f, 0x00, 0x0c, 0x78, 0x00, 0x0c, 0xe0, 0x00, 
+0x0c, 0xc0, 0x00, 0x0c, 0xc0, 0x01, 0x0c, 0x80, 0x01, 0x0c, 0x80, 0x01, 
+0xff, 0x80, 0x01, 0xff, 0x80, 0x01, 0x0c, 0x80, 0x01, 0x0c, 0x80, 0x01, 
+0x0c, 0x80, 0x01, 0x0c, 0xc0, 0x01, 0x0c, 0xc0, 0x00, 0x0c, 0xe0, 0x00, 
+0x0c, 0x78, 0x00, 0xfc, 0x3f, 0x00, 0xfc, 0x0f, 0x00};
+static unsigned char helvetica24_209_bits[] = {
+0xe0, 0x08, 0xb0, 0x0d, 0x10, 0x07, 0x00, 0x00, 0x07, 0x30, 0x0f, 0x30, 
+0x0f, 0x30, 0x1b, 0x30, 0x3b, 0x30, 0x33, 0x30, 0x73, 0x30, 0x63, 0x30, 
+0xe3, 0x30, 0xc3, 0x30, 0xc3, 0x31, 0x83, 0x31, 0x83, 0x33, 0x03, 0x33, 
+0x03, 0x37, 0x03, 0x36, 0x03, 0x3c, 0x03, 0x3c, 0x03, 0x38};
+static unsigned char helvetica24_210_bits[] = {
+0x60, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x00, 0x03, 0x00, 0x00, 0xe0, 0x07, 
+0xf8, 0x1f, 0x3c, 0x3c, 0x0e, 0x70, 0x06, 0x60, 0x07, 0xe0, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x07, 0xe0, 0x06, 0x60, 0x0e, 0x70, 0x3c, 0x3c, 0xf8, 0x1f, 0xe0, 0x07};
+static unsigned char helvetica24_211_bits[] = {
+0x00, 0x0c, 0x00, 0x06, 0x00, 0x03, 0x80, 0x01, 0x00, 0x00, 0xe0, 0x07, 
+0xf8, 0x1f, 0x3c, 0x3c, 0x0e, 0x70, 0x06, 0x60, 0x07, 0xe0, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x07, 0xe0, 0x06, 0x60, 0x0e, 0x70, 0x3c, 0x3c, 0xf8, 0x1f, 0xe0, 0x07};
+static unsigned char helvetica24_212_bits[] = {
+0x80, 0x01, 0xc0, 0x03, 0x60, 0x06, 0x30, 0x0c, 0x00, 0x00, 0xe0, 0x07, 
+0xf8, 0x1f, 0x3c, 0x3c, 0x0e, 0x70, 0x06, 0x60, 0x07, 0xe0, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x07, 0xe0, 0x06, 0x60, 0x0e, 0x70, 0x3c, 0x3c, 0xf8, 0x1f, 0xe0, 0x07};
+static unsigned char helvetica24_213_bits[] = {
+0xe0, 0x08, 0xb0, 0x0d, 0x10, 0x07, 0x00, 0x00, 0xe0, 0x07, 0xf8, 0x1f, 
+0x3c, 0x3c, 0x0e, 0x70, 0x06, 0x60, 0x07, 0xe0, 0x03, 0xc0, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x07, 0xe0, 
+0x06, 0x60, 0x0e, 0x70, 0x3c, 0x3c, 0xf8, 0x1f, 0xe0, 0x07};
+static unsigned char helvetica24_214_bits[] = {
+0x60, 0x06, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0xf8, 0x1f, 
+0x3c, 0x3c, 0x0e, 0x70, 0x06, 0x60, 0x07, 0xe0, 0x03, 0xc0, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x07, 0xe0, 
+0x06, 0x60, 0x0e, 0x70, 0x3c, 0x3c, 0xf8, 0x1f, 0xe0, 0x07};
+static unsigned char helvetica24_215_bits[] = {
+0x03, 0x18, 0x06, 0x0c, 0x0c, 0x06, 0x18, 0x03, 0xb0, 0x01, 0xe0, 0x00, 
+0xe0, 0x00, 0xb0, 0x01, 0x18, 0x03, 0x0c, 0x06, 0x06, 0x0c, 0x03, 0x18};
+static unsigned char helvetica24_216_bits[] = {
+0xc0, 0x0f, 0x02, 0xf0, 0x3f, 0x03, 0x78, 0xf8, 0x01, 0x1c, 0xe0, 0x00, 
+0x0c, 0xe0, 0x00, 0x0e, 0xb0, 0x01, 0x06, 0x98, 0x01, 0x06, 0x8c, 0x01, 
+0x06, 0x86, 0x01, 0x06, 0x83, 0x01, 0x86, 0x81, 0x01, 0xc6, 0x80, 0x01, 
+0x66, 0x80, 0x01, 0x36, 0xc0, 0x01, 0x1c, 0xc0, 0x00, 0x1c, 0xe0, 0x00, 
+0x7e, 0x78, 0x00, 0xf3, 0x3f, 0x00, 0xc1, 0x0f, 0x00};
+static unsigned char helvetica24_217_bits[] = {
+0x30, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x00, 0x00, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x06, 0x18, 0x0e, 0x1c, 0xfc, 0x0f, 0xf0, 0x03};
+static unsigned char helvetica24_218_bits[] = {
+0x00, 0x06, 0x00, 0x03, 0x80, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x06, 0x18, 0x0e, 0x1c, 0xfc, 0x0f, 0xf0, 0x03};
+static unsigned char helvetica24_219_bits[] = {
+0xc0, 0x00, 0xe0, 0x01, 0x30, 0x03, 0x18, 0x06, 0x00, 0x00, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x06, 0x18, 0x0e, 0x1c, 0xfc, 0x0f, 0xf0, 0x03};
+static unsigned char helvetica24_220_bits[] = {
+0x30, 0x03, 0x30, 0x03, 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 0x03, 0x30, 
+0x03, 0x30, 0x06, 0x18, 0x0e, 0x1c, 0xfc, 0x0f, 0xf0, 0x03};
+static unsigned char helvetica24_221_bits[] = {
+0x00, 0x06, 0x00, 0x03, 0x80, 0x01, 0xc0, 0x00, 0x00, 0x00, 0x03, 0x30, 
+0x07, 0x38, 0x06, 0x18, 0x0e, 0x1c, 0x0c, 0x0c, 0x1c, 0x0e, 0x18, 0x06, 
+0x38, 0x07, 0x30, 0x03, 0xf0, 0x03, 0xe0, 0x01, 0xe0, 0x01, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00};
+static unsigned char helvetica24_222_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x07, 0xff, 0x0f, 
+0x03, 0x0c, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x03, 0x0c, 
+0xff, 0x0f, 0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00};
+static unsigned char helvetica24_223_bits[] = {
+0x38, 0x00, 0xfe, 0x00, 0xc7, 0x00, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 
+0xc3, 0x00, 0xe3, 0x00, 0x73, 0x00, 0xf3, 0x00, 0xc3, 0x01, 0x83, 0x01, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x01, 0xc3, 0x01, 0xf3, 0x00, 
+0x73, 0x00};
+static unsigned char helvetica24_224_bits[] = {
+0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xf8, 0x00, 
+0xfc, 0x01, 0x86, 0x03, 0x06, 0x03, 0x00, 0x03, 0xe0, 0x03, 0xfc, 0x03, 
+0x1e, 0x03, 0x07, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc7, 0x03, 0x7e, 0x07, 
+0x3c, 0x06};
+static unsigned char helvetica24_225_bits[] = {
+0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0xf8, 0x00, 
+0xfc, 0x01, 0x86, 0x03, 0x06, 0x03, 0x00, 0x03, 0xe0, 0x03, 0xfc, 0x03, 
+0x1e, 0x03, 0x07, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc7, 0x03, 0x7e, 0x07, 
+0x3c, 0x06};
+static unsigned char helvetica24_226_bits[] = {
+0x60, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x0c, 0x03, 0x00, 0x00, 0xf8, 0x00, 
+0xfc, 0x01, 0x86, 0x03, 0x06, 0x03, 0x00, 0x03, 0xe0, 0x03, 0xfc, 0x03, 
+0x1e, 0x03, 0x07, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc7, 0x03, 0x7e, 0x07, 
+0x3c, 0x06};
+static unsigned char helvetica24_227_bits[] = {
+0x38, 0x02, 0x6c, 0x03, 0xc4, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 
+0xfc, 0x01, 0x86, 0x03, 0x06, 0x03, 0x00, 0x03, 0xe0, 0x03, 0xfc, 0x03, 
+0x1e, 0x03, 0x07, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc7, 0x03, 0x7e, 0x07, 
+0x3c, 0x06};
+static unsigned char helvetica24_228_bits[] = {
+0x98, 0x01, 0x98, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0xfc, 0x01, 
+0x86, 0x03, 0x06, 0x03, 0x00, 0x03, 0xe0, 0x03, 0xfc, 0x03, 0x1e, 0x03, 
+0x07, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc7, 0x03, 0x7e, 0x07, 0x3c, 0x06};
+static unsigned char helvetica24_229_bits[] = {
+0x70, 0x00, 0xd8, 0x00, 0x88, 0x00, 0xd8, 0x00, 0x70, 0x00, 0xf8, 0x00, 
+0xfc, 0x01, 0x86, 0x03, 0x06, 0x03, 0x00, 0x03, 0xe0, 0x03, 0xfc, 0x03, 
+0x1e, 0x03, 0x07, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc7, 0x03, 0x7e, 0x07, 
+0x3c, 0x06};
+static unsigned char helvetica24_230_bits[] = {
+0xf8, 0x70, 0x00, 0xfc, 0xfd, 0x01, 0x86, 0x8f, 0x03, 0x06, 0x07, 0x03, 
+0x00, 0x03, 0x06, 0xe0, 0x03, 0x06, 0xfc, 0xff, 0x07, 0x1e, 0xff, 0x07, 
+0x07, 0x03, 0x00, 0x03, 0x03, 0x00, 0x83, 0x07, 0x06, 0xc7, 0x0f, 0x07, 
+0x7e, 0xfc, 0x03, 0x3c, 0xf0, 0x00};
+static unsigned char helvetica24_231_bits[] = {
+0xf8, 0x00, 0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x03, 0x8e, 0x03, 
+0xfc, 0x01, 0xf8, 0x00, 0x38, 0x00, 0x60, 0x00, 0x60, 0x00, 0x7c, 0x00, 
+0x38, 0x00};
+static unsigned char helvetica24_232_bits[] = {
+0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x70, 0x00, 
+0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 0xff, 0x07, 
+0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 0x06, 0x06, 0x0e, 0x07, 0xfc, 0x03, 
+0xf0, 0x00};
+static unsigned char helvetica24_233_bits[] = {
+0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0x70, 0x00, 
+0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 0xff, 0x07, 
+0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 0x06, 0x06, 0x0e, 0x07, 0xfc, 0x03, 
+0xf0, 0x00};
+static unsigned char helvetica24_234_bits[] = {
+0x60, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x0c, 0x03, 0x00, 0x00, 0x70, 0x00, 
+0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 0xff, 0x07, 
+0xff, 0x07, 0x03, 0x00, 0x03, 0x00, 0x06, 0x06, 0x0e, 0x07, 0xfc, 0x03, 
+0xf0, 0x00};
+static unsigned char helvetica24_235_bits[] = {
+0x98, 0x01, 0x98, 0x01, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0xfc, 0x01, 
+0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 0xff, 0x07, 0xff, 0x07, 
+0x03, 0x00, 0x03, 0x00, 0x06, 0x06, 0x0e, 0x07, 0xfc, 0x03, 0xf0, 0x00};
+static unsigned char helvetica24_236_bits[] = {
+0x03, 0x06, 0x0c, 0x18, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c};
+static unsigned char helvetica24_237_bits[] = {
+0x18, 0x0c, 0x06, 0x03, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06};
+static unsigned char helvetica24_238_bits[] = {
+0x18, 0x3c, 0x66, 0xc3, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18};
+static unsigned char helvetica24_239_bits[] = {
+0x33, 0x33, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c};
+static unsigned char helvetica24_240_bits[] = {
+0x07, 0x00, 0x8e, 0x01, 0x78, 0x00, 0x3c, 0x00, 0x63, 0x00, 0xf8, 0x00, 
+0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0x8e, 0x03, 0xfc, 0x01, 
+0xf8, 0x00};
+static unsigned char helvetica24_241_bits[] = {
+0x1c, 0x01, 0xb6, 0x01, 0xe2, 0x00, 0x00, 0x00, 0x73, 0x00, 0xfb, 0x01, 
+0x8f, 0x01, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char helvetica24_242_bits[] = {
+0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xf8, 0x00, 
+0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0x8e, 0x03, 0xfc, 0x01, 
+0xf8, 0x00};
+static unsigned char helvetica24_243_bits[] = {
+0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0xf8, 0x00, 
+0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0x8e, 0x03, 0xfc, 0x01, 
+0xf8, 0x00};
+static unsigned char helvetica24_244_bits[] = {
+0x60, 0x00, 0xf0, 0x00, 0x98, 0x01, 0x0c, 0x03, 0x00, 0x00, 0xf8, 0x00, 
+0xfc, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0x8e, 0x03, 0xfc, 0x01, 
+0xf8, 0x00};
+static unsigned char helvetica24_245_bits[] = {
+0x38, 0x02, 0x6c, 0x03, 0xc4, 0x01, 0x00, 0x00, 0xf8, 0x00, 0xfc, 0x01, 
+0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0x8e, 0x03, 0xfc, 0x01, 0xf8, 0x00};
+static unsigned char helvetica24_246_bits[] = {
+0x8c, 0x01, 0x8c, 0x01, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x00, 0xfc, 0x01, 
+0x8e, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x06, 0x03, 0x8e, 0x03, 0xfc, 0x01, 0xf8, 0x00};
+static unsigned char helvetica24_247_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 
+0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char helvetica24_248_bits[] = {
+0xf0, 0x19, 0xf8, 0x0f, 0x1c, 0x07, 0x0c, 0x06, 0x06, 0x0f, 0x86, 0x0d, 
+0xc6, 0x0c, 0x66, 0x0c, 0x66, 0x0c, 0x36, 0x0c, 0x1c, 0x06, 0x0c, 0x07, 
+0xfe, 0x03, 0xf3, 0x01};
+static unsigned char helvetica24_249_bits[] = {
+0x0c, 0x00, 0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc6, 0x03, 0x7e, 0x03, 
+0x38, 0x03};
+static unsigned char helvetica24_250_bits[] = {
+0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x00, 0x00, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc6, 0x03, 0x7e, 0x03, 
+0x38, 0x03};
+static unsigned char helvetica24_251_bits[] = {
+0x30, 0x00, 0x78, 0x00, 0xcc, 0x00, 0x86, 0x01, 0x00, 0x00, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc6, 0x03, 0x7e, 0x03, 
+0x38, 0x03};
+static unsigned char helvetica24_252_bits[] = {
+0xcc, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc6, 0x03, 0x7e, 0x03, 0x38, 0x03};
+static unsigned char helvetica24_253_bits[] = {
+0x00, 0x03, 0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x00, 0x00, 0x03, 0x0c, 
+0x03, 0x0c, 0x06, 0x0c, 0x0e, 0x06, 0x0c, 0x06, 0x1c, 0x07, 0x18, 0x03, 
+0x18, 0x03, 0xb0, 0x01, 0xb0, 0x01, 0xe0, 0x01, 0xe0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 0x3c, 0x00, 0x1c, 0x00};
+static unsigned char helvetica24_254_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0xf3, 0x00, 
+0xfb, 0x01, 0x8f, 0x03, 0x07, 0x03, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x07, 0x03, 0x8f, 0x03, 0xfb, 0x01, 
+0xf3, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00};
+static unsigned char helvetica24_255_bits[] = {
+0x98, 0x01, 0x98, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x03, 0x0c, 
+0x06, 0x0c, 0x0e, 0x06, 0x0c, 0x06, 0x1c, 0x07, 0x18, 0x03, 0x18, 0x03, 
+0xb0, 0x01, 0xb0, 0x01, 0xe0, 0x01, 0xe0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 0x3c, 0x00, 0x1c, 0x00};
+static RotFont helvetica24font[] = {
+{5, 1, 1, helvetica24_0_bits},
+{5, 1, 1, helvetica24_1_bits},
+{5, 1, 1, helvetica24_2_bits},
+{5, 1, 1, helvetica24_3_bits},
+{5, 1, 1, helvetica24_4_bits},
+{5, 1, 1, helvetica24_5_bits},
+{5, 1, 1, helvetica24_6_bits},
+{5, 1, 1, helvetica24_7_bits},
+{5, 1, 1, helvetica24_8_bits},
+{5, 1, 1, helvetica24_9_bits},
+{5, 1, 1, helvetica24_10_bits},
+{5, 1, 1, helvetica24_11_bits},
+{5, 1, 1, helvetica24_12_bits},
+{5, 1, 1, helvetica24_13_bits},
+{5, 1, 1, helvetica24_14_bits},
+{5, 1, 1, helvetica24_15_bits},
+{5, 1, 1, helvetica24_16_bits},
+{5, 1, 1, helvetica24_17_bits},
+{5, 1, 1, helvetica24_18_bits},
+{5, 1, 1, helvetica24_19_bits},
+{5, 1, 1, helvetica24_20_bits},
+{5, 1, 1, helvetica24_21_bits},
+{5, 1, 1, helvetica24_22_bits},
+{5, 1, 1, helvetica24_23_bits},
+{5, 1, 1, helvetica24_24_bits},
+{5, 1, 1, helvetica24_25_bits},
+{5, 1, 1, helvetica24_26_bits},
+{5, 1, 1, helvetica24_27_bits},
+{5, 1, 1, helvetica24_28_bits},
+{5, 1, 1, helvetica24_29_bits},
+{5, 1, 1, helvetica24_30_bits},
+{5, 1, 1, helvetica24_31_bits},
+{10, 1, 1, helvetica24_32_bits},
+{2, 19, 19, helvetica24_33_bits},
+{6, 6, 19, helvetica24_34_bits},
+{11, 17, 17, helvetica24_35_bits},
+{11, 21, 19, helvetica24_36_bits},
+{19, 18, 18, helvetica24_37_bits},
+{14, 18, 18, helvetica24_38_bits},
+{2, 6, 19, helvetica24_39_bits},
+{5, 24, 19, helvetica24_40_bits},
+{5, 24, 19, helvetica24_41_bits},
+{7, 7, 19, helvetica24_42_bits},
+{12, 12, 13, helvetica24_43_bits},
+{2, 6, 3, helvetica24_44_bits},
+{11, 2, 8, helvetica24_45_bits},
+{2, 3, 3, helvetica24_46_bits},
+{7, 19, 19, helvetica24_47_bits},
+{11, 18, 18, helvetica24_48_bits},
+{6, 18, 18, helvetica24_49_bits},
+{11, 18, 18, helvetica24_50_bits},
+{11, 18, 18, helvetica24_51_bits},
+{11, 18, 18, helvetica24_52_bits},
+{11, 18, 18, helvetica24_53_bits},
+{11, 18, 18, helvetica24_54_bits},
+{11, 18, 18, helvetica24_55_bits},
+{11, 18, 18, helvetica24_56_bits},
+{11, 18, 18, helvetica24_57_bits},
+{2, 14, 14, helvetica24_58_bits},
+{2, 17, 14, helvetica24_59_bits},
+{12, 12, 13, helvetica24_60_bits},
+{10, 6, 11, helvetica24_61_bits},
+{12, 12, 13, helvetica24_62_bits},
+{10, 19, 19, helvetica24_63_bits},
+{22, 23, 19, helvetica24_64_bits},
+{15, 19, 19, helvetica24_65_bits},
+{14, 19, 19, helvetica24_66_bits},
+{16, 19, 19, helvetica24_67_bits},
+{15, 19, 19, helvetica24_68_bits},
+{12, 19, 19, helvetica24_69_bits},
+{11, 19, 19, helvetica24_70_bits},
+{16, 19, 19, helvetica24_71_bits},
+{14, 19, 19, helvetica24_72_bits},
+{2, 19, 19, helvetica24_73_bits},
+{10, 19, 19, helvetica24_74_bits},
+{15, 19, 19, helvetica24_75_bits},
+{11, 19, 19, helvetica24_76_bits},
+{17, 19, 19, helvetica24_77_bits},
+{14, 19, 19, helvetica24_78_bits},
+{16, 19, 19, helvetica24_79_bits},
+{13, 19, 19, helvetica24_80_bits},
+{16, 19, 19, helvetica24_81_bits},
+{13, 19, 19, helvetica24_82_bits},
+{14, 19, 19, helvetica24_83_bits},
+{14, 19, 19, helvetica24_84_bits},
+{14, 19, 19, helvetica24_85_bits},
+{15, 19, 19, helvetica24_86_bits},
+{20, 19, 19, helvetica24_87_bits},
+{15, 19, 19, helvetica24_88_bits},
+{14, 19, 19, helvetica24_89_bits},
+{13, 19, 19, helvetica24_90_bits},
+{4, 24, 19, helvetica24_91_bits},
+{7, 19, 19, helvetica24_92_bits},
+{4, 24, 19, helvetica24_93_bits},
+{10, 9, 19, helvetica24_94_bits},
+{14, 2, -3, helvetica24_95_bits},
+{2, 6, 19, helvetica24_96_bits},
+{11, 14, 14, helvetica24_97_bits},
+{11, 19, 19, helvetica24_98_bits},
+{10, 14, 14, helvetica24_99_bits},
+{11, 19, 19, helvetica24_100_bits},
+{11, 14, 14, helvetica24_101_bits},
+{6, 19, 19, helvetica24_102_bits},
+{11, 19, 14, helvetica24_103_bits},
+{10, 19, 19, helvetica24_104_bits},
+{2, 19, 19, helvetica24_105_bits},
+{4, 24, 19, helvetica24_106_bits},
+{10, 19, 19, helvetica24_107_bits},
+{2, 19, 19, helvetica24_108_bits},
+{16, 14, 14, helvetica24_109_bits},
+{10, 14, 14, helvetica24_110_bits},
+{11, 14, 14, helvetica24_111_bits},
+{11, 19, 14, helvetica24_112_bits},
+{11, 19, 14, helvetica24_113_bits},
+{6, 14, 14, helvetica24_114_bits},
+{10, 14, 14, helvetica24_115_bits},
+{6, 18, 18, helvetica24_116_bits},
+{10, 14, 14, helvetica24_117_bits},
+{11, 14, 14, helvetica24_118_bits},
+{18, 14, 14, helvetica24_119_bits},
+{10, 14, 14, helvetica24_120_bits},
+{12, 19, 14, helvetica24_121_bits},
+{10, 14, 14, helvetica24_122_bits},
+{6, 24, 19, helvetica24_123_bits},
+{2, 24, 19, helvetica24_124_bits},
+{6, 24, 19, helvetica24_125_bits},
+{10, 4, 9, helvetica24_126_bits},
+{5, 1, 1, helvetica24_127_bits},
+{5, 1, 1, helvetica24_128_bits},
+{5, 1, 1, helvetica24_129_bits},
+{5, 1, 1, helvetica24_130_bits},
+{5, 1, 1, helvetica24_131_bits},
+{5, 1, 1, helvetica24_132_bits},
+{5, 1, 1, helvetica24_133_bits},
+{5, 1, 1, helvetica24_134_bits},
+{5, 1, 1, helvetica24_135_bits},
+{5, 1, 1, helvetica24_136_bits},
+{5, 1, 1, helvetica24_137_bits},
+{5, 1, 1, helvetica24_138_bits},
+{5, 1, 1, helvetica24_139_bits},
+{5, 1, 1, helvetica24_140_bits},
+{5, 1, 1, helvetica24_141_bits},
+{5, 1, 1, helvetica24_142_bits},
+{5, 1, 1, helvetica24_143_bits},
+{5, 1, 1, helvetica24_144_bits},
+{5, 1, 1, helvetica24_145_bits},
+{5, 1, 1, helvetica24_146_bits},
+{5, 1, 1, helvetica24_147_bits},
+{5, 1, 1, helvetica24_148_bits},
+{5, 1, 1, helvetica24_149_bits},
+{5, 1, 1, helvetica24_150_bits},
+{5, 1, 1, helvetica24_151_bits},
+{5, 1, 1, helvetica24_152_bits},
+{5, 1, 1, helvetica24_153_bits},
+{5, 1, 1, helvetica24_154_bits},
+{5, 1, 1, helvetica24_155_bits},
+{5, 1, 1, helvetica24_156_bits},
+{5, 1, 1, helvetica24_157_bits},
+{5, 1, 1, helvetica24_158_bits},
+{5, 1, 1, helvetica24_159_bits},
+{1, 1, 1, helvetica24_160_bits},
+{2, 19, 14, helvetica24_161_bits},
+{10, 18, 16, helvetica24_162_bits},
+{12, 18, 18, helvetica24_163_bits},
+{11, 12, 15, helvetica24_164_bits},
+{14, 18, 18, helvetica24_165_bits},
+{2, 23, 19, helvetica24_166_bits},
+{11, 24, 19, helvetica24_167_bits},
+{6, 2, 18, helvetica24_168_bits},
+{17, 17, 17, helvetica24_169_bits},
+{7, 12, 19, helvetica24_170_bits},
+{9, 8, 11, helvetica24_171_bits},
+{13, 8, 11, helvetica24_172_bits},
+{6, 2, 8, helvetica24_173_bits},
+{17, 17, 17, helvetica24_174_bits},
+{6, 2, 18, helvetica24_175_bits},
+{8, 7, 18, helvetica24_176_bits},
+{12, 13, 13, helvetica24_177_bits},
+{7, 10, 18, helvetica24_178_bits},
+{7, 10, 18, helvetica24_179_bits},
+{5, 4, 19, helvetica24_180_bits},
+{10, 19, 14, helvetica24_181_bits},
+{10, 23, 19, helvetica24_182_bits},
+{2, 3, 9, helvetica24_183_bits},
+{5, 6, 1, helvetica24_184_bits},
+{4, 10, 18, helvetica24_185_bits},
+{7, 12, 19, helvetica24_186_bits},
+{9, 8, 11, helvetica24_187_bits},
+{18, 18, 18, helvetica24_188_bits},
+{18, 18, 18, helvetica24_189_bits},
+{19, 18, 18, helvetica24_190_bits},
+{10, 19, 14, helvetica24_191_bits},
+{15, 24, 24, helvetica24_192_bits},
+{15, 24, 24, helvetica24_193_bits},
+{15, 24, 24, helvetica24_194_bits},
+{15, 23, 23, helvetica24_195_bits},
+{15, 23, 23, helvetica24_196_bits},
+{15, 24, 24, helvetica24_197_bits},
+{21, 19, 19, helvetica24_198_bits},
+{16, 24, 19, helvetica24_199_bits},
+{12, 24, 24, helvetica24_200_bits},
+{12, 24, 24, helvetica24_201_bits},
+{12, 24, 24, helvetica24_202_bits},
+{12, 23, 23, helvetica24_203_bits},
+{5, 24, 24, helvetica24_204_bits},
+{5, 24, 24, helvetica24_205_bits},
+{8, 24, 24, helvetica24_206_bits},
+{6, 23, 23, helvetica24_207_bits},
+{17, 19, 19, helvetica24_208_bits},
+{14, 23, 23, helvetica24_209_bits},
+{16, 24, 24, helvetica24_210_bits},
+{16, 24, 24, helvetica24_211_bits},
+{16, 24, 24, helvetica24_212_bits},
+{16, 23, 23, helvetica24_213_bits},
+{16, 23, 23, helvetica24_214_bits},
+{13, 12, 13, helvetica24_215_bits},
+{18, 19, 19, helvetica24_216_bits},
+{14, 24, 24, helvetica24_217_bits},
+{14, 24, 24, helvetica24_218_bits},
+{14, 24, 24, helvetica24_219_bits},
+{14, 23, 23, helvetica24_220_bits},
+{14, 24, 24, helvetica24_221_bits},
+{13, 19, 19, helvetica24_222_bits},
+{10, 19, 19, helvetica24_223_bits},
+{11, 19, 19, helvetica24_224_bits},
+{11, 19, 19, helvetica24_225_bits},
+{11, 19, 19, helvetica24_226_bits},
+{11, 19, 19, helvetica24_227_bits},
+{11, 18, 18, helvetica24_228_bits},
+{11, 19, 19, helvetica24_229_bits},
+{19, 14, 14, helvetica24_230_bits},
+{10, 19, 14, helvetica24_231_bits},
+{11, 19, 19, helvetica24_232_bits},
+{11, 19, 19, helvetica24_233_bits},
+{11, 19, 19, helvetica24_234_bits},
+{11, 18, 18, helvetica24_235_bits},
+{5, 19, 19, helvetica24_236_bits},
+{5, 19, 19, helvetica24_237_bits},
+{8, 19, 19, helvetica24_238_bits},
+{6, 18, 18, helvetica24_239_bits},
+{11, 19, 19, helvetica24_240_bits},
+{10, 18, 18, helvetica24_241_bits},
+{11, 19, 19, helvetica24_242_bits},
+{11, 19, 19, helvetica24_243_bits},
+{11, 19, 19, helvetica24_244_bits},
+{11, 18, 18, helvetica24_245_bits},
+{11, 18, 18, helvetica24_246_bits},
+{12, 12, 13, helvetica24_247_bits},
+{13, 14, 14, helvetica24_248_bits},
+{10, 19, 19, helvetica24_249_bits},
+{10, 19, 19, helvetica24_250_bits},
+{10, 19, 19, helvetica24_251_bits},
+{10, 18, 18, helvetica24_252_bits},
+{12, 24, 19, helvetica24_253_bits},
+{11, 24, 19, helvetica24_254_bits},
+{12, 23, 18, helvetica24_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica8.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica8.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica8.bdf	(revision 15879)
@@ -0,0 +1,2572 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Helvetica-Medium-R-Normal--8-80-75-75-P-46-ISO8859-1
+SIZE 8 75 75
+FONTBOUNDINGBOX 9 11 0 -2
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Helvetica"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 8
+POINT_SIZE 80
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 46
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 6
+X_HEIGHT 5
+FACE_NAME "Helvetica"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "Helvetica is a trademark of Linotype-Hell AG and/or its subsidiaries.  "
+_DEC_DEVICE_FONTNAMES "PS=Helvetica"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2-1, 04-Dec-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Helvetica"
+FONT "-Adobe-Helvetica-Medium-R-Normal--8-80-75-75-P-46-ISO8859-1"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 5
+DEFAULT_CHAR 32
+FONT_ASCENT 8
+FONT_DESCENT 2
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 6 1 0
+BITMAP
+80
+80
+80
+80
+00
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 3 1 3
+BITMAP
+a0
+a0
+a0
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+BITMAP
+50
+f8
+50
+f8
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 7 1 -1
+BITMAP
+20
+70
+80
+60
+10
+e0
+40
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 6 6 1 0
+BITMAP
+e8
+a8
+d0
+2c
+54
+5c
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+40
+a0
+48
+a8
+b0
+58
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 3 1 3
+BITMAP
+80
+80
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 7 1 -1
+BITMAP
+40
+80
+80
+80
+80
+80
+40
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 7 1 -1
+BITMAP
+80
+40
+40
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 3 1 2
+BITMAP
+40
+e0
+40
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 1 0
+BITMAP
+20
+20
+f8
+20
+20
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 3 0 -2
+BITMAP
+40
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 1 2 2
+BITMAP
+f0
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 1 1 0
+BITMAP
+80
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 7 1 -1
+BITMAP
+40
+40
+40
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 0
+BITMAP
+60
+90
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 2 6 2 0
+BITMAP
+40
+c0
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 0
+BITMAP
+60
+90
+10
+20
+40
+f0
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 6 2 0
+BITMAP
+c0
+20
+c0
+20
+20
+c0
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 0
+BITMAP
+20
+20
+60
+f0
+20
+20
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 6 2 0
+BITMAP
+e0
+80
+c0
+20
+20
+c0
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 0
+BITMAP
+70
+80
+e0
+90
+90
+60
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 0
+BITMAP
+f0
+10
+20
+40
+40
+40
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 0
+BITMAP
+60
+90
+60
+90
+90
+60
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 0
+BITMAP
+60
+90
+90
+70
+10
+60
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 4 1 0
+BITMAP
+80
+00
+00
+80
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 6 0 -2
+BITMAP
+40
+00
+00
+40
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+BITMAP
+20
+40
+80
+40
+20
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 3 1 1
+BITMAP
+e0
+00
+e0
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 2 0
+BITMAP
+80
+40
+20
+40
+80
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 2 0
+BITMAP
+c0
+20
+40
+00
+40
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 1080 0
+DWIDTH 9 0
+BBX 8 7 1 -1
+BITMAP
+3e
+41
+99
+a5
+9e
+80
+78
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+20
+20
+50
+70
+88
+88
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 2 0
+BITMAP
+e0
+90
+e0
+90
+90
+e0
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+70
+88
+80
+80
+88
+70
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+f0
+88
+88
+88
+88
+f0
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 2 0
+BITMAP
+f0
+80
+e0
+80
+80
+f0
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 2 0
+BITMAP
+f0
+80
+e0
+80
+80
+80
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+70
+80
+98
+88
+88
+70
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+88
+88
+f8
+88
+88
+88
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 6 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 1 0
+BITMAP
+20
+20
+20
+20
+a0
+40
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 2 0
+BITMAP
+90
+a0
+c0
+e0
+90
+90
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 6 2 0
+BITMAP
+80
+80
+80
+80
+80
+e0
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 5 6 2 0
+BITMAP
+88
+d8
+a8
+a8
+a8
+a8
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+88
+c8
+a8
+a8
+98
+88
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+70
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 2 0
+BITMAP
+e0
+90
+90
+e0
+80
+80
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 1 -2
+BITMAP
+70
+88
+88
+88
+88
+70
+20
+10
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 2 0
+BITMAP
+e0
+90
+90
+e0
+90
+90
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 2 0
+BITMAP
+70
+80
+e0
+10
+10
+e0
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 1 0
+BITMAP
+e0
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 2 0
+BITMAP
+90
+90
+90
+90
+a0
+40
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 7 6 1 0
+BITMAP
+92
+92
+92
+6c
+48
+48
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 2 0
+BITMAP
+90
+90
+60
+60
+90
+90
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+c8
+48
+48
+30
+20
+20
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 2 0
+BITMAP
+f0
+10
+20
+40
+80
+f0
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 7 1 -1
+BITMAP
+c0
+80
+80
+80
+80
+80
+c0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 7 0 -1
+BITMAP
+80
+80
+80
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 7 0 -1
+BITMAP
+c0
+40
+40
+40
+40
+40
+c0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 3 0 2
+BITMAP
+20
+50
+88
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 1 0 -1
+BITMAP
+f8
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 3 1 3
+BITMAP
+80
+80
+80
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 5 1 0
+BITMAP
+c0
+20
+e0
+a0
+d0
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 7 1 0
+BITMAP
+80
+80
+e0
+90
+90
+90
+e0
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 1 0
+BITMAP
+60
+80
+80
+80
+60
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 7 1 0
+BITMAP
+10
+10
+70
+90
+90
+90
+70
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 1 0
+BITMAP
+40
+a0
+e0
+80
+60
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 7 1 0
+BITMAP
+20
+40
+e0
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 -1
+BITMAP
+70
+90
+90
+70
+10
+60
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 7 1 0
+BITMAP
+80
+80
+e0
+90
+90
+90
+90
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 7 1 0
+BITMAP
+80
+00
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 9 0 -2
+BITMAP
+40
+00
+40
+40
+40
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 1 0
+BITMAP
+80
+80
+a0
+c0
+c0
+a0
+a0
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 7 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 1 0
+BITMAP
+f0
+a8
+a8
+a8
+a8
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 1 0
+BITMAP
+e0
+90
+90
+90
+90
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 1 0
+BITMAP
+60
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 -1
+BITMAP
+e0
+90
+90
+90
+e0
+80
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 -1
+BITMAP
+70
+90
+90
+90
+70
+10
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 5 1 0
+BITMAP
+a0
+c0
+80
+80
+80
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 1 0
+BITMAP
+60
+80
+60
+20
+c0
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 7 1 0
+BITMAP
+40
+40
+e0
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 1 0
+BITMAP
+a0
+a0
+a0
+a0
+60
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 1 0
+BITMAP
+90
+90
+90
+a0
+40
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 1 0
+BITMAP
+a8
+a8
+a8
+50
+50
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 1 0
+BITMAP
+90
+90
+60
+90
+90
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 6 1 -1
+BITMAP
+90
+90
+90
+60
+40
+80
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 1 0
+BITMAP
+e0
+20
+40
+80
+e0
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 7 0 -1
+BITMAP
+20
+40
+40
+c0
+40
+40
+20
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 7 1 -1
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 7 0 -1
+BITMAP
+80
+40
+40
+60
+40
+40
+80
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 2 1 2
+BITMAP
+48
+b0
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 7 1 -2
+BITMAP
+80
+00
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 7 1 -1
+BITMAP
+40
+40
+a0
+80
+a0
+40
+40
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 0
+BITMAP
+30
+40
+e0
+40
+40
+f0
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 5 5 0 0
+BITMAP
+88
+70
+50
+70
+88
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 1 0
+BITMAP
+88
+50
+f8
+20
+20
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 7 1 -1
+BITMAP
+80
+80
+80
+00
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 1 -2
+BITMAP
+70
+80
+60
+90
+60
+30
+10
+e0
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 4 1 0 5
+BITMAP
+90
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 6 7 1 -1
+BITMAP
+78
+84
+b4
+a4
+b4
+84
+78
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 5 0 1
+BITMAP
+c0
+20
+e0
+00
+e0
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 3 1 1
+BITMAP
+50
+a0
+50
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 3 1 1
+BITMAP
+f0
+10
+10
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 1 0 2
+BITMAP
+c0
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 6 7 1 -1
+BITMAP
+78
+84
+b4
+b4
+ac
+84
+78
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 1 0 5
+BITMAP
+e0
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 3 1 3
+BITMAP
+40
+a0
+40
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 1 0
+BITMAP
+20
+f0
+20
+00
+f0
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 4 1 2
+BITMAP
+80
+40
+80
+c0
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 4 0 2
+BITMAP
+e0
+60
+20
+c0
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 2 0 4
+BITMAP
+40
+80
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 1 -2
+BITMAP
+a0
+a0
+a0
+e0
+80
+80
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 8 0 -2
+BITMAP
+78
+d0
+d0
+d0
+50
+50
+50
+50
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 2 1 1
+BITMAP
+80
+80
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 2 0 -2
+BITMAP
+40
+80
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 4 0 2
+BITMAP
+40
+c0
+40
+40
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 5 0 1
+BITMAP
+e0
+a0
+e0
+00
+e0
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 3 1 1
+BITMAP
+a0
+50
+a0
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 7 7 0 -1
+BITMAP
+40
+c4
+48
+54
+2c
+5e
+04
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 7 7 0 -1
+BITMAP
+40
+c4
+48
+5c
+22
+44
+0e
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 7 7 0 -1
+BITMAP
+e0
+64
+28
+d4
+2c
+5e
+04
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 1 -1
+BITMAP
+20
+00
+20
+40
+90
+60
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+40
+20
+00
+20
+20
+50
+70
+88
+88
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+10
+20
+00
+20
+20
+50
+70
+88
+88
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+20
+50
+00
+20
+20
+50
+70
+88
+88
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+28
+50
+00
+20
+20
+50
+70
+88
+88
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 1 0
+BITMAP
+50
+00
+20
+20
+50
+70
+88
+88
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+20
+50
+20
+20
+20
+50
+70
+88
+88
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 7 6 1 0
+BITMAP
+3e
+30
+50
+7c
+90
+9e
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 1 -2
+BITMAP
+70
+88
+88
+80
+88
+70
+40
+80
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 9 2 0
+BITMAP
+40
+20
+00
+f0
+80
+e0
+80
+80
+f0
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 9 2 0
+BITMAP
+20
+40
+00
+f0
+80
+e0
+80
+80
+f0
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 9 2 0
+BITMAP
+40
+a0
+00
+f0
+80
+e0
+80
+80
+f0
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 8 2 0
+BITMAP
+a0
+00
+f0
+80
+e0
+80
+80
+f0
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 9 0 0
+BITMAP
+80
+40
+00
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 9 1 0
+BITMAP
+40
+80
+00
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 9 0 0
+BITMAP
+40
+a0
+00
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 8 0 0
+BITMAP
+a0
+00
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+70
+48
+e8
+48
+48
+70
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+28
+50
+00
+88
+c8
+a8
+a8
+98
+88
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+40
+20
+00
+70
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+10
+20
+00
+70
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+20
+50
+00
+70
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+28
+50
+00
+70
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 1 0
+BITMAP
+50
+00
+70
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 1 0
+BITMAP
+90
+60
+60
+90
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 1 -1
+BITMAP
+08
+78
+88
+98
+a8
+c8
+f0
+80
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+40
+20
+00
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+10
+20
+00
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+20
+50
+00
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 1 0
+BITMAP
+50
+00
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+08
+10
+00
+c8
+48
+48
+30
+20
+20
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+80
+f0
+88
+88
+f0
+80
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 7 2 -1
+BITMAP
+60
+90
+a0
+90
+90
+a0
+80
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 8 1 0
+BITMAP
+80
+40
+00
+c0
+20
+e0
+a0
+d0
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 8 1 0
+BITMAP
+20
+40
+00
+c0
+20
+e0
+a0
+d0
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 8 1 0
+BITMAP
+40
+a0
+00
+c0
+20
+e0
+a0
+d0
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 5 8 0 0
+BITMAP
+68
+b0
+00
+60
+10
+70
+50
+68
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 7 1 0
+BITMAP
+a0
+00
+c0
+20
+e0
+a0
+d0
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 8 1 0
+BITMAP
+40
+a0
+40
+c0
+20
+e0
+a0
+d0
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 1 0
+BITMAP
+d0
+28
+f8
+a0
+d8
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 1 -2
+BITMAP
+60
+80
+80
+80
+60
+40
+80
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 8 1 0
+BITMAP
+40
+20
+00
+40
+a0
+e0
+80
+60
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 8 1 0
+BITMAP
+20
+40
+00
+40
+a0
+e0
+80
+60
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 8 1 0
+BITMAP
+40
+a0
+00
+40
+a0
+e0
+80
+60
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 1 0
+BITMAP
+a0
+00
+40
+a0
+e0
+80
+60
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 8 0 0
+BITMAP
+80
+40
+00
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 8 1 0
+BITMAP
+40
+80
+00
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 8 0 0
+BITMAP
+40
+a0
+00
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 7 0 0
+BITMAP
+a0
+00
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 1 0
+BITMAP
+90
+60
+a0
+70
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 1 0
+BITMAP
+50
+a0
+00
+e0
+90
+90
+90
+90
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 1 0
+BITMAP
+40
+20
+00
+60
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 1 0
+BITMAP
+10
+20
+00
+60
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 1 0
+BITMAP
+40
+a0
+00
+60
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 1 0
+BITMAP
+50
+a0
+00
+60
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 7 1 0
+BITMAP
+90
+00
+60
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 1 0
+BITMAP
+20
+00
+f0
+00
+20
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 7 7 0 -1
+BITMAP
+02
+3c
+48
+58
+68
+70
+80
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 8 1 0
+BITMAP
+80
+40
+00
+a0
+a0
+a0
+a0
+60
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 8 1 0
+BITMAP
+20
+40
+00
+a0
+a0
+a0
+a0
+60
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 8 1 0
+BITMAP
+40
+a0
+00
+a0
+a0
+a0
+a0
+60
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 1 0
+BITMAP
+a0
+00
+a0
+a0
+a0
+a0
+60
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 9 1 -1
+BITMAP
+10
+20
+00
+90
+90
+90
+60
+40
+80
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 7 1 -1
+BITMAP
+80
+e0
+90
+90
+90
+e0
+80
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 8 1 -1
+BITMAP
+50
+00
+90
+90
+90
+60
+40
+80
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica8.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica8.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/helvetica8.h	(revision 15879)
@@ -0,0 +1,769 @@
+static unsigned char helvetica8_0_bits[] = {
+0x00};
+static unsigned char helvetica8_1_bits[] = {
+0x00};
+static unsigned char helvetica8_2_bits[] = {
+0x00};
+static unsigned char helvetica8_3_bits[] = {
+0x00};
+static unsigned char helvetica8_4_bits[] = {
+0x00};
+static unsigned char helvetica8_5_bits[] = {
+0x00};
+static unsigned char helvetica8_6_bits[] = {
+0x00};
+static unsigned char helvetica8_7_bits[] = {
+0x00};
+static unsigned char helvetica8_8_bits[] = {
+0x00};
+static unsigned char helvetica8_9_bits[] = {
+0x00};
+static unsigned char helvetica8_10_bits[] = {
+0x00};
+static unsigned char helvetica8_11_bits[] = {
+0x00};
+static unsigned char helvetica8_12_bits[] = {
+0x00};
+static unsigned char helvetica8_13_bits[] = {
+0x00};
+static unsigned char helvetica8_14_bits[] = {
+0x00};
+static unsigned char helvetica8_15_bits[] = {
+0x00};
+static unsigned char helvetica8_16_bits[] = {
+0x00};
+static unsigned char helvetica8_17_bits[] = {
+0x00};
+static unsigned char helvetica8_18_bits[] = {
+0x00};
+static unsigned char helvetica8_19_bits[] = {
+0x00};
+static unsigned char helvetica8_20_bits[] = {
+0x00};
+static unsigned char helvetica8_21_bits[] = {
+0x00};
+static unsigned char helvetica8_22_bits[] = {
+0x00};
+static unsigned char helvetica8_23_bits[] = {
+0x00};
+static unsigned char helvetica8_24_bits[] = {
+0x00};
+static unsigned char helvetica8_25_bits[] = {
+0x00};
+static unsigned char helvetica8_26_bits[] = {
+0x00};
+static unsigned char helvetica8_27_bits[] = {
+0x00};
+static unsigned char helvetica8_28_bits[] = {
+0x00};
+static unsigned char helvetica8_29_bits[] = {
+0x00};
+static unsigned char helvetica8_30_bits[] = {
+0x00};
+static unsigned char helvetica8_31_bits[] = {
+0x00};
+static unsigned char helvetica8_32_bits[] = {
+0x00};
+static unsigned char helvetica8_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x00, 0x01};
+static unsigned char helvetica8_34_bits[] = {
+0x05, 0x05, 0x05};
+static unsigned char helvetica8_35_bits[] = {
+0x0a, 0x1f, 0x0a, 0x1f, 0x0a};
+static unsigned char helvetica8_36_bits[] = {
+0x04, 0x0e, 0x01, 0x06, 0x08, 0x07, 0x02};
+static unsigned char helvetica8_37_bits[] = {
+0x17, 0x15, 0x0b, 0x34, 0x2a, 0x3a};
+static unsigned char helvetica8_38_bits[] = {
+0x02, 0x05, 0x12, 0x15, 0x0d, 0x1a};
+static unsigned char helvetica8_39_bits[] = {
+0x01, 0x01, 0x01};
+static unsigned char helvetica8_40_bits[] = {
+0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02};
+static unsigned char helvetica8_41_bits[] = {
+0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01};
+static unsigned char helvetica8_42_bits[] = {
+0x02, 0x07, 0x02};
+static unsigned char helvetica8_43_bits[] = {
+0x04, 0x04, 0x1f, 0x04, 0x04};
+static unsigned char helvetica8_44_bits[] = {
+0x02, 0x02, 0x01};
+static unsigned char helvetica8_45_bits[] = {
+0x0f};
+static unsigned char helvetica8_46_bits[] = {
+0x01};
+static unsigned char helvetica8_47_bits[] = {
+0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_48_bits[] = {
+0x06, 0x09, 0x09, 0x09, 0x09, 0x06};
+static unsigned char helvetica8_49_bits[] = {
+0x02, 0x03, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_50_bits[] = {
+0x06, 0x09, 0x08, 0x04, 0x02, 0x0f};
+static unsigned char helvetica8_51_bits[] = {
+0x03, 0x04, 0x03, 0x04, 0x04, 0x03};
+static unsigned char helvetica8_52_bits[] = {
+0x04, 0x04, 0x06, 0x0f, 0x04, 0x04};
+static unsigned char helvetica8_53_bits[] = {
+0x07, 0x01, 0x03, 0x04, 0x04, 0x03};
+static unsigned char helvetica8_54_bits[] = {
+0x0e, 0x01, 0x07, 0x09, 0x09, 0x06};
+static unsigned char helvetica8_55_bits[] = {
+0x0f, 0x08, 0x04, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_56_bits[] = {
+0x06, 0x09, 0x06, 0x09, 0x09, 0x06};
+static unsigned char helvetica8_57_bits[] = {
+0x06, 0x09, 0x09, 0x0e, 0x08, 0x06};
+static unsigned char helvetica8_58_bits[] = {
+0x01, 0x00, 0x00, 0x01};
+static unsigned char helvetica8_59_bits[] = {
+0x02, 0x00, 0x00, 0x02, 0x02, 0x01};
+static unsigned char helvetica8_60_bits[] = {
+0x04, 0x02, 0x01, 0x02, 0x04};
+static unsigned char helvetica8_61_bits[] = {
+0x07, 0x00, 0x07};
+static unsigned char helvetica8_62_bits[] = {
+0x01, 0x02, 0x04, 0x02, 0x01};
+static unsigned char helvetica8_63_bits[] = {
+0x03, 0x04, 0x02, 0x00, 0x02};
+static unsigned char helvetica8_64_bits[] = {
+0x7c, 0x82, 0x99, 0xa5, 0x79, 0x01, 0x1e};
+static unsigned char helvetica8_65_bits[] = {
+0x04, 0x04, 0x0a, 0x0e, 0x11, 0x11};
+static unsigned char helvetica8_66_bits[] = {
+0x07, 0x09, 0x07, 0x09, 0x09, 0x07};
+static unsigned char helvetica8_67_bits[] = {
+0x0e, 0x11, 0x01, 0x01, 0x11, 0x0e};
+static unsigned char helvetica8_68_bits[] = {
+0x0f, 0x11, 0x11, 0x11, 0x11, 0x0f};
+static unsigned char helvetica8_69_bits[] = {
+0x0f, 0x01, 0x07, 0x01, 0x01, 0x0f};
+static unsigned char helvetica8_70_bits[] = {
+0x0f, 0x01, 0x07, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_71_bits[] = {
+0x0e, 0x01, 0x19, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_72_bits[] = {
+0x11, 0x11, 0x1f, 0x11, 0x11, 0x11};
+static unsigned char helvetica8_73_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_74_bits[] = {
+0x04, 0x04, 0x04, 0x04, 0x05, 0x02};
+static unsigned char helvetica8_75_bits[] = {
+0x09, 0x05, 0x03, 0x07, 0x09, 0x09};
+static unsigned char helvetica8_76_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x07};
+static unsigned char helvetica8_77_bits[] = {
+0x11, 0x1b, 0x15, 0x15, 0x15, 0x15};
+static unsigned char helvetica8_78_bits[] = {
+0x11, 0x13, 0x15, 0x15, 0x19, 0x11};
+static unsigned char helvetica8_79_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_80_bits[] = {
+0x07, 0x09, 0x09, 0x07, 0x01, 0x01};
+static unsigned char helvetica8_81_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e, 0x04, 0x08};
+static unsigned char helvetica8_82_bits[] = {
+0x07, 0x09, 0x09, 0x07, 0x09, 0x09};
+static unsigned char helvetica8_83_bits[] = {
+0x0e, 0x01, 0x07, 0x08, 0x08, 0x07};
+static unsigned char helvetica8_84_bits[] = {
+0x07, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_85_bits[] = {
+0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_86_bits[] = {
+0x09, 0x09, 0x09, 0x09, 0x05, 0x02};
+static unsigned char helvetica8_87_bits[] = {
+0x49, 0x49, 0x49, 0x36, 0x12, 0x12};
+static unsigned char helvetica8_88_bits[] = {
+0x09, 0x09, 0x06, 0x06, 0x09, 0x09};
+static unsigned char helvetica8_89_bits[] = {
+0x13, 0x12, 0x12, 0x0c, 0x04, 0x04};
+static unsigned char helvetica8_90_bits[] = {
+0x0f, 0x08, 0x04, 0x02, 0x01, 0x0f};
+static unsigned char helvetica8_91_bits[] = {
+0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03};
+static unsigned char helvetica8_92_bits[] = {
+0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_93_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03};
+static unsigned char helvetica8_94_bits[] = {
+0x04, 0x0a, 0x11};
+static unsigned char helvetica8_95_bits[] = {
+0x1f};
+static unsigned char helvetica8_96_bits[] = {
+0x01, 0x01, 0x01};
+static unsigned char helvetica8_97_bits[] = {
+0x03, 0x04, 0x07, 0x05, 0x0b};
+static unsigned char helvetica8_98_bits[] = {
+0x01, 0x01, 0x07, 0x09, 0x09, 0x09, 0x07};
+static unsigned char helvetica8_99_bits[] = {
+0x06, 0x01, 0x01, 0x01, 0x06};
+static unsigned char helvetica8_100_bits[] = {
+0x08, 0x08, 0x0e, 0x09, 0x09, 0x09, 0x0e};
+static unsigned char helvetica8_101_bits[] = {
+0x02, 0x05, 0x07, 0x01, 0x06};
+static unsigned char helvetica8_102_bits[] = {
+0x04, 0x02, 0x07, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_103_bits[] = {
+0x0e, 0x09, 0x09, 0x0e, 0x08, 0x06};
+static unsigned char helvetica8_104_bits[] = {
+0x01, 0x01, 0x07, 0x09, 0x09, 0x09, 0x09};
+static unsigned char helvetica8_105_bits[] = {
+0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_106_bits[] = {
+0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01};
+static unsigned char helvetica8_107_bits[] = {
+0x01, 0x01, 0x05, 0x03, 0x03, 0x05, 0x05};
+static unsigned char helvetica8_108_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_109_bits[] = {
+0x0f, 0x15, 0x15, 0x15, 0x15};
+static unsigned char helvetica8_110_bits[] = {
+0x07, 0x09, 0x09, 0x09, 0x09};
+static unsigned char helvetica8_111_bits[] = {
+0x06, 0x09, 0x09, 0x09, 0x06};
+static unsigned char helvetica8_112_bits[] = {
+0x07, 0x09, 0x09, 0x09, 0x07, 0x01};
+static unsigned char helvetica8_113_bits[] = {
+0x0e, 0x09, 0x09, 0x09, 0x0e, 0x08};
+static unsigned char helvetica8_114_bits[] = {
+0x05, 0x03, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_115_bits[] = {
+0x06, 0x01, 0x06, 0x04, 0x03};
+static unsigned char helvetica8_116_bits[] = {
+0x02, 0x02, 0x07, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_117_bits[] = {
+0x05, 0x05, 0x05, 0x05, 0x06};
+static unsigned char helvetica8_118_bits[] = {
+0x09, 0x09, 0x09, 0x05, 0x02};
+static unsigned char helvetica8_119_bits[] = {
+0x15, 0x15, 0x15, 0x0a, 0x0a};
+static unsigned char helvetica8_120_bits[] = {
+0x09, 0x09, 0x06, 0x09, 0x09};
+static unsigned char helvetica8_121_bits[] = {
+0x09, 0x09, 0x09, 0x06, 0x02, 0x01};
+static unsigned char helvetica8_122_bits[] = {
+0x07, 0x04, 0x02, 0x01, 0x07};
+static unsigned char helvetica8_123_bits[] = {
+0x04, 0x02, 0x02, 0x03, 0x02, 0x02, 0x04};
+static unsigned char helvetica8_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_125_bits[] = {
+0x01, 0x02, 0x02, 0x06, 0x02, 0x02, 0x01};
+static unsigned char helvetica8_126_bits[] = {
+0x12, 0x0d};
+static unsigned char helvetica8_127_bits[] = {
+0x00};
+static unsigned char helvetica8_128_bits[] = {
+0x00};
+static unsigned char helvetica8_129_bits[] = {
+0x00};
+static unsigned char helvetica8_130_bits[] = {
+0x00};
+static unsigned char helvetica8_131_bits[] = {
+0x00};
+static unsigned char helvetica8_132_bits[] = {
+0x00};
+static unsigned char helvetica8_133_bits[] = {
+0x00};
+static unsigned char helvetica8_134_bits[] = {
+0x00};
+static unsigned char helvetica8_135_bits[] = {
+0x00};
+static unsigned char helvetica8_136_bits[] = {
+0x00};
+static unsigned char helvetica8_137_bits[] = {
+0x00};
+static unsigned char helvetica8_138_bits[] = {
+0x00};
+static unsigned char helvetica8_139_bits[] = {
+0x00};
+static unsigned char helvetica8_140_bits[] = {
+0x00};
+static unsigned char helvetica8_141_bits[] = {
+0x00};
+static unsigned char helvetica8_142_bits[] = {
+0x00};
+static unsigned char helvetica8_143_bits[] = {
+0x00};
+static unsigned char helvetica8_144_bits[] = {
+0x00};
+static unsigned char helvetica8_145_bits[] = {
+0x00};
+static unsigned char helvetica8_146_bits[] = {
+0x00};
+static unsigned char helvetica8_147_bits[] = {
+0x00};
+static unsigned char helvetica8_148_bits[] = {
+0x00};
+static unsigned char helvetica8_149_bits[] = {
+0x00};
+static unsigned char helvetica8_150_bits[] = {
+0x00};
+static unsigned char helvetica8_151_bits[] = {
+0x00};
+static unsigned char helvetica8_152_bits[] = {
+0x00};
+static unsigned char helvetica8_153_bits[] = {
+0x00};
+static unsigned char helvetica8_154_bits[] = {
+0x00};
+static unsigned char helvetica8_155_bits[] = {
+0x00};
+static unsigned char helvetica8_156_bits[] = {
+0x00};
+static unsigned char helvetica8_157_bits[] = {
+0x00};
+static unsigned char helvetica8_158_bits[] = {
+0x00};
+static unsigned char helvetica8_159_bits[] = {
+0x00};
+static unsigned char helvetica8_160_bits[] = {
+0x00};
+static unsigned char helvetica8_161_bits[] = {
+0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_162_bits[] = {
+0x02, 0x02, 0x05, 0x01, 0x05, 0x02, 0x02};
+static unsigned char helvetica8_163_bits[] = {
+0x0c, 0x02, 0x07, 0x02, 0x02, 0x0f};
+static unsigned char helvetica8_164_bits[] = {
+0x11, 0x0e, 0x0a, 0x0e, 0x11};
+static unsigned char helvetica8_165_bits[] = {
+0x11, 0x0a, 0x1f, 0x04, 0x04};
+static unsigned char helvetica8_166_bits[] = {
+0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_167_bits[] = {
+0x0e, 0x01, 0x06, 0x09, 0x06, 0x0c, 0x08, 0x07};
+static unsigned char helvetica8_168_bits[] = {
+0x09};
+static unsigned char helvetica8_169_bits[] = {
+0x1e, 0x21, 0x2d, 0x25, 0x2d, 0x21, 0x1e};
+static unsigned char helvetica8_170_bits[] = {
+0x03, 0x04, 0x07, 0x00, 0x07};
+static unsigned char helvetica8_171_bits[] = {
+0x0a, 0x05, 0x0a};
+static unsigned char helvetica8_172_bits[] = {
+0x0f, 0x08, 0x08};
+static unsigned char helvetica8_173_bits[] = {
+0x03};
+static unsigned char helvetica8_174_bits[] = {
+0x1e, 0x21, 0x2d, 0x2d, 0x35, 0x21, 0x1e};
+static unsigned char helvetica8_175_bits[] = {
+0x07};
+static unsigned char helvetica8_176_bits[] = {
+0x02, 0x05, 0x02};
+static unsigned char helvetica8_177_bits[] = {
+0x04, 0x0f, 0x04, 0x00, 0x0f};
+static unsigned char helvetica8_178_bits[] = {
+0x01, 0x02, 0x01, 0x03};
+static unsigned char helvetica8_179_bits[] = {
+0x07, 0x06, 0x04, 0x03};
+static unsigned char helvetica8_180_bits[] = {
+0x02, 0x01};
+static unsigned char helvetica8_181_bits[] = {
+0x05, 0x05, 0x05, 0x07, 0x01, 0x01};
+static unsigned char helvetica8_182_bits[] = {
+0x1e, 0x0b, 0x0b, 0x0b, 0x0a, 0x0a, 0x0a, 0x0a};
+static unsigned char helvetica8_183_bits[] = {
+0x01, 0x01};
+static unsigned char helvetica8_184_bits[] = {
+0x02, 0x01};
+static unsigned char helvetica8_185_bits[] = {
+0x02, 0x03, 0x02, 0x02};
+static unsigned char helvetica8_186_bits[] = {
+0x07, 0x05, 0x07, 0x00, 0x07};
+static unsigned char helvetica8_187_bits[] = {
+0x05, 0x0a, 0x05};
+static unsigned char helvetica8_188_bits[] = {
+0x02, 0x23, 0x12, 0x2a, 0x34, 0x7a, 0x20};
+static unsigned char helvetica8_189_bits[] = {
+0x02, 0x23, 0x12, 0x3a, 0x44, 0x22, 0x70};
+static unsigned char helvetica8_190_bits[] = {
+0x07, 0x26, 0x14, 0x2b, 0x34, 0x7a, 0x20};
+static unsigned char helvetica8_191_bits[] = {
+0x04, 0x00, 0x04, 0x02, 0x09, 0x06};
+static unsigned char helvetica8_192_bits[] = {
+0x02, 0x04, 0x00, 0x04, 0x04, 0x0a, 0x0e, 0x11, 0x11};
+static unsigned char helvetica8_193_bits[] = {
+0x08, 0x04, 0x00, 0x04, 0x04, 0x0a, 0x0e, 0x11, 0x11};
+static unsigned char helvetica8_194_bits[] = {
+0x04, 0x0a, 0x00, 0x04, 0x04, 0x0a, 0x0e, 0x11, 0x11};
+static unsigned char helvetica8_195_bits[] = {
+0x14, 0x0a, 0x00, 0x04, 0x04, 0x0a, 0x0e, 0x11, 0x11};
+static unsigned char helvetica8_196_bits[] = {
+0x0a, 0x00, 0x04, 0x04, 0x0a, 0x0e, 0x11, 0x11};
+static unsigned char helvetica8_197_bits[] = {
+0x04, 0x0a, 0x04, 0x04, 0x04, 0x0a, 0x0e, 0x11, 0x11};
+static unsigned char helvetica8_198_bits[] = {
+0x7c, 0x0c, 0x0a, 0x3e, 0x09, 0x79};
+static unsigned char helvetica8_199_bits[] = {
+0x0e, 0x11, 0x11, 0x01, 0x11, 0x0e, 0x02, 0x01};
+static unsigned char helvetica8_200_bits[] = {
+0x02, 0x04, 0x00, 0x0f, 0x01, 0x07, 0x01, 0x01, 0x0f};
+static unsigned char helvetica8_201_bits[] = {
+0x04, 0x02, 0x00, 0x0f, 0x01, 0x07, 0x01, 0x01, 0x0f};
+static unsigned char helvetica8_202_bits[] = {
+0x02, 0x05, 0x00, 0x0f, 0x01, 0x07, 0x01, 0x01, 0x0f};
+static unsigned char helvetica8_203_bits[] = {
+0x05, 0x00, 0x0f, 0x01, 0x07, 0x01, 0x01, 0x0f};
+static unsigned char helvetica8_204_bits[] = {
+0x01, 0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_205_bits[] = {
+0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_206_bits[] = {
+0x02, 0x05, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_207_bits[] = {
+0x05, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_208_bits[] = {
+0x0e, 0x12, 0x17, 0x12, 0x12, 0x0e};
+static unsigned char helvetica8_209_bits[] = {
+0x14, 0x0a, 0x00, 0x11, 0x13, 0x15, 0x15, 0x19, 0x11};
+static unsigned char helvetica8_210_bits[] = {
+0x02, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_211_bits[] = {
+0x08, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_212_bits[] = {
+0x04, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_213_bits[] = {
+0x14, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_214_bits[] = {
+0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_215_bits[] = {
+0x09, 0x06, 0x06, 0x09};
+static unsigned char helvetica8_216_bits[] = {
+0x10, 0x1e, 0x11, 0x19, 0x15, 0x13, 0x0f, 0x01};
+static unsigned char helvetica8_217_bits[] = {
+0x02, 0x04, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_218_bits[] = {
+0x08, 0x04, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_219_bits[] = {
+0x04, 0x0a, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_220_bits[] = {
+0x0a, 0x00, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char helvetica8_221_bits[] = {
+0x10, 0x08, 0x00, 0x13, 0x12, 0x12, 0x0c, 0x04, 0x04};
+static unsigned char helvetica8_222_bits[] = {
+0x01, 0x0f, 0x11, 0x11, 0x0f, 0x01};
+static unsigned char helvetica8_223_bits[] = {
+0x06, 0x09, 0x05, 0x09, 0x09, 0x05, 0x01};
+static unsigned char helvetica8_224_bits[] = {
+0x01, 0x02, 0x00, 0x03, 0x04, 0x07, 0x05, 0x0b};
+static unsigned char helvetica8_225_bits[] = {
+0x04, 0x02, 0x00, 0x03, 0x04, 0x07, 0x05, 0x0b};
+static unsigned char helvetica8_226_bits[] = {
+0x02, 0x05, 0x00, 0x03, 0x04, 0x07, 0x05, 0x0b};
+static unsigned char helvetica8_227_bits[] = {
+0x16, 0x0d, 0x00, 0x06, 0x08, 0x0e, 0x0a, 0x16};
+static unsigned char helvetica8_228_bits[] = {
+0x05, 0x00, 0x03, 0x04, 0x07, 0x05, 0x0b};
+static unsigned char helvetica8_229_bits[] = {
+0x02, 0x05, 0x02, 0x03, 0x04, 0x07, 0x05, 0x0b};
+static unsigned char helvetica8_230_bits[] = {
+0x0b, 0x14, 0x1f, 0x05, 0x1b};
+static unsigned char helvetica8_231_bits[] = {
+0x06, 0x01, 0x01, 0x01, 0x06, 0x02, 0x01};
+static unsigned char helvetica8_232_bits[] = {
+0x02, 0x04, 0x00, 0x02, 0x05, 0x07, 0x01, 0x06};
+static unsigned char helvetica8_233_bits[] = {
+0x04, 0x02, 0x00, 0x02, 0x05, 0x07, 0x01, 0x06};
+static unsigned char helvetica8_234_bits[] = {
+0x02, 0x05, 0x00, 0x02, 0x05, 0x07, 0x01, 0x06};
+static unsigned char helvetica8_235_bits[] = {
+0x05, 0x00, 0x02, 0x05, 0x07, 0x01, 0x06};
+static unsigned char helvetica8_236_bits[] = {
+0x01, 0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_237_bits[] = {
+0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char helvetica8_238_bits[] = {
+0x02, 0x05, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_239_bits[] = {
+0x05, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char helvetica8_240_bits[] = {
+0x09, 0x06, 0x05, 0x0e, 0x09, 0x09, 0x09, 0x06};
+static unsigned char helvetica8_241_bits[] = {
+0x0a, 0x05, 0x00, 0x07, 0x09, 0x09, 0x09, 0x09};
+static unsigned char helvetica8_242_bits[] = {
+0x02, 0x04, 0x00, 0x06, 0x09, 0x09, 0x09, 0x06};
+static unsigned char helvetica8_243_bits[] = {
+0x08, 0x04, 0x00, 0x06, 0x09, 0x09, 0x09, 0x06};
+static unsigned char helvetica8_244_bits[] = {
+0x02, 0x05, 0x00, 0x06, 0x09, 0x09, 0x09, 0x06};
+static unsigned char helvetica8_245_bits[] = {
+0x0a, 0x05, 0x00, 0x06, 0x09, 0x09, 0x09, 0x06};
+static unsigned char helvetica8_246_bits[] = {
+0x09, 0x00, 0x06, 0x09, 0x09, 0x09, 0x06};
+static unsigned char helvetica8_247_bits[] = {
+0x04, 0x00, 0x0f, 0x00, 0x04};
+static unsigned char helvetica8_248_bits[] = {
+0x40, 0x3c, 0x12, 0x1a, 0x16, 0x0e, 0x01};
+static unsigned char helvetica8_249_bits[] = {
+0x01, 0x02, 0x00, 0x05, 0x05, 0x05, 0x05, 0x06};
+static unsigned char helvetica8_250_bits[] = {
+0x04, 0x02, 0x00, 0x05, 0x05, 0x05, 0x05, 0x06};
+static unsigned char helvetica8_251_bits[] = {
+0x02, 0x05, 0x00, 0x05, 0x05, 0x05, 0x05, 0x06};
+static unsigned char helvetica8_252_bits[] = {
+0x05, 0x00, 0x05, 0x05, 0x05, 0x05, 0x06};
+static unsigned char helvetica8_253_bits[] = {
+0x08, 0x04, 0x00, 0x09, 0x09, 0x09, 0x06, 0x02, 0x01};
+static unsigned char helvetica8_254_bits[] = {
+0x01, 0x07, 0x09, 0x09, 0x09, 0x07, 0x01};
+static unsigned char helvetica8_255_bits[] = {
+0x0a, 0x00, 0x09, 0x09, 0x09, 0x06, 0x02, 0x01};
+static RotFont helvetica8font[] = {
+{5, 1, 1, helvetica8_0_bits},
+{5, 1, 1, helvetica8_1_bits},
+{5, 1, 1, helvetica8_2_bits},
+{5, 1, 1, helvetica8_3_bits},
+{5, 1, 1, helvetica8_4_bits},
+{5, 1, 1, helvetica8_5_bits},
+{5, 1, 1, helvetica8_6_bits},
+{5, 1, 1, helvetica8_7_bits},
+{5, 1, 1, helvetica8_8_bits},
+{5, 1, 1, helvetica8_9_bits},
+{5, 1, 1, helvetica8_10_bits},
+{5, 1, 1, helvetica8_11_bits},
+{5, 1, 1, helvetica8_12_bits},
+{5, 1, 1, helvetica8_13_bits},
+{5, 1, 1, helvetica8_14_bits},
+{5, 1, 1, helvetica8_15_bits},
+{5, 1, 1, helvetica8_16_bits},
+{5, 1, 1, helvetica8_17_bits},
+{5, 1, 1, helvetica8_18_bits},
+{5, 1, 1, helvetica8_19_bits},
+{5, 1, 1, helvetica8_20_bits},
+{5, 1, 1, helvetica8_21_bits},
+{5, 1, 1, helvetica8_22_bits},
+{5, 1, 1, helvetica8_23_bits},
+{5, 1, 1, helvetica8_24_bits},
+{5, 1, 1, helvetica8_25_bits},
+{5, 1, 1, helvetica8_26_bits},
+{5, 1, 1, helvetica8_27_bits},
+{5, 1, 1, helvetica8_28_bits},
+{5, 1, 1, helvetica8_29_bits},
+{5, 1, 1, helvetica8_30_bits},
+{5, 1, 1, helvetica8_31_bits},
+{4, 1, 1, helvetica8_32_bits},
+{1, 6, 6, helvetica8_33_bits},
+{3, 3, 6, helvetica8_34_bits},
+{5, 5, 5, helvetica8_35_bits},
+{4, 7, 6, helvetica8_36_bits},
+{6, 6, 6, helvetica8_37_bits},
+{5, 6, 6, helvetica8_38_bits},
+{1, 3, 6, helvetica8_39_bits},
+{2, 7, 6, helvetica8_40_bits},
+{2, 7, 6, helvetica8_41_bits},
+{3, 3, 5, helvetica8_42_bits},
+{5, 5, 5, helvetica8_43_bits},
+{2, 3, 1, helvetica8_44_bits},
+{4, 1, 3, helvetica8_45_bits},
+{1, 1, 1, helvetica8_46_bits},
+{2, 7, 6, helvetica8_47_bits},
+{4, 6, 6, helvetica8_48_bits},
+{2, 6, 6, helvetica8_49_bits},
+{4, 6, 6, helvetica8_50_bits},
+{3, 6, 6, helvetica8_51_bits},
+{4, 6, 6, helvetica8_52_bits},
+{3, 6, 6, helvetica8_53_bits},
+{4, 6, 6, helvetica8_54_bits},
+{4, 6, 6, helvetica8_55_bits},
+{4, 6, 6, helvetica8_56_bits},
+{4, 6, 6, helvetica8_57_bits},
+{1, 4, 4, helvetica8_58_bits},
+{2, 6, 4, helvetica8_59_bits},
+{3, 5, 5, helvetica8_60_bits},
+{3, 3, 4, helvetica8_61_bits},
+{3, 5, 5, helvetica8_62_bits},
+{3, 5, 5, helvetica8_63_bits},
+{8, 7, 6, helvetica8_64_bits},
+{5, 6, 6, helvetica8_65_bits},
+{4, 6, 6, helvetica8_66_bits},
+{5, 6, 6, helvetica8_67_bits},
+{5, 6, 6, helvetica8_68_bits},
+{4, 6, 6, helvetica8_69_bits},
+{4, 6, 6, helvetica8_70_bits},
+{5, 6, 6, helvetica8_71_bits},
+{5, 6, 6, helvetica8_72_bits},
+{1, 6, 6, helvetica8_73_bits},
+{3, 6, 6, helvetica8_74_bits},
+{4, 6, 6, helvetica8_75_bits},
+{3, 6, 6, helvetica8_76_bits},
+{5, 6, 6, helvetica8_77_bits},
+{5, 6, 6, helvetica8_78_bits},
+{5, 6, 6, helvetica8_79_bits},
+{4, 6, 6, helvetica8_80_bits},
+{5, 8, 6, helvetica8_81_bits},
+{4, 6, 6, helvetica8_82_bits},
+{4, 6, 6, helvetica8_83_bits},
+{3, 6, 6, helvetica8_84_bits},
+{5, 6, 6, helvetica8_85_bits},
+{4, 6, 6, helvetica8_86_bits},
+{7, 6, 6, helvetica8_87_bits},
+{4, 6, 6, helvetica8_88_bits},
+{5, 6, 6, helvetica8_89_bits},
+{4, 6, 6, helvetica8_90_bits},
+{2, 7, 6, helvetica8_91_bits},
+{2, 7, 6, helvetica8_92_bits},
+{2, 7, 6, helvetica8_93_bits},
+{5, 3, 5, helvetica8_94_bits},
+{5, 1, 0, helvetica8_95_bits},
+{1, 3, 6, helvetica8_96_bits},
+{4, 5, 5, helvetica8_97_bits},
+{4, 7, 7, helvetica8_98_bits},
+{3, 5, 5, helvetica8_99_bits},
+{4, 7, 7, helvetica8_100_bits},
+{3, 5, 5, helvetica8_101_bits},
+{3, 7, 7, helvetica8_102_bits},
+{4, 6, 5, helvetica8_103_bits},
+{4, 7, 7, helvetica8_104_bits},
+{1, 7, 7, helvetica8_105_bits},
+{2, 9, 7, helvetica8_106_bits},
+{3, 7, 7, helvetica8_107_bits},
+{1, 7, 7, helvetica8_108_bits},
+{5, 5, 5, helvetica8_109_bits},
+{4, 5, 5, helvetica8_110_bits},
+{4, 5, 5, helvetica8_111_bits},
+{4, 6, 5, helvetica8_112_bits},
+{4, 6, 5, helvetica8_113_bits},
+{3, 5, 5, helvetica8_114_bits},
+{3, 5, 5, helvetica8_115_bits},
+{3, 7, 7, helvetica8_116_bits},
+{3, 5, 5, helvetica8_117_bits},
+{4, 5, 5, helvetica8_118_bits},
+{5, 5, 5, helvetica8_119_bits},
+{4, 5, 5, helvetica8_120_bits},
+{4, 6, 5, helvetica8_121_bits},
+{3, 5, 5, helvetica8_122_bits},
+{3, 7, 6, helvetica8_123_bits},
+{1, 7, 6, helvetica8_124_bits},
+{3, 7, 6, helvetica8_125_bits},
+{5, 2, 4, helvetica8_126_bits},
+{5, 1, 1, helvetica8_127_bits},
+{5, 1, 1, helvetica8_128_bits},
+{5, 1, 1, helvetica8_129_bits},
+{5, 1, 1, helvetica8_130_bits},
+{5, 1, 1, helvetica8_131_bits},
+{5, 1, 1, helvetica8_132_bits},
+{5, 1, 1, helvetica8_133_bits},
+{5, 1, 1, helvetica8_134_bits},
+{5, 1, 1, helvetica8_135_bits},
+{5, 1, 1, helvetica8_136_bits},
+{5, 1, 1, helvetica8_137_bits},
+{5, 1, 1, helvetica8_138_bits},
+{5, 1, 1, helvetica8_139_bits},
+{5, 1, 1, helvetica8_140_bits},
+{5, 1, 1, helvetica8_141_bits},
+{5, 1, 1, helvetica8_142_bits},
+{5, 1, 1, helvetica8_143_bits},
+{5, 1, 1, helvetica8_144_bits},
+{5, 1, 1, helvetica8_145_bits},
+{5, 1, 1, helvetica8_146_bits},
+{5, 1, 1, helvetica8_147_bits},
+{5, 1, 1, helvetica8_148_bits},
+{5, 1, 1, helvetica8_149_bits},
+{5, 1, 1, helvetica8_150_bits},
+{5, 1, 1, helvetica8_151_bits},
+{5, 1, 1, helvetica8_152_bits},
+{5, 1, 1, helvetica8_153_bits},
+{5, 1, 1, helvetica8_154_bits},
+{5, 1, 1, helvetica8_155_bits},
+{5, 1, 1, helvetica8_156_bits},
+{5, 1, 1, helvetica8_157_bits},
+{5, 1, 1, helvetica8_158_bits},
+{5, 1, 1, helvetica8_159_bits},
+{1, 1, 1, helvetica8_160_bits},
+{1, 7, 5, helvetica8_161_bits},
+{3, 7, 6, helvetica8_162_bits},
+{4, 6, 6, helvetica8_163_bits},
+{5, 5, 5, helvetica8_164_bits},
+{5, 5, 5, helvetica8_165_bits},
+{1, 7, 6, helvetica8_166_bits},
+{4, 8, 6, helvetica8_167_bits},
+{4, 1, 6, helvetica8_168_bits},
+{6, 7, 6, helvetica8_169_bits},
+{3, 5, 6, helvetica8_170_bits},
+{4, 3, 4, helvetica8_171_bits},
+{4, 3, 4, helvetica8_172_bits},
+{2, 1, 3, helvetica8_173_bits},
+{6, 7, 6, helvetica8_174_bits},
+{3, 1, 6, helvetica8_175_bits},
+{3, 3, 6, helvetica8_176_bits},
+{4, 5, 5, helvetica8_177_bits},
+{2, 4, 6, helvetica8_178_bits},
+{3, 4, 6, helvetica8_179_bits},
+{2, 2, 6, helvetica8_180_bits},
+{3, 6, 4, helvetica8_181_bits},
+{5, 8, 6, helvetica8_182_bits},
+{1, 2, 3, helvetica8_183_bits},
+{2, 2, 0, helvetica8_184_bits},
+{2, 4, 6, helvetica8_185_bits},
+{3, 5, 6, helvetica8_186_bits},
+{4, 3, 4, helvetica8_187_bits},
+{7, 7, 6, helvetica8_188_bits},
+{7, 7, 6, helvetica8_189_bits},
+{7, 7, 6, helvetica8_190_bits},
+{4, 6, 5, helvetica8_191_bits},
+{5, 9, 9, helvetica8_192_bits},
+{5, 9, 9, helvetica8_193_bits},
+{5, 9, 9, helvetica8_194_bits},
+{5, 9, 9, helvetica8_195_bits},
+{5, 8, 8, helvetica8_196_bits},
+{5, 9, 9, helvetica8_197_bits},
+{7, 6, 6, helvetica8_198_bits},
+{5, 8, 6, helvetica8_199_bits},
+{4, 9, 9, helvetica8_200_bits},
+{4, 9, 9, helvetica8_201_bits},
+{4, 9, 9, helvetica8_202_bits},
+{4, 8, 8, helvetica8_203_bits},
+{2, 9, 9, helvetica8_204_bits},
+{2, 9, 9, helvetica8_205_bits},
+{3, 9, 9, helvetica8_206_bits},
+{3, 8, 8, helvetica8_207_bits},
+{5, 6, 6, helvetica8_208_bits},
+{5, 9, 9, helvetica8_209_bits},
+{5, 9, 9, helvetica8_210_bits},
+{5, 9, 9, helvetica8_211_bits},
+{5, 9, 9, helvetica8_212_bits},
+{5, 9, 9, helvetica8_213_bits},
+{5, 8, 8, helvetica8_214_bits},
+{4, 4, 4, helvetica8_215_bits},
+{5, 8, 7, helvetica8_216_bits},
+{5, 9, 9, helvetica8_217_bits},
+{5, 9, 9, helvetica8_218_bits},
+{5, 9, 9, helvetica8_219_bits},
+{5, 8, 8, helvetica8_220_bits},
+{5, 9, 9, helvetica8_221_bits},
+{5, 6, 6, helvetica8_222_bits},
+{4, 7, 6, helvetica8_223_bits},
+{4, 8, 8, helvetica8_224_bits},
+{4, 8, 8, helvetica8_225_bits},
+{4, 8, 8, helvetica8_226_bits},
+{5, 8, 8, helvetica8_227_bits},
+{4, 7, 7, helvetica8_228_bits},
+{4, 8, 8, helvetica8_229_bits},
+{5, 5, 5, helvetica8_230_bits},
+{3, 7, 5, helvetica8_231_bits},
+{3, 8, 8, helvetica8_232_bits},
+{3, 8, 8, helvetica8_233_bits},
+{3, 8, 8, helvetica8_234_bits},
+{3, 7, 7, helvetica8_235_bits},
+{2, 8, 8, helvetica8_236_bits},
+{2, 8, 8, helvetica8_237_bits},
+{3, 8, 8, helvetica8_238_bits},
+{3, 7, 7, helvetica8_239_bits},
+{4, 8, 8, helvetica8_240_bits},
+{4, 8, 8, helvetica8_241_bits},
+{4, 8, 8, helvetica8_242_bits},
+{4, 8, 8, helvetica8_243_bits},
+{4, 8, 8, helvetica8_244_bits},
+{4, 8, 8, helvetica8_245_bits},
+{4, 7, 7, helvetica8_246_bits},
+{4, 5, 5, helvetica8_247_bits},
+{7, 7, 6, helvetica8_248_bits},
+{3, 8, 8, helvetica8_249_bits},
+{3, 8, 8, helvetica8_250_bits},
+{3, 8, 8, helvetica8_251_bits},
+{3, 7, 7, helvetica8_252_bits},
+{4, 9, 8, helvetica8_253_bits},
+{4, 7, 6, helvetica8_254_bits},
+{4, 8, 7, helvetica8_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol12.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol12.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol12.bdf	(revision 15879)
@@ -0,0 +1,3022 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Symbol-Medium-R-Normal--12-120-75-75-P-74-Adobe-FontSpecific
+SIZE 12 75 75
+FONTBOUNDINGBOX 14 16 -1 -4
+STARTPROPERTIES 31
+FOUNDRY "Adobe"
+FAMILY_NAME "Symbol"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 12
+POINT_SIZE 120
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 74
+CHARSET_REGISTRY "Adobe"
+CHARSET_ENCODING "FontSpecific"
+CAP_HEIGHT 9
+X_HEIGHT 6
+FACE_NAME "Symbol"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "No mark"
+_DEC_DEVICE_FONTNAMES "PS=Symbol"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2-1, 18-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+FULL_NAME "Symbol"
+FONT "-Adobe-Symbol-Medium-R-Normal--12-120-75-75-P-74-Adobe-FontSpecific"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 8
+DEFAULT_CHAR 32
+FONT_ASCENT 11
+FONT_DESCENT 3
+ENDPROPERTIES
+CHARS 188
+STARTCHAR space
+ENCODING 32
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 1 9 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+00
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+8080
+4100
+4100
+3e00
+2200
+1400
+1400
+0800
+0800
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 0 0
+BITMAP
+28
+28
+28
+fc
+50
+f8
+50
+50
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+f8
+08
+08
+08
+f8
+08
+08
+08
+f8
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+7900
+9700
+9200
+6400
+0800
+1300
+1480
+2480
+6300
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 1 0
+BITMAP
+3000
+4800
+4800
+3700
+7200
+9a00
+8c00
+8c80
+7300
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 6 1 0
+BITMAP
+e0
+10
+f0
+10
+10
+e0
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 12 1 -3
+BITMAP
+20
+40
+40
+80
+80
+80
+80
+80
+80
+40
+40
+20
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 12 0 -3
+BITMAP
+80
+40
+40
+20
+20
+20
+20
+20
+20
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 5 0 2
+BITMAP
+20
+a8
+70
+a8
+20
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+20
+20
+f8
+20
+20
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 3 0 -2
+BITMAP
+40
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 1 1 3
+BITMAP
+f8
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 1 1 0
+BITMAP
+80
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 9 0 0
+BITMAP
+20
+20
+20
+40
+40
+40
+80
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+88
+88
+88
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 3 9 1 0
+BITMAP
+40
+c0
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+88
+88
+08
+10
+20
+40
+88
+f8
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+88
+88
+08
+30
+08
+08
+88
+70
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 0
+BITMAP
+18
+28
+28
+48
+48
+88
+fc
+08
+08
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+78
+40
+80
+f0
+18
+08
+08
+88
+f0
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+38
+40
+80
+b0
+c8
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+f8
+88
+10
+10
+20
+20
+40
+40
+40
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+88
+88
+c8
+70
+98
+88
+88
+70
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+88
+88
+88
+78
+10
+10
+20
+40
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 6 2 0
+BITMAP
+80
+00
+00
+00
+00
+80
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 8 0 -2
+BITMAP
+40
+00
+00
+00
+00
+40
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 0 1
+BITMAP
+0c
+30
+c0
+30
+0c
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 3 1 2
+BITMAP
+f8
+00
+f8
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 0 1
+BITMAP
+c0
+30
+0c
+30
+c0
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+88
+88
+08
+10
+20
+20
+00
+20
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 6 1 0
+BITMAP
+68
+b0
+00
+f8
+00
+f8
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+0800
+1c00
+1400
+1400
+2200
+3e00
+2200
+4100
+e380
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+fc
+46
+42
+46
+7c
+46
+42
+46
+fc
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+e7
+42
+24
+18
+18
+24
+24
+42
+e7
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+10
+10
+28
+28
+44
+44
+44
+82
+fe
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+fe
+42
+40
+44
+7c
+44
+40
+42
+fe
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+1c00
+0800
+7f00
+c980
+8880
+c980
+7f00
+0800
+1c00
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+fe
+42
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+e7
+42
+42
+42
+7e
+42
+42
+42
+e7
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 9 0 0
+BITMAP
+e0
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 8 9 0 0
+BITMAP
+04
+0a
+0a
+66
+a3
+22
+22
+26
+1c
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+ee
+44
+48
+50
+70
+48
+44
+42
+e7
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+0800
+0800
+1400
+1400
+2200
+2200
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 11 9 0 0
+BITMAP
+e0e0
+60c0
+5140
+5140
+5140
+4a40
+4a40
+4440
+e4e0
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+e7
+62
+52
+52
+4a
+4a
+46
+46
+e2
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+3c
+66
+42
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+ff
+42
+42
+42
+42
+42
+42
+42
+e7
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+3c
+66
+42
+a5
+bd
+a5
+42
+66
+3c
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 0 0
+BITMAP
+f8
+4c
+44
+4c
+78
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+BITMAP
+fc
+84
+c0
+60
+30
+20
+40
+82
+fe
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+fe
+92
+92
+10
+10
+10
+10
+10
+38
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+e380
+4100
+2200
+1400
+0800
+0800
+0800
+0800
+1c00
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 -3
+BITMAP
+78
+80
+80
+80
+c0
+70
+08
+48
+70
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 10 9 0 0
+BITMAP
+1e00
+3300
+2100
+4080
+4080
+4080
+2100
+9240
+f3c0
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 8 9 0 0
+BITMAP
+7e
+42
+00
+24
+3c
+24
+00
+81
+ff
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+dd80
+4900
+4900
+6b00
+3e00
+0800
+0800
+0800
+1c00
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+fc
+84
+08
+10
+20
+20
+40
+84
+fc
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 12 1 -3
+BITMAP
+e0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+e0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 6 1 0
+BITMAP
+10
+10
+00
+00
+82
+82
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 12 0 -3
+BITMAP
+e0
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+e0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+10
+10
+10
+10
+10
+10
+10
+10
+fe
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 1 0 -3
+BITMAP
+fc
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 7 1 0 11
+BITMAP
+fe
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 6 1 0
+BITMAP
+74
+d4
+88
+88
+d4
+66
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 13 1 -3
+BITMAP
+70
+88
+88
+88
+b0
+88
+88
+88
+c8
+b0
+80
+80
+80
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 -3
+BITMAP
+c6
+ac
+28
+18
+30
+28
+68
+4a
+c6
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+70
+98
+80
+40
+70
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 6 1 0
+BITMAP
+70
+80
+e0
+80
+90
+70
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 11 0 -3
+BITMAP
+10
+10
+38
+54
+92
+92
+54
+38
+10
+10
+10
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 0 -3
+BITMAP
+c4
+a4
+24
+24
+28
+18
+10
+30
+20
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 -3
+BITMAP
+6c
+b2
+22
+22
+22
+22
+02
+02
+02
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 6 0 0
+BITMAP
+c0
+40
+40
+40
+40
+60
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 -3
+BITMAP
+18
+54
+92
+92
+54
+38
+10
+10
+10
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 6 0 0
+BITMAP
+4c
+d4
+60
+70
+58
+4c
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+BITMAP
+60
+50
+10
+30
+28
+48
+48
+8a
+86
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 1 -3
+BITMAP
+88
+88
+88
+88
+9a
+ec
+80
+80
+c0
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 6 0 0
+BITMAP
+cc
+44
+44
+28
+28
+30
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 6 1 0
+BITMAP
+70
+88
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 6 0 0
+BITMAP
+7e
+a4
+24
+24
+26
+64
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 0
+BITMAP
+70
+88
+88
+88
+f8
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 9 1 -3
+BITMAP
+70
+88
+88
+88
+c8
+b0
+80
+80
+80
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 6 1 0
+BITMAP
+7c
+90
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+78
+a0
+20
+20
+28
+30
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 6 0 0
+BITMAP
+64
+a2
+22
+22
+26
+1c
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+7f
+a2
+49
+49
+49
+49
+36
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 6 1 0
+BITMAP
+44
+92
+92
+92
+92
+6c
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 14 1 -3
+BITMAP
+40
+80
+70
+c0
+80
+f0
+40
+80
+80
+c0
+70
+08
+48
+70
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 -3
+BITMAP
+8880
+4900
+4900
+4900
+6b00
+3e00
+0800
+0800
+0800
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 13 1 -3
+BITMAP
+40
+98
+70
+40
+80
+80
+80
+80
+c0
+70
+08
+48
+70
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 12 0 -3
+BITMAP
+18
+20
+20
+20
+40
+80
+40
+20
+20
+20
+20
+18
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 12 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 12 0 -3
+BITMAP
+c0
+20
+20
+20
+10
+08
+10
+20
+20
+20
+20
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 3 0 2
+BITMAP
+62
+92
+8c
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 8 9 0 0
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 3 1 6
+BITMAP
+00
+00
+00
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 0 0
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 5 9 -1 0
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 4 0 1
+BITMAP
+0000
+0000
+0000
+c600
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 12 0 -3
+BITMAP
+28
+10
+10
+10
+10
+10
+38
+20
+40
+80
+0c
+30
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 7 1 -1
+BITMAP
+c0
+30
+0c
+00
+fc
+08
+10
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 6 1 0
+BITMAP
+10
+20
+20
+40
+40
+80
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 6 1 0
+BITMAP
+80
+76
+00
+98
+80
+8c
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 7 1 -1
+BITMAP
+80
+76
+00
+0c
+14
+10
+7c
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 1040 0
+DWIDTH 13 0
+BBX 11 5 1 1
+BITMAP
+1000
+1020
+2020
+a0c0
+3820
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 960 0
+DWIDTH 12 0
+BBX 12 5 0 1
+BITMAP
+d6f0
+d610
+1020
+70f0
+f870
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 16 1 -4
+BITMAP
+20
+68
+f8
+f8
+78
+38
+10
+10
+38
+78
+f8
+d0
+10
+10
+20
+80
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 960 0
+DWIDTH 12 0
+BBX 12 5 0 1
+BITMAP
+4040
+ffe0
+4040
+2080
+2000
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 15 1 -3
+BITMAP
+40
+00
+f8
+f0
+40
+00
+20
+00
+20
+70
+a8
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 4 0 5
+BITMAP
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+20
+20
+20
+20
+20
+00
+40
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 5 3 0 6
+BITMAP
+00
+20
+f8
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 0 0
+BITMAP
+f0
+00
+20
+00
+40
+20
+20
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+20
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 4 0 1
+BITMAP
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 10 0 0
+BITMAP
+20
+a8
+70
+20
+60
+90
+90
+60
+20
+20
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 4 1 1
+BITMAP
+f0
+20
+20
+00
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+f8
+28
+50
+a0
+c0
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+30
+08
+30
+c0
+00
+f8
+88
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+50
+20
+50
+88
+70
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 0 1
+BITMAP
+88
+88
+74
+60
+90
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 9 1 1 0
+BITMAP
+0800
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 1 16 3 -4
+BITMAP
+00
+80
+80
+80
+80
+00
+00
+80
+80
+00
+00
+00
+80
+00
+00
+00
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 1040 0
+DWIDTH 13 0
+BBX 13 1 0 3
+BITMAP
+10f8
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 8 0 0
+BITMAP
+20
+f8
+40
+80
+f8
+00
+f8
+00
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 7 9 1 0
+BITMAP
+f8
+64
+98
+00
+64
+98
+88
+80
+80
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 11 0 -1
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 10 0 0
+BITMAP
+8080
+8080
+ff80
+0200
+0200
+0200
+fe00
+8880
+6600
+d480
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 11 1 -3
+BITMAP
+4c
+66
+e2
+3f
+61
+42
+64
+0c
+06
+03
+01
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+6180
+1c00
+0080
+0080
+0080
+0000
+0000
+0000
+0000
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+0000
+0080
+8000
+2600
+9180
+ab80
+6480
+9000
+1c00
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+6300
+6300
+9480
+8880
+9480
+6300
+6300
+1c00
+1c00
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 6 1 0
+BITMAP
+63
+00
+49
+00
+88
+80
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 6 1 0
+BITMAP
+be
+80
+88
+80
+49
+00
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 6 1 0
+BITMAP
+63
+00
+1c
+00
+1c
+80
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 8 1 -2
+BITMAP
+63
+00
+43
+00
+84
+80
+88
+80
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 8 0 -1
+BITMAP
+90
+80
+61
+00
+63
+00
+9c
+00
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 6 0 0
+BITMAP
+3c
+42
+81
+81
+81
+81
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 8 0 -2
+BITMAP
+81
+81
+81
+81
+42
+3c
+fc
+02
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 6 1 0
+BITMAP
+00
+00
+00
+fc
+fc
+00
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 8 1 -1
+BITMAP
+00
+00
+00
+fc
+00
+fc
+00
+3c
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+4480
+8800
+3f00
+3f00
+8080
+4000
+3f00
+8080
+4000
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+00
+ff
+7c
+80
+fc
+80
+80
+7c
+04
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+7c
+88
+fc
+90
+a0
+7c
+40
+00
+80
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+01
+00
+02
+00
+04
+00
+08
+00
+10
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 11 6 0 3
+BITMAP
+0020
+0040
+00e0
+80e0
+8140
+4220
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 11 0 -1
+BITMAP
+2400
+1800
+3c00
+f980
+b980
+ed00
+3c00
+4280
+a980
+a580
+4200
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 12 0 0
+BITMAP
+fa
+80
+aa
+80
+24
+40
+24
+40
+24
+40
+76
+60
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 1 1 3
+BITMAP
+c0
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 7 4 1 0
+BITMAP
+80
+40
+00
+40
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 6 1 0
+BITMAP
+00
+40
+00
+40
+00
+40
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 6 1 0
+BITMAP
+00
+40
+00
+40
+00
+40
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 1040 0
+DWIDTH 13 0
+BBX 11 5 1 1
+BITMAP
+0040
+00e0
+8000
+0200
+0400
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 960 0
+DWIDTH 12 0
+BBX 11 5 0 1
+BITMAP
+0460
+a820
+2800
+10c0
+fe00
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 5 12 1 -1
+BITMAP
+00
+00
+30
+30
+48
+48
+80
+80
+80
+80
+48
+48
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 960 0
+DWIDTH 12 0
+BBX 11 5 1 1
+BITMAP
+3020
+2080
+7fc0
+c060
+7fc0
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 5 12 1 0
+BITMAP
+20
+80
+20
+00
+78
+e0
+c0
+00
+78
+e0
+20
+00
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 0
+BITMAP
+20
+70
+d8
+50
+50
+50
+50
+50
+50
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 11 0 -1
+BITMAP
+50
+50
+50
+00
+80
+f0
+c0
+00
+60
+f0
+c0
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+00
+80
+50
+50
+50
+50
+50
+50
+50
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+50
+50
+d8
+70
+20
+30
+30
+48
+84
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 10 6 0 3
+BITMAP
+8440
+4800
+3000
+2000
+4040
+8040
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 11 0 -1
+BITMAP
+40
+20
+20
+10
+3c
+42
+b9
+a5
+b9
+a5
+a5
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 16 1 -4
+BITMAP
+40
+30
+30
+40
+90
+a0
+a0
+a0
+90
+40
+30
+f0
+80
+20
+80
+20
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 1 16 1 -4
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+80
+80
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 16 1 -4
+BITMAP
+80
+f0
+10
+20
+20
+40
+40
+40
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 16 1 -4
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 1 16 1 -4
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 15 1 -3
+BITMAP
+20
+00
+e0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 3 16 2 -4
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 3 16 0 -4
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 3 15 2 -3
+BITMAP
+80
+e0
+60
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 1 16 2 -4
+BITMAP
+80
+80
+80
+00
+00
+00
+00
+00
+00
+00
+80
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 12 0 -2
+BITMAP
+20
+20
+20
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 5 15 0 -3
+BITMAP
+80
+80
+80
+80
+80
+60
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 5 16 4 -4
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+00
+80
+40
+40
+20
+20
+10
+10
+20
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 1 16 1 -4
+BITMAP
+00
+00
+00
+80
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 5 15 0 -3
+BITMAP
+20
+a0
+c0
+38
+58
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 16 0 -4
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 1 16 3 -4
+BITMAP
+80
+80
+80
+80
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 16 0 -4
+BITMAP
+00
+d0
+e0
+80
+40
+40
+20
+20
+20
+10
+10
+10
+10
+10
+10
+10
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 16 1 -4
+BITMAP
+00
+00
+00
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 1 16 3 -4
+BITMAP
+80
+80
+80
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 15 1 -3
+BITMAP
+40
+40
+80
+e0
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 3 16 0 -4
+BITMAP
+20
+20
+20
+20
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 3 16 2 -4
+BITMAP
+80
+80
+80
+80
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 3 15 0 -3
+BITMAP
+20
+20
+e0
+c0
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol12.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol12.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol12.h	(revision 15879)
@@ -0,0 +1,815 @@
+static unsigned char symbol12_0_bits[] = {
+0x00};
+static unsigned char symbol12_1_bits[] = {
+0x00};
+static unsigned char symbol12_2_bits[] = {
+0x00};
+static unsigned char symbol12_3_bits[] = {
+0x00};
+static unsigned char symbol12_4_bits[] = {
+0x00};
+static unsigned char symbol12_5_bits[] = {
+0x00};
+static unsigned char symbol12_6_bits[] = {
+0x00};
+static unsigned char symbol12_7_bits[] = {
+0x00};
+static unsigned char symbol12_8_bits[] = {
+0x00};
+static unsigned char symbol12_9_bits[] = {
+0x00};
+static unsigned char symbol12_10_bits[] = {
+0x00};
+static unsigned char symbol12_11_bits[] = {
+0x00};
+static unsigned char symbol12_12_bits[] = {
+0x00};
+static unsigned char symbol12_13_bits[] = {
+0x00};
+static unsigned char symbol12_14_bits[] = {
+0x00};
+static unsigned char symbol12_15_bits[] = {
+0x00};
+static unsigned char symbol12_16_bits[] = {
+0x00};
+static unsigned char symbol12_17_bits[] = {
+0x00};
+static unsigned char symbol12_18_bits[] = {
+0x00};
+static unsigned char symbol12_19_bits[] = {
+0x00};
+static unsigned char symbol12_20_bits[] = {
+0x00};
+static unsigned char symbol12_21_bits[] = {
+0x00};
+static unsigned char symbol12_22_bits[] = {
+0x00};
+static unsigned char symbol12_23_bits[] = {
+0x00};
+static unsigned char symbol12_24_bits[] = {
+0x00};
+static unsigned char symbol12_25_bits[] = {
+0x00};
+static unsigned char symbol12_26_bits[] = {
+0x00};
+static unsigned char symbol12_27_bits[] = {
+0x00};
+static unsigned char symbol12_28_bits[] = {
+0x00};
+static unsigned char symbol12_29_bits[] = {
+0x00};
+static unsigned char symbol12_30_bits[] = {
+0x00};
+static unsigned char symbol12_31_bits[] = {
+0x00};
+static unsigned char symbol12_32_bits[] = {
+0x00};
+static unsigned char symbol12_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01};
+static unsigned char symbol12_34_bits[] = {
+0x01, 0x01, 0x82, 0x00, 0x82, 0x00, 0x7c, 0x00, 0x44, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char symbol12_35_bits[] = {
+0x14, 0x14, 0x14, 0x3f, 0x0a, 0x1f, 0x0a, 0x0a, 0x0a};
+static unsigned char symbol12_36_bits[] = {
+0x1f, 0x10, 0x10, 0x10, 0x1f, 0x10, 0x10, 0x10, 0x1f};
+static unsigned char symbol12_37_bits[] = {
+0x9e, 0x00, 0xe9, 0x00, 0x49, 0x00, 0x26, 0x00, 0x10, 0x00, 0xc8, 0x00, 
+0x28, 0x01, 0x24, 0x01, 0xc6, 0x00};
+static unsigned char symbol12_38_bits[] = {
+0x0c, 0x00, 0x12, 0x00, 0x12, 0x00, 0xec, 0x00, 0x4e, 0x00, 0x59, 0x00, 
+0x31, 0x00, 0x31, 0x01, 0xce, 0x00};
+static unsigned char symbol12_39_bits[] = {
+0x07, 0x08, 0x0f, 0x08, 0x08, 0x07};
+static unsigned char symbol12_40_bits[] = {
+0x04, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x04};
+static unsigned char symbol12_41_bits[] = {
+0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x02, 0x01};
+static unsigned char symbol12_42_bits[] = {
+0x04, 0x15, 0x0e, 0x15, 0x04};
+static unsigned char symbol12_43_bits[] = {
+0x04, 0x04, 0x1f, 0x04, 0x04};
+static unsigned char symbol12_44_bits[] = {
+0x02, 0x02, 0x01};
+static unsigned char symbol12_45_bits[] = {
+0x1f};
+static unsigned char symbol12_46_bits[] = {
+0x01};
+static unsigned char symbol12_47_bits[] = {
+0x04, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01};
+static unsigned char symbol12_48_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char symbol12_49_bits[] = {
+0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char symbol12_50_bits[] = {
+0x0e, 0x11, 0x11, 0x10, 0x08, 0x04, 0x02, 0x11, 0x1f};
+static unsigned char symbol12_51_bits[] = {
+0x0e, 0x11, 0x11, 0x10, 0x0c, 0x10, 0x10, 0x11, 0x0e};
+static unsigned char symbol12_52_bits[] = {
+0x18, 0x14, 0x14, 0x12, 0x12, 0x11, 0x3f, 0x10, 0x10};
+static unsigned char symbol12_53_bits[] = {
+0x1e, 0x02, 0x01, 0x0f, 0x18, 0x10, 0x10, 0x11, 0x0f};
+static unsigned char symbol12_54_bits[] = {
+0x1c, 0x02, 0x01, 0x0d, 0x13, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char symbol12_55_bits[] = {
+0x1f, 0x11, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x02};
+static unsigned char symbol12_56_bits[] = {
+0x0e, 0x11, 0x11, 0x13, 0x0e, 0x19, 0x11, 0x11, 0x0e};
+static unsigned char symbol12_57_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x1e, 0x08, 0x08, 0x04, 0x02};
+static unsigned char symbol12_58_bits[] = {
+0x01, 0x00, 0x00, 0x00, 0x00, 0x01};
+static unsigned char symbol12_59_bits[] = {
+0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x01};
+static unsigned char symbol12_60_bits[] = {
+0x30, 0x0c, 0x03, 0x0c, 0x30};
+static unsigned char symbol12_61_bits[] = {
+0x1f, 0x00, 0x1f};
+static unsigned char symbol12_62_bits[] = {
+0x03, 0x0c, 0x30, 0x0c, 0x03};
+static unsigned char symbol12_63_bits[] = {
+0x0e, 0x11, 0x11, 0x10, 0x08, 0x04, 0x04, 0x00, 0x04};
+static unsigned char symbol12_64_bits[] = {
+0x16, 0x0d, 0x00, 0x1f, 0x00, 0x1f};
+static unsigned char symbol12_65_bits[] = {
+0x10, 0x00, 0x38, 0x00, 0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 
+0x44, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char symbol12_66_bits[] = {
+0x3f, 0x62, 0x42, 0x62, 0x3e, 0x62, 0x42, 0x62, 0x3f};
+static unsigned char symbol12_67_bits[] = {
+0xe7, 0x42, 0x24, 0x18, 0x18, 0x24, 0x24, 0x42, 0xe7};
+static unsigned char symbol12_68_bits[] = {
+0x08, 0x08, 0x14, 0x14, 0x22, 0x22, 0x22, 0x41, 0x7f};
+static unsigned char symbol12_69_bits[] = {
+0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 0x7f};
+static unsigned char symbol12_70_bits[] = {
+0x38, 0x00, 0x10, 0x00, 0xfe, 0x00, 0x93, 0x01, 0x11, 0x01, 0x93, 0x01, 
+0xfe, 0x00, 0x10, 0x00, 0x38, 0x00};
+static unsigned char symbol12_71_bits[] = {
+0x7f, 0x42, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char symbol12_72_bits[] = {
+0xe7, 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0xe7};
+static unsigned char symbol12_73_bits[] = {
+0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char symbol12_74_bits[] = {
+0x20, 0x50, 0x50, 0x66, 0xc5, 0x44, 0x44, 0x64, 0x38};
+static unsigned char symbol12_75_bits[] = {
+0x77, 0x22, 0x12, 0x0a, 0x0e, 0x12, 0x22, 0x42, 0xe7};
+static unsigned char symbol12_76_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char symbol12_77_bits[] = {
+0x07, 0x07, 0x06, 0x03, 0x8a, 0x02, 0x8a, 0x02, 0x8a, 0x02, 0x52, 0x02, 
+0x52, 0x02, 0x22, 0x02, 0x27, 0x07};
+static unsigned char symbol12_78_bits[] = {
+0xe7, 0x46, 0x4a, 0x4a, 0x52, 0x52, 0x62, 0x62, 0x47};
+static unsigned char symbol12_79_bits[] = {
+0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c};
+static unsigned char symbol12_80_bits[] = {
+0xff, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0xe7};
+static unsigned char symbol12_81_bits[] = {
+0x3c, 0x66, 0x42, 0xa5, 0xbd, 0xa5, 0x42, 0x66, 0x3c};
+static unsigned char symbol12_82_bits[] = {
+0x1f, 0x32, 0x22, 0x32, 0x1e, 0x02, 0x02, 0x02, 0x07};
+static unsigned char symbol12_83_bits[] = {
+0x3f, 0x21, 0x03, 0x06, 0x0c, 0x04, 0x02, 0x41, 0x7f};
+static unsigned char symbol12_84_bits[] = {
+0x7f, 0x49, 0x49, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1c};
+static unsigned char symbol12_85_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 0x28, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x38, 0x00};
+static unsigned char symbol12_86_bits[] = {
+0x1e, 0x01, 0x01, 0x01, 0x03, 0x0e, 0x10, 0x12, 0x0e};
+static unsigned char symbol12_87_bits[] = {
+0x78, 0x00, 0xcc, 0x00, 0x84, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 
+0x84, 0x00, 0x49, 0x02, 0xcf, 0x03};
+static unsigned char symbol12_88_bits[] = {
+0x7e, 0x42, 0x00, 0x24, 0x3c, 0x24, 0x00, 0x81, 0xff};
+static unsigned char symbol12_89_bits[] = {
+0xbb, 0x01, 0x92, 0x00, 0x92, 0x00, 0xd6, 0x00, 0x7c, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x38, 0x00};
+static unsigned char symbol12_90_bits[] = {
+0x3f, 0x21, 0x10, 0x08, 0x04, 0x04, 0x02, 0x21, 0x3f};
+static unsigned char symbol12_91_bits[] = {
+0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07};
+static unsigned char symbol12_92_bits[] = {
+0x08, 0x08, 0x00, 0x00, 0x41, 0x41};
+static unsigned char symbol12_93_bits[] = {
+0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07};
+static unsigned char symbol12_94_bits[] = {
+0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x7f};
+static unsigned char symbol12_95_bits[] = {
+0x3f};
+static unsigned char symbol12_96_bits[] = {
+0x7f};
+static unsigned char symbol12_97_bits[] = {
+0x2e, 0x2b, 0x11, 0x11, 0x2b, 0x66};
+static unsigned char symbol12_98_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x0d, 0x11, 0x11, 0x11, 0x13, 0x0d, 0x01, 0x01, 
+0x01};
+static unsigned char symbol12_99_bits[] = {
+0x63, 0x35, 0x14, 0x18, 0x0c, 0x14, 0x16, 0x52, 0x63};
+static unsigned char symbol12_100_bits[] = {
+0x0e, 0x19, 0x01, 0x02, 0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char symbol12_101_bits[] = {
+0x0e, 0x01, 0x07, 0x01, 0x09, 0x0e};
+static unsigned char symbol12_102_bits[] = {
+0x08, 0x08, 0x1c, 0x2a, 0x49, 0x49, 0x2a, 0x1c, 0x08, 0x08, 0x08};
+static unsigned char symbol12_103_bits[] = {
+0x23, 0x25, 0x24, 0x24, 0x14, 0x18, 0x08, 0x0c, 0x04};
+static unsigned char symbol12_104_bits[] = {
+0x36, 0x4d, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40};
+static unsigned char symbol12_105_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x02, 0x06};
+static unsigned char symbol12_106_bits[] = {
+0x18, 0x2a, 0x49, 0x49, 0x2a, 0x1c, 0x08, 0x08, 0x08};
+static unsigned char symbol12_107_bits[] = {
+0x32, 0x2b, 0x06, 0x0e, 0x1a, 0x32};
+static unsigned char symbol12_108_bits[] = {
+0x06, 0x0a, 0x08, 0x0c, 0x14, 0x12, 0x12, 0x51, 0x61};
+static unsigned char symbol12_109_bits[] = {
+0x11, 0x11, 0x11, 0x11, 0x59, 0x37, 0x01, 0x01, 0x03};
+static unsigned char symbol12_110_bits[] = {
+0x33, 0x22, 0x22, 0x14, 0x14, 0x0c};
+static unsigned char symbol12_111_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char symbol12_112_bits[] = {
+0x7e, 0x25, 0x24, 0x24, 0x64, 0x26};
+static unsigned char symbol12_113_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char symbol12_114_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x13, 0x0d, 0x01, 0x01, 0x01};
+static unsigned char symbol12_115_bits[] = {
+0x3e, 0x09, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char symbol12_116_bits[] = {
+0x1e, 0x05, 0x04, 0x04, 0x14, 0x0c};
+static unsigned char symbol12_117_bits[] = {
+0x26, 0x45, 0x44, 0x44, 0x64, 0x38};
+static unsigned char symbol12_118_bits[] = {
+0xfe, 0x45, 0x92, 0x92, 0x92, 0x92, 0x6c};
+static unsigned char symbol12_119_bits[] = {
+0x22, 0x49, 0x49, 0x49, 0x49, 0x36};
+static unsigned char symbol12_120_bits[] = {
+0x02, 0x01, 0x0e, 0x03, 0x01, 0x0f, 0x02, 0x01, 0x01, 0x03, 0x0e, 0x10, 
+0x12, 0x0e};
+static unsigned char symbol12_121_bits[] = {
+0x11, 0x01, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0xd6, 0x00, 0x7c, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char symbol12_122_bits[] = {
+0x02, 0x19, 0x0e, 0x02, 0x01, 0x01, 0x01, 0x01, 0x03, 0x0e, 0x10, 0x12, 
+0x0e};
+static unsigned char symbol12_123_bits[] = {
+0x18, 0x04, 0x04, 0x04, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x18};
+static unsigned char symbol12_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol12_125_bits[] = {
+0x03, 0x04, 0x04, 0x04, 0x08, 0x10, 0x08, 0x04, 0x04, 0x04, 0x04, 0x03};
+static unsigned char symbol12_126_bits[] = {
+0x46, 0x49, 0x31};
+static unsigned char symbol12_127_bits[] = {
+0x00};
+static unsigned char symbol12_128_bits[] = {
+0x00};
+static unsigned char symbol12_129_bits[] = {
+0x00};
+static unsigned char symbol12_130_bits[] = {
+0x00};
+static unsigned char symbol12_131_bits[] = {
+0x00};
+static unsigned char symbol12_132_bits[] = {
+0x00};
+static unsigned char symbol12_133_bits[] = {
+0x00};
+static unsigned char symbol12_134_bits[] = {
+0x00};
+static unsigned char symbol12_135_bits[] = {
+0x00};
+static unsigned char symbol12_136_bits[] = {
+0x00};
+static unsigned char symbol12_137_bits[] = {
+0x00};
+static unsigned char symbol12_138_bits[] = {
+0x00};
+static unsigned char symbol12_139_bits[] = {
+0x00};
+static unsigned char symbol12_140_bits[] = {
+0x00};
+static unsigned char symbol12_141_bits[] = {
+0x00};
+static unsigned char symbol12_142_bits[] = {
+0x00};
+static unsigned char symbol12_143_bits[] = {
+0x00};
+static unsigned char symbol12_144_bits[] = {
+0x00};
+static unsigned char symbol12_145_bits[] = {
+0x00};
+static unsigned char symbol12_146_bits[] = {
+0x00};
+static unsigned char symbol12_147_bits[] = {
+0x00};
+static unsigned char symbol12_148_bits[] = {
+0x00};
+static unsigned char symbol12_149_bits[] = {
+0x00};
+static unsigned char symbol12_150_bits[] = {
+0x00};
+static unsigned char symbol12_151_bits[] = {
+0x00};
+static unsigned char symbol12_152_bits[] = {
+0x00};
+static unsigned char symbol12_153_bits[] = {
+0x00};
+static unsigned char symbol12_154_bits[] = {
+0x00};
+static unsigned char symbol12_155_bits[] = {
+0x00};
+static unsigned char symbol12_156_bits[] = {
+0x00};
+static unsigned char symbol12_157_bits[] = {
+0x00};
+static unsigned char symbol12_158_bits[] = {
+0x00};
+static unsigned char symbol12_159_bits[] = {
+0x00};
+static unsigned char symbol12_160_bits[] = {
+0x00};
+static unsigned char symbol12_161_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol12_162_bits[] = {
+0x00, 0x00, 0x00};
+static unsigned char symbol12_163_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol12_164_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol12_165_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00};
+static unsigned char symbol12_166_bits[] = {
+0x14, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1c, 0x04, 0x02, 0x01, 0x30, 0x0c};
+static unsigned char symbol12_167_bits[] = {
+0x03, 0x0c, 0x30, 0x00, 0x3f, 0x10, 0x08};
+static unsigned char symbol12_168_bits[] = {
+0x08, 0x04, 0x04, 0x02, 0x02, 0x01};
+static unsigned char symbol12_169_bits[] = {
+0x01, 0x6e, 0x00, 0x19, 0x01, 0x31};
+static unsigned char symbol12_170_bits[] = {
+0x01, 0x6e, 0x00, 0x30, 0x28, 0x08, 0x3e};
+static unsigned char symbol12_171_bits[] = {
+0x08, 0x00, 0x08, 0x04, 0x04, 0x04, 0x05, 0x03, 0x1c, 0x04};
+static unsigned char symbol12_172_bits[] = {
+0x6b, 0x0f, 0x6b, 0x08, 0x08, 0x04, 0x0e, 0x0f, 0x1f, 0x0e};
+static unsigned char symbol12_173_bits[] = {
+0x04, 0x16, 0x1f, 0x1f, 0x1e, 0x1c, 0x08, 0x08, 0x1c, 0x1e, 0x1f, 0x0b, 
+0x08, 0x08, 0x04, 0x01};
+static unsigned char symbol12_174_bits[] = {
+0x02, 0x02, 0xff, 0x07, 0x02, 0x02, 0x04, 0x01, 0x04, 0x00};
+static unsigned char symbol12_175_bits[] = {
+0x02, 0x00, 0x1f, 0x0f, 0x02, 0x00, 0x04, 0x00, 0x04, 0x0e, 0x15, 0x04, 
+0x04, 0x04, 0x04};
+static unsigned char symbol12_176_bits[] = {
+0x04, 0x04, 0x04, 0x04};
+static unsigned char symbol12_177_bits[] = {
+0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x02};
+static unsigned char symbol12_178_bits[] = {
+0x00, 0x04, 0x1f};
+static unsigned char symbol12_179_bits[] = {
+0x0f, 0x00, 0x04, 0x00, 0x02, 0x04, 0x04};
+static unsigned char symbol12_180_bits[] = {
+0x04, 0x04, 0x04, 0x04, 0x04};
+static unsigned char symbol12_181_bits[] = {
+0x04, 0x04, 0x04, 0x04};
+static unsigned char symbol12_182_bits[] = {
+0x04, 0x15, 0x0e, 0x04, 0x06, 0x09, 0x09, 0x06, 0x04, 0x04};
+static unsigned char symbol12_183_bits[] = {
+0x0f, 0x04, 0x04, 0x00};
+static unsigned char symbol12_184_bits[] = {
+0x1f, 0x14, 0x0a, 0x05, 0x03};
+static unsigned char symbol12_185_bits[] = {
+0x0c, 0x10, 0x0c, 0x03, 0x00, 0x1f, 0x11};
+static unsigned char symbol12_186_bits[] = {
+0x0a, 0x04, 0x0a, 0x11, 0x0e};
+static unsigned char symbol12_187_bits[] = {
+0x11, 0x11, 0x2e, 0x06, 0x09};
+static unsigned char symbol12_188_bits[] = {
+0x10, 0x00};
+static unsigned char symbol12_189_bits[] = {
+0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 
+0x01, 0x00, 0x00, 0x00};
+static unsigned char symbol12_190_bits[] = {
+0x08, 0x1f};
+static unsigned char symbol12_191_bits[] = {
+0x04, 0x1f, 0x02, 0x01, 0x1f, 0x00, 0x1f, 0x00};
+static unsigned char symbol12_192_bits[] = {
+0x1f, 0x26, 0x19, 0x00, 0x26, 0x19, 0x11, 0x01, 0x01};
+static unsigned char symbol12_193_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol12_194_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0xff, 0x01, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 
+0x7f, 0x00, 0x11, 0x01, 0x66, 0x00, 0x2b, 0x01};
+static unsigned char symbol12_195_bits[] = {
+0x32, 0x66, 0x47, 0xfc, 0x86, 0x42, 0x26, 0x30, 0x60, 0xc0, 0x80};
+static unsigned char symbol12_196_bits[] = {
+0x86, 0x01, 0x38, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol12_197_bits[] = {
+0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x64, 0x00, 0x89, 0x01, 0xd5, 0x01, 
+0x26, 0x01, 0x09, 0x00, 0x38, 0x00};
+static unsigned char symbol12_198_bits[] = {
+0xc6, 0x00, 0xc6, 0x00, 0x29, 0x01, 0x11, 0x01, 0x29, 0x01, 0xc6, 0x00, 
+0xc6, 0x00, 0x38, 0x00, 0x38, 0x00};
+static unsigned char symbol12_199_bits[] = {
+0xc6, 0x00, 0x92, 0x00, 0x11, 0x01};
+static unsigned char symbol12_200_bits[] = {
+0x7d, 0x01, 0x11, 0x01, 0x92, 0x00};
+static unsigned char symbol12_201_bits[] = {
+0xc6, 0x00, 0x38, 0x00, 0x38, 0x01};
+static unsigned char symbol12_202_bits[] = {
+0xc6, 0x00, 0xc2, 0x00, 0x21, 0x01, 0x11, 0x01};
+static unsigned char symbol12_203_bits[] = {
+0x09, 0x01, 0x86, 0x00, 0xc6, 0x00, 0x39, 0x00};
+static unsigned char symbol12_204_bits[] = {
+0x3c, 0x42, 0x81, 0x81, 0x81, 0x81};
+static unsigned char symbol12_205_bits[] = {
+0x81, 0x81, 0x81, 0x81, 0x42, 0x3c, 0x3f, 0x40};
+static unsigned char symbol12_206_bits[] = {
+0x00, 0x00, 0x00, 0x3f, 0x3f, 0x00};
+static unsigned char symbol12_207_bits[] = {
+0x00, 0x00, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3c};
+static unsigned char symbol12_208_bits[] = {
+0x22, 0x01, 0x11, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0x01, 0x01, 0x02, 0x00, 
+0xfc, 0x00, 0x01, 0x01, 0x02, 0x00};
+static unsigned char symbol12_209_bits[] = {
+0x00, 0xff, 0x3e, 0x01, 0x3f, 0x01, 0x01, 0x3e, 0x20};
+static unsigned char symbol12_210_bits[] = {
+0x3e, 0x11, 0x3f, 0x09, 0x05, 0x3e, 0x02, 0x00, 0x01};
+static unsigned char symbol12_211_bits[] = {
+0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08};
+static unsigned char symbol12_212_bits[] = {
+0x00, 0x04, 0x00, 0x02, 0x00, 0x07, 0x01, 0x07, 0x81, 0x02, 0x42, 0x04};
+static unsigned char symbol12_213_bits[] = {
+0x24, 0x00, 0x18, 0x00, 0x3c, 0x00, 0x9f, 0x01, 0x9d, 0x01, 0xb7, 0x00, 
+0x3c, 0x00, 0x42, 0x01, 0x95, 0x01, 0xa5, 0x01, 0x42, 0x00};
+static unsigned char symbol12_214_bits[] = {
+0x5f, 0x01, 0x55, 0x01, 0x24, 0x02, 0x24, 0x02, 0x24, 0x02, 0x6e, 0x06};
+static unsigned char symbol12_215_bits[] = {
+0x03};
+static unsigned char symbol12_216_bits[] = {
+0x01, 0x02, 0x00, 0x02};
+static unsigned char symbol12_217_bits[] = {
+0x00, 0x02, 0x00, 0x02, 0x00, 0x02};
+static unsigned char symbol12_218_bits[] = {
+0x00, 0x02, 0x00, 0x02, 0x00, 0x02};
+static unsigned char symbol12_219_bits[] = {
+0x00, 0x02, 0x00, 0x07, 0x01, 0x00, 0x40, 0x00, 0x20, 0x00};
+static unsigned char symbol12_220_bits[] = {
+0x20, 0x06, 0x15, 0x04, 0x14, 0x00, 0x08, 0x03, 0x7f, 0x00};
+static unsigned char symbol12_221_bits[] = {
+0x00, 0x00, 0x0c, 0x0c, 0x12, 0x12, 0x01, 0x01, 0x01, 0x01, 0x12, 0x12};
+static unsigned char symbol12_222_bits[] = {
+0x0c, 0x04, 0x04, 0x01, 0xfe, 0x03, 0x03, 0x06, 0xfe, 0x03};
+static unsigned char symbol12_223_bits[] = {
+0x04, 0x01, 0x04, 0x00, 0x1e, 0x07, 0x03, 0x00, 0x1e, 0x07, 0x04, 0x00};
+static unsigned char symbol12_224_bits[] = {
+0x04, 0x0e, 0x1b, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a};
+static unsigned char symbol12_225_bits[] = {
+0x0a, 0x0a, 0x0a, 0x00, 0x01, 0x0f, 0x03, 0x00, 0x06, 0x0f, 0x03};
+static unsigned char symbol12_226_bits[] = {
+0x00, 0x01, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a};
+static unsigned char symbol12_227_bits[] = {
+0x0a, 0x0a, 0x1b, 0x0e, 0x04, 0x0c, 0x0c, 0x12, 0x21};
+static unsigned char symbol12_228_bits[] = {
+0x21, 0x02, 0x12, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x02, 0x02, 0x01, 0x02};
+static unsigned char symbol12_229_bits[] = {
+0x02, 0x04, 0x04, 0x08, 0x3c, 0x42, 0x9d, 0xa5, 0x9d, 0xa5, 0xa5};
+static unsigned char symbol12_230_bits[] = {
+0x02, 0x0c, 0x0c, 0x02, 0x09, 0x05, 0x05, 0x05, 0x09, 0x02, 0x0c, 0x0f, 
+0x01, 0x04, 0x01, 0x04};
+static unsigned char symbol12_231_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol12_232_bits[] = {
+0x01, 0x0f, 0x08, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol12_233_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol12_234_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol12_235_bits[] = {
+0x04, 0x00, 0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01};
+static unsigned char symbol12_236_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol12_237_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol12_238_bits[] = {
+0x01, 0x07, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01};
+static unsigned char symbol12_239_bits[] = {
+0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol12_240_bits[] = {
+0x00};
+static unsigned char symbol12_241_bits[] = {
+0x04, 0x04, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol12_242_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01};
+static unsigned char symbol12_243_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x02, 0x02, 0x04, 
+0x04, 0x08, 0x08, 0x04};
+static unsigned char symbol12_244_bits[] = {
+0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol12_245_bits[] = {
+0x04, 0x05, 0x03, 0x1c, 0x1a, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01};
+static unsigned char symbol12_246_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol12_247_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol12_248_bits[] = {
+0x00, 0x0b, 0x07, 0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x08};
+static unsigned char symbol12_249_bits[] = {
+0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol12_250_bits[] = {
+0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol12_251_bits[] = {
+0x02, 0x02, 0x01, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0x04};
+static unsigned char symbol12_252_bits[] = {
+0x04, 0x04, 0x04, 0x04, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol12_253_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0x04, 0x04};
+static unsigned char symbol12_254_bits[] = {
+0x04, 0x04, 0x07, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x04, 0x04};
+static unsigned char symbol12_255_bits[] = {
+0x00};
+static RotFont symbol12font[] = {
+{5, 1, 1, symbol12_0_bits},
+{5, 1, 1, symbol12_1_bits},
+{5, 1, 1, symbol12_2_bits},
+{5, 1, 1, symbol12_3_bits},
+{5, 1, 1, symbol12_4_bits},
+{5, 1, 1, symbol12_5_bits},
+{5, 1, 1, symbol12_6_bits},
+{5, 1, 1, symbol12_7_bits},
+{5, 1, 1, symbol12_8_bits},
+{5, 1, 1, symbol12_9_bits},
+{5, 1, 1, symbol12_10_bits},
+{5, 1, 1, symbol12_11_bits},
+{5, 1, 1, symbol12_12_bits},
+{5, 1, 1, symbol12_13_bits},
+{5, 1, 1, symbol12_14_bits},
+{5, 1, 1, symbol12_15_bits},
+{5, 1, 1, symbol12_16_bits},
+{5, 1, 1, symbol12_17_bits},
+{5, 1, 1, symbol12_18_bits},
+{5, 1, 1, symbol12_19_bits},
+{5, 1, 1, symbol12_20_bits},
+{5, 1, 1, symbol12_21_bits},
+{5, 1, 1, symbol12_22_bits},
+{5, 1, 1, symbol12_23_bits},
+{5, 1, 1, symbol12_24_bits},
+{5, 1, 1, symbol12_25_bits},
+{5, 1, 1, symbol12_26_bits},
+{5, 1, 1, symbol12_27_bits},
+{5, 1, 1, symbol12_28_bits},
+{5, 1, 1, symbol12_29_bits},
+{5, 1, 1, symbol12_30_bits},
+{5, 1, 1, symbol12_31_bits},
+{1, 1, 1, symbol12_32_bits},
+{1, 9, 9, symbol12_33_bits},
+{9, 9, 9, symbol12_34_bits},
+{6, 9, 9, symbol12_35_bits},
+{5, 9, 9, symbol12_36_bits},
+{9, 9, 9, symbol12_37_bits},
+{9, 9, 9, symbol12_38_bits},
+{4, 6, 6, symbol12_39_bits},
+{3, 12, 9, symbol12_40_bits},
+{3, 12, 9, symbol12_41_bits},
+{5, 5, 7, symbol12_42_bits},
+{5, 5, 6, symbol12_43_bits},
+{2, 3, 1, symbol12_44_bits},
+{5, 1, 4, symbol12_45_bits},
+{1, 1, 1, symbol12_46_bits},
+{3, 9, 9, symbol12_47_bits},
+{5, 9, 9, symbol12_48_bits},
+{3, 9, 9, symbol12_49_bits},
+{5, 9, 9, symbol12_50_bits},
+{5, 9, 9, symbol12_51_bits},
+{6, 9, 9, symbol12_52_bits},
+{5, 9, 9, symbol12_53_bits},
+{5, 9, 9, symbol12_54_bits},
+{5, 9, 9, symbol12_55_bits},
+{5, 9, 9, symbol12_56_bits},
+{5, 9, 9, symbol12_57_bits},
+{1, 6, 6, symbol12_58_bits},
+{2, 8, 6, symbol12_59_bits},
+{6, 5, 6, symbol12_60_bits},
+{5, 3, 5, symbol12_61_bits},
+{6, 5, 6, symbol12_62_bits},
+{5, 9, 9, symbol12_63_bits},
+{5, 6, 6, symbol12_64_bits},
+{9, 9, 9, symbol12_65_bits},
+{7, 9, 9, symbol12_66_bits},
+{8, 9, 9, symbol12_67_bits},
+{7, 9, 9, symbol12_68_bits},
+{7, 9, 9, symbol12_69_bits},
+{9, 9, 9, symbol12_70_bits},
+{7, 9, 9, symbol12_71_bits},
+{8, 9, 9, symbol12_72_bits},
+{3, 9, 9, symbol12_73_bits},
+{8, 9, 9, symbol12_74_bits},
+{8, 9, 9, symbol12_75_bits},
+{9, 9, 9, symbol12_76_bits},
+{11, 9, 9, symbol12_77_bits},
+{8, 9, 9, symbol12_78_bits},
+{8, 9, 9, symbol12_79_bits},
+{8, 9, 9, symbol12_80_bits},
+{8, 9, 9, symbol12_81_bits},
+{6, 9, 9, symbol12_82_bits},
+{7, 9, 9, symbol12_83_bits},
+{7, 9, 9, symbol12_84_bits},
+{9, 9, 9, symbol12_85_bits},
+{5, 9, 6, symbol12_86_bits},
+{10, 9, 9, symbol12_87_bits},
+{8, 9, 9, symbol12_88_bits},
+{9, 9, 9, symbol12_89_bits},
+{6, 9, 9, symbol12_90_bits},
+{3, 12, 9, symbol12_91_bits},
+{7, 6, 6, symbol12_92_bits},
+{3, 12, 9, symbol12_93_bits},
+{7, 9, 9, symbol12_94_bits},
+{6, 1, -2, symbol12_95_bits},
+{7, 1, 12, symbol12_96_bits},
+{7, 6, 6, symbol12_97_bits},
+{5, 13, 10, symbol12_98_bits},
+{7, 9, 6, symbol12_99_bits},
+{5, 10, 10, symbol12_100_bits},
+{4, 6, 6, symbol12_101_bits},
+{7, 11, 8, symbol12_102_bits},
+{6, 9, 6, symbol12_103_bits},
+{7, 9, 6, symbol12_104_bits},
+{3, 6, 6, symbol12_105_bits},
+{7, 9, 6, symbol12_106_bits},
+{6, 6, 6, symbol12_107_bits},
+{7, 9, 9, symbol12_108_bits},
+{7, 9, 6, symbol12_109_bits},
+{6, 6, 6, symbol12_110_bits},
+{5, 6, 6, symbol12_111_bits},
+{7, 6, 6, symbol12_112_bits},
+{5, 9, 9, symbol12_113_bits},
+{5, 9, 6, symbol12_114_bits},
+{6, 6, 6, symbol12_115_bits},
+{5, 6, 6, symbol12_116_bits},
+{7, 6, 6, symbol12_117_bits},
+{8, 7, 7, symbol12_118_bits},
+{7, 6, 6, symbol12_119_bits},
+{5, 14, 11, symbol12_120_bits},
+{9, 9, 6, symbol12_121_bits},
+{5, 13, 10, symbol12_122_bits},
+{5, 12, 9, symbol12_123_bits},
+{1, 12, 9, symbol12_124_bits},
+{5, 12, 9, symbol12_125_bits},
+{7, 3, 5, symbol12_126_bits},
+{5, 1, 1, symbol12_127_bits},
+{5, 1, 1, symbol12_128_bits},
+{5, 1, 1, symbol12_129_bits},
+{5, 1, 1, symbol12_130_bits},
+{5, 1, 1, symbol12_131_bits},
+{5, 1, 1, symbol12_132_bits},
+{5, 1, 1, symbol12_133_bits},
+{5, 1, 1, symbol12_134_bits},
+{5, 1, 1, symbol12_135_bits},
+{5, 1, 1, symbol12_136_bits},
+{5, 1, 1, symbol12_137_bits},
+{5, 1, 1, symbol12_138_bits},
+{5, 1, 1, symbol12_139_bits},
+{5, 1, 1, symbol12_140_bits},
+{5, 1, 1, symbol12_141_bits},
+{5, 1, 1, symbol12_142_bits},
+{5, 1, 1, symbol12_143_bits},
+{5, 1, 1, symbol12_144_bits},
+{5, 1, 1, symbol12_145_bits},
+{5, 1, 1, symbol12_146_bits},
+{5, 1, 1, symbol12_147_bits},
+{5, 1, 1, symbol12_148_bits},
+{5, 1, 1, symbol12_149_bits},
+{5, 1, 1, symbol12_150_bits},
+{5, 1, 1, symbol12_151_bits},
+{5, 1, 1, symbol12_152_bits},
+{5, 1, 1, symbol12_153_bits},
+{5, 1, 1, symbol12_154_bits},
+{5, 1, 1, symbol12_155_bits},
+{5, 1, 1, symbol12_156_bits},
+{5, 1, 1, symbol12_157_bits},
+{5, 1, 1, symbol12_158_bits},
+{5, 1, 1, symbol12_159_bits},
+{5, 1, 1, symbol12_160_bits},
+{8, 9, 9, symbol12_161_bits},
+{3, 3, 9, symbol12_162_bits},
+{6, 7, 7, symbol12_163_bits},
+{5, 9, 9, symbol12_164_bits},
+{9, 4, 5, symbol12_165_bits},
+{6, 12, 9, symbol12_166_bits},
+{7, 7, 6, symbol12_167_bits},
+{5, 6, 6, symbol12_168_bits},
+{7, 6, 6, symbol12_169_bits},
+{7, 7, 6, symbol12_170_bits},
+{11, 5, 6, symbol12_171_bits},
+{12, 5, 6, symbol12_172_bits},
+{5, 16, 12, symbol12_173_bits},
+{12, 5, 6, symbol12_174_bits},
+{5, 15, 12, symbol12_175_bits},
+{4, 4, 9, symbol12_176_bits},
+{5, 7, 7, symbol12_177_bits},
+{5, 3, 9, symbol12_178_bits},
+{6, 7, 7, symbol12_179_bits},
+{5, 5, 6, symbol12_180_bits},
+{8, 4, 5, symbol12_181_bits},
+{5, 10, 10, symbol12_182_bits},
+{4, 4, 5, symbol12_183_bits},
+{5, 5, 6, symbol12_184_bits},
+{5, 7, 7, symbol12_185_bits},
+{5, 5, 6, symbol12_186_bits},
+{6, 5, 6, symbol12_187_bits},
+{9, 1, 1, symbol12_188_bits},
+{1, 16, 12, symbol12_189_bits},
+{13, 1, 4, symbol12_190_bits},
+{7, 8, 8, symbol12_191_bits},
+{7, 9, 9, symbol12_192_bits},
+{8, 11, 10, symbol12_193_bits},
+{9, 10, 10, symbol12_194_bits},
+{8, 11, 8, symbol12_195_bits},
+{9, 9, 9, symbol12_196_bits},
+{9, 9, 9, symbol12_197_bits},
+{9, 9, 9, symbol12_198_bits},
+{8, 6, 6, symbol12_199_bits},
+{8, 6, 6, symbol12_200_bits},
+{8, 6, 6, symbol12_201_bits},
+{8, 8, 6, symbol12_202_bits},
+{8, 8, 7, symbol12_203_bits},
+{8, 6, 6, symbol12_204_bits},
+{8, 8, 6, symbol12_205_bits},
+{6, 6, 6, symbol12_206_bits},
+{6, 8, 7, symbol12_207_bits},
+{9, 9, 9, symbol12_208_bits},
+{8, 9, 9, symbol12_209_bits},
+{8, 9, 9, symbol12_210_bits},
+{8, 9, 9, symbol12_211_bits},
+{11, 6, 9, symbol12_212_bits},
+{9, 11, 10, symbol12_213_bits},
+{7, 12, 12, symbol12_214_bits},
+{2, 1, 4, symbol12_215_bits},
+{7, 4, 4, symbol12_216_bits},
+{6, 6, 6, symbol12_217_bits},
+{6, 6, 6, symbol12_218_bits},
+{11, 5, 6, symbol12_219_bits},
+{11, 5, 6, symbol12_220_bits},
+{5, 12, 11, symbol12_221_bits},
+{11, 5, 6, symbol12_222_bits},
+{5, 12, 12, symbol12_223_bits},
+{6, 9, 9, symbol12_224_bits},
+{4, 11, 10, symbol12_225_bits},
+{8, 9, 9, symbol12_226_bits},
+{8, 9, 9, symbol12_227_bits},
+{10, 6, 9, symbol12_228_bits},
+{8, 11, 10, symbol12_229_bits},
+{4, 16, 12, symbol12_230_bits},
+{1, 16, 12, symbol12_231_bits},
+{4, 16, 12, symbol12_232_bits},
+{3, 16, 12, symbol12_233_bits},
+{1, 16, 12, symbol12_234_bits},
+{3, 15, 12, symbol12_235_bits},
+{3, 16, 12, symbol12_236_bits},
+{3, 16, 12, symbol12_237_bits},
+{3, 15, 12, symbol12_238_bits},
+{1, 16, 12, symbol12_239_bits},
+{5, 1, 1, symbol12_240_bits},
+{4, 12, 10, symbol12_241_bits},
+{5, 15, 12, symbol12_242_bits},
+{5, 16, 12, symbol12_243_bits},
+{1, 16, 12, symbol12_244_bits},
+{5, 15, 12, symbol12_245_bits},
+{4, 16, 12, symbol12_246_bits},
+{1, 16, 12, symbol12_247_bits},
+{4, 16, 12, symbol12_248_bits},
+{3, 16, 12, symbol12_249_bits},
+{1, 16, 12, symbol12_250_bits},
+{3, 15, 12, symbol12_251_bits},
+{3, 16, 12, symbol12_252_bits},
+{3, 16, 12, symbol12_253_bits},
+{3, 15, 12, symbol12_254_bits},
+{5, 1, 1, symbol12_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol14.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol14.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol14.bdf	(revision 15879)
@@ -0,0 +1,3274 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Symbol-Medium-R-Normal--14-140-75-75-P-85-Adobe-FontSpecific
+SIZE 14 75 75
+FONTBOUNDINGBOX 16 20 -1 -6
+STARTPROPERTIES 31
+FOUNDRY "Adobe"
+FAMILY_NAME "Symbol"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 14
+POINT_SIZE 140
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 85
+CHARSET_REGISTRY "Adobe"
+CHARSET_ENCODING "FontSpecific"
+CAP_HEIGHT 10
+X_HEIGHT 7
+FACE_NAME "Symbol"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "No mark"
+_DEC_DEVICE_FONTNAMES "PS=Symbol"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2-1, 18-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+FULL_NAME "Symbol"
+FONT "-Adobe-Symbol-Medium-R-Normal--14-140-75-75-P-85-Adobe-FontSpecific"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 9
+DEFAULT_CHAR 32
+FONT_ASCENT 12
+FONT_DESCENT 3
+ENDPROPERTIES
+CHARS 188
+STARTCHAR space
+ENCODING 32
+SWIDTH 274 0
+DWIDTH 4 0
+BBX 1 1 1 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 342 0
+DWIDTH 5 0
+BBX 1 10 2 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+00
+80
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 9 10 0 0
+BITMAP
+8080
+4100
+4100
+3e00
+2200
+2200
+1400
+1400
+0800
+0800
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 7 10 0 0
+BITMAP
+14
+14
+14
+7e
+28
+28
+fc
+50
+50
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 6 10 1 0
+BITMAP
+fc
+04
+04
+04
+fc
+04
+04
+04
+04
+fc
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 822 0
+DWIDTH 12 0
+BBX 9 10 1 0
+BITMAP
+7980
+9700
+9200
+9400
+6c00
+1b00
+1480
+2480
+4480
+c300
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+3000
+4800
+4800
+7000
+2700
+7200
+ca00
+8400
+ce80
+7b00
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 5 7 0 0
+BITMAP
+e0
+10
+08
+78
+08
+10
+e0
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 342 0
+DWIDTH 5 0
+BBX 3 13 1 -3
+BITMAP
+20
+40
+40
+80
+80
+80
+80
+80
+80
+80
+40
+40
+20
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 342 0
+DWIDTH 5 0
+BBX 3 13 1 -3
+BITMAP
+80
+40
+40
+20
+20
+20
+20
+20
+20
+20
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 5 6 1 2
+BITMAP
+20
+a8
+70
+70
+a8
+20
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+10
+10
+10
+fe
+10
+10
+10
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 205 0
+DWIDTH 3 0
+BBX 2 4 0 -2
+BITMAP
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 1 0 3
+BITMAP
+fe
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 205 0
+DWIDTH 3 0
+BBX 1 2 1 0
+BITMAP
+80
+80
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 274 0
+DWIDTH 4 0
+BBX 4 10 0 0
+BITMAP
+10
+10
+20
+20
+20
+40
+40
+40
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+78
+cc
+84
+84
+84
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+20
+e0
+20
+20
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+70
+d8
+88
+08
+18
+10
+20
+40
+c4
+fc
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+78
+cc
+84
+0c
+38
+0c
+04
+04
+cc
+78
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+08
+18
+18
+28
+68
+48
+88
+fc
+08
+08
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+78
+40
+80
+e0
+30
+18
+08
+08
+90
+e0
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+1c
+30
+40
+40
+f8
+8c
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+fc
+84
+08
+08
+10
+10
+20
+20
+40
+40
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+70
+d8
+88
+88
+70
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+78
+cc
+84
+84
+c4
+78
+18
+10
+60
+c0
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 274 0
+DWIDTH 4 0
+BBX 1 7 2 0
+BITMAP
+80
+80
+00
+00
+00
+80
+80
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 274 0
+DWIDTH 4 0
+BBX 2 9 1 -2
+BITMAP
+40
+40
+00
+00
+00
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 1 0
+BITMAP
+02
+0c
+30
+c0
+30
+0c
+02
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 3 0 2
+BITMAP
+fe
+00
+fe
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+80
+60
+18
+06
+18
+60
+80
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 5 10 0 0
+BITMAP
+70
+88
+88
+08
+10
+20
+20
+00
+20
+20
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+72
+9c
+00
+fe
+00
+00
+fe
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+0800
+1c00
+1400
+1400
+2200
+2200
+3e00
+6300
+4100
+e380
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+fc
+46
+42
+46
+7c
+46
+42
+42
+46
+fc
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+e380
+4100
+2200
+3600
+1c00
+1400
+2200
+6300
+4100
+e380
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+10
+10
+28
+28
+28
+44
+44
+44
+82
+fe
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+fe
+42
+40
+44
+7c
+44
+40
+42
+42
+fe
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+1c00
+0800
+7f00
+c980
+8880
+8880
+c980
+7f00
+0800
+1c00
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+fe
+42
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+e380
+4100
+4100
+4100
+7f00
+4100
+4100
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 342 0
+DWIDTH 5 0
+BBX 3 10 1 0
+BITMAP
+e0
+40
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+0c
+0a
+0a
+66
+a3
+22
+22
+22
+36
+1c
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+ee
+44
+48
+50
+70
+50
+48
+44
+42
+e7
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 10 0 0
+BITMAP
+0800
+0800
+1400
+3600
+2200
+2200
+6300
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 891 0
+DWIDTH 13 0
+BBX 11 10 1 0
+BITMAP
+e0e0
+60c0
+5140
+5140
+5b40
+4a40
+4a40
+4e40
+4440
+e4e0
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+e380
+6100
+5100
+5900
+4900
+4d00
+4500
+4700
+4300
+e100
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+3c
+66
+42
+81
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+ff80
+4100
+4100
+4100
+4100
+4100
+4100
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+3c
+66
+42
+a5
+bd
+a5
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 6 10 1 0
+BITMAP
+f8
+4c
+44
+44
+4c
+78
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 8 10 1 0
+BITMAP
+fe
+c2
+60
+30
+18
+10
+20
+40
+c1
+ff
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+fe
+92
+92
+10
+10
+10
+10
+10
+10
+38
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 9 10 0 0
+BITMAP
+e380
+4100
+2200
+2200
+1400
+0800
+0800
+0800
+0800
+1c00
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 10 1 -3
+BITMAP
+38
+c0
+80
+80
+80
+60
+38
+04
+24
+38
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 10 10 0 0
+BITMAP
+0c00
+3300
+2100
+4080
+4080
+4080
+4080
+2100
+9240
+f3c0
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 9 10 0 0
+BITMAP
+7f00
+4100
+0000
+2200
+3e00
+2200
+0000
+0000
+8080
+ff80
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 11 10 0 0
+BITMAP
+ce60
+64c0
+2480
+2480
+1f00
+0400
+0400
+0400
+0400
+0e00
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+fe
+82
+04
+08
+10
+10
+20
+40
+82
+fe
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 342 0
+DWIDTH 5 0
+BBX 3 13 1 -3
+BITMAP
+e0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+e0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 8 7 1 0
+BITMAP
+18
+18
+00
+00
+00
+c3
+c3
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 342 0
+DWIDTH 5 0
+BBX 3 13 1 -3
+BITMAP
+e0
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+e0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 10 0 0
+BITMAP
+0800
+0800
+0800
+0800
+0800
+0800
+0800
+0800
+0800
+ff80
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 7 1 0 -3
+BITMAP
+fe
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 8 1 0 13
+BITMAP
+ff
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 8 7 1 0
+BITMAP
+76
+d4
+88
+88
+88
+d5
+66
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 6 14 1 -3
+BITMAP
+78
+cc
+84
+8c
+98
+8c
+84
+84
+84
+cc
+b8
+80
+80
+80
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 8 10 0 -3
+BITMAP
+c3
+a6
+24
+3c
+18
+38
+28
+64
+45
+c3
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 5 11 1 0
+BITMAP
+70
+98
+80
+40
+70
+98
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 5 7 1 0
+BITMAP
+78
+c8
+80
+60
+80
+c8
+70
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 13 1 -3
+BITMAP
+10
+10
+10
+38
+54
+92
+92
+92
+54
+38
+10
+10
+10
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 6 10 0 -3
+BITMAP
+c4
+a4
+24
+28
+28
+18
+18
+10
+30
+30
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 10 0 -3
+BITMAP
+6c
+b2
+22
+22
+22
+22
+22
+02
+02
+02
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 342 0
+DWIDTH 5 0
+BBX 5 7 0 0
+BITMAP
+60
+a0
+20
+20
+20
+28
+30
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 10 1 -3
+BITMAP
+18
+54
+d2
+92
+92
+54
+38
+10
+10
+10
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+46
+ca
+50
+70
+58
+4c
+46
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 8 10 1 0
+BITMAP
+60
+50
+10
+10
+28
+28
+48
+44
+85
+83
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 9 1 -2
+BITMAP
+88
+88
+88
+88
+88
+9a
+f6
+80
+c0
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+c6
+42
+22
+22
+14
+14
+08
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 6 7 1 0
+BITMAP
+78
+cc
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 8 7 0 0
+BITMAP
+7e
+a4
+24
+24
+24
+25
+66
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+70
+d8
+88
+88
+f8
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 6 10 1 -3
+BITMAP
+78
+cc
+84
+84
+84
+cc
+b8
+80
+80
+80
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 1 0
+BITMAP
+7e
+c8
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 5 7 0 0
+BITMAP
+78
+a0
+20
+20
+20
+28
+30
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+64
+a2
+22
+22
+22
+26
+1c
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 10 8 0 0
+BITMAP
+7fc0
+a080
+4440
+4440
+4440
+4440
+64c0
+3b80
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 7 1 0
+BITMAP
+6300
+8880
+8880
+8880
+8880
+c980
+7700
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 15 1 -3
+BITMAP
+20
+40
+38
+20
+40
+78
+20
+40
+80
+80
+c0
+78
+04
+24
+38
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 9 10 0 -3
+BITMAP
+8880
+4900
+4900
+4900
+6b00
+3e00
+0800
+0800
+0800
+0800
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 14 1 -3
+BITMAP
+20
+44
+3c
+10
+20
+40
+40
+80
+80
+c0
+78
+04
+24
+38
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 5 13 1 -3
+BITMAP
+18
+20
+20
+20
+20
+40
+80
+40
+20
+20
+20
+20
+18
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 205 0
+DWIDTH 3 0
+BBX 1 13 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 5 13 1 -3
+BITMAP
+c0
+20
+20
+20
+20
+10
+08
+10
+20
+20
+20
+20
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 3 1 2
+BITMAP
+62
+92
+8c
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 8 10 0 0
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 274 0
+DWIDTH 4 0
+BBX 4 3 0 7
+BITMAP
+00
+00
+00
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 274 0
+DWIDTH 4 0
+BBX 5 10 -1 0
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 4 0 2
+BITMAP
+0000
+c600
+2b00
+1000
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 7 13 0 -3
+BITMAP
+10
+10
+10
+38
+30
+60
+80
+02
+0c
+30
+c0
+30
+0c
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 8 1 -1
+BITMAP
+0200
+fe00
+0800
+1000
+2000
+4080
+8000
+0080
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 7 7 2 0
+BITMAP
+80
+8c
+80
+76
+00
+06
+0a
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 7 7 2 0
+BITMAP
+08
+08
+3c
+10
+10
+10
+20
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 8 1 -1
+BITMAP
+2000
+a080
+1c00
+1c00
+1c00
+eb80
+ff80
+eb80
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 1028 0
+DWIDTH 15 0
+BBX 13 7 1 0
+BITMAP
+0800
+0800
+1038
+7cf8
+7c38
+1068
+fef8
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 960 0
+DWIDTH 14 0
+BBX 14 7 0 0
+BITMAP
+fe7c
+3810
+0800
+1c00
+3e00
+7f00
+ff80
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 20 1 -6
+BITMAP
+6a
+00
+08
+00
+08
+00
+10
+40
+20
+20
+40
+10
+fe
+f8
+40
+10
+20
+20
+10
+40
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 960 0
+DWIDTH 14 0
+BBX 14 7 0 0
+BITMAP
+1000
+2000
+4000
+fffc
+4000
+2000
+1000
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 17 1 -3
+BITMAP
+10
+38
+54
+92
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 4 4 1 6
+BITMAP
+10
+10
+10
+00
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+20
+00
+10
+00
+08
+fe
+fc
+00
+08
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 7 3 -1 7
+BITMAP
+00
+10
+00
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+20
+10
+10
+10
+10
+10
+10
+10
+10
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+10
+10
+10
+10
+10
+92
+54
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 8 4 0 2
+BITMAP
+38
+10
+60
+90
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 6 11 0 0
+BITMAP
+90
+60
+10
+10
+10
+fc
+10
+10
+10
+00
+fc
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+30
+68
+90
+80
+60
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+18
+06
+18
+60
+80
+00
+fe
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+82
+44
+28
+10
+28
+44
+82
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 5 0 1
+BITMAP
+76
+88
+88
+76
+70
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 7 5 0 1
+BITMAP
+88
+04
+04
+04
+74
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 891 0
+DWIDTH 13 0
+BBX 9 2 2 0
+BITMAP
+cc80
+8480
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 1 20 4 -6
+BITMAP
+00
+00
+80
+80
+80
+00
+00
+00
+00
+80
+00
+00
+00
+00
+00
+80
+00
+80
+00
+00
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 1028 0
+DWIDTH 15 0
+BBX 15 1 0 3
+BITMAP
+fe00
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 8 9 0 0
+BITMAP
+fe
+00
+fe
+72
+9c
+00
+72
+9c
+88
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 822 0
+DWIDTH 12 0
+BBX 8 10 2 0
+BITMAP
+80
+88
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 8 12 1 -1
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 822 0
+DWIDTH 12 0
+BBX 10 11 1 0
+BITMAP
+80c0
+fe00
+0100
+0100
+0140
+ff40
+88c0
+6600
+7480
+8c40
+63c0
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 822 0
+DWIDTH 12 0
+BBX 9 12 1 -3
+BITMAP
+3f00
+4200
+2400
+0300
+6180
+1a00
+7300
+9d80
+8980
+8b00
+ce00
+6a00
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+2900
+0900
+0900
+6900
+b080
+1000
+2300
+4580
+8880
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+9080
+d480
+6900
+6b00
+b600
+9000
+9000
+6000
+1c00
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 822 0
+DWIDTH 12 0
+BBX 11 11 0 0
+BITMAP
+6300
+6300
+9480
+8880
+9480
+6300
+6300
+1c00
+1c00
+6300
+4900
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 10 7 0 0
+BITMAP
+8880
+be80
+8880
+4900
+6300
+1c00
+1f00
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 10 7 0 0
+BITMAP
+60c0
+40c0
+8100
+8200
+8400
+8800
+9000
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 7 0 0
+BITMAP
+6000
+6080
+9f00
+1e00
+6180
+4080
+8000
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 9 1 -2
+BITMAP
+8000
+8000
+8000
+8000
+8000
+8000
+8000
+4080
+6180
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 9 0 -1
+BITMAP
+1e00
+fe00
+0100
+0080
+0080
+0080
+0100
+fe00
+fe00
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 7 1 0
+BITMAP
+0100
+0080
+0080
+0080
+0100
+fe00
+0000
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 9 0 -2
+BITMAP
+ff80
+0100
+3f80
+4200
+8200
+8400
+8400
+4800
+3f80
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 7 7 1 0
+BITMAP
+10
+00
+3e
+80
+40
+00
+80
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 7 9 0 -1
+BITMAP
+00
+80
+00
+80
+00
+40
+00
+3e
+80
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 11 10 0 0
+BITMAP
+3f80
+4000
+8000
+8000
+8000
+4000
+3f80
+0000
+ff80
+3e40
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 11 0 0
+BITMAP
+8080
+8000
+3e00
+3e00
+9080
+9000
+3e00
+0000
+0080
+0100
+0200
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 822 0
+DWIDTH 12 0
+BBX 10 10 1 0
+BITMAP
+0400
+0800
+1000
+2000
+4000
+ffc0
+ff80
+8080
+4100
+4100
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 822 0
+DWIDTH 12 0
+BBX 10 10 1 0
+BITMAP
+2200
+2200
+2200
+1400
+1400
+0800
+0800
+1e00
+2100
+7c80
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 11 6 0 4
+BITMAP
+9240
+9240
+9c40
+9240
+7980
+2100
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 822 0
+DWIDTH 12 0
+BBX 10 12 1 -1
+BITMAP
+1e00
+1e00
+2100
+4e80
+9240
+9040
+9040
+9240
+4c80
+2100
+1e00
+fa80
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 548 0
+DWIDTH 8 0
+BBX 8 14 0 0
+BITMAP
+aa
+80
+26
+c0
+25
+40
+25
+40
+76
+e0
+ff
+c0
+40
+80
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 274 0
+DWIDTH 4 0
+BBX 1 2 1 3
+BITMAP
+00
+80
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 5 0 0
+BITMAP
+4080
+4080
+4080
+4080
+4080
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+40
+80
+40
+80
+40
+80
+e1
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 8 7 0 0
+BITMAP
+c0
+01
+01
+01
+02
+02
+02
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 1028 0
+DWIDTH 15 0
+BBX 13 7 1 0
+BITMAP
+0260
+a420
+1410
+0808
+8080
+ff80
+0080
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 960 0
+DWIDTH 14 0
+BBX 13 7 0 0
+BITMAP
+0080
+0080
+0080
+1818
+2420
+4240
+8180
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+42
+42
+24
+24
+18
+18
+10
+40
+20
+20
+7e
+f0
+c0
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 960 0
+DWIDTH 14 0
+BBX 13 7 1 0
+BITMAP
+1878
+f020
+2010
+4010
+0020
+0078
+f8c0
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 617 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+00
+7e
+f8
+20
+00
+10
+00
+10
+38
+6c
+aa
+28
+28
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 7 11 0 0
+BITMAP
+28
+28
+28
+28
+28
+28
+28
+00
+40
+00
+20
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 342 0
+DWIDTH 5 0
+BBX 4 15 0 -4
+BITMAP
+f0
+f0
+00
+10
+f0
+f0
+00
+20
+00
+40
+20
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 822 0
+DWIDTH 12 0
+BBX 10 10 1 0
+BITMAP
+2800
+2800
+aa40
+3800
+1000
+2840
+4480
+4440
+2800
+1000
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 822 0
+DWIDTH 12 0
+BBX 10 10 1 0
+BITMAP
+2000
+4040
+4080
+8080
+4040
+4000
+2000
+1e00
+2100
+5c80
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 754 0
+DWIDTH 11 0
+BBX 10 6 0 4
+BITMAP
+9240
+9240
+9c40
+9240
+5280
+2100
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 9 12 0 -1
+BITMAP
+1e00
+1e00
+2100
+4c80
+9200
+9000
+9000
+9200
+4c80
+2100
+1e00
+fa80
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 4 20 1 -6
+BITMAP
+20
+80
+20
+c0
+20
+40
+20
+40
+20
+40
+f0
+00
+80
+00
+40
+00
+20
+00
+10
+00
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 1 20 1 -6
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+80
+80
+80
+80
+00
+00
+00
+00
+80
+80
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 4 20 1 -6
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 4 20 1 -6
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 1 20 1 -6
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+00
+00
+00
+00
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 4 17 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 4 20 3 -6
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 3 20 1 -6
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+e0
+20
+40
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 4 17 3 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+20
+20
+20
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 1 20 3 -6
+BITMAP
+00
+00
+00
+00
+00
+00
+80
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+80
+80
+80
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 342 0
+DWIDTH 5 0
+BBX 4 15 1 -4
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+40
+30
+80
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 274 0
+DWIDTH 4 0
+BBX 5 13 0 -1
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 5 20 5 -6
+BITMAP
+80
+80
+80
+80
+80
+80
+00
+80
+40
+40
+20
+20
+20
+10
+10
+10
+20
+20
+20
+40
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 1 20 1 -6
+BITMAP
+00
+80
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+80
+80
+00
+00
+00
+80
+80
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 685 0
+DWIDTH 10 0
+BBX 5 17 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 4 20 1 -6
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+00
+00
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 1 20 4 -6
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+80
+80
+80
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 4 20 1 -6
+BITMAP
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 4 20 1 -6
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+10
+10
+10
+10
+10
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 1 20 4 -6
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+80
+80
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 411 0
+DWIDTH 6 0
+BBX 4 17 1 -3
+BITMAP
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+80
+80
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 4 20 0 -6
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+10
+10
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 3 20 3 -6
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+e0
+c0
+20
+00
+00
+00
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 480 0
+DWIDTH 7 0
+BBX 4 17 0 -3
+BITMAP
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+10
+80
+80
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol14.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol14.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol14.h	(revision 15879)
@@ -0,0 +1,859 @@
+static unsigned char symbol14_0_bits[] = {
+0x00};
+static unsigned char symbol14_1_bits[] = {
+0x00};
+static unsigned char symbol14_2_bits[] = {
+0x00};
+static unsigned char symbol14_3_bits[] = {
+0x00};
+static unsigned char symbol14_4_bits[] = {
+0x00};
+static unsigned char symbol14_5_bits[] = {
+0x00};
+static unsigned char symbol14_6_bits[] = {
+0x00};
+static unsigned char symbol14_7_bits[] = {
+0x00};
+static unsigned char symbol14_8_bits[] = {
+0x00};
+static unsigned char symbol14_9_bits[] = {
+0x00};
+static unsigned char symbol14_10_bits[] = {
+0x00};
+static unsigned char symbol14_11_bits[] = {
+0x00};
+static unsigned char symbol14_12_bits[] = {
+0x00};
+static unsigned char symbol14_13_bits[] = {
+0x00};
+static unsigned char symbol14_14_bits[] = {
+0x00};
+static unsigned char symbol14_15_bits[] = {
+0x00};
+static unsigned char symbol14_16_bits[] = {
+0x00};
+static unsigned char symbol14_17_bits[] = {
+0x00};
+static unsigned char symbol14_18_bits[] = {
+0x00};
+static unsigned char symbol14_19_bits[] = {
+0x00};
+static unsigned char symbol14_20_bits[] = {
+0x00};
+static unsigned char symbol14_21_bits[] = {
+0x00};
+static unsigned char symbol14_22_bits[] = {
+0x00};
+static unsigned char symbol14_23_bits[] = {
+0x00};
+static unsigned char symbol14_24_bits[] = {
+0x00};
+static unsigned char symbol14_25_bits[] = {
+0x00};
+static unsigned char symbol14_26_bits[] = {
+0x00};
+static unsigned char symbol14_27_bits[] = {
+0x00};
+static unsigned char symbol14_28_bits[] = {
+0x00};
+static unsigned char symbol14_29_bits[] = {
+0x00};
+static unsigned char symbol14_30_bits[] = {
+0x00};
+static unsigned char symbol14_31_bits[] = {
+0x00};
+static unsigned char symbol14_32_bits[] = {
+0x00};
+static unsigned char symbol14_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01};
+static unsigned char symbol14_34_bits[] = {
+0x01, 0x01, 0x82, 0x00, 0x82, 0x00, 0x7c, 0x00, 0x44, 0x00, 0x44, 0x00, 
+0x28, 0x00, 0x28, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char symbol14_35_bits[] = {
+0x28, 0x28, 0x28, 0x7e, 0x14, 0x14, 0x3f, 0x0a, 0x0a, 0x0a};
+static unsigned char symbol14_36_bits[] = {
+0x3f, 0x20, 0x20, 0x20, 0x3f, 0x20, 0x20, 0x20, 0x20, 0x3f};
+static unsigned char symbol14_37_bits[] = {
+0x9e, 0x01, 0xe9, 0x00, 0x49, 0x00, 0x29, 0x00, 0x36, 0x00, 0xd8, 0x00, 
+0x28, 0x01, 0x24, 0x01, 0x22, 0x01, 0xc3, 0x00};
+static unsigned char symbol14_38_bits[] = {
+0x0c, 0x00, 0x12, 0x00, 0x12, 0x00, 0x0e, 0x00, 0xe4, 0x00, 0x4e, 0x00, 
+0x53, 0x00, 0x21, 0x00, 0x73, 0x01, 0xde, 0x00};
+static unsigned char symbol14_39_bits[] = {
+0x07, 0x08, 0x10, 0x1e, 0x10, 0x08, 0x07};
+static unsigned char symbol14_40_bits[] = {
+0x04, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 
+0x04};
+static unsigned char symbol14_41_bits[] = {
+0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x02, 
+0x01};
+static unsigned char symbol14_42_bits[] = {
+0x04, 0x15, 0x0e, 0x0e, 0x15, 0x04};
+static unsigned char symbol14_43_bits[] = {
+0x08, 0x08, 0x08, 0x7f, 0x08, 0x08, 0x08};
+static unsigned char symbol14_44_bits[] = {
+0x02, 0x02, 0x02, 0x01};
+static unsigned char symbol14_45_bits[] = {
+0x7f};
+static unsigned char symbol14_46_bits[] = {
+0x01, 0x01};
+static unsigned char symbol14_47_bits[] = {
+0x08, 0x08, 0x04, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01};
+static unsigned char symbol14_48_bits[] = {
+0x1e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char symbol14_49_bits[] = {
+0x04, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char symbol14_50_bits[] = {
+0x0e, 0x1b, 0x11, 0x10, 0x18, 0x08, 0x04, 0x02, 0x23, 0x3f};
+static unsigned char symbol14_51_bits[] = {
+0x1e, 0x33, 0x21, 0x30, 0x1c, 0x30, 0x20, 0x20, 0x33, 0x1e};
+static unsigned char symbol14_52_bits[] = {
+0x10, 0x18, 0x18, 0x14, 0x16, 0x12, 0x11, 0x3f, 0x10, 0x10};
+static unsigned char symbol14_53_bits[] = {
+0x1e, 0x02, 0x01, 0x07, 0x0c, 0x18, 0x10, 0x10, 0x09, 0x07};
+static unsigned char symbol14_54_bits[] = {
+0x38, 0x0c, 0x02, 0x02, 0x1f, 0x31, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char symbol14_55_bits[] = {
+0x3f, 0x21, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02};
+static unsigned char symbol14_56_bits[] = {
+0x0e, 0x1b, 0x11, 0x11, 0x0e, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char symbol14_57_bits[] = {
+0x1e, 0x33, 0x21, 0x21, 0x23, 0x1e, 0x18, 0x08, 0x06, 0x03};
+static unsigned char symbol14_58_bits[] = {
+0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01};
+static unsigned char symbol14_59_bits[] = {
+0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x01};
+static unsigned char symbol14_60_bits[] = {
+0x40, 0x30, 0x0c, 0x03, 0x0c, 0x30, 0x40};
+static unsigned char symbol14_61_bits[] = {
+0x7f, 0x00, 0x7f};
+static unsigned char symbol14_62_bits[] = {
+0x01, 0x06, 0x18, 0x60, 0x18, 0x06, 0x01};
+static unsigned char symbol14_63_bits[] = {
+0x0e, 0x11, 0x11, 0x10, 0x08, 0x04, 0x04, 0x00, 0x04, 0x04};
+static unsigned char symbol14_64_bits[] = {
+0x4e, 0x39, 0x00, 0x7f, 0x00, 0x00, 0x7f};
+static unsigned char symbol14_65_bits[] = {
+0x10, 0x00, 0x38, 0x00, 0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 
+0x7c, 0x00, 0xc6, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char symbol14_66_bits[] = {
+0x3f, 0x62, 0x42, 0x62, 0x3e, 0x62, 0x42, 0x42, 0x62, 0x3f};
+static unsigned char symbol14_67_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 0x6c, 0x00, 0x38, 0x00, 0x28, 0x00, 
+0x44, 0x00, 0xc6, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char symbol14_68_bits[] = {
+0x08, 0x08, 0x14, 0x14, 0x14, 0x22, 0x22, 0x22, 0x41, 0x7f};
+static unsigned char symbol14_69_bits[] = {
+0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 0x42, 0x7f};
+static unsigned char symbol14_70_bits[] = {
+0x38, 0x00, 0x10, 0x00, 0xfe, 0x00, 0x93, 0x01, 0x11, 0x01, 0x11, 0x01, 
+0x93, 0x01, 0xfe, 0x00, 0x10, 0x00, 0x38, 0x00};
+static unsigned char symbol14_71_bits[] = {
+0x7f, 0x42, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char symbol14_72_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xfe, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char symbol14_73_bits[] = {
+0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char symbol14_74_bits[] = {
+0x30, 0x50, 0x50, 0x66, 0xc5, 0x44, 0x44, 0x44, 0x6c, 0x38};
+static unsigned char symbol14_75_bits[] = {
+0x77, 0x22, 0x12, 0x0a, 0x0e, 0x0a, 0x12, 0x22, 0x42, 0xe7};
+static unsigned char symbol14_76_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 0x6c, 0x00, 0x44, 0x00, 0x44, 0x00, 
+0xc6, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char symbol14_77_bits[] = {
+0x07, 0x07, 0x06, 0x03, 0x8a, 0x02, 0x8a, 0x02, 0xda, 0x02, 0x52, 0x02, 
+0x52, 0x02, 0x72, 0x02, 0x22, 0x02, 0x27, 0x07};
+static unsigned char symbol14_78_bits[] = {
+0xc7, 0x01, 0x86, 0x00, 0x8a, 0x00, 0x9a, 0x00, 0x92, 0x00, 0xb2, 0x00, 
+0xa2, 0x00, 0xe2, 0x00, 0xc2, 0x00, 0x87, 0x00};
+static unsigned char symbol14_79_bits[] = {
+0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c};
+static unsigned char symbol14_80_bits[] = {
+0xff, 0x01, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char symbol14_81_bits[] = {
+0x3c, 0x66, 0x42, 0xa5, 0xbd, 0xa5, 0x81, 0x42, 0x66, 0x3c};
+static unsigned char symbol14_82_bits[] = {
+0x1f, 0x32, 0x22, 0x22, 0x32, 0x1e, 0x02, 0x02, 0x02, 0x07};
+static unsigned char symbol14_83_bits[] = {
+0x7f, 0x43, 0x06, 0x0c, 0x18, 0x08, 0x04, 0x02, 0x83, 0xff};
+static unsigned char symbol14_84_bits[] = {
+0x7f, 0x49, 0x49, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1c};
+static unsigned char symbol14_85_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x38, 0x00};
+static unsigned char symbol14_86_bits[] = {
+0x1c, 0x03, 0x01, 0x01, 0x01, 0x06, 0x1c, 0x20, 0x24, 0x1c};
+static unsigned char symbol14_87_bits[] = {
+0x30, 0x00, 0xcc, 0x00, 0x84, 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 
+0x02, 0x01, 0x84, 0x00, 0x49, 0x02, 0xcf, 0x03};
+static unsigned char symbol14_88_bits[] = {
+0xfe, 0x00, 0x82, 0x00, 0x00, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x44, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0xff, 0x01};
+static unsigned char symbol14_89_bits[] = {
+0x73, 0x06, 0x26, 0x03, 0x24, 0x01, 0x24, 0x01, 0xf8, 0x00, 0x20, 0x00, 
+0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x70, 0x00};
+static unsigned char symbol14_90_bits[] = {
+0x7f, 0x41, 0x20, 0x10, 0x08, 0x08, 0x04, 0x02, 0x41, 0x7f};
+static unsigned char symbol14_91_bits[] = {
+0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x07};
+static unsigned char symbol14_92_bits[] = {
+0x18, 0x18, 0x00, 0x00, 0x00, 0xc3, 0xc3};
+static unsigned char symbol14_93_bits[] = {
+0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x07};
+static unsigned char symbol14_94_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0xff, 0x01};
+static unsigned char symbol14_95_bits[] = {
+0x7f};
+static unsigned char symbol14_96_bits[] = {
+0xff};
+static unsigned char symbol14_97_bits[] = {
+0x6e, 0x2b, 0x11, 0x11, 0x11, 0xab, 0x66};
+static unsigned char symbol14_98_bits[] = {
+0x1e, 0x33, 0x21, 0x31, 0x19, 0x31, 0x21, 0x21, 0x21, 0x33, 0x1d, 0x01, 
+0x01, 0x01};
+static unsigned char symbol14_99_bits[] = {
+0xc3, 0x65, 0x24, 0x3c, 0x18, 0x1c, 0x14, 0x26, 0xa2, 0xc3};
+static unsigned char symbol14_100_bits[] = {
+0x0e, 0x19, 0x01, 0x02, 0x0e, 0x19, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char symbol14_101_bits[] = {
+0x1e, 0x13, 0x01, 0x06, 0x01, 0x13, 0x0e};
+static unsigned char symbol14_102_bits[] = {
+0x08, 0x08, 0x08, 0x1c, 0x2a, 0x49, 0x49, 0x49, 0x2a, 0x1c, 0x08, 0x08, 
+0x08};
+static unsigned char symbol14_103_bits[] = {
+0x23, 0x25, 0x24, 0x14, 0x14, 0x18, 0x18, 0x08, 0x0c, 0x0c};
+static unsigned char symbol14_104_bits[] = {
+0x36, 0x4d, 0x44, 0x44, 0x44, 0x44, 0x44, 0x40, 0x40, 0x40};
+static unsigned char symbol14_105_bits[] = {
+0x06, 0x05, 0x04, 0x04, 0x04, 0x14, 0x0c};
+static unsigned char symbol14_106_bits[] = {
+0x18, 0x2a, 0x4b, 0x49, 0x49, 0x2a, 0x1c, 0x08, 0x08, 0x08};
+static unsigned char symbol14_107_bits[] = {
+0x62, 0x53, 0x0a, 0x0e, 0x1a, 0x32, 0x62};
+static unsigned char symbol14_108_bits[] = {
+0x06, 0x0a, 0x08, 0x08, 0x14, 0x14, 0x12, 0x22, 0xa1, 0xc1};
+static unsigned char symbol14_109_bits[] = {
+0x11, 0x11, 0x11, 0x11, 0x11, 0x59, 0x6f, 0x01, 0x03};
+static unsigned char symbol14_110_bits[] = {
+0x63, 0x42, 0x44, 0x44, 0x28, 0x28, 0x10};
+static unsigned char symbol14_111_bits[] = {
+0x1e, 0x33, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char symbol14_112_bits[] = {
+0x7e, 0x25, 0x24, 0x24, 0x24, 0xa4, 0x66};
+static unsigned char symbol14_113_bits[] = {
+0x0e, 0x1b, 0x11, 0x11, 0x1f, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char symbol14_114_bits[] = {
+0x1e, 0x33, 0x21, 0x21, 0x21, 0x33, 0x1d, 0x01, 0x01, 0x01};
+static unsigned char symbol14_115_bits[] = {
+0x7e, 0x13, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char symbol14_116_bits[] = {
+0x1e, 0x05, 0x04, 0x04, 0x04, 0x14, 0x0c};
+static unsigned char symbol14_117_bits[] = {
+0x26, 0x45, 0x44, 0x44, 0x44, 0x64, 0x38};
+static unsigned char symbol14_118_bits[] = {
+0xfe, 0x03, 0x05, 0x01, 0x22, 0x02, 0x22, 0x02, 0x22, 0x02, 0x22, 0x02, 
+0x26, 0x03, 0xdc, 0x01};
+static unsigned char symbol14_119_bits[] = {
+0xc6, 0x00, 0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x11, 0x01, 0x93, 0x01, 
+0xee, 0x00};
+static unsigned char symbol14_120_bits[] = {
+0x04, 0x02, 0x1c, 0x04, 0x02, 0x1e, 0x04, 0x02, 0x01, 0x01, 0x03, 0x1e, 
+0x20, 0x24, 0x1c};
+static unsigned char symbol14_121_bits[] = {
+0x11, 0x01, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0xd6, 0x00, 0x7c, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char symbol14_122_bits[] = {
+0x04, 0x22, 0x3c, 0x08, 0x04, 0x02, 0x02, 0x01, 0x01, 0x03, 0x1e, 0x20, 
+0x24, 0x1c};
+static unsigned char symbol14_123_bits[] = {
+0x18, 0x04, 0x04, 0x04, 0x04, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 
+0x18};
+static unsigned char symbol14_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01};
+static unsigned char symbol14_125_bits[] = {
+0x03, 0x04, 0x04, 0x04, 0x04, 0x08, 0x10, 0x08, 0x04, 0x04, 0x04, 0x04, 
+0x03};
+static unsigned char symbol14_126_bits[] = {
+0x46, 0x49, 0x31};
+static unsigned char symbol14_127_bits[] = {
+0x00};
+static unsigned char symbol14_128_bits[] = {
+0x00};
+static unsigned char symbol14_129_bits[] = {
+0x00};
+static unsigned char symbol14_130_bits[] = {
+0x00};
+static unsigned char symbol14_131_bits[] = {
+0x00};
+static unsigned char symbol14_132_bits[] = {
+0x00};
+static unsigned char symbol14_133_bits[] = {
+0x00};
+static unsigned char symbol14_134_bits[] = {
+0x00};
+static unsigned char symbol14_135_bits[] = {
+0x00};
+static unsigned char symbol14_136_bits[] = {
+0x00};
+static unsigned char symbol14_137_bits[] = {
+0x00};
+static unsigned char symbol14_138_bits[] = {
+0x00};
+static unsigned char symbol14_139_bits[] = {
+0x00};
+static unsigned char symbol14_140_bits[] = {
+0x00};
+static unsigned char symbol14_141_bits[] = {
+0x00};
+static unsigned char symbol14_142_bits[] = {
+0x00};
+static unsigned char symbol14_143_bits[] = {
+0x00};
+static unsigned char symbol14_144_bits[] = {
+0x00};
+static unsigned char symbol14_145_bits[] = {
+0x00};
+static unsigned char symbol14_146_bits[] = {
+0x00};
+static unsigned char symbol14_147_bits[] = {
+0x00};
+static unsigned char symbol14_148_bits[] = {
+0x00};
+static unsigned char symbol14_149_bits[] = {
+0x00};
+static unsigned char symbol14_150_bits[] = {
+0x00};
+static unsigned char symbol14_151_bits[] = {
+0x00};
+static unsigned char symbol14_152_bits[] = {
+0x00};
+static unsigned char symbol14_153_bits[] = {
+0x00};
+static unsigned char symbol14_154_bits[] = {
+0x00};
+static unsigned char symbol14_155_bits[] = {
+0x00};
+static unsigned char symbol14_156_bits[] = {
+0x00};
+static unsigned char symbol14_157_bits[] = {
+0x00};
+static unsigned char symbol14_158_bits[] = {
+0x00};
+static unsigned char symbol14_159_bits[] = {
+0x00};
+static unsigned char symbol14_160_bits[] = {
+0x00};
+static unsigned char symbol14_161_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol14_162_bits[] = {
+0x00, 0x00, 0x00};
+static unsigned char symbol14_163_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol14_164_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol14_165_bits[] = {
+0x00, 0x00, 0x63, 0x00, 0xd4, 0x00, 0x08, 0x00};
+static unsigned char symbol14_166_bits[] = {
+0x08, 0x08, 0x08, 0x1c, 0x0c, 0x06, 0x01, 0x40, 0x30, 0x0c, 0x03, 0x0c, 
+0x30};
+static unsigned char symbol14_167_bits[] = {
+0x40, 0x00, 0x7f, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x01, 
+0x01, 0x00, 0x00, 0x01};
+static unsigned char symbol14_168_bits[] = {
+0x01, 0x31, 0x01, 0x6e, 0x00, 0x60, 0x50};
+static unsigned char symbol14_169_bits[] = {
+0x10, 0x10, 0x3c, 0x08, 0x08, 0x08, 0x04};
+static unsigned char symbol14_170_bits[] = {
+0x04, 0x00, 0x05, 0x01, 0x38, 0x00, 0x38, 0x00, 0x38, 0x00, 0xd7, 0x01, 
+0xff, 0x01, 0xd7, 0x01};
+static unsigned char symbol14_171_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x08, 0x1c, 0x3e, 0x1f, 0x3e, 0x1c, 0x08, 0x16, 
+0x7f, 0x1f};
+static unsigned char symbol14_172_bits[] = {
+0x7f, 0x3e, 0x1c, 0x08, 0x10, 0x00, 0x38, 0x00, 0x7c, 0x00, 0xfe, 0x00, 
+0xff, 0x01};
+static unsigned char symbol14_173_bits[] = {
+0x56, 0x00, 0x10, 0x00, 0x10, 0x00, 0x08, 0x02, 0x04, 0x04, 0x02, 0x08, 
+0x7f, 0x1f, 0x02, 0x08, 0x04, 0x04, 0x08, 0x02};
+static unsigned char symbol14_174_bits[] = {
+0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0xff, 0x3f, 0x02, 0x00, 0x04, 0x00, 
+0x08, 0x00};
+static unsigned char symbol14_175_bits[] = {
+0x08, 0x1c, 0x2a, 0x49, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x08, 0x08};
+static unsigned char symbol14_176_bits[] = {
+0x08, 0x08, 0x08, 0x00};
+static unsigned char symbol14_177_bits[] = {
+0x04, 0x00, 0x08, 0x00, 0x10, 0x7f, 0x3f, 0x00, 0x10};
+static unsigned char symbol14_178_bits[] = {
+0x00, 0x08, 0x00};
+static unsigned char symbol14_179_bits[] = {
+0x04, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08};
+static unsigned char symbol14_180_bits[] = {
+0x08, 0x08, 0x08, 0x08, 0x08, 0x49, 0x2a};
+static unsigned char symbol14_181_bits[] = {
+0x1c, 0x08, 0x06, 0x09};
+static unsigned char symbol14_182_bits[] = {
+0x09, 0x06, 0x08, 0x08, 0x08, 0x3f, 0x08, 0x08, 0x08, 0x00, 0x3f};
+static unsigned char symbol14_183_bits[] = {
+0x0c, 0x16, 0x09, 0x01, 0x06};
+static unsigned char symbol14_184_bits[] = {
+0x18, 0x60, 0x18, 0x06, 0x01, 0x00, 0x7f};
+static unsigned char symbol14_185_bits[] = {
+0x41, 0x22, 0x14, 0x08, 0x14, 0x22, 0x41};
+static unsigned char symbol14_186_bits[] = {
+0x6e, 0x11, 0x11, 0x6e, 0x0e};
+static unsigned char symbol14_187_bits[] = {
+0x11, 0x20, 0x20, 0x20, 0x2e};
+static unsigned char symbol14_188_bits[] = {
+0x33, 0x01, 0x21, 0x01};
+static unsigned char symbol14_189_bits[] = {
+0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00};
+static unsigned char symbol14_190_bits[] = {
+0x7f, 0x00};
+static unsigned char symbol14_191_bits[] = {
+0x7f, 0x00, 0x7f, 0x4e, 0x39, 0x00, 0x4e, 0x39, 0x11};
+static unsigned char symbol14_192_bits[] = {
+0x01, 0x11, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol14_193_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol14_194_bits[] = {
+0x01, 0x03, 0x7f, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x02, 0xff, 0x02, 
+0x11, 0x03, 0x66, 0x00, 0x2e, 0x01, 0x31, 0x02, 0xc6, 0x03};
+static unsigned char symbol14_195_bits[] = {
+0xfc, 0x00, 0x42, 0x00, 0x24, 0x00, 0xc0, 0x00, 0x86, 0x01, 0x58, 0x00, 
+0xce, 0x00, 0xb9, 0x01, 0x91, 0x01, 0xd1, 0x00, 0x73, 0x00, 0x56, 0x00};
+static unsigned char symbol14_196_bits[] = {
+0x94, 0x00, 0x90, 0x00, 0x90, 0x00, 0x96, 0x00, 0x0d, 0x01, 0x08, 0x00, 
+0xc4, 0x00, 0xa2, 0x01, 0x11, 0x01};
+static unsigned char symbol14_197_bits[] = {
+0x09, 0x01, 0x2b, 0x01, 0x96, 0x00, 0xd6, 0x00, 0x6d, 0x00, 0x09, 0x00, 
+0x09, 0x00, 0x06, 0x00, 0x38, 0x00};
+static unsigned char symbol14_198_bits[] = {
+0xc6, 0x00, 0xc6, 0x00, 0x29, 0x01, 0x11, 0x01, 0x29, 0x01, 0xc6, 0x00, 
+0xc6, 0x00, 0x38, 0x00, 0x38, 0x00, 0xc6, 0x00, 0x92, 0x00};
+static unsigned char symbol14_199_bits[] = {
+0x11, 0x01, 0x7d, 0x01, 0x11, 0x01, 0x92, 0x00, 0xc6, 0x00, 0x38, 0x00, 
+0xf8, 0x00};
+static unsigned char symbol14_200_bits[] = {
+0x06, 0x03, 0x02, 0x03, 0x81, 0x00, 0x41, 0x00, 0x21, 0x00, 0x11, 0x00, 
+0x09, 0x00};
+static unsigned char symbol14_201_bits[] = {
+0x06, 0x00, 0x06, 0x01, 0xf9, 0x00, 0x78, 0x00, 0x86, 0x01, 0x02, 0x01, 
+0x01, 0x00};
+static unsigned char symbol14_202_bits[] = {
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x02, 0x01, 0x86, 0x01};
+static unsigned char symbol14_203_bits[] = {
+0x78, 0x00, 0x7f, 0x00, 0x80, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 
+0x80, 0x00, 0x7f, 0x00, 0x7f, 0x00};
+static unsigned char symbol14_204_bits[] = {
+0x80, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x80, 0x00, 0x7f, 0x00, 
+0x00, 0x00};
+static unsigned char symbol14_205_bits[] = {
+0xff, 0x01, 0x80, 0x00, 0xfc, 0x01, 0x42, 0x00, 0x41, 0x00, 0x21, 0x00, 
+0x21, 0x00, 0x12, 0x00, 0xfc, 0x01};
+static unsigned char symbol14_206_bits[] = {
+0x08, 0x00, 0x7c, 0x01, 0x02, 0x00, 0x01};
+static unsigned char symbol14_207_bits[] = {
+0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x7c, 0x01};
+static unsigned char symbol14_208_bits[] = {
+0xfc, 0x01, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 
+0xfc, 0x01, 0x00, 0x00, 0xff, 0x01, 0x7c, 0x02};
+static unsigned char symbol14_209_bits[] = {
+0x01, 0x01, 0x01, 0x00, 0x7c, 0x00, 0x7c, 0x00, 0x09, 0x01, 0x09, 0x00, 
+0x7c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00};
+static unsigned char symbol14_210_bits[] = {
+0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0xff, 0x03, 
+0xff, 0x01, 0x01, 0x01, 0x82, 0x00, 0x82, 0x00};
+static unsigned char symbol14_211_bits[] = {
+0x44, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x78, 0x00, 0x84, 0x00, 0x3e, 0x01};
+static unsigned char symbol14_212_bits[] = {
+0x49, 0x02, 0x49, 0x02, 0x39, 0x02, 0x49, 0x02, 0x9e, 0x01, 0x84, 0x00};
+static unsigned char symbol14_213_bits[] = {
+0x78, 0x00, 0x78, 0x00, 0x84, 0x00, 0x72, 0x01, 0x49, 0x02, 0x09, 0x02, 
+0x09, 0x02, 0x49, 0x02, 0x32, 0x01, 0x84, 0x00, 0x78, 0x00, 0x5f, 0x01};
+static unsigned char symbol14_214_bits[] = {
+0x55, 0x01, 0x64, 0x03, 0xa4, 0x02, 0xa4, 0x02, 0x6e, 0x07, 0xff, 0x03, 
+0x02, 0x01};
+static unsigned char symbol14_215_bits[] = {
+0x00, 0x01};
+static unsigned char symbol14_216_bits[] = {
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01};
+static unsigned char symbol14_217_bits[] = {
+0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x87};
+static unsigned char symbol14_218_bits[] = {
+0x03, 0x80, 0x80, 0x80, 0x40, 0x40, 0x40};
+static unsigned char symbol14_219_bits[] = {
+0x40, 0x06, 0x25, 0x04, 0x28, 0x08, 0x10, 0x10, 0x01, 0x01, 0xff, 0x01, 
+0x00, 0x01};
+static unsigned char symbol14_220_bits[] = {
+0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x18, 0x18, 0x24, 0x04, 0x42, 0x02, 
+0x81, 0x01};
+static unsigned char symbol14_221_bits[] = {
+0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x08, 0x02, 0x04, 0x04, 0x7e, 0x0f, 
+0x03};
+static unsigned char symbol14_222_bits[] = {
+0x18, 0x1e, 0x0f, 0x04, 0x04, 0x08, 0x02, 0x08, 0x00, 0x04, 0x00, 0x1e, 
+0x1f, 0x03};
+static unsigned char symbol14_223_bits[] = {
+0x00, 0x7e, 0x1f, 0x04, 0x00, 0x08, 0x00, 0x08, 0x1c, 0x36, 0x55, 0x14, 
+0x14};
+static unsigned char symbol14_224_bits[] = {
+0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x02, 0x00, 0x04};
+static unsigned char symbol14_225_bits[] = {
+0x0f, 0x0f, 0x00, 0x08, 0x0f, 0x0f, 0x00, 0x04, 0x00, 0x02, 0x04, 0x04, 
+0x04, 0x04, 0x04};
+static unsigned char symbol14_226_bits[] = {
+0x14, 0x00, 0x14, 0x00, 0x55, 0x02, 0x1c, 0x00, 0x08, 0x00, 0x14, 0x02, 
+0x22, 0x01, 0x22, 0x02, 0x14, 0x00, 0x08, 0x00};
+static unsigned char symbol14_227_bits[] = {
+0x04, 0x00, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x00, 
+0x04, 0x00, 0x78, 0x00, 0x84, 0x00, 0x3a, 0x01};
+static unsigned char symbol14_228_bits[] = {
+0x49, 0x02, 0x49, 0x02, 0x39, 0x02, 0x49, 0x02, 0x4a, 0x01, 0x84, 0x00};
+static unsigned char symbol14_229_bits[] = {
+0x78, 0x00, 0x78, 0x00, 0x84, 0x00, 0x32, 0x01, 0x49, 0x00, 0x09, 0x00, 
+0x09, 0x00, 0x49, 0x00, 0x32, 0x01, 0x84, 0x00, 0x78, 0x00, 0x5f, 0x01};
+static unsigned char symbol14_230_bits[] = {
+0x04, 0x01, 0x04, 0x03, 0x04, 0x02, 0x04, 0x02, 0x04, 0x02, 0x0f, 0x00, 
+0x01, 0x00, 0x02, 0x00, 0x04, 0x00, 0x08, 0x00};
+static unsigned char symbol14_231_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01};
+static unsigned char symbol14_232_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol14_233_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol14_234_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 
+0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol14_235_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol14_236_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol14_237_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x07, 0x04, 0x02, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol14_238_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x04, 0x04, 0x04};
+static unsigned char symbol14_239_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01};
+static unsigned char symbol14_240_bits[] = {
+0x00};
+static unsigned char symbol14_241_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x02, 0x0c, 0x01};
+static unsigned char symbol14_242_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01};
+static unsigned char symbol14_243_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x02, 0x02, 0x04, 0x04, 
+0x04, 0x08, 0x08, 0x08, 0x04, 0x04, 0x04, 0x02};
+static unsigned char symbol14_244_bits[] = {
+0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01};
+static unsigned char symbol14_245_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol14_246_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00};
+static unsigned char symbol14_247_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol14_248_bits[] = {
+0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol14_249_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x08, 0x08, 0x08, 0x08, 0x08};
+static unsigned char symbol14_250_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol14_251_bits[] = {
+0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x01, 0x01};
+static unsigned char symbol14_252_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x08, 0x08};
+static unsigned char symbol14_253_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x07, 0x03, 0x04, 0x00, 0x00, 0x00};
+static unsigned char symbol14_254_bits[] = {
+0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 
+0x08, 0x08, 0x08, 0x01, 0x01};
+static unsigned char symbol14_255_bits[] = {
+0x00};
+static RotFont symbol14font[] = {
+{5, 1, 1, symbol14_0_bits},
+{5, 1, 1, symbol14_1_bits},
+{5, 1, 1, symbol14_2_bits},
+{5, 1, 1, symbol14_3_bits},
+{5, 1, 1, symbol14_4_bits},
+{5, 1, 1, symbol14_5_bits},
+{5, 1, 1, symbol14_6_bits},
+{5, 1, 1, symbol14_7_bits},
+{5, 1, 1, symbol14_8_bits},
+{5, 1, 1, symbol14_9_bits},
+{5, 1, 1, symbol14_10_bits},
+{5, 1, 1, symbol14_11_bits},
+{5, 1, 1, symbol14_12_bits},
+{5, 1, 1, symbol14_13_bits},
+{5, 1, 1, symbol14_14_bits},
+{5, 1, 1, symbol14_15_bits},
+{5, 1, 1, symbol14_16_bits},
+{5, 1, 1, symbol14_17_bits},
+{5, 1, 1, symbol14_18_bits},
+{5, 1, 1, symbol14_19_bits},
+{5, 1, 1, symbol14_20_bits},
+{5, 1, 1, symbol14_21_bits},
+{5, 1, 1, symbol14_22_bits},
+{5, 1, 1, symbol14_23_bits},
+{5, 1, 1, symbol14_24_bits},
+{5, 1, 1, symbol14_25_bits},
+{5, 1, 1, symbol14_26_bits},
+{5, 1, 1, symbol14_27_bits},
+{5, 1, 1, symbol14_28_bits},
+{5, 1, 1, symbol14_29_bits},
+{5, 1, 1, symbol14_30_bits},
+{5, 1, 1, symbol14_31_bits},
+{1, 1, 1, symbol14_32_bits},
+{1, 10, 10, symbol14_33_bits},
+{9, 10, 10, symbol14_34_bits},
+{7, 10, 10, symbol14_35_bits},
+{6, 10, 10, symbol14_36_bits},
+{9, 10, 10, symbol14_37_bits},
+{9, 10, 10, symbol14_38_bits},
+{5, 7, 7, symbol14_39_bits},
+{3, 13, 10, symbol14_40_bits},
+{3, 13, 10, symbol14_41_bits},
+{5, 6, 8, symbol14_42_bits},
+{7, 7, 7, symbol14_43_bits},
+{2, 4, 2, symbol14_44_bits},
+{7, 1, 4, symbol14_45_bits},
+{1, 2, 2, symbol14_46_bits},
+{4, 10, 10, symbol14_47_bits},
+{6, 10, 10, symbol14_48_bits},
+{5, 10, 10, symbol14_49_bits},
+{6, 10, 10, symbol14_50_bits},
+{6, 10, 10, symbol14_51_bits},
+{6, 10, 10, symbol14_52_bits},
+{5, 10, 10, symbol14_53_bits},
+{6, 10, 10, symbol14_54_bits},
+{6, 10, 10, symbol14_55_bits},
+{5, 10, 10, symbol14_56_bits},
+{6, 10, 10, symbol14_57_bits},
+{1, 7, 7, symbol14_58_bits},
+{2, 9, 7, symbol14_59_bits},
+{7, 7, 7, symbol14_60_bits},
+{7, 3, 5, symbol14_61_bits},
+{7, 7, 7, symbol14_62_bits},
+{5, 10, 10, symbol14_63_bits},
+{7, 7, 7, symbol14_64_bits},
+{9, 10, 10, symbol14_65_bits},
+{7, 10, 10, symbol14_66_bits},
+{9, 10, 10, symbol14_67_bits},
+{7, 10, 10, symbol14_68_bits},
+{7, 10, 10, symbol14_69_bits},
+{9, 10, 10, symbol14_70_bits},
+{7, 10, 10, symbol14_71_bits},
+{9, 10, 10, symbol14_72_bits},
+{3, 10, 10, symbol14_73_bits},
+{8, 10, 10, symbol14_74_bits},
+{8, 10, 10, symbol14_75_bits},
+{9, 10, 10, symbol14_76_bits},
+{11, 10, 10, symbol14_77_bits},
+{9, 10, 10, symbol14_78_bits},
+{8, 10, 10, symbol14_79_bits},
+{9, 10, 10, symbol14_80_bits},
+{8, 10, 10, symbol14_81_bits},
+{6, 10, 10, symbol14_82_bits},
+{8, 10, 10, symbol14_83_bits},
+{7, 10, 10, symbol14_84_bits},
+{9, 10, 10, symbol14_85_bits},
+{6, 10, 7, symbol14_86_bits},
+{10, 10, 10, symbol14_87_bits},
+{9, 10, 10, symbol14_88_bits},
+{11, 10, 10, symbol14_89_bits},
+{7, 10, 10, symbol14_90_bits},
+{3, 13, 10, symbol14_91_bits},
+{8, 7, 7, symbol14_92_bits},
+{3, 13, 10, symbol14_93_bits},
+{9, 10, 10, symbol14_94_bits},
+{7, 1, -2, symbol14_95_bits},
+{8, 1, 14, symbol14_96_bits},
+{8, 7, 7, symbol14_97_bits},
+{6, 14, 11, symbol14_98_bits},
+{8, 10, 7, symbol14_99_bits},
+{5, 11, 11, symbol14_100_bits},
+{5, 7, 7, symbol14_101_bits},
+{7, 13, 10, symbol14_102_bits},
+{6, 10, 7, symbol14_103_bits},
+{7, 10, 7, symbol14_104_bits},
+{5, 7, 7, symbol14_105_bits},
+{7, 10, 7, symbol14_106_bits},
+{7, 7, 7, symbol14_107_bits},
+{8, 10, 10, symbol14_108_bits},
+{7, 9, 7, symbol14_109_bits},
+{7, 7, 7, symbol14_110_bits},
+{6, 7, 7, symbol14_111_bits},
+{8, 7, 7, symbol14_112_bits},
+{5, 10, 10, symbol14_113_bits},
+{6, 10, 7, symbol14_114_bits},
+{7, 7, 7, symbol14_115_bits},
+{5, 7, 7, symbol14_116_bits},
+{7, 7, 7, symbol14_117_bits},
+{10, 8, 8, symbol14_118_bits},
+{9, 7, 7, symbol14_119_bits},
+{6, 15, 12, symbol14_120_bits},
+{9, 10, 7, symbol14_121_bits},
+{6, 14, 11, symbol14_122_bits},
+{5, 13, 10, symbol14_123_bits},
+{1, 13, 10, symbol14_124_bits},
+{5, 13, 10, symbol14_125_bits},
+{7, 3, 5, symbol14_126_bits},
+{5, 1, 1, symbol14_127_bits},
+{5, 1, 1, symbol14_128_bits},
+{5, 1, 1, symbol14_129_bits},
+{5, 1, 1, symbol14_130_bits},
+{5, 1, 1, symbol14_131_bits},
+{5, 1, 1, symbol14_132_bits},
+{5, 1, 1, symbol14_133_bits},
+{5, 1, 1, symbol14_134_bits},
+{5, 1, 1, symbol14_135_bits},
+{5, 1, 1, symbol14_136_bits},
+{5, 1, 1, symbol14_137_bits},
+{5, 1, 1, symbol14_138_bits},
+{5, 1, 1, symbol14_139_bits},
+{5, 1, 1, symbol14_140_bits},
+{5, 1, 1, symbol14_141_bits},
+{5, 1, 1, symbol14_142_bits},
+{5, 1, 1, symbol14_143_bits},
+{5, 1, 1, symbol14_144_bits},
+{5, 1, 1, symbol14_145_bits},
+{5, 1, 1, symbol14_146_bits},
+{5, 1, 1, symbol14_147_bits},
+{5, 1, 1, symbol14_148_bits},
+{5, 1, 1, symbol14_149_bits},
+{5, 1, 1, symbol14_150_bits},
+{5, 1, 1, symbol14_151_bits},
+{5, 1, 1, symbol14_152_bits},
+{5, 1, 1, symbol14_153_bits},
+{5, 1, 1, symbol14_154_bits},
+{5, 1, 1, symbol14_155_bits},
+{5, 1, 1, symbol14_156_bits},
+{5, 1, 1, symbol14_157_bits},
+{5, 1, 1, symbol14_158_bits},
+{5, 1, 1, symbol14_159_bits},
+{5, 1, 1, symbol14_160_bits},
+{8, 10, 10, symbol14_161_bits},
+{4, 3, 10, symbol14_162_bits},
+{7, 9, 9, symbol14_163_bits},
+{5, 10, 10, symbol14_164_bits},
+{9, 4, 6, symbol14_165_bits},
+{7, 13, 10, symbol14_166_bits},
+{9, 8, 7, symbol14_167_bits},
+{7, 7, 7, symbol14_168_bits},
+{7, 7, 7, symbol14_169_bits},
+{9, 8, 7, symbol14_170_bits},
+{13, 7, 7, symbol14_171_bits},
+{14, 7, 7, symbol14_172_bits},
+{7, 20, 14, symbol14_173_bits},
+{14, 7, 7, symbol14_174_bits},
+{7, 17, 14, symbol14_175_bits},
+{4, 4, 10, symbol14_176_bits},
+{7, 9, 9, symbol14_177_bits},
+{7, 3, 10, symbol14_178_bits},
+{7, 9, 9, symbol14_179_bits},
+{7, 7, 7, symbol14_180_bits},
+{8, 4, 6, symbol14_181_bits},
+{6, 11, 11, symbol14_182_bits},
+{5, 5, 6, symbol14_183_bits},
+{7, 7, 7, symbol14_184_bits},
+{7, 7, 7, symbol14_185_bits},
+{7, 5, 6, symbol14_186_bits},
+{7, 5, 6, symbol14_187_bits},
+{9, 2, 2, symbol14_188_bits},
+{1, 20, 14, symbol14_189_bits},
+{15, 1, 4, symbol14_190_bits},
+{8, 9, 9, symbol14_191_bits},
+{8, 10, 10, symbol14_192_bits},
+{8, 12, 11, symbol14_193_bits},
+{10, 11, 11, symbol14_194_bits},
+{9, 12, 9, symbol14_195_bits},
+{9, 9, 9, symbol14_196_bits},
+{9, 9, 9, symbol14_197_bits},
+{11, 11, 11, symbol14_198_bits},
+{10, 7, 7, symbol14_199_bits},
+{10, 7, 7, symbol14_200_bits},
+{9, 7, 7, symbol14_201_bits},
+{9, 9, 7, symbol14_202_bits},
+{9, 9, 8, symbol14_203_bits},
+{9, 7, 7, symbol14_204_bits},
+{9, 9, 7, symbol14_205_bits},
+{7, 7, 7, symbol14_206_bits},
+{7, 9, 8, symbol14_207_bits},
+{11, 10, 10, symbol14_208_bits},
+{9, 11, 11, symbol14_209_bits},
+{10, 10, 10, symbol14_210_bits},
+{10, 10, 10, symbol14_211_bits},
+{11, 6, 10, symbol14_212_bits},
+{10, 12, 11, symbol14_213_bits},
+{8, 14, 14, symbol14_214_bits},
+{1, 2, 5, symbol14_215_bits},
+{9, 5, 5, symbol14_216_bits},
+{8, 7, 7, symbol14_217_bits},
+{8, 7, 7, symbol14_218_bits},
+{13, 7, 7, symbol14_219_bits},
+{13, 7, 7, symbol14_220_bits},
+{7, 13, 13, symbol14_221_bits},
+{13, 7, 7, symbol14_222_bits},
+{7, 13, 13, symbol14_223_bits},
+{7, 11, 11, symbol14_224_bits},
+{4, 15, 11, symbol14_225_bits},
+{10, 10, 10, symbol14_226_bits},
+{10, 10, 10, symbol14_227_bits},
+{10, 6, 10, symbol14_228_bits},
+{9, 12, 11, symbol14_229_bits},
+{4, 20, 14, symbol14_230_bits},
+{1, 20, 14, symbol14_231_bits},
+{4, 20, 14, symbol14_232_bits},
+{4, 20, 14, symbol14_233_bits},
+{1, 20, 14, symbol14_234_bits},
+{4, 17, 14, symbol14_235_bits},
+{4, 20, 14, symbol14_236_bits},
+{3, 20, 14, symbol14_237_bits},
+{4, 17, 14, symbol14_238_bits},
+{1, 20, 14, symbol14_239_bits},
+{5, 1, 1, symbol14_240_bits},
+{4, 15, 11, symbol14_241_bits},
+{5, 13, 12, symbol14_242_bits},
+{5, 20, 14, symbol14_243_bits},
+{1, 20, 14, symbol14_244_bits},
+{5, 17, 14, symbol14_245_bits},
+{4, 20, 14, symbol14_246_bits},
+{1, 20, 14, symbol14_247_bits},
+{4, 20, 14, symbol14_248_bits},
+{4, 20, 14, symbol14_249_bits},
+{1, 20, 14, symbol14_250_bits},
+{4, 17, 14, symbol14_251_bits},
+{4, 20, 14, symbol14_252_bits},
+{3, 20, 14, symbol14_253_bits},
+{4, 17, 14, symbol14_254_bits},
+{5, 1, 1, symbol14_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol18.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol18.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol18.bdf	(revision 15879)
@@ -0,0 +1,3822 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Symbol-Medium-R-Normal--18-180-75-75-P-107-Adobe-FontSpecific
+SIZE 18 75 75
+FONTBOUNDINGBOX 20 25 -1 -7
+STARTPROPERTIES 31
+FOUNDRY "Adobe"
+FAMILY_NAME "Symbol"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 18
+POINT_SIZE 180
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 107
+CHARSET_REGISTRY "Adobe"
+CHARSET_ENCODING "FontSpecific"
+CAP_HEIGHT 13
+X_HEIGHT 9
+FACE_NAME "Symbol"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "No mark"
+_DEC_DEVICE_FONTNAMES "PS=Symbol"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2-1, 18-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+FULL_NAME "Symbol"
+FONT "-Adobe-Symbol-Medium-R-Normal--18-180-75-75-P-107-Adobe-FontSpecific"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 11
+DEFAULT_CHAR 32
+FONT_ASCENT 16
+FONT_DESCENT 4
+ENDPROPERTIES
+CHARS 188
+STARTCHAR space
+ENCODING 32
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 1 1 1 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 2 13 2 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+40
+40
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 13 13 0 0
+BITMAP
+c018
+c018
+6030
+6030
+3fe0
+3060
+18c0
+18c0
+0880
+0d80
+0500
+0700
+0200
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 10 13 -1 0
+BITMAP
+0900
+0900
+0900
+0900
+7fc0
+1200
+1200
+1200
+ff80
+2400
+2400
+2400
+2400
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+ff
+03
+03
+03
+03
+03
+7f
+03
+03
+03
+03
+03
+ff
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+3860
+67e0
+c4c0
+c580
+e980
+7300
+0600
+0670
+0cc8
+1988
+1988
+31d0
+30e0
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 13 1 0
+BITMAP
+1c00
+3600
+2200
+2600
+3c00
+39e0
+7cc0
+ee80
+c780
+c300
+c390
+67f0
+3ce0
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+f0
+38
+1c
+0c
+7c
+0c
+1c
+38
+f0
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 17 1 -4
+BITMAP
+10
+30
+60
+60
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+60
+60
+30
+10
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 17 1 -4
+BITMAP
+80
+c0
+60
+60
+30
+30
+30
+30
+30
+30
+30
+30
+30
+60
+60
+c0
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 7 1 3
+BITMAP
+10
+d6
+7c
+38
+7c
+d6
+10
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 8 1 1
+BITMAP
+18
+18
+18
+ff
+ff
+18
+18
+18
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 3 5 1 -3
+BITMAP
+60
+60
+20
+60
+c0
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 2 1 4
+BITMAP
+fe
+fe
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 2 1 0
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 13 0 0
+BITMAP
+18
+18
+18
+30
+30
+30
+60
+60
+60
+60
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+3c
+66
+66
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+66
+66
+3c
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 6 13 1 0
+BITMAP
+10
+30
+f0
+30
+30
+30
+30
+30
+30
+30
+30
+30
+fc
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+3c
+7e
+ce
+86
+06
+06
+0c
+18
+30
+60
+c2
+fe
+fe
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+7c
+ce
+86
+06
+0c
+38
+1c
+0e
+06
+06
+06
+cc
+f8
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+06
+0e
+0e
+1e
+36
+36
+66
+c6
+c6
+ff
+06
+06
+06
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+7e
+7c
+c0
+c0
+f0
+3c
+0c
+0e
+06
+06
+0c
+dc
+f0
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+0e
+38
+30
+60
+60
+fc
+c6
+c3
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+7f
+ff
+86
+06
+0c
+0c
+0c
+18
+18
+18
+30
+30
+30
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+3c
+66
+62
+62
+76
+3c
+3e
+67
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+3c
+6e
+c7
+c3
+c3
+c3
+e3
+7f
+3a
+06
+0c
+38
+e0
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 2 9 2 0
+BITMAP
+c0
+c0
+00
+00
+00
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 3 12 1 -3
+BITMAP
+60
+60
+00
+00
+00
+00
+00
+60
+60
+20
+60
+c0
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+0380
+0f00
+3c00
+f000
+c000
+f000
+3c00
+0f00
+0380
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 6 1 2
+BITMAP
+ff
+ff
+00
+00
+ff
+ff
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+e000
+7800
+1e00
+0780
+0180
+0780
+1e00
+7800
+e000
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 6 13 1 0
+BITMAP
+78
+dc
+cc
+cc
+0c
+0c
+18
+30
+20
+20
+00
+60
+60
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+73
+ff
+ce
+00
+ff
+ff
+00
+ff
+ff
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+0400
+0e00
+0e00
+0b00
+1b00
+1300
+1180
+3180
+3fc0
+20c0
+60c0
+60e0
+f1f0
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 1 0
+BITMAP
+fc00
+6600
+6300
+6300
+6300
+6600
+7e00
+6300
+6180
+6180
+6180
+6380
+ff00
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+f070
+7060
+38c0
+18c0
+1d80
+0f00
+0600
+0f00
+1b80
+3180
+31c0
+60e0
+e0f0
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 11 13 0 0
+BITMAP
+0400
+0600
+0e00
+0b00
+1300
+1300
+1180
+2180
+21c0
+40c0
+40c0
+8060
+ffe0
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 1 0
+BITMAP
+ff80
+6180
+6080
+6000
+6000
+6100
+7f00
+6100
+6000
+6000
+6080
+6180
+ff80
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+0f00
+0600
+1f80
+6660
+c630
+c630
+c630
+c630
+c630
+6660
+1f80
+0600
+0f00
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 13 0 0
+BITMAP
+ffc0
+70c0
+3040
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+7800
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+f1e0
+60c0
+60c0
+60c0
+60c0
+60c0
+7fc0
+60c0
+60c0
+60c0
+60c0
+60c0
+f1e0
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 13 1 0
+BITMAP
+f0
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 11 13 1 0
+BITMAP
+0600
+0b00
+0980
+0580
+6380
+f180
+b1c0
+31a0
+3180
+3180
+3180
+3b00
+1e00
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 11 13 2 0
+BITMAP
+f3c0
+6180
+6300
+6600
+6c00
+7800
+7800
+6c00
+6600
+6300
+6380
+61c0
+f1e0
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 13 0 0
+BITMAP
+0600
+0600
+0f00
+0b00
+0b00
+1980
+1180
+1180
+30c0
+20c0
+2060
+6060
+f0f0
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 853 0
+DWIDTH 16 0
+BBX 14 13 1 0
+BITMAP
+e01c
+7038
+7038
+5878
+5858
+58d8
+4c98
+4c98
+4d98
+4718
+4718
+4318
+e23c
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+e0e0
+7040
+7040
+5840
+4c40
+4c40
+4640
+4340
+43c0
+41c0
+40c0
+40c0
+e040
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+0e00
+3180
+60c0
+e0e0
+c060
+c060
+c060
+c060
+c060
+e0e0
+60c0
+3180
+0e00
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+ffe0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+f1e0
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+0e00
+3180
+60c0
+e0e0
+c060
+d160
+df60
+d160
+c060
+e0e0
+60c0
+3180
+0e00
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+fe
+67
+63
+63
+63
+67
+7e
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 13 1 0
+BITMAP
+ff80
+c180
+6080
+3000
+1800
+0c00
+0c00
+0800
+1000
+2040
+40c0
+ff80
+ff80
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 13 1 0
+BITMAP
+ffc0
+ccc0
+8c40
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+1e00
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 13 0 0
+BITMAP
+f8f0
+7060
+30c0
+18c0
+1d80
+0f00
+0f00
+0600
+0600
+0600
+0600
+0600
+0f00
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 6 13 1 -4
+BITMAP
+3c
+7c
+c0
+80
+80
+80
+c0
+78
+3c
+04
+04
+3c
+38
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 13 13 0 0
+BITMAP
+0700
+18c0
+3060
+7070
+6030
+6030
+6030
+6030
+3060
+18c0
+8888
+f8f8
+f8f8
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 13 1 0
+BITMAP
+7f80
+7f80
+4080
+0000
+2100
+3f00
+3f00
+2100
+0000
+8040
+8040
+ffc0
+ffc0
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 14 13 0 0
+BITMAP
+c78c
+6318
+6318
+6318
+6318
+3330
+1fe0
+0300
+0300
+0300
+0300
+0300
+0780
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 1 0
+BITMAP
+ff80
+c380
+8300
+0700
+0600
+0e00
+1c00
+1800
+3800
+7000
+6080
+e180
+ff80
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 17 1 -4
+BITMAP
+f0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+f0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 10 9 2 0
+BITMAP
+0c00
+0c00
+0000
+0000
+0000
+0000
+0000
+c0c0
+c0c0
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 17 1 -4
+BITMAP
+f0
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+f0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 13 1 0
+BITMAP
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+ffc0
+ffc0
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 2 0 -4
+BITMAP
+ff80
+ff80
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 10 1 0 16
+BITMAP
+ffc0
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 11 9 1 0
+BITMAP
+3cc0
+6580
+c300
+c300
+c300
+c300
+c300
+6520
+38c0
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 18 1 -4
+BITMAP
+3c
+46
+c6
+c6
+c6
+cc
+c6
+c3
+c3
+c3
+c3
+c3
+e6
+dc
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 10 13 0 -4
+BITMAP
+60c0
+f1c0
+9180
+1300
+1700
+0e00
+0c00
+1c00
+1a00
+3200
+6240
+e3c0
+c180
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+38
+4c
+40
+60
+30
+38
+6c
+c6
+c6
+c6
+c6
+c6
+6c
+38
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 6 9 1 0
+BITMAP
+78
+ec
+cc
+c0
+70
+c0
+c0
+e4
+78
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 16 1 -4
+BITMAP
+0800
+0800
+0800
+3e00
+6b00
+c980
+c980
+c980
+c980
+c980
+6b00
+3e00
+0800
+0800
+0800
+0800
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 8 13 0 -4
+BITMAP
+c3
+e3
+a3
+26
+26
+16
+14
+1c
+0c
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 1 -4
+BITMAP
+6700
+e980
+b180
+3180
+3180
+3180
+3180
+3180
+3180
+0180
+0180
+0180
+0180
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+60
+e0
+60
+60
+60
+60
+60
+68
+70
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 1 -4
+BITMAP
+6600
+cf00
+c980
+c980
+c980
+c980
+4900
+6b00
+3e00
+0800
+0800
+0800
+0800
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+6380
+e580
+6800
+7800
+7c00
+6e00
+6700
+6380
+6180
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 10 14 0 0
+BITMAP
+3000
+7800
+4800
+0800
+0800
+0800
+1c00
+1c00
+3400
+3400
+6600
+6240
+c3c0
+c180
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 2 -4
+BITMAP
+4200
+c600
+c600
+c600
+c600
+c600
+c680
+fb80
+7b00
+4000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+c3
+c3
+61
+62
+32
+34
+1c
+18
+08
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+3c
+66
+c3
+c3
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+7f80
+ff80
+9200
+1200
+1200
+1200
+3280
+7380
+6300
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+3c
+66
+c3
+c3
+c3
+c3
+ff
+c3
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 -4
+BITMAP
+3c
+46
+c3
+c3
+c3
+c3
+c3
+e6
+dc
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 9 1 0
+BITMAP
+1fc0
+7fc0
+6600
+c300
+c300
+c300
+c300
+6600
+3c00
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+7e
+fe
+90
+10
+10
+10
+12
+1e
+1c
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+6300
+f180
+b180
+3180
+3180
+3180
+3180
+3b00
+1e00
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 11 11 0 0
+BITMAP
+3fe0
+7fe0
+9980
+30c0
+2040
+6660
+6660
+6660
+6660
+36c0
+39c0
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 9 1 0
+BITMAP
+3300
+6180
+4080
+ccc0
+ccc0
+ccc0
+ccc0
+6d80
+7380
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 19 1 -4
+BITMAP
+60
+8e
+fc
+20
+40
+40
+7c
+78
+c0
+80
+80
+80
+c0
+fc
+7e
+02
+02
+1e
+1c
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 13 13 0 -4
+BITMAP
+e238
+7270
+3260
+3260
+3260
+3260
+1ac0
+1ac0
+0f80
+0200
+0200
+0200
+0200
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 19 1 -4
+BITMAP
+60
+86
+9e
+78
+60
+40
+80
+80
+80
+80
+80
+80
+c0
+fc
+7e
+02
+02
+1e
+1c
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 17 1 -4
+BITMAP
+0e
+18
+30
+30
+30
+30
+30
+60
+c0
+60
+30
+30
+30
+30
+30
+18
+0e
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 17 1 -4
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 17 1 -4
+BITMAP
+e0
+30
+18
+18
+18
+18
+18
+0c
+06
+0c
+18
+18
+18
+18
+18
+30
+e0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 3 1 4
+BITMAP
+73
+ff
+ce
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 11 13 0 0
+BITMAP
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 4 5 1 9
+BITMAP
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 12 0 0
+BITMAP
+0000
+0080
+c000
+2000
+6000
+6000
+0000
+0000
+0000
+0000
+0000
+0000
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 8 13 -1 0
+BITMAP
+00
+0c
+00
+1e
+00
+30
+70
+60
+c0
+80
+03
+80
+0f
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 5 0 3
+BITMAP
+0030
+00f0
+00c0
+00f0
+0030
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 17 0 -4
+BITMAP
+0000
+0000
+8000
+0080
+8080
+8000
+0600
+0c00
+1800
+3000
+6000
+c080
+7980
+cf00
+8600
+cf00
+7980
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 10 9 2 0
+BITMAP
+0380
+0580
+0c00
+0c00
+0c00
+7f00
+1800
+1800
+1800
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 9 9 2 0
+BITMAP
+1800
+1800
+1800
+1800
+1800
+1800
+d000
+e000
+0c00
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 9 9 2 0
+BITMAP
+1e00
+1e00
+1e00
+6d80
+ff80
+ff80
+6d80
+0c00
+0800
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 10 9 2 0
+BITMAP
+1c00
+3e00
+7f00
+ff80
+7f00
+3e00
+1c00
+0800
+6300
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 1013 0
+DWIDTH 19 0
+BBX 17 8 1 1
+BITMAP
+f78080
+80ff80
+7f0000
+003e00
+1c0000
+000c00
+1e0000
+007f80
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 960 0
+DWIDTH 18 0
+BBX 18 8 0 1
+BITMAP
+ffc0c0
+c06d80
+0c0000
+001800
+003000
+006000
+00ffc0
+80ffc0
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 25 1 -7
+BITMAP
+80
+60
+03
+00
+30
+06
+00
+18
+0c
+00
+18
+00
+00
+30
+00
+00
+60
+00
+00
+ff
+ff
+c0
+ff
+ff
+c0
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 960 0
+DWIDTH 18 0
+BBX 18 8 0 1
+BITMAP
+600000
+300000
+180000
+183c40
+db9900
+181800
+181800
+181800
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 22 1 -4
+BITMAP
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+00
+06
+00
+00
+03
+00
+00
+01
+80
+ff
+ff
+c0
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 6 1 7
+BITMAP
+f8
+f8
+c0
+00
+00
+80
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 11 1 0
+BITMAP
+00
+03
+00
+00
+06
+00
+18
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 8 5 0 9
+BITMAP
+18
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 12 0 0
+BITMAP
+1800
+1800
+1800
+1880
+db00
+3c00
+7080
+8880
+d800
+1800
+1880
+ff00
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 10 9 0 0
+BITMAP
+1800
+00c0
+ff00
+7740
+cc80
+e000
+7800
+1e00
+0780
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 11 5 0 3
+BITMAP
+0180
+0780
+1e00
+7800
+e000
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+00
+00
+fe
+80
+fe
+80
+e0
+c0
+72
+80
+32
+00
+1e
+00
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 5 6 2 2
+BITMAP
+08
+00
+18
+00
+30
+00
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 8 1 1
+BITMAP
+73
+80
+e1
+c0
+79
+e0
+cf
+00
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+86
+00
+cf
+00
+79
+e0
+78
+cc
+86
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 8 1 1
+BITMAP
+06
+06
+06
+3e
+66
+c6
+c6
+c6
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 7 1 2
+BITMAP
+c4
+ec
+78
+70
+f8
+f8
+f8
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 960 0
+DWIDTH 18 0
+BBX 14 2 2 0
+BITMAP
+f870
+1818
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 2 25 4 -7
+BITMAP
+00
+c0
+c0
+00
+00
+00
+00
+00
+c0
+c0
+00
+c0
+c0
+00
+00
+c0
+c0
+00
+c0
+c0
+00
+c0
+c0
+40
+c0
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 1013 0
+DWIDTH 19 0
+BBX 19 2 0 4
+BITMAP
+ce0060
+ffcec0
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 9 12 1 0
+BITMAP
+0c80
+0c80
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+c0c0
+c0c0
+ffe0
+e0e0
+ffe0
+0180
+0180
+0180
+0180
+0180
+0180
+2180
+6180
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 10 15 1 -1
+BITMAP
+ff80
+ff80
+6000
+2000
+c200
+e3c0
+71c0
+38c0
+3980
+7d00
+cf00
+c700
+e300
+7380
+31c0
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 14 1 0
+BITMAP
+70c0
+f040
+1fc0
+3fc0
+6080
+4100
+4200
+2200
+1300
+0380
+01c0
+00c0
+00c0
+70c0
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 15 1 -4
+BITMAP
+f880
+1f00
+0e00
+79c0
+fee0
+8e70
+8630
+c660
+7680
+3640
+2660
+0660
+0660
+0660
+0660
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+6c70
+b830
+0c00
+1800
+31e0
+6730
+cc30
+d830
+d630
+f660
+64e0
+77c0
+b380
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+9800
+9800
+d800
+7000
+1f80
+39c0
+6060
+d9b0
+ddb0
+8f10
+8610
+8f10
+dbb0
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+d9b0
+6060
+39c0
+1f80
+1f80
+39c0
+6660
+c630
+c630
+bfd0
+bfd0
+8610
+c630
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 9 1 0
+BITMAP
+c630
+6060
+39c0
+1f80
+1fb0
+39f0
+6060
+c0f0
+c1b0
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 9 1 0
+BITMAP
+8310
+8610
+8c10
+d830
+f030
+6060
+f9c0
+df80
+1f80
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 9 1 0
+BITMAP
+39c0
+6060
+e070
+c030
+c030
+c030
+c030
+c030
+c030
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 12 0 -3
+BITMAP
+c030
+c030
+c030
+c030
+e070
+6060
+39c0
+1f80
+ff80
+ffe0
+0060
+0030
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 13 0 -2
+BITMAP
+0030
+0030
+0060
+ffe0
+ff80
+ff80
+ffe0
+0060
+0030
+0030
+0030
+0060
+ffe0
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 9 0 0
+BITMAP
+ff80
+0000
+fff0
+fff0
+0060
+00c0
+1ff0
+7ff0
+6180
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 12 0 -3
+BITMAP
+c300
+c300
+c600
+6600
+7ff0
+1ff0
+1800
+3000
+1ff0
+7ff0
+6000
+c000
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 9 9 1 0
+BITMAP
+c000
+c000
+6000
+7f80
+1f80
+1f80
+7f80
+6000
+c000
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 11 1 -1
+BITMAP
+c000
+c000
+6000
+7fc0
+1fc0
+0000
+ffc0
+ffc0
+1f80
+7f80
+e000
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 13 13 0 0
+BITMAP
+c000
+ff80
+c000
+e000
+7f80
+1f80
+0080
+1fc0
+7fc0
+e200
+c400
+ff80
+c800
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 13 1 0
+BITMAP
+f000
+7fc0
+3fc0
+4000
+0010
+0030
+0060
+00c0
+0180
+0300
+0600
+0c00
+1800
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+3000
+6000
+c000
+fff8
+fff0
+e020
+6060
+6040
+70c0
+3080
+3080
+3980
+1900
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+1b00
+0e00
+0e00
+0400
+1fc0
+38e0
+6030
+df18
+cd98
+cd98
+cd98
+cf18
+cd98
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 853 0
+DWIDTH 16 0
+BBX 14 8 1 5
+BITMAP
+dcd8
+6030
+38e0
+1fc0
+1fc0
+38e0
+6030
+c798
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 14 16 0 -2
+BITMAP
+cd98
+cc98
+cc18
+cc18
+cc98
+c718
+6030
+38e0
+1fc0
+ff1c
+ab18
+2318
+22a8
+22a8
+22a8
+2248
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 10 17 0 0
+BITMAP
+7740
+ffc0
+7000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+fcc0
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 2 1 4
+BITMAP
+00
+40
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 6 1 0
+BITMAP
+0040
+0040
+0080
+0080
+0080
+0080
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 9 0 0
+BITMAP
+3080
+7100
+d900
+1900
+1900
+0d00
+0d00
+0600
+0600
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 9 0 0
+BITMAP
+0600
+c0c0
+ffc0
+ffc0
+0040
+0040
+0040
+0040
+0c00
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 960 0
+DWIDTH 18 0
+BBX 18 9 0 0
+BITMAP
+0c0000
+003300
+330040
+806180
+c0c0c0
+c0c0c0
+c0c040
+806180
+330000
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 960 0
+DWIDTH 18 0
+BBX 16 9 1 0
+BITMAP
+001e
+000c
+000c
+0008
+0400
+1806
+003f
+ff00
+7fff
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+8080
+0180
+7f80
+8000
+ff00
+1800
+0000
+0400
+0800
+1800
+3f80
+7f80
+e000
+7f80
+3f80
+1800
+0800
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 960 0
+DWIDTH 18 0
+BBX 16 9 1 0
+BITMAP
+0800
+1c00
+3600
+7700
+f780
+3600
+3600
+3600
+3600
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+3600
+3600
+3600
+3600
+3600
+3600
+3600
+3600
+0000
+0000
+ff80
+ff80
+0000
+ff80
+ff80
+0000
+0000
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 14 0 0
+BITMAP
+3600
+3600
+3600
+3600
+3600
+3600
+3600
+3600
+3600
+3600
+3600
+3600
+f780
+7700
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 5 17 0 -3
+BITMAP
+30
+00
+18
+00
+08
+00
+08
+00
+18
+00
+30
+00
+30
+00
+60
+00
+60
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+00c0
+80c0
+8060
+0060
+0030
+0030
+0018
+0008
+0018
+1830
+3060
+60c0
+c080
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+c0c0
+6060
+3030
+1818
+1fc0
+38e0
+6030
+cf18
+cd98
+cd98
+cf18
+cd98
+cd98
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 8 1 5
+BITMAP
+cd98
+6030
+38e0
+1fc0
+1fc0
+38e0
+6030
+c718
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 16 0 -2
+BITMAP
+cc90
+cc10
+cc10
+cc10
+cc90
+c710
+6030
+38e0
+1fc0
+fb10
+2310
+2310
+22a0
+22a0
+22a0
+2240
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 6 25 1 -7
+BITMAP
+20
+48
+fc
+e0
+e0
+60
+70
+20
+38
+00
+1c
+00
+0c
+00
+04
+00
+00
+00
+04
+00
+0c
+00
+18
+00
+30
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 2 25 1 -7
+BITMAP
+00
+40
+00
+c0
+00
+c0
+c0
+c0
+c0
+00
+00
+00
+00
+00
+00
+40
+40
+40
+40
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 6 25 1 -7
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 25 1 -7
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+e0
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 2 25 1 -7
+BITMAP
+40
+40
+40
+00
+00
+00
+00
+00
+00
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 22 1 -4
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 5 25 4 -7
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 5 25 1 -7
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+f8
+38
+60
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 5 22 4 -4
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+30
+e0
+e0
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 2 25 4 -7
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 5 17 0 -3
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+60
+38
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 6 22 0 -4
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+00
+c0
+c0
+60
+60
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 7 25 5 -7
+BITMAP
+30
+30
+18
+18
+08
+18
+18
+30
+30
+60
+60
+c0
+c0
+1c
+1c
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 2 25 0 -7
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+c0
+c0
+00
+40
+40
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 7 22 0 -4
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 6 25 0 -7
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+04
+04
+04
+04
+04
+04
+04
+04
+04
+04
+04
+04
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 2 25 4 -7
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+c0
+c0
+40
+80
+c0
+40
+40
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 6 25 0 -7
+BITMAP
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 25 1 -7
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+08
+08
+08
+08
+08
+08
+08
+08
+08
+08
+08
+08
+08
+08
+08
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 2 25 4 -7
+BITMAP
+00
+00
+00
+00
+00
+00
+40
+40
+c0
+80
+c0
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 22 1 -4
+BITMAP
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 5 25 1 -7
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 5 25 4 -7
+BITMAP
+18
+18
+18
+18
+18
+18
+18
+18
+18
+f8
+e0
+30
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 5 22 1 -4
+BITMAP
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+60
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol18.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol18.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol18.h	(revision 15879)
@@ -0,0 +1,1000 @@
+static unsigned char symbol18_0_bits[] = {
+0x00};
+static unsigned char symbol18_1_bits[] = {
+0x00};
+static unsigned char symbol18_2_bits[] = {
+0x00};
+static unsigned char symbol18_3_bits[] = {
+0x00};
+static unsigned char symbol18_4_bits[] = {
+0x00};
+static unsigned char symbol18_5_bits[] = {
+0x00};
+static unsigned char symbol18_6_bits[] = {
+0x00};
+static unsigned char symbol18_7_bits[] = {
+0x00};
+static unsigned char symbol18_8_bits[] = {
+0x00};
+static unsigned char symbol18_9_bits[] = {
+0x00};
+static unsigned char symbol18_10_bits[] = {
+0x00};
+static unsigned char symbol18_11_bits[] = {
+0x00};
+static unsigned char symbol18_12_bits[] = {
+0x00};
+static unsigned char symbol18_13_bits[] = {
+0x00};
+static unsigned char symbol18_14_bits[] = {
+0x00};
+static unsigned char symbol18_15_bits[] = {
+0x00};
+static unsigned char symbol18_16_bits[] = {
+0x00};
+static unsigned char symbol18_17_bits[] = {
+0x00};
+static unsigned char symbol18_18_bits[] = {
+0x00};
+static unsigned char symbol18_19_bits[] = {
+0x00};
+static unsigned char symbol18_20_bits[] = {
+0x00};
+static unsigned char symbol18_21_bits[] = {
+0x00};
+static unsigned char symbol18_22_bits[] = {
+0x00};
+static unsigned char symbol18_23_bits[] = {
+0x00};
+static unsigned char symbol18_24_bits[] = {
+0x00};
+static unsigned char symbol18_25_bits[] = {
+0x00};
+static unsigned char symbol18_26_bits[] = {
+0x00};
+static unsigned char symbol18_27_bits[] = {
+0x00};
+static unsigned char symbol18_28_bits[] = {
+0x00};
+static unsigned char symbol18_29_bits[] = {
+0x00};
+static unsigned char symbol18_30_bits[] = {
+0x00};
+static unsigned char symbol18_31_bits[] = {
+0x00};
+static unsigned char symbol18_32_bits[] = {
+0x00};
+static unsigned char symbol18_33_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x00, 0x00, 0x03, 
+0x03};
+static unsigned char symbol18_34_bits[] = {
+0x03, 0x18, 0x03, 0x18, 0x06, 0x0c, 0x06, 0x0c, 0xfc, 0x07, 0x0c, 0x06, 
+0x18, 0x03, 0x18, 0x03, 0x10, 0x01, 0xb0, 0x01, 0xa0, 0x00, 0xe0, 0x00, 
+0x40, 0x00};
+static unsigned char symbol18_35_bits[] = {
+0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0xfe, 0x03, 0x48, 0x00, 
+0x48, 0x00, 0x48, 0x00, 0xff, 0x01, 0x24, 0x00, 0x24, 0x00, 0x24, 0x00, 
+0x24, 0x00};
+static unsigned char symbol18_36_bits[] = {
+0xff, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xfe, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 
+0xff};
+static unsigned char symbol18_37_bits[] = {
+0x1c, 0x06, 0xe6, 0x07, 0x23, 0x03, 0xa3, 0x01, 0x97, 0x01, 0xce, 0x00, 
+0x60, 0x00, 0x60, 0x0e, 0x30, 0x13, 0x98, 0x11, 0x98, 0x11, 0x8c, 0x0b, 
+0x0c, 0x07};
+static unsigned char symbol18_38_bits[] = {
+0x38, 0x00, 0x6c, 0x00, 0x44, 0x00, 0x64, 0x00, 0x3c, 0x00, 0x9c, 0x07, 
+0x3e, 0x03, 0x77, 0x01, 0xe3, 0x01, 0xc3, 0x00, 0xc3, 0x09, 0xe6, 0x0f, 
+0x3c, 0x07};
+static unsigned char symbol18_39_bits[] = {
+0x0f, 0x1c, 0x38, 0x30, 0x3e, 0x30, 0x38, 0x1c, 0x0f};
+static unsigned char symbol18_40_bits[] = {
+0x08, 0x0c, 0x06, 0x06, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x06, 0x06, 0x0c, 0x08};
+static unsigned char symbol18_41_bits[] = {
+0x01, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x06, 0x06, 0x03, 0x01};
+static unsigned char symbol18_42_bits[] = {
+0x08, 0x6b, 0x3e, 0x1c, 0x3e, 0x6b, 0x08};
+static unsigned char symbol18_43_bits[] = {
+0x18, 0x18, 0x18, 0xff, 0xff, 0x18, 0x18, 0x18};
+static unsigned char symbol18_44_bits[] = {
+0x06, 0x06, 0x04, 0x06, 0x03};
+static unsigned char symbol18_45_bits[] = {
+0x7f, 0x7f};
+static unsigned char symbol18_46_bits[] = {
+0x03, 0x03};
+static unsigned char symbol18_47_bits[] = {
+0x18, 0x18, 0x18, 0x0c, 0x0c, 0x0c, 0x06, 0x06, 0x06, 0x06, 0x03, 0x03, 
+0x03};
+static unsigned char symbol18_48_bits[] = {
+0x3c, 0x66, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x66, 
+0x3c};
+static unsigned char symbol18_49_bits[] = {
+0x08, 0x0c, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x3f};
+static unsigned char symbol18_50_bits[] = {
+0x3c, 0x7e, 0x73, 0x61, 0x60, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x43, 0x7f, 
+0x7f};
+static unsigned char symbol18_51_bits[] = {
+0x3e, 0x73, 0x61, 0x60, 0x30, 0x1c, 0x38, 0x70, 0x60, 0x60, 0x60, 0x33, 
+0x1f};
+static unsigned char symbol18_52_bits[] = {
+0x60, 0x70, 0x70, 0x78, 0x6c, 0x6c, 0x66, 0x63, 0x63, 0xff, 0x60, 0x60, 
+0x60};
+static unsigned char symbol18_53_bits[] = {
+0x7e, 0x3e, 0x03, 0x03, 0x0f, 0x3c, 0x30, 0x70, 0x60, 0x60, 0x30, 0x3b, 
+0x0f};
+static unsigned char symbol18_54_bits[] = {
+0x70, 0x1c, 0x0c, 0x06, 0x06, 0x3f, 0x63, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 
+0x3c};
+static unsigned char symbol18_55_bits[] = {
+0xfe, 0xff, 0x61, 0x60, 0x30, 0x30, 0x30, 0x18, 0x18, 0x18, 0x0c, 0x0c, 
+0x0c};
+static unsigned char symbol18_56_bits[] = {
+0x3c, 0x66, 0x46, 0x46, 0x6e, 0x3c, 0x7c, 0xe6, 0xc3, 0xc3, 0xc3, 0x66, 
+0x3c};
+static unsigned char symbol18_57_bits[] = {
+0x3c, 0x76, 0xe3, 0xc3, 0xc3, 0xc3, 0xc7, 0xfe, 0x5c, 0x60, 0x30, 0x1c, 
+0x07};
+static unsigned char symbol18_58_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03};
+static unsigned char symbol18_59_bits[] = {
+0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x04, 0x06, 0x03};
+static unsigned char symbol18_60_bits[] = {
+0xc0, 0x01, 0xf0, 0x00, 0x3c, 0x00, 0x0f, 0x00, 0x03, 0x00, 0x0f, 0x00, 
+0x3c, 0x00, 0xf0, 0x00, 0xc0, 0x01};
+static unsigned char symbol18_61_bits[] = {
+0xff, 0xff, 0x00, 0x00, 0xff, 0xff};
+static unsigned char symbol18_62_bits[] = {
+0x07, 0x00, 0x1e, 0x00, 0x78, 0x00, 0xe0, 0x01, 0x80, 0x01, 0xe0, 0x01, 
+0x78, 0x00, 0x1e, 0x00, 0x07, 0x00};
+static unsigned char symbol18_63_bits[] = {
+0x1e, 0x3b, 0x33, 0x33, 0x30, 0x30, 0x18, 0x0c, 0x04, 0x04, 0x00, 0x06, 
+0x06};
+static unsigned char symbol18_64_bits[] = {
+0xce, 0xff, 0x73, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff};
+static unsigned char symbol18_65_bits[] = {
+0x20, 0x00, 0x70, 0x00, 0x70, 0x00, 0xd0, 0x00, 0xd8, 0x00, 0xc8, 0x00, 
+0x88, 0x01, 0x8c, 0x01, 0xfc, 0x03, 0x04, 0x03, 0x06, 0x03, 0x06, 0x07, 
+0x8f, 0x0f};
+static unsigned char symbol18_66_bits[] = {
+0x3f, 0x00, 0x66, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0x66, 0x00, 
+0x7e, 0x00, 0xc6, 0x00, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0xc6, 0x01, 
+0xff, 0x00};
+static unsigned char symbol18_67_bits[] = {
+0x0f, 0x0e, 0x0e, 0x06, 0x1c, 0x03, 0x18, 0x03, 0xb8, 0x01, 0xf0, 0x00, 
+0x60, 0x00, 0xf0, 0x00, 0xd8, 0x01, 0x8c, 0x01, 0x8c, 0x03, 0x06, 0x07, 
+0x07, 0x0f};
+static unsigned char symbol18_68_bits[] = {
+0x20, 0x00, 0x60, 0x00, 0x70, 0x00, 0xd0, 0x00, 0xc8, 0x00, 0xc8, 0x00, 
+0x88, 0x01, 0x84, 0x01, 0x84, 0x03, 0x02, 0x03, 0x02, 0x03, 0x01, 0x06, 
+0xff, 0x07};
+static unsigned char symbol18_69_bits[] = {
+0xff, 0x01, 0x86, 0x01, 0x06, 0x01, 0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 
+0xfe, 0x00, 0x86, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x01, 0x86, 0x01, 
+0xff, 0x01};
+static unsigned char symbol18_70_bits[] = {
+0xf0, 0x00, 0x60, 0x00, 0xf8, 0x01, 0x66, 0x06, 0x63, 0x0c, 0x63, 0x0c, 
+0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x66, 0x06, 0xf8, 0x01, 0x60, 0x00, 
+0xf0, 0x00};
+static unsigned char symbol18_71_bits[] = {
+0xff, 0x03, 0x0e, 0x03, 0x0c, 0x02, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x1e, 0x00};
+static unsigned char symbol18_72_bits[] = {
+0x8f, 0x07, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0xfe, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x8f, 0x07};
+static unsigned char symbol18_73_bits[] = {
+0x0f, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x0f};
+static unsigned char symbol18_74_bits[] = {
+0x60, 0x00, 0xd0, 0x00, 0x90, 0x01, 0xa0, 0x01, 0xc6, 0x01, 0x8f, 0x01, 
+0x8d, 0x03, 0x8c, 0x05, 0x8c, 0x01, 0x8c, 0x01, 0x8c, 0x01, 0xdc, 0x00, 
+0x78, 0x00};
+static unsigned char symbol18_75_bits[] = {
+0xcf, 0x03, 0x86, 0x01, 0xc6, 0x00, 0x66, 0x00, 0x36, 0x00, 0x1e, 0x00, 
+0x1e, 0x00, 0x36, 0x00, 0x66, 0x00, 0xc6, 0x00, 0xc6, 0x01, 0x86, 0x03, 
+0x8f, 0x07};
+static unsigned char symbol18_76_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0xf0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0x98, 0x01, 
+0x88, 0x01, 0x88, 0x01, 0x0c, 0x03, 0x04, 0x03, 0x04, 0x06, 0x06, 0x06, 
+0x0f, 0x0f};
+static unsigned char symbol18_77_bits[] = {
+0x07, 0x38, 0x0e, 0x1c, 0x0e, 0x1c, 0x1a, 0x1e, 0x1a, 0x1a, 0x1a, 0x1b, 
+0x32, 0x19, 0x32, 0x19, 0xb2, 0x19, 0xe2, 0x18, 0xe2, 0x18, 0xc2, 0x18, 
+0x47, 0x3c};
+static unsigned char symbol18_78_bits[] = {
+0x07, 0x07, 0x0e, 0x02, 0x0e, 0x02, 0x1a, 0x02, 0x32, 0x02, 0x32, 0x02, 
+0x62, 0x02, 0xc2, 0x02, 0xc2, 0x03, 0x82, 0x03, 0x02, 0x03, 0x02, 0x03, 
+0x07, 0x02};
+static unsigned char symbol18_79_bits[] = {
+0x70, 0x00, 0x8c, 0x01, 0x06, 0x03, 0x07, 0x07, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x07, 0x07, 0x06, 0x03, 0x8c, 0x01, 
+0x70, 0x00};
+static unsigned char symbol18_80_bits[] = {
+0xff, 0x07, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x8f, 0x07};
+static unsigned char symbol18_81_bits[] = {
+0x70, 0x00, 0x8c, 0x01, 0x06, 0x03, 0x07, 0x07, 0x03, 0x06, 0x8b, 0x06, 
+0xfb, 0x06, 0x8b, 0x06, 0x03, 0x06, 0x07, 0x07, 0x06, 0x03, 0x8c, 0x01, 
+0x70, 0x00};
+static unsigned char symbol18_82_bits[] = {
+0x7f, 0xe6, 0xc6, 0xc6, 0xc6, 0xe6, 0x7e, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x0f};
+static unsigned char symbol18_83_bits[] = {
+0xff, 0x01, 0x83, 0x01, 0x06, 0x01, 0x0c, 0x00, 0x18, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x02, 0x02, 0x03, 0xff, 0x01, 
+0xff, 0x01};
+static unsigned char symbol18_84_bits[] = {
+0xff, 0x03, 0x33, 0x03, 0x31, 0x02, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x78, 0x00};
+static unsigned char symbol18_85_bits[] = {
+0x1f, 0x0f, 0x0e, 0x06, 0x0c, 0x03, 0x18, 0x03, 0xb8, 0x01, 0xf0, 0x00, 
+0xf0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0xf0, 0x00};
+static unsigned char symbol18_86_bits[] = {
+0x3c, 0x3e, 0x03, 0x01, 0x01, 0x01, 0x03, 0x1e, 0x3c, 0x20, 0x20, 0x3c, 
+0x1c};
+static unsigned char symbol18_87_bits[] = {
+0xe0, 0x00, 0x18, 0x03, 0x0c, 0x06, 0x0e, 0x0e, 0x06, 0x0c, 0x06, 0x0c, 
+0x06, 0x0c, 0x06, 0x0c, 0x0c, 0x06, 0x18, 0x03, 0x11, 0x11, 0x1f, 0x1f, 
+0x1f, 0x1f};
+static unsigned char symbol18_88_bits[] = {
+0xfe, 0x01, 0xfe, 0x01, 0x02, 0x01, 0x00, 0x00, 0x84, 0x00, 0xfc, 0x00, 
+0xfc, 0x00, 0x84, 0x00, 0x00, 0x00, 0x01, 0x02, 0x01, 0x02, 0xff, 0x03, 
+0xff, 0x03};
+static unsigned char symbol18_89_bits[] = {
+0xe3, 0x31, 0xc6, 0x18, 0xc6, 0x18, 0xc6, 0x18, 0xc6, 0x18, 0xcc, 0x0c, 
+0xf8, 0x07, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0xe0, 0x01};
+static unsigned char symbol18_90_bits[] = {
+0xff, 0x01, 0xc3, 0x01, 0xc1, 0x00, 0xe0, 0x00, 0x60, 0x00, 0x70, 0x00, 
+0x38, 0x00, 0x18, 0x00, 0x1c, 0x00, 0x0e, 0x00, 0x06, 0x01, 0x87, 0x01, 
+0xff, 0x01};
+static unsigned char symbol18_91_bits[] = {
+0x0f, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x0f};
+static unsigned char symbol18_92_bits[] = {
+0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol18_93_bits[] = {
+0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0f};
+static unsigned char symbol18_94_bits[] = {
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0xff, 0x03, 
+0xff, 0x03};
+static unsigned char symbol18_95_bits[] = {
+0xff, 0x01, 0xff, 0x01};
+static unsigned char symbol18_96_bits[] = {
+0xff, 0x03};
+static unsigned char symbol18_97_bits[] = {
+0x3c, 0x03, 0xa6, 0x01, 0xc3, 0x00, 0xc3, 0x00, 0xc3, 0x00, 0xc3, 0x00, 
+0xc3, 0x00, 0xa6, 0x04, 0x1c, 0x03};
+static unsigned char symbol18_98_bits[] = {
+0x3c, 0x62, 0x63, 0x63, 0x63, 0x33, 0x63, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 
+0x67, 0x3b, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol18_99_bits[] = {
+0x06, 0x03, 0x8f, 0x03, 0x89, 0x01, 0xc8, 0x00, 0xe8, 0x00, 0x70, 0x00, 
+0x30, 0x00, 0x38, 0x00, 0x58, 0x00, 0x4c, 0x00, 0x46, 0x02, 0xc7, 0x03, 
+0x83, 0x01};
+static unsigned char symbol18_100_bits[] = {
+0x1c, 0x32, 0x02, 0x06, 0x0c, 0x1c, 0x36, 0x63, 0x63, 0x63, 0x63, 0x63, 
+0x36, 0x1c};
+static unsigned char symbol18_101_bits[] = {
+0x1e, 0x37, 0x33, 0x03, 0x0e, 0x03, 0x03, 0x27, 0x1e};
+static unsigned char symbol18_102_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x7c, 0x00, 0xd6, 0x00, 0x93, 0x01, 
+0x93, 0x01, 0x93, 0x01, 0x93, 0x01, 0x93, 0x01, 0xd6, 0x00, 0x7c, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char symbol18_103_bits[] = {
+0xc3, 0xc7, 0xc5, 0x64, 0x64, 0x68, 0x28, 0x38, 0x30, 0x18, 0x18, 0x18, 
+0x18};
+static unsigned char symbol18_104_bits[] = {
+0xe6, 0x00, 0x97, 0x01, 0x8d, 0x01, 0x8c, 0x01, 0x8c, 0x01, 0x8c, 0x01, 
+0x8c, 0x01, 0x8c, 0x01, 0x8c, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 
+0x80, 0x01};
+static unsigned char symbol18_105_bits[] = {
+0x06, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x16, 0x0e};
+static unsigned char symbol18_106_bits[] = {
+0x66, 0x00, 0xf3, 0x00, 0x93, 0x01, 0x93, 0x01, 0x93, 0x01, 0x93, 0x01, 
+0x92, 0x00, 0xd6, 0x00, 0x7c, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x10, 0x00};
+static unsigned char symbol18_107_bits[] = {
+0xc6, 0x01, 0xa7, 0x01, 0x16, 0x00, 0x1e, 0x00, 0x3e, 0x00, 0x76, 0x00, 
+0xe6, 0x00, 0xc6, 0x01, 0x86, 0x01};
+static unsigned char symbol18_108_bits[] = {
+0x0c, 0x00, 0x1e, 0x00, 0x12, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x38, 0x00, 0x38, 0x00, 0x2c, 0x00, 0x2c, 0x00, 0x66, 0x00, 0x46, 0x02, 
+0xc3, 0x03, 0x83, 0x01};
+static unsigned char symbol18_109_bits[] = {
+0x42, 0x00, 0x63, 0x00, 0x63, 0x00, 0x63, 0x00, 0x63, 0x00, 0x63, 0x00, 
+0x63, 0x01, 0xdf, 0x01, 0xde, 0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00};
+static unsigned char symbol18_110_bits[] = {
+0xc3, 0xc3, 0x86, 0x46, 0x4c, 0x2c, 0x38, 0x18, 0x10};
+static unsigned char symbol18_111_bits[] = {
+0x3c, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c};
+static unsigned char symbol18_112_bits[] = {
+0xfe, 0x01, 0xff, 0x01, 0x49, 0x00, 0x48, 0x00, 0x48, 0x00, 0x48, 0x00, 
+0x4c, 0x01, 0xce, 0x01, 0xc6, 0x00};
+static unsigned char symbol18_113_bits[] = {
+0x3c, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xff, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 
+0x3c};
+static unsigned char symbol18_114_bits[] = {
+0x3c, 0x62, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x67, 0x3b, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char symbol18_115_bits[] = {
+0xf8, 0x03, 0xfe, 0x03, 0x66, 0x00, 0xc3, 0x00, 0xc3, 0x00, 0xc3, 0x00, 
+0xc3, 0x00, 0x66, 0x00, 0x3c, 0x00};
+static unsigned char symbol18_116_bits[] = {
+0x7e, 0x7f, 0x09, 0x08, 0x08, 0x08, 0x48, 0x78, 0x38};
+static unsigned char symbol18_117_bits[] = {
+0xc6, 0x00, 0x8f, 0x01, 0x8d, 0x01, 0x8c, 0x01, 0x8c, 0x01, 0x8c, 0x01, 
+0x8c, 0x01, 0xdc, 0x00, 0x78, 0x00};
+static unsigned char symbol18_118_bits[] = {
+0xfc, 0x07, 0xfe, 0x07, 0x99, 0x01, 0x0c, 0x03, 0x04, 0x02, 0x66, 0x06, 
+0x66, 0x06, 0x66, 0x06, 0x66, 0x06, 0x6c, 0x03, 0x9c, 0x03};
+static unsigned char symbol18_119_bits[] = {
+0xcc, 0x00, 0x86, 0x01, 0x02, 0x01, 0x33, 0x03, 0x33, 0x03, 0x33, 0x03, 
+0x33, 0x03, 0xb6, 0x01, 0xce, 0x01};
+static unsigned char symbol18_120_bits[] = {
+0x06, 0x71, 0x3f, 0x04, 0x02, 0x02, 0x3e, 0x1e, 0x03, 0x01, 0x01, 0x01, 
+0x03, 0x3f, 0x7e, 0x40, 0x40, 0x78, 0x38};
+static unsigned char symbol18_121_bits[] = {
+0x47, 0x1c, 0x4e, 0x0e, 0x4c, 0x06, 0x4c, 0x06, 0x4c, 0x06, 0x4c, 0x06, 
+0x58, 0x03, 0x58, 0x03, 0xf0, 0x01, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 
+0x40, 0x00};
+static unsigned char symbol18_122_bits[] = {
+0x06, 0x61, 0x79, 0x1e, 0x06, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x03, 0x3f, 0x7e, 0x40, 0x40, 0x78, 0x38};
+static unsigned char symbol18_123_bits[] = {
+0x70, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x06, 0x03, 0x06, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x18, 0x70};
+static unsigned char symbol18_124_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol18_125_bits[] = {
+0x07, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0x60, 0x30, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x0c, 0x07};
+static unsigned char symbol18_126_bits[] = {
+0xce, 0xff, 0x73};
+static unsigned char symbol18_127_bits[] = {
+0x00};
+static unsigned char symbol18_128_bits[] = {
+0x00};
+static unsigned char symbol18_129_bits[] = {
+0x00};
+static unsigned char symbol18_130_bits[] = {
+0x00};
+static unsigned char symbol18_131_bits[] = {
+0x00};
+static unsigned char symbol18_132_bits[] = {
+0x00};
+static unsigned char symbol18_133_bits[] = {
+0x00};
+static unsigned char symbol18_134_bits[] = {
+0x00};
+static unsigned char symbol18_135_bits[] = {
+0x00};
+static unsigned char symbol18_136_bits[] = {
+0x00};
+static unsigned char symbol18_137_bits[] = {
+0x00};
+static unsigned char symbol18_138_bits[] = {
+0x00};
+static unsigned char symbol18_139_bits[] = {
+0x00};
+static unsigned char symbol18_140_bits[] = {
+0x00};
+static unsigned char symbol18_141_bits[] = {
+0x00};
+static unsigned char symbol18_142_bits[] = {
+0x00};
+static unsigned char symbol18_143_bits[] = {
+0x00};
+static unsigned char symbol18_144_bits[] = {
+0x00};
+static unsigned char symbol18_145_bits[] = {
+0x00};
+static unsigned char symbol18_146_bits[] = {
+0x00};
+static unsigned char symbol18_147_bits[] = {
+0x00};
+static unsigned char symbol18_148_bits[] = {
+0x00};
+static unsigned char symbol18_149_bits[] = {
+0x00};
+static unsigned char symbol18_150_bits[] = {
+0x00};
+static unsigned char symbol18_151_bits[] = {
+0x00};
+static unsigned char symbol18_152_bits[] = {
+0x00};
+static unsigned char symbol18_153_bits[] = {
+0x00};
+static unsigned char symbol18_154_bits[] = {
+0x00};
+static unsigned char symbol18_155_bits[] = {
+0x00};
+static unsigned char symbol18_156_bits[] = {
+0x00};
+static unsigned char symbol18_157_bits[] = {
+0x00};
+static unsigned char symbol18_158_bits[] = {
+0x00};
+static unsigned char symbol18_159_bits[] = {
+0x00};
+static unsigned char symbol18_160_bits[] = {
+0x00};
+static unsigned char symbol18_161_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00};
+static unsigned char symbol18_162_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol18_163_bits[] = {
+0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x04, 0x00, 0x06, 0x00, 0x06, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol18_164_bits[] = {
+0x00, 0x30, 0x00, 0x78, 0x00, 0x0c, 0x0e, 0x06, 0x03, 0x01, 0xc0, 0x01, 
+0xf0};
+static unsigned char symbol18_165_bits[] = {
+0x00, 0x0c, 0x00, 0x0f, 0x00, 0x03, 0x00, 0x0f, 0x00, 0x0c};
+static unsigned char symbol18_166_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 
+0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x03, 0x01, 
+0x9e, 0x01, 0xf3, 0x00, 0x61, 0x00, 0xf3, 0x00, 0x9e, 0x01};
+static unsigned char symbol18_167_bits[] = {
+0xc0, 0x01, 0xa0, 0x01, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0xfe, 0x00, 
+0x18, 0x00, 0x18, 0x00, 0x18, 0x00};
+static unsigned char symbol18_168_bits[] = {
+0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 
+0x0b, 0x00, 0x07, 0x00, 0x30, 0x00};
+static unsigned char symbol18_169_bits[] = {
+0x78, 0x00, 0x78, 0x00, 0x78, 0x00, 0xb6, 0x01, 0xff, 0x01, 0xff, 0x01, 
+0xb6, 0x01, 0x30, 0x00, 0x10, 0x00};
+static unsigned char symbol18_170_bits[] = {
+0x38, 0x00, 0x7c, 0x00, 0xfe, 0x00, 0xff, 0x01, 0xfe, 0x00, 0x7c, 0x00, 
+0x38, 0x00, 0x10, 0x00, 0xc6, 0x00};
+static unsigned char symbol18_171_bits[] = {
+0xef, 0x01, 0x01, 0x01, 0xff, 0x01, 0xfe, 0x00, 0x00, 0x00, 0x7c, 0x00, 
+0x38, 0x00, 0x00, 0x00, 0x30, 0x00, 0x78, 0x00, 0x00, 0x00, 0xfe, 0x01};
+static unsigned char symbol18_172_bits[] = {
+0xff, 0x03, 0x03, 0x03, 0xb6, 0x01, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 
+0x00, 0x0c, 0x00, 0x00, 0x06, 0x00, 0x00, 0xff, 0x03, 0x01, 0xff, 0x03};
+static unsigned char symbol18_173_bits[] = {
+0x01, 0x06, 0xc0, 0x00, 0x0c, 0x60, 0x00, 0x18, 0x30, 0x00, 0x18, 0x00, 
+0x00, 0x0c, 0x00, 0x00, 0x06, 0x00, 0x00, 0xff, 0xff, 0x03, 0xff, 0xff, 
+0x03};
+static unsigned char symbol18_174_bits[] = {
+0x06, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x3c, 0x02, 
+0xdb, 0x99, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00};
+static unsigned char symbol18_175_bits[] = {
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x60, 
+0x00, 0x00, 0xc0, 0x00, 0x00, 0x80, 0x01, 0xff, 0xff, 0x03};
+static unsigned char symbol18_176_bits[] = {
+0x1f, 0x1f, 0x03, 0x00, 0x00, 0x01};
+static unsigned char symbol18_177_bits[] = {
+0x00, 0xc0, 0x00, 0x00, 0x60, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18};
+static unsigned char symbol18_178_bits[] = {
+0x18, 0x18, 0x18, 0x18, 0x18};
+static unsigned char symbol18_179_bits[] = {
+0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x01, 0xdb, 0x00, 0x3c, 0x00, 
+0x0e, 0x01, 0x11, 0x01, 0x1b, 0x00, 0x18, 0x00, 0x18, 0x01, 0xff, 0x00};
+static unsigned char symbol18_180_bits[] = {
+0x18, 0x00, 0x00, 0x03, 0xff, 0x00, 0xee, 0x02, 0x33, 0x01, 0x07, 0x00, 
+0x1e, 0x00, 0x78, 0x00, 0xe0, 0x01};
+static unsigned char symbol18_181_bits[] = {
+0x80, 0x01, 0xe0, 0x01, 0x78, 0x00, 0x1e, 0x00, 0x07, 0x00};
+static unsigned char symbol18_182_bits[] = {
+0x00, 0x00, 0x7f, 0x01, 0x7f, 0x01, 0x07, 0x03, 0x4e, 0x01, 0x4c, 0x00, 
+0x78, 0x00};
+static unsigned char symbol18_183_bits[] = {
+0x10, 0x00, 0x18, 0x00, 0x0c, 0x00};
+static unsigned char symbol18_184_bits[] = {
+0xce, 0x01, 0x87, 0x03, 0x9e, 0x07, 0xf3, 0x00};
+static unsigned char symbol18_185_bits[] = {
+0x61, 0x00, 0xf3, 0x00, 0x9e, 0x07, 0x1e, 0x33, 0x61};
+static unsigned char symbol18_186_bits[] = {
+0x60, 0x60, 0x60, 0x7c, 0x66, 0x63, 0x63, 0x63};
+static unsigned char symbol18_187_bits[] = {
+0x23, 0x37, 0x1e, 0x0e, 0x1f, 0x1f, 0x1f};
+static unsigned char symbol18_188_bits[] = {
+0x1f, 0x0e, 0x18, 0x18};
+static unsigned char symbol18_189_bits[] = {
+0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x03, 
+0x03, 0x00, 0x00, 0x03, 0x03, 0x00, 0x03, 0x03, 0x00, 0x03, 0x03, 0x02, 
+0x03};
+static unsigned char symbol18_190_bits[] = {
+0x73, 0x00, 0x06, 0xff, 0x73, 0x03};
+static unsigned char symbol18_191_bits[] = {
+0x30, 0x01, 0x30, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01};
+static unsigned char symbol18_192_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0xff, 0x07, 0x07, 0x07, 0xff, 0x07, 0x80, 0x01, 
+0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x84, 0x01, 
+0x86, 0x01};
+static unsigned char symbol18_193_bits[] = {
+0xff, 0x01, 0xff, 0x01, 0x06, 0x00, 0x04, 0x00, 0x43, 0x00, 0xc7, 0x03, 
+0x8e, 0x03, 0x1c, 0x03, 0x9c, 0x01, 0xbe, 0x00, 0xf3, 0x00, 0xe3, 0x00, 
+0xc7, 0x00, 0xce, 0x01, 0x8c, 0x03};
+static unsigned char symbol18_194_bits[] = {
+0x0e, 0x03, 0x0f, 0x02, 0xf8, 0x03, 0xfc, 0x03, 0x06, 0x01, 0x82, 0x00, 
+0x42, 0x00, 0x44, 0x00, 0xc8, 0x00, 0xc0, 0x01, 0x80, 0x03, 0x00, 0x03, 
+0x00, 0x03, 0x0e, 0x03};
+static unsigned char symbol18_195_bits[] = {
+0x1f, 0x01, 0xf8, 0x00, 0x70, 0x00, 0x9e, 0x03, 0x7f, 0x07, 0x71, 0x0e, 
+0x61, 0x0c, 0x63, 0x06, 0x6e, 0x01, 0x6c, 0x02, 0x64, 0x06, 0x60, 0x06, 
+0x60, 0x06, 0x60, 0x06, 0x60, 0x06};
+static unsigned char symbol18_196_bits[] = {
+0x36, 0x0e, 0x1d, 0x0c, 0x30, 0x00, 0x18, 0x00, 0x8c, 0x07, 0xe6, 0x0c, 
+0x33, 0x0c, 0x1b, 0x0c, 0x6b, 0x0c, 0x6f, 0x06, 0x26, 0x07, 0xee, 0x03, 
+0xcd, 0x01};
+static unsigned char symbol18_197_bits[] = {
+0x19, 0x00, 0x19, 0x00, 0x1b, 0x00, 0x0e, 0x00, 0xf8, 0x01, 0x9c, 0x03, 
+0x06, 0x06, 0x9b, 0x0d, 0xbb, 0x0d, 0xf1, 0x08, 0x61, 0x08, 0xf1, 0x08, 
+0xdb, 0x0d};
+static unsigned char symbol18_198_bits[] = {
+0x9b, 0x0d, 0x06, 0x06, 0x9c, 0x03, 0xf8, 0x01, 0xf8, 0x01, 0x9c, 0x03, 
+0x66, 0x06, 0x63, 0x0c, 0x63, 0x0c, 0xfd, 0x0b, 0xfd, 0x0b, 0x61, 0x08, 
+0x63, 0x0c};
+static unsigned char symbol18_199_bits[] = {
+0x63, 0x0c, 0x06, 0x06, 0x9c, 0x03, 0xf8, 0x01, 0xf8, 0x0d, 0x9c, 0x0f, 
+0x06, 0x06, 0x03, 0x0f, 0x83, 0x0d};
+static unsigned char symbol18_200_bits[] = {
+0xc1, 0x08, 0x61, 0x08, 0x31, 0x08, 0x1b, 0x0c, 0x0f, 0x0c, 0x06, 0x06, 
+0x9f, 0x03, 0xfb, 0x01, 0xf8, 0x01};
+static unsigned char symbol18_201_bits[] = {
+0x9c, 0x03, 0x06, 0x06, 0x07, 0x0e, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 
+0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c};
+static unsigned char symbol18_202_bits[] = {
+0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x07, 0x0e, 0x06, 0x06, 
+0x9c, 0x03, 0xf8, 0x01, 0xff, 0x01, 0xff, 0x07, 0x00, 0x06, 0x00, 0x0c};
+static unsigned char symbol18_203_bits[] = {
+0x00, 0x0c, 0x00, 0x0c, 0x00, 0x06, 0xff, 0x07, 0xff, 0x01, 0xff, 0x01, 
+0xff, 0x07, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x06, 
+0xff, 0x07};
+static unsigned char symbol18_204_bits[] = {
+0xff, 0x01, 0x00, 0x00, 0xff, 0x0f, 0xff, 0x0f, 0x00, 0x06, 0x00, 0x03, 
+0xf8, 0x0f, 0xfe, 0x0f, 0x86, 0x01};
+static unsigned char symbol18_205_bits[] = {
+0xc3, 0x00, 0xc3, 0x00, 0x63, 0x00, 0x66, 0x00, 0xfe, 0x0f, 0xf8, 0x0f, 
+0x18, 0x00, 0x0c, 0x00, 0xf8, 0x0f, 0xfe, 0x0f, 0x06, 0x00, 0x03, 0x00};
+static unsigned char symbol18_206_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 0xfe, 0x01, 0xf8, 0x01, 0xf8, 0x01, 
+0xfe, 0x01, 0x06, 0x00, 0x03, 0x00};
+static unsigned char symbol18_207_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 0xfe, 0x03, 0xf8, 0x03, 0x00, 0x00, 
+0xff, 0x03, 0xff, 0x03, 0xf8, 0x01, 0xfe, 0x01, 0x07, 0x00};
+static unsigned char symbol18_208_bits[] = {
+0x03, 0x00, 0xff, 0x01, 0x03, 0x00, 0x07, 0x00, 0xfe, 0x01, 0xf8, 0x01, 
+0x00, 0x01, 0xf8, 0x03, 0xfe, 0x03, 0x47, 0x00, 0x23, 0x00, 0xff, 0x01, 
+0x13, 0x00};
+static unsigned char symbol18_209_bits[] = {
+0x0f, 0x00, 0xfe, 0x03, 0xfc, 0x03, 0x02, 0x00, 0x00, 0x08, 0x00, 0x0c, 
+0x00, 0x06, 0x00, 0x03, 0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 
+0x18, 0x00};
+static unsigned char symbol18_210_bits[] = {
+0x0c, 0x00, 0x06, 0x00, 0x03, 0x00, 0xff, 0x1f, 0xff, 0x0f, 0x07, 0x04, 
+0x06, 0x06, 0x06, 0x02, 0x0e, 0x03, 0x0c, 0x01, 0x0c, 0x01, 0x9c, 0x01, 
+0x98, 0x00};
+static unsigned char symbol18_211_bits[] = {
+0xd8, 0x00, 0x70, 0x00, 0x70, 0x00, 0x20, 0x00, 0xf8, 0x03, 0x1c, 0x07, 
+0x06, 0x0c, 0xfb, 0x18, 0xb3, 0x19, 0xb3, 0x19, 0xb3, 0x19, 0xf3, 0x18, 
+0xb3, 0x19};
+static unsigned char symbol18_212_bits[] = {
+0x3b, 0x1b, 0x06, 0x0c, 0x1c, 0x07, 0xf8, 0x03, 0xf8, 0x03, 0x1c, 0x07, 
+0x06, 0x0c, 0xe3, 0x19};
+static unsigned char symbol18_213_bits[] = {
+0xb3, 0x19, 0x33, 0x19, 0x33, 0x18, 0x33, 0x18, 0x33, 0x19, 0xe3, 0x18, 
+0x06, 0x0c, 0x1c, 0x07, 0xf8, 0x03, 0xff, 0x38, 0xd5, 0x18, 0xc4, 0x18, 
+0x44, 0x15, 0x44, 0x15, 0x44, 0x15, 0x44, 0x12};
+static unsigned char symbol18_214_bits[] = {
+0xee, 0x02, 0xff, 0x03, 0x0e, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x3f, 0x03};
+static unsigned char symbol18_215_bits[] = {
+0x00, 0x02};
+static unsigned char symbol18_216_bits[] = {
+0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01};
+static unsigned char symbol18_217_bits[] = {
+0x0c, 0x01, 0x8e, 0x00, 0x9b, 0x00, 0x98, 0x00, 0x98, 0x00, 0xb0, 0x00, 
+0xb0, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char symbol18_218_bits[] = {
+0x60, 0x00, 0x03, 0x03, 0xff, 0x03, 0xff, 0x03, 0x00, 0x02, 0x00, 0x02, 
+0x00, 0x02, 0x00, 0x02, 0x30, 0x00};
+static unsigned char symbol18_219_bits[] = {
+0x30, 0x00, 0x00, 0x00, 0xcc, 0x00, 0xcc, 0x00, 0x02, 0x01, 0x86, 0x01, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x01, 0x86, 0x01, 
+0xcc, 0x00, 0x00};
+static unsigned char symbol18_220_bits[] = {
+0x00, 0x78, 0x00, 0x30, 0x00, 0x30, 0x00, 0x10, 0x20, 0x00, 0x18, 0x60, 
+0x00, 0xfc, 0xff, 0x00, 0xfe, 0xff};
+static unsigned char symbol18_221_bits[] = {
+0x01, 0x01, 0x80, 0x01, 0xfe, 0x01, 0x01, 0x00, 0xff, 0x00, 0x18, 0x00, 
+0x00, 0x00, 0x20, 0x00, 0x10, 0x00, 0x18, 0x00, 0xfc, 0x01, 0xfe, 0x01, 
+0x07, 0x00, 0xfe, 0x01, 0xfc, 0x01, 0x18, 0x00, 0x10, 0x00};
+static unsigned char symbol18_222_bits[] = {
+0x10, 0x00, 0x38, 0x00, 0x6c, 0x00, 0xee, 0x00, 0xef, 0x01, 0x6c, 0x00, 
+0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00};
+static unsigned char symbol18_223_bits[] = {
+0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 
+0x6c, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0xff, 0x01, 
+0x00, 0x00, 0xff, 0x01, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol18_224_bits[] = {
+0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 
+0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 
+0xef, 0x01, 0xee, 0x00};
+static unsigned char symbol18_225_bits[] = {
+0x0c, 0x00, 0x18, 0x00, 0x10, 0x00, 0x10, 0x00, 0x18, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x06, 0x00, 0x06};
+static unsigned char symbol18_226_bits[] = {
+0x00, 0x03, 0x01, 0x03, 0x01, 0x06, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x0c, 
+0x00, 0x18, 0x00, 0x10, 0x00, 0x18, 0x18, 0x0c, 0x0c, 0x06, 0x06, 0x03, 
+0x03, 0x01};
+static unsigned char symbol18_227_bits[] = {
+0x03, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0xf8, 0x03, 0x1c, 0x07, 
+0x06, 0x0c, 0xf3, 0x18, 0xb3, 0x19, 0xb3, 0x19, 0xf3, 0x18, 0xb3, 0x19, 
+0xb3, 0x19};
+static unsigned char symbol18_228_bits[] = {
+0xb3, 0x19, 0x06, 0x0c, 0x1c, 0x07, 0xf8, 0x03, 0xf8, 0x03, 0x1c, 0x07, 
+0x06, 0x0c, 0xe3, 0x18};
+static unsigned char symbol18_229_bits[] = {
+0x33, 0x09, 0x33, 0x08, 0x33, 0x08, 0x33, 0x08, 0x33, 0x09, 0xe3, 0x08, 
+0x06, 0x0c, 0x1c, 0x07, 0xf8, 0x03, 0xdf, 0x08, 0xc4, 0x08, 0xc4, 0x08, 
+0x44, 0x05, 0x44, 0x05, 0x44, 0x05, 0x44, 0x02};
+static unsigned char symbol18_230_bits[] = {
+0x04, 0x12, 0x3f, 0x07, 0x07, 0x06, 0x0e, 0x04, 0x1c, 0x00, 0x38, 0x00, 
+0x30, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x30, 0x00, 0x18, 0x00, 
+0x0c};
+static unsigned char symbol18_231_bits[] = {
+0x00, 0x02, 0x00, 0x03, 0x00, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char symbol18_232_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char symbol18_233_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x07};
+static unsigned char symbol18_234_bits[] = {
+0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char symbol18_235_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol18_236_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char symbol18_237_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x1f, 0x1c, 0x06, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char symbol18_238_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x07, 0x07};
+static unsigned char symbol18_239_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char symbol18_240_bits[] = {
+0x00};
+static unsigned char symbol18_241_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x1c, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol18_242_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x03, 0x03, 0x06, 0x06};
+static unsigned char symbol18_243_bits[] = {
+0x0c, 0x0c, 0x18, 0x18, 0x10, 0x18, 0x18, 0x0c, 0x0c, 0x06, 0x06, 0x03, 
+0x03, 0x38, 0x38, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c};
+static unsigned char symbol18_244_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x02, 
+0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char symbol18_245_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol18_246_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 
+0x20};
+static unsigned char symbol18_247_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x02, 0x01, 0x03, 
+0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00};
+static unsigned char symbol18_248_bits[] = {
+0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char symbol18_249_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x10, 0x10, 
+0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 
+0x10};
+static unsigned char symbol18_250_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x01, 0x03, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00};
+static unsigned char symbol18_251_bits[] = {
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol18_252_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18};
+static unsigned char symbol18_253_bits[] = {
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x07, 0x0c, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18};
+static unsigned char symbol18_254_bits[] = {
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x06};
+static unsigned char symbol18_255_bits[] = {
+0x00};
+static RotFont symbol18font[] = {
+{5, 1, 1, symbol18_0_bits},
+{5, 1, 1, symbol18_1_bits},
+{5, 1, 1, symbol18_2_bits},
+{5, 1, 1, symbol18_3_bits},
+{5, 1, 1, symbol18_4_bits},
+{5, 1, 1, symbol18_5_bits},
+{5, 1, 1, symbol18_6_bits},
+{5, 1, 1, symbol18_7_bits},
+{5, 1, 1, symbol18_8_bits},
+{5, 1, 1, symbol18_9_bits},
+{5, 1, 1, symbol18_10_bits},
+{5, 1, 1, symbol18_11_bits},
+{5, 1, 1, symbol18_12_bits},
+{5, 1, 1, symbol18_13_bits},
+{5, 1, 1, symbol18_14_bits},
+{5, 1, 1, symbol18_15_bits},
+{5, 1, 1, symbol18_16_bits},
+{5, 1, 1, symbol18_17_bits},
+{5, 1, 1, symbol18_18_bits},
+{5, 1, 1, symbol18_19_bits},
+{5, 1, 1, symbol18_20_bits},
+{5, 1, 1, symbol18_21_bits},
+{5, 1, 1, symbol18_22_bits},
+{5, 1, 1, symbol18_23_bits},
+{5, 1, 1, symbol18_24_bits},
+{5, 1, 1, symbol18_25_bits},
+{5, 1, 1, symbol18_26_bits},
+{5, 1, 1, symbol18_27_bits},
+{5, 1, 1, symbol18_28_bits},
+{5, 1, 1, symbol18_29_bits},
+{5, 1, 1, symbol18_30_bits},
+{5, 1, 1, symbol18_31_bits},
+{1, 1, 1, symbol18_32_bits},
+{2, 13, 13, symbol18_33_bits},
+{13, 13, 13, symbol18_34_bits},
+{10, 13, 13, symbol18_35_bits},
+{8, 13, 13, symbol18_36_bits},
+{13, 13, 13, symbol18_37_bits},
+{12, 13, 13, symbol18_38_bits},
+{6, 9, 9, symbol18_39_bits},
+{4, 17, 13, symbol18_40_bits},
+{4, 17, 13, symbol18_41_bits},
+{7, 7, 10, symbol18_42_bits},
+{8, 8, 9, symbol18_43_bits},
+{3, 5, 2, symbol18_44_bits},
+{7, 2, 6, symbol18_45_bits},
+{2, 2, 2, symbol18_46_bits},
+{5, 13, 13, symbol18_47_bits},
+{8, 13, 13, symbol18_48_bits},
+{6, 13, 13, symbol18_49_bits},
+{7, 13, 13, symbol18_50_bits},
+{7, 13, 13, symbol18_51_bits},
+{8, 13, 13, symbol18_52_bits},
+{7, 13, 13, symbol18_53_bits},
+{8, 13, 13, symbol18_54_bits},
+{8, 13, 13, symbol18_55_bits},
+{8, 13, 13, symbol18_56_bits},
+{8, 13, 13, symbol18_57_bits},
+{2, 9, 9, symbol18_58_bits},
+{3, 12, 9, symbol18_59_bits},
+{9, 9, 9, symbol18_60_bits},
+{8, 6, 8, symbol18_61_bits},
+{9, 9, 9, symbol18_62_bits},
+{6, 13, 13, symbol18_63_bits},
+{8, 9, 9, symbol18_64_bits},
+{12, 13, 13, symbol18_65_bits},
+{9, 13, 13, symbol18_66_bits},
+{12, 13, 13, symbol18_67_bits},
+{11, 13, 13, symbol18_68_bits},
+{9, 13, 13, symbol18_69_bits},
+{12, 13, 13, symbol18_70_bits},
+{10, 13, 13, symbol18_71_bits},
+{11, 13, 13, symbol18_72_bits},
+{4, 13, 13, symbol18_73_bits},
+{11, 13, 13, symbol18_74_bits},
+{11, 13, 13, symbol18_75_bits},
+{12, 13, 13, symbol18_76_bits},
+{14, 13, 13, symbol18_77_bits},
+{11, 13, 13, symbol18_78_bits},
+{11, 13, 13, symbol18_79_bits},
+{11, 13, 13, symbol18_80_bits},
+{11, 13, 13, symbol18_81_bits},
+{8, 13, 13, symbol18_82_bits},
+{10, 13, 13, symbol18_83_bits},
+{10, 13, 13, symbol18_84_bits},
+{12, 13, 13, symbol18_85_bits},
+{6, 13, 9, symbol18_86_bits},
+{13, 13, 13, symbol18_87_bits},
+{10, 13, 13, symbol18_88_bits},
+{14, 13, 13, symbol18_89_bits},
+{9, 13, 13, symbol18_90_bits},
+{4, 17, 13, symbol18_91_bits},
+{10, 9, 9, symbol18_92_bits},
+{4, 17, 13, symbol18_93_bits},
+{10, 13, 13, symbol18_94_bits},
+{9, 2, -2, symbol18_95_bits},
+{10, 1, 17, symbol18_96_bits},
+{11, 9, 9, symbol18_97_bits},
+{8, 18, 14, symbol18_98_bits},
+{10, 13, 9, symbol18_99_bits},
+{7, 14, 14, symbol18_100_bits},
+{6, 9, 9, symbol18_101_bits},
+{9, 16, 12, symbol18_102_bits},
+{8, 13, 9, symbol18_103_bits},
+{9, 13, 9, symbol18_104_bits},
+{5, 9, 9, symbol18_105_bits},
+{9, 13, 9, symbol18_106_bits},
+{9, 9, 9, symbol18_107_bits},
+{10, 14, 14, symbol18_108_bits},
+{9, 13, 9, symbol18_109_bits},
+{8, 9, 9, symbol18_110_bits},
+{8, 9, 9, symbol18_111_bits},
+{9, 9, 9, symbol18_112_bits},
+{8, 13, 13, symbol18_113_bits},
+{8, 13, 9, symbol18_114_bits},
+{10, 9, 9, symbol18_115_bits},
+{7, 9, 9, symbol18_116_bits},
+{9, 9, 9, symbol18_117_bits},
+{11, 11, 11, symbol18_118_bits},
+{10, 9, 9, symbol18_119_bits},
+{7, 19, 15, symbol18_120_bits},
+{13, 13, 9, symbol18_121_bits},
+{7, 19, 15, symbol18_122_bits},
+{7, 17, 13, symbol18_123_bits},
+{2, 17, 13, symbol18_124_bits},
+{7, 17, 13, symbol18_125_bits},
+{8, 3, 7, symbol18_126_bits},
+{5, 1, 1, symbol18_127_bits},
+{5, 1, 1, symbol18_128_bits},
+{5, 1, 1, symbol18_129_bits},
+{5, 1, 1, symbol18_130_bits},
+{5, 1, 1, symbol18_131_bits},
+{5, 1, 1, symbol18_132_bits},
+{5, 1, 1, symbol18_133_bits},
+{5, 1, 1, symbol18_134_bits},
+{5, 1, 1, symbol18_135_bits},
+{5, 1, 1, symbol18_136_bits},
+{5, 1, 1, symbol18_137_bits},
+{5, 1, 1, symbol18_138_bits},
+{5, 1, 1, symbol18_139_bits},
+{5, 1, 1, symbol18_140_bits},
+{5, 1, 1, symbol18_141_bits},
+{5, 1, 1, symbol18_142_bits},
+{5, 1, 1, symbol18_143_bits},
+{5, 1, 1, symbol18_144_bits},
+{5, 1, 1, symbol18_145_bits},
+{5, 1, 1, symbol18_146_bits},
+{5, 1, 1, symbol18_147_bits},
+{5, 1, 1, symbol18_148_bits},
+{5, 1, 1, symbol18_149_bits},
+{5, 1, 1, symbol18_150_bits},
+{5, 1, 1, symbol18_151_bits},
+{5, 1, 1, symbol18_152_bits},
+{5, 1, 1, symbol18_153_bits},
+{5, 1, 1, symbol18_154_bits},
+{5, 1, 1, symbol18_155_bits},
+{5, 1, 1, symbol18_156_bits},
+{5, 1, 1, symbol18_157_bits},
+{5, 1, 1, symbol18_158_bits},
+{5, 1, 1, symbol18_159_bits},
+{5, 1, 1, symbol18_160_bits},
+{11, 13, 13, symbol18_161_bits},
+{4, 5, 14, symbol18_162_bits},
+{9, 12, 12, symbol18_163_bits},
+{8, 13, 13, symbol18_164_bits},
+{12, 5, 8, symbol18_165_bits},
+{9, 17, 13, symbol18_166_bits},
+{10, 9, 9, symbol18_167_bits},
+{9, 9, 9, symbol18_168_bits},
+{9, 9, 9, symbol18_169_bits},
+{10, 9, 9, symbol18_170_bits},
+{17, 8, 9, symbol18_171_bits},
+{18, 8, 9, symbol18_172_bits},
+{8, 25, 18, symbol18_173_bits},
+{18, 8, 9, symbol18_174_bits},
+{8, 22, 18, symbol18_175_bits},
+{5, 6, 13, symbol18_176_bits},
+{8, 11, 11, symbol18_177_bits},
+{8, 5, 14, symbol18_178_bits},
+{9, 12, 12, symbol18_179_bits},
+{10, 9, 9, symbol18_180_bits},
+{11, 5, 8, symbol18_181_bits},
+{7, 14, 14, symbol18_182_bits},
+{5, 6, 8, symbol18_183_bits},
+{8, 8, 9, symbol18_184_bits},
+{8, 9, 9, symbol18_185_bits},
+{8, 8, 9, symbol18_186_bits},
+{8, 7, 9, symbol18_187_bits},
+{14, 2, 2, symbol18_188_bits},
+{2, 25, 18, symbol18_189_bits},
+{19, 2, 6, symbol18_190_bits},
+{9, 12, 12, symbol18_191_bits},
+{11, 13, 13, symbol18_192_bits},
+{10, 15, 14, symbol18_193_bits},
+{13, 14, 14, symbol18_194_bits},
+{12, 15, 11, symbol18_195_bits},
+{12, 13, 13, symbol18_196_bits},
+{12, 13, 13, symbol18_197_bits},
+{12, 13, 13, symbol18_198_bits},
+{12, 9, 9, symbol18_199_bits},
+{12, 9, 9, symbol18_200_bits},
+{12, 9, 9, symbol18_201_bits},
+{12, 12, 9, symbol18_202_bits},
+{12, 13, 11, symbol18_203_bits},
+{12, 9, 9, symbol18_204_bits},
+{12, 12, 9, symbol18_205_bits},
+{9, 9, 9, symbol18_206_bits},
+{10, 11, 10, symbol18_207_bits},
+{13, 13, 13, symbol18_208_bits},
+{12, 13, 13, symbol18_209_bits},
+{13, 13, 13, symbol18_210_bits},
+{13, 13, 13, symbol18_211_bits},
+{14, 8, 13, symbol18_212_bits},
+{14, 16, 14, symbol18_213_bits},
+{10, 17, 17, symbol18_214_bits},
+{2, 2, 6, symbol18_215_bits},
+{11, 6, 6, symbol18_216_bits},
+{10, 9, 9, symbol18_217_bits},
+{10, 9, 9, symbol18_218_bits},
+{18, 9, 9, symbol18_219_bits},
+{16, 9, 9, symbol18_220_bits},
+{9, 17, 17, symbol18_221_bits},
+{16, 9, 9, symbol18_222_bits},
+{9, 17, 17, symbol18_223_bits},
+{9, 14, 14, symbol18_224_bits},
+{5, 17, 14, symbol18_225_bits},
+{13, 13, 13, symbol18_226_bits},
+{13, 13, 13, symbol18_227_bits},
+{13, 8, 13, symbol18_228_bits},
+{12, 16, 14, symbol18_229_bits},
+{6, 25, 18, symbol18_230_bits},
+{2, 25, 18, symbol18_231_bits},
+{6, 25, 18, symbol18_232_bits},
+{5, 25, 18, symbol18_233_bits},
+{2, 25, 18, symbol18_234_bits},
+{5, 22, 18, symbol18_235_bits},
+{5, 25, 18, symbol18_236_bits},
+{5, 25, 18, symbol18_237_bits},
+{5, 22, 18, symbol18_238_bits},
+{2, 25, 18, symbol18_239_bits},
+{5, 1, 1, symbol18_240_bits},
+{5, 17, 14, symbol18_241_bits},
+{6, 22, 18, symbol18_242_bits},
+{7, 25, 18, symbol18_243_bits},
+{2, 25, 18, symbol18_244_bits},
+{7, 22, 18, symbol18_245_bits},
+{6, 25, 18, symbol18_246_bits},
+{2, 25, 18, symbol18_247_bits},
+{6, 25, 18, symbol18_248_bits},
+{5, 25, 18, symbol18_249_bits},
+{2, 25, 18, symbol18_250_bits},
+{5, 22, 18, symbol18_251_bits},
+{5, 25, 18, symbol18_252_bits},
+{5, 25, 18, symbol18_253_bits},
+{5, 22, 18, symbol18_254_bits},
+{5, 1, 1, symbol18_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol24.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol24.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol24.bdf	(revision 15879)
@@ -0,0 +1,4576 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Symbol-Medium-R-Normal--24-240-75-75-P-142-Adobe-FontSpecific
+SIZE 24 75 75
+FONTBOUNDINGBOX 26 32 -1 -8
+STARTPROPERTIES 31
+FOUNDRY "Adobe"
+FAMILY_NAME "Symbol"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 24
+POINT_SIZE 240
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 142
+CHARSET_REGISTRY "Adobe"
+CHARSET_ENCODING "FontSpecific"
+CAP_HEIGHT 17
+X_HEIGHT 13
+FACE_NAME "Symbol"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "No mark"
+_DEC_DEVICE_FONTNAMES "PS=Symbol"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2-1, 18-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+FULL_NAME "Symbol"
+FONT "-Adobe-Symbol-Medium-R-Normal--24-240-75-75-P-142-Adobe-FontSpecific"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 15
+DEFAULT_CHAR 32
+FONT_ASCENT 20
+FONT_DESCENT 5
+ENDPROPERTIES
+CHARS 188
+STARTCHAR space
+ENCODING 32
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 1 1 1 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 3 17 2 0
+BITMAP
+40
+e0
+e0
+e0
+e0
+e0
+e0
+e0
+40
+40
+40
+40
+00
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 17 1 0
+BITMAP
+c006
+c006
+600c
+600c
+3ff8
+3ff8
+3018
+1830
+1830
+0c60
+0c60
+0c60
+06c0
+06c0
+0380
+0380
+0380
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+0880
+0880
+0880
+0880
+0880
+0880
+7fe0
+1100
+1100
+1100
+ffc0
+2200
+2200
+2200
+2200
+2200
+2200
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+ffe0
+ffe0
+0060
+0060
+0060
+0060
+0060
+ffe0
+ffe0
+0060
+0060
+0060
+0060
+0060
+0060
+ffe0
+ffe0
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 800 0
+DWIDTH 20 0
+BBX 18 17 1 0
+BITMAP
+1f0600
+39fe00
+710c00
+611800
+e31800
+c23000
+c66000
+cc6000
+78c780
+018ec0
+019c40
+033840
+0630c0
+063080
+0c3180
+183300
+181e00
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 17 1 0
+BITMAP
+0780
+0cc0
+1840
+1840
+18c0
+1d80
+0f3e
+1e1c
+3e18
+6730
+c3a0
+c1e0
+c0c0
+c1e0
+e372
+7e3e
+3c1c
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 8 13 2 0
+BITMAP
+f0
+3c
+0e
+07
+03
+03
+7f
+03
+03
+07
+0e
+3c
+f0
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 22 1 -5
+BITMAP
+0c
+18
+30
+20
+60
+60
+40
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+40
+60
+60
+20
+30
+18
+0c
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 22 1 -5
+BITMAP
+c0
+60
+30
+10
+18
+18
+08
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+08
+18
+18
+10
+30
+60
+c0
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 8 10 2 7
+BITMAP
+18
+18
+c3
+e7
+18
+18
+e7
+c3
+18
+18
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 10 1 2
+BITMAP
+0c00
+0c00
+0c00
+0c00
+ffc0
+ffc0
+0c00
+0c00
+0c00
+0c00
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 3 6 1 -4
+BITMAP
+60
+60
+20
+60
+c0
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 2 1 6
+BITMAP
+ffe0
+ffe0
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 3 2 0
+BITMAP
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 7 17 0 0
+BITMAP
+06
+06
+06
+0c
+0c
+0c
+18
+18
+30
+30
+30
+60
+60
+60
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1e00
+3300
+6180
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+6180
+3300
+1e00
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 6 17 3 0
+BITMAP
+30
+70
+f0
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+fc
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1c00
+7f00
+6700
+8380
+8180
+0180
+0180
+0380
+0300
+0700
+0c00
+0c00
+1800
+3000
+6040
+ffc0
+ff80
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 9 17 1 0
+BITMAP
+1c00
+7e00
+4700
+8300
+8300
+0600
+0c00
+1e00
+0700
+0300
+0180
+0180
+0180
+0300
+c700
+fe00
+7800
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+0300
+0700
+0700
+0f00
+0b00
+1b00
+1300
+3300
+2300
+6300
+4300
+ffc0
+ffc0
+0300
+0300
+0300
+0300
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 9 17 1 0
+BITMAP
+3f80
+3f00
+6000
+4000
+c000
+f000
+fc00
+1e00
+0700
+0380
+0180
+0180
+0180
+0180
+c300
+fe00
+7c00
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+03c0
+0e00
+3800
+7000
+6000
+e000
+cf00
+f380
+e180
+c0c0
+c0c0
+c0c0
+c0c0
+e0c0
+61c0
+7380
+1f00
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+7fc0
+ffc0
+c0c0
+8180
+0180
+0300
+0300
+0300
+0600
+0600
+0600
+0c00
+0c00
+0c00
+1800
+1800
+1800
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1e00
+3300
+6180
+6180
+6180
+7300
+3e00
+1c00
+3f00
+6380
+c1c0
+c0c0
+c0c0
+c0c0
+c1c0
+6380
+3e00
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1e00
+7380
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+61c0
+73c0
+1ec0
+0180
+0380
+0700
+0e00
+3c00
+f000
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 11 2 0
+BITMAP
+c0
+c0
+c0
+00
+00
+00
+00
+00
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 3 15 1 -4
+BITMAP
+60
+60
+60
+00
+00
+00
+00
+00
+00
+60
+60
+20
+60
+c0
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 12 12 0 1
+BITMAP
+0070
+01e0
+0780
+1e00
+7800
+e000
+e000
+7800
+1e00
+0780
+01e0
+0070
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 6 1 4
+BITMAP
+ffc0
+ffc0
+0000
+0000
+ffc0
+ffc0
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 12 12 0 1
+BITMAP
+e000
+7800
+1e00
+0780
+01e0
+0070
+0070
+01e0
+0780
+1e00
+7800
+e000
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 8 17 2 0
+BITMAP
+7c
+c6
+83
+c3
+c7
+06
+0e
+0c
+18
+18
+10
+10
+10
+00
+00
+30
+30
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 12 1 1
+BITMAP
+3820
+7c60
+c7c0
+8380
+0000
+0000
+ffe0
+ffe0
+0000
+0000
+ffe0
+ffe0
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 17 17 0 0
+BITMAP
+008000
+01c000
+01c000
+014000
+036000
+026000
+023000
+063000
+043000
+0c1800
+081800
+0ffc00
+180c00
+100c00
+300600
+300600
+f80f80
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+ffc0
+30e0
+3070
+3030
+3030
+3030
+3030
+3060
+3fc0
+3070
+3038
+3018
+3018
+3018
+3038
+3070
+ffc0
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 17 17 1 0
+BITMAP
+f81f80
+700e00
+380c00
+1c1800
+0c3000
+066000
+07c000
+038000
+018000
+03c000
+06e000
+0c7000
+083800
+181800
+301c00
+700e00
+f81f80
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 16 17 0 0
+BITMAP
+0300
+0300
+0780
+0480
+04c0
+0cc0
+0860
+0860
+1830
+1030
+3018
+2018
+200c
+600c
+4006
+c006
+ffff
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+fff0
+3030
+3010
+3000
+3000
+3000
+3020
+3020
+3fe0
+3020
+3020
+3000
+3000
+3008
+3008
+3018
+fff8
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 16 17 1 0
+BITMAP
+07e0
+0180
+0180
+0ff0
+399c
+6186
+e187
+c183
+c183
+c183
+e187
+6186
+399c
+0ff0
+0180
+0180
+07e0
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+fff8
+3018
+3008
+3008
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+fc00
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+fc3f
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+3ffc
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+fc3f
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 17 1 0
+BITMAP
+fc
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+fc
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 17 1 0
+BITMAP
+03c0
+06e0
+0460
+0660
+0330
+71b0
+f8f0
+983c
+1830
+1830
+3030
+3030
+3030
+3060
+3860
+1cc0
+0f80
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 17 1 0
+BITMAP
+fc7c
+3030
+3060
+30c0
+3180
+3300
+3600
+3e00
+3f00
+3380
+3180
+31c0
+30e0
+3070
+3038
+301c
+fc3e
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 17 1 0
+BITMAP
+0300
+0300
+0780
+0480
+04c0
+04c0
+0cc0
+0860
+0860
+1860
+1030
+1030
+3030
+2018
+2018
+601c
+f83e
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 880 0
+DWIDTH 22 0
+BBX 20 17 1 0
+BITMAP
+f001f0
+3801c0
+3803c0
+3c02c0
+2c02c0
+2e06c0
+2604c0
+270cc0
+2308c0
+2388c0
+2198c0
+21d0c0
+20d0c0
+20f0c0
+2060c0
+2060c0
+f803f0
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+f01f
+3804
+3804
+2c04
+2e04
+2604
+2304
+2304
+2184
+21c4
+20c4
+2064
+2064
+2034
+203c
+201c
+f80c
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+07e0
+1c38
+300c
+6006
+6006
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+6006
+6006
+300c
+1c38
+07e0
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+ffff
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+300c
+fc3f
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+07e0
+1c38
+300c
+6006
+6006
+c813
+c813
+cff3
+cff3
+c813
+c813
+c003
+4002
+6006
+300c
+1c38
+07e0
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 17 1 0
+BITMAP
+ff80
+30e0
+3060
+3030
+3030
+3030
+3060
+30e0
+3f80
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+fc00
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 17 1 0
+BITMAP
+fff0
+e030
+7010
+3800
+1c00
+0e00
+0700
+0380
+0300
+0600
+0c00
+1800
+3010
+6010
+c030
+fff0
+fff0
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 17 1 0
+BITMAP
+fffc
+c30c
+8304
+8304
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0fc0
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 16 17 0 0
+BITMAP
+f81f
+700e
+300c
+1818
+1c10
+0c30
+0e60
+0660
+03c0
+03c0
+0180
+0180
+0180
+0180
+0180
+0180
+07e0
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 18 1 -5
+BITMAP
+1f80
+3f80
+6000
+6000
+c000
+c000
+c000
+c000
+c000
+c000
+6000
+7f00
+1f80
+0080
+0080
+0180
+0f00
+0e00
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+07e0
+1c38
+300c
+6006
+6006
+c003
+c003
+c003
+c003
+e007
+6006
+300c
+1818
+8c31
+8421
+fc3f
+fc3f
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 17 1 0
+BITMAP
+7ff8
+7ff8
+6018
+4008
+0000
+1020
+1020
+1fe0
+1fe0
+1020
+1020
+0000
+8004
+8004
+c00c
+fffc
+fffc
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 800 0
+DWIDTH 20 0
+BBX 18 17 1 0
+BITMAP
+e3f1c0
+70c380
+30c300
+30c300
+38c700
+38c700
+18c600
+1cce00
+07f800
+00c000
+00c000
+00c000
+00c000
+00c000
+00c000
+00c000
+03f000
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 12 17 1 0
+BITMAP
+fff0
+c070
+8060
+00e0
+01c0
+0180
+0380
+0700
+0600
+0e00
+1c00
+3800
+3800
+7000
+6010
+e030
+fff0
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 5 22 2 -5
+BITMAP
+f8
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+f8
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 12 10 3 0
+BITMAP
+0600
+0600
+0600
+0000
+0000
+0000
+0000
+c030
+c030
+c030
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 5 22 1 -5
+BITMAP
+f8
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+f8
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 17 1 0
+BITMAP
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+fffc
+fffc
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 13 2 0 -5
+BITMAP
+fff8
+fff8
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 13 2 0 21
+BITMAP
+fff8
+fff8
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 13 1 0
+BITMAP
+1f18
+71b8
+60b0
+e0f0
+c060
+c060
+c060
+c060
+c060
+e0e0
+60e4
+71fc
+1f38
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 24 1 -5
+BITMAP
+3e00
+6700
+c380
+c180
+c180
+c380
+c300
+ce00
+cf00
+c380
+c180
+c1c0
+c0c0
+c0c0
+c0c0
+c1c0
+e180
+f380
+df00
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 18 1 -5
+BITMAP
+7060
+f860
+d8c0
+88c0
+0980
+0980
+0b00
+0700
+0600
+0600
+0e00
+0e00
+1900
+1900
+3110
+31b0
+61f0
+60e0
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 18 1 0
+BITMAP
+1f00
+3380
+2180
+3000
+3800
+1c00
+0e00
+3f00
+7380
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+7380
+1e00
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 13 1 0
+BITMAP
+3e00
+7300
+e300
+c300
+e000
+6000
+3c00
+6000
+e000
+c000
+e080
+7180
+3f00
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 22 1 -5
+BITMAP
+0600
+0600
+0600
+0600
+1f80
+36c0
+6660
+e670
+c630
+c630
+c630
+c630
+c630
+e670
+6660
+36c0
+1f80
+0600
+0600
+0600
+0600
+0600
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 11 18 0 -5
+BITMAP
+7060
+f860
+9860
+98c0
+18c0
+0cc0
+0d80
+0d80
+0580
+0700
+0700
+0300
+0600
+0600
+0600
+0600
+0600
+0600
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 12 18 1 -5
+BITMAP
+71c0
+fbe0
+9e30
+1c30
+1830
+1830
+1830
+1830
+1830
+1830
+1830
+1830
+1830
+0030
+0030
+0030
+0030
+0030
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 7 13 1 0
+BITMAP
+30
+70
+f0
+30
+30
+30
+30
+30
+30
+30
+32
+3e
+1c
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 18 1 -5
+BITMAP
+3380
+73c0
+6660
+c670
+c630
+c630
+c630
+c630
+c630
+e670
+6660
+36c0
+1f80
+0600
+0600
+0600
+0600
+0600
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+3070
+70f0
+f1b0
+3300
+3600
+3c00
+3c00
+3e00
+3700
+3380
+31c0
+30e0
+31f0
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 19 1 0
+BITMAP
+7000
+f800
+8800
+0800
+0800
+0c00
+0c00
+0c00
+1c00
+1e00
+1a00
+3200
+3200
+3300
+6100
+6100
+6190
+c1f0
+c0e0
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 18 2 -5
+BITMAP
+c180
+c180
+c180
+c180
+c180
+c180
+c180
+c180
+c180
+c180
+e390
+fff0
+de60
+c000
+c000
+e000
+e000
+e000
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+c0e0
+c0e0
+c060
+6040
+60c0
+6080
+3180
+3100
+3300
+1a00
+1a00
+0e00
+0c00
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+1f00
+71c0
+60c0
+e0e0
+c060
+c060
+c060
+c060
+c060
+e0e0
+60c0
+71c0
+1f00
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 13 13 0 0
+BITMAP
+7ff8
+fff8
+98c0
+18c0
+18c0
+18c0
+18c0
+18c0
+18c0
+18c0
+18c8
+38f8
+30f0
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1e00
+3300
+6180
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+ffc0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+6180
+3300
+1e00
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 18 1 -5
+BITMAP
+3e00
+6380
+c180
+c1c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c1c0
+c180
+e380
+de00
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 14 13 1 0
+BITMAP
+1ffc
+71fc
+60c0
+e0e0
+c060
+c060
+c060
+c060
+c060
+e0e0
+60c0
+71c0
+1f00
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 10 13 0 0
+BITMAP
+3fc0
+7fc0
+cc00
+8c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c80
+0f80
+0700
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 13 13 0 0
+BITMAP
+30e0
+7830
+d818
+9818
+1818
+1818
+1818
+1818
+1818
+1830
+0c30
+0ee0
+07c0
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 14 1 0
+BITMAP
+7fff
+ffff
+9818
+300c
+318c
+6186
+6186
+6186
+6186
+6186
+6186
+318c
+3bdc
+1e78
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 13 1 0
+BITMAP
+1860
+3030
+6018
+6318
+c30c
+c30c
+c30c
+c30c
+c30c
+c30c
+6318
+77b8
+3cf0
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 24 1 -5
+BITMAP
+3000
+6380
+6780
+3f00
+3000
+2000
+3780
+1f80
+3000
+6000
+c000
+8000
+8000
+8000
+c000
+f000
+7c00
+3f80
+0fc0
+00c0
+0040
+00c0
+0f80
+0f00
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 18 1 -5
+BITMAP
+c183
+718e
+318c
+399c
+399c
+399c
+399c
+399c
+399c
+1998
+1998
+0db0
+07e0
+0180
+0180
+0180
+0180
+0180
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 24 1 -5
+BITMAP
+3000
+6380
+6780
+3f00
+1800
+3000
+2000
+6000
+4000
+c000
+8000
+8000
+8000
+8000
+c000
+f000
+7c00
+3f80
+0fc0
+00c0
+0040
+00c0
+0f80
+0f00
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 8 22 1 -5
+BITMAP
+07
+0c
+18
+18
+18
+18
+18
+10
+30
+20
+c0
+20
+30
+10
+18
+18
+18
+18
+18
+18
+0c
+07
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 160 0
+DWIDTH 4 0
+BBX 2 22 1 -5
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 8 22 1 -5
+BITMAP
+e0
+30
+18
+18
+18
+18
+18
+08
+0c
+04
+03
+04
+0c
+08
+18
+18
+18
+18
+18
+18
+30
+e0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 4 1 5
+BITMAP
+3820
+7c60
+c7c0
+8380
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 5 6 1 12
+BITMAP
+e0
+70
+70
+d8
+38
+b8
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 15 0 0
+BITMAP
+1b30
+0e00
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+1f80
+1830
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 160 0
+DWIDTH 4 0
+BBX 8 17 -1 0
+BITMAP
+70
+60
+c0
+80
+00
+70
+01
+e0
+07
+80
+1e
+00
+78
+00
+e0
+00
+e0
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 7 1 4
+BITMAP
+0078
+001e
+0002
+c000
+f000
+3000
+00fe
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 13 22 0 -5
+BITMAP
+f0f8
+f000
+0300
+0608
+0c18
+1818
+3030
+6060
+60c0
+c0c0
+3838
+7e78
+c7c0
+c380
+c6c0
+7c78
+3838
+00f0
+0198
+0198
+0300
+0300
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 14 13 2 0
+BITMAP
+0300
+1fe0
+0300
+0300
+0300
+0600
+0600
+0600
+0600
+0600
+0600
+0c00
+0c00
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 10 13 4 0
+BITMAP
+cc00
+cc00
+d800
+7000
+0780
+0fc0
+0fc0
+0fc0
+0fc0
+7780
+fb40
+ffc0
+ffc0
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 12 13 3 0
+BITMAP
+fb70
+7330
+0300
+0780
+0c00
+0c00
+1e00
+3f00
+3f00
+7f80
+ffc0
+7f80
+3f00
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 12 13 3 0
+BITMAP
+3f00
+1e00
+0c00
+0c00
+70e0
+f9f0
+f9f0
+fff0
+fff0
+fff0
+7fe0
+7fe0
+3fc0
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 1040 0
+DWIDTH 26 0
+BBX 24 12 1 1
+BITMAP
+1f800f
+000f00
+060006
+000600
+0f001f
+803fc0
+7fe07f
+e0fff0
+fff0f6
+f06660
+06000f
+000600
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 1000 0
+DWIDTH 25 0
+BBX 25 12 0 1
+BITMAP
+600c0000
+18001800
+000c6000
+06ffff80
+ffffff00
+00063000
+0c180000
+0c003000
+00600600
+00000c00
+00001800
+00003000
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 31 1 -8
+BITMAP
+0000
+6000
+0000
+fff0
+ff80
+fff0
+ff80
+6000
+0000
+3000
+0000
+1800
+0000
+0c00
+0000
+0600
+0000
+0600
+0f00
+1f80
+36c0
+6660
+c630
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 1000 0
+DWIDTH 25 0
+BBX 25 12 0 1
+BITMAP
+06000600
+06000600
+06000600
+06000600
+06000600
+06000600
+06000600
+06000600
+06000000
+30000000
+18000000
+0c000000
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 29 1 -5
+BITMAP
+0600
+0000
+0300
+fff0
+ff80
+fff0
+ff80
+0000
+0300
+0000
+0600
+0000
+0c00
+0000
+1800
+0000
+3000
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 360 0
+DWIDTH 9 0
+BBX 7 7 1 10
+BITMAP
+06
+00
+06
+00
+06
+00
+06
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 14 1 0
+BITMAP
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+00c0
+3040
+6000
+c000
+8000
+0000
+0000
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 9 6 1 12
+BITMAP
+6c80
+8280
+6c00
+0c00
+0c00
+0c00
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 15 0 0
+BITMAP
+0c00
+ffc0
+ffc0
+0c00
+0c00
+0c00
+0c00
+0000
+0000
+ffc0
+ffc0
+1980
+3b80
+7700
+6600
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 10 1 2
+BITMAP
+cc00
+8800
+e000
+7800
+1e00
+0780
+01e0
+0060
+0060
+01e0
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 7 1 4
+BITMAP
+0780
+3e00
+f000
+c000
+0000
+fff0
+fff0
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 19 1 0
+BITMAP
+c040
+60c0
+3180
+1b00
+0e00
+0e00
+1b00
+3180
+60c0
+c040
+3800
+7c40
+c6c0
+c380
+c7c0
+7c40
+3800
+3e00
+6300
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 8 8 2 3
+BITMAP
+c1
+80
+01
+80
+00
+c0
+00
+c0
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 8 1 3
+BITMAP
+00c0
+00c0
+1ec0
+73c0
+61c0
+c0c0
+c0c0
+c180
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 13 2 0
+BITMAP
+c180
+c180
+c300
+6700
+3c00
+3c40
+ffc0
+ffc0
+7e00
+0c00
+0c00
+0000
+ffc0
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 8 1 3
+BITMAP
+ffc0
+0000
+0c00
+0c00
+0180
+0180
+0300
+0300
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 8 1 3
+BITMAP
+ffc0
+ffc0
+0c00
+ffc0
+ffc0
+3000
+3000
+6000
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 960 0
+DWIDTH 24 0
+BBX 18 3 3 0
+BITMAP
+6000c0
+e0ffc0
+0000c0
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 2 32 6 -8
+BITMAP
+c0
+c0
+c0
+00
+00
+c0
+c0
+c0
+c0
+00
+00
+40
+40
+c0
+c0
+80
+80
+00
+00
+40
+40
+c0
+c0
+80
+80
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 1000 0
+DWIDTH 25 0
+BBX 25 2 0 6
+BITMAP
+c0c0c080
+c0c0c080
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 16 1 0
+BITMAP
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+fffc
+ff80
+fffc
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 16 1 0
+BITMAP
+ff80
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+2000
+6000
+fff0
+fff0
+6000
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 19 1 -1
+BITMAP
+2000
+8180
+c300
+e3f0
+71f0
+3860
+1cc0
+3c80
+6e80
+c780
+c380
+e380
+f1c0
+70e0
+3070
+7030
+e010
+0f80
+3ffc
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 17 18 1 0
+BITMAP
+70f800
+304000
+40c000
+c03080
+1c7000
+380000
+001c00
+1c0000
+300c00
+0cde00
+0ff000
+c01e00
+003f00
+006380
+00c180
+008180
+00c180
+00e180
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 15 20 2 -5
+BITMAP
+0070
+b800
+39b0
+0018
+9800
+1198
+0000
+9800
+019c
+0000
+8c00
+018c
+0018
+8680
+3f06
+804e
+0700
+0600
+0c00
+183c
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+30fe
+3186
+6306
+6606
+6c06
+680c
+799c
+7398
+7230
+7a70
+5be0
+dd80
+8c00
+8c00
+8c00
+d800
+7000
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+07e0
+1e78
+381c
+6006
+6816
+cc33
+c663
+c3c3
+c183
+c3c3
+c663
+cc33
+6816
+6006
+381c
+1e78
+07e0
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 800 0
+DWIDTH 20 0
+BBX 18 17 1 0
+BITMAP
+07e000
+783800
+618640
+86c180
+c183c0
+fbdfc0
+c183c0
+83c180
+618640
+063800
+1e7800
+e003c0
+c00fc0
+801c00
+003000
+003000
+006000
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 13 1 0
+BITMAP
+8060
+3180
+6061
+8060
+c180
+6181
+8063
+0180
+6601
+803c
+0300
+3803
+003c
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 13 1 0
+BITMAP
+0e00
+6ffc
+00c3
+f000
+07e0
+1ff8
+381c
+6006
+6006
+c003
+c003
+c003
+c003
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 12 1 0
+BITMAP
+c002
+c002
+c002
+c002
+c002
+c002
+c002
+c002
+c002
+c002
+c002
+c002
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 15 1 -3
+BITMAP
+6006
+6006
+381c
+1ff8
+07e0
+ffe0
+fff8
+001c
+000c
+0006
+0006
+0006
+0006
+000c
+001c
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 16 1 -2
+BITMAP
+fff8
+ffe0
+ffe0
+fff8
+001c
+000c
+0006
+0006
+0006
+0006
+000c
+001c
+fff8
+ffe0
+0000
+fffe
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 12 1 0
+BITMAP
+fffe
+000c
+000c
+0ffe
+3ffe
+7030
+6030
+c060
+c060
+c0c0
+c0c0
+6180
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 15 1 -3
+BITMAP
+7180
+3ffe
+0ffe
+0600
+0600
+0ffe
+3ffe
+7000
+6000
+c000
+c000
+c000
+c000
+6000
+7000
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 12 13 2 0
+BITMAP
+3ff0
+0ff0
+0ff0
+3ff0
+7000
+6000
+c000
+c000
+c000
+c000
+6000
+7000
+3ff0
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 12 17 2 -2
+BITMAP
+0ff0
+0000
+fff0
+fff0
+1ff0
+7ff0
+6000
+c000
+c000
+fff0
+fff0
+c000
+c000
+c000
+6000
+7ff0
+1ff0
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 17 16 1 0
+BITMAP
+00c000
+c01f80
+7ff000
+80c180
+c30080
+f0ff80
+c60080
+00cc00
+6c0000
+f01f80
+180000
+000000
+800000
+000000
+000000
+000000
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 18 1 0
+BITMAP
+0000
+3000
+0060
+0000
+c000
+0180
+0003
+0000
+0600
+000c
+0000
+1800
+0030
+0000
+7fff
+80ff
+ff80
+ffff
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+c003
+c002
+6006
+6004
+300c
+3008
+3018
+1810
+1830
+0c20
+0c20
+0660
+0640
+03c0
+03c0
+0180
+0180
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+07e0
+1e78
+381c
+6006
+6fe6
+c673
+c633
+c673
+c7e3
+c6c3
+c663
+c633
+6f3e
+6006
+381c
+1e78
+07e0
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 880 0
+DWIDTH 22 0
+BBX 20 10 1 7
+BITMAP
+07e010
+783810
+600660
+c6c660
+cc23c0
+03cc00
+cc03c0
+23c660
+63c660
+063810
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 17 21 1 -3
+BITMAP
+1e7800
+e0ff80
+709900
+601800
+e01800
+e01800
+601800
+601800
+601800
+601800
+603c80
+f0ff80
+803000
+003000
+003000
+003000
+003000
+003000
+003000
+003000
+003000
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 14 23 0 0
+BITMAP
+0030
+0600
+3004
+0030
+0600
+3004
+0030
+0600
+3004
+0030
+0600
+3004
+0030
+0600
+3004
+00fc
+1f80
+0004
+0004
+0004
+000c
+000c
+0008
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 3 2 6
+BITMAP
+00
+00
+00
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 8 1 0
+BITMAP
+0800
+1830
+1870
+10d8
+1018
+100c
+300c
+3006
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 12 1 0
+BITMAP
+2000
+2000
+2000
+6000
+c000
+c000
+c000
+c0c0
+c0c0
+fff8
+fff8
+0000
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 12 1 0
+BITMAP
+0000
+0000
+0000
+0000
+0000
+0700
+0700
+0d80
+0d80
+18c0
+18c0
+3060
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 1000 0
+DWIDTH 25 0
+BBX 23 12 1 0
+BITMAP
+306060
+306030
+c018c0
+18c018
+c01860
+306030
+306030
+6018c0
+18c00c
+800d80
+070006
+000600
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 1000 0
+DWIDTH 25 0
+BBX 23 12 1 0
+BITMAP
+c00c00
+601800
+303ffe
+f87ffe
+fce000
+0ee000
+0e7ffe
+fc3ffe
+f81800
+300c00
+600600
+c00600
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 23 1 0
+BITMAP
+0000
+0000
+1800
+0030
+fff0
+7ff0
+fee0
+0000
+e000
+0070
+fff0
+3ff0
+fe10
+0000
+0c00
+0000
+0000
+0600
+0f00
+1f80
+39c0
+79e0
+d9b0
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 1000 0
+DWIDTH 25 0
+BBX 23 12 1 0
+BITMAP
+198018
+801980
+198018
+801980
+198018
+801980
+198018
+801980
+198018
+801980
+198018
+800000
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 23 1 0
+BITMAP
+c000
+0060
+0000
+30f0
+fff0
+fff0
+fc00
+0000
+0000
+0ef0
+fff0
+fff0
+f800
+0030
+0000
+6000
+00c0
+1980
+1980
+1980
+1980
+1980
+1980
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 18 1 0
+BITMAP
+1980
+1980
+1980
+1980
+1980
+1980
+1980
+1980
+1980
+1980
+1980
+d980
+79c0
+39c0
+1f80
+0f00
+0600
+0c00
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 7 22 0 -5
+BITMAP
+0c
+00
+1e
+00
+32
+00
+32
+00
+60
+80
+60
+80
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+60
+80
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+6180
+3300
+3300
+1e00
+0c00
+0c00
+0606
+0c0c
+1818
+3030
+6060
+c0c0
+6060
+3030
+1818
+0c0c
+0606
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+07e0
+1e78
+381c
+6006
+67e6
+c633
+c633
+c633
+c7e3
+c663
+c633
+c633
+6632
+6006
+381c
+1e78
+07e0
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 800 0
+DWIDTH 20 0
+BBX 18 10 1 7
+BITMAP
+07e000
+783800
+600640
+c6c7c0
+ce63c0
+03cc00
+cc03c0
+63c7c0
+63c640
+063800
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 14 20 2 -2
+BITMAP
+1e78
+07e0
+fec0
+c018
+c0c0
+18e0
+c018
+e1c0
+18f0
+c018
+d2c0
+18dc
+c018
+ccc0
+18cc
+c018
+ccc0
+fff8
+e018
+7008
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 9 31 1 -8
+BITMAP
+3800
+1c00
+0e00
+0700
+0380
+0180
+0080
+0180
+0300
+0600
+0c00
+1800
+3000
+6000
+c000
+ff80
+ff80
+0180
+0300
+0600
+0c00
+1800
+1800
+3000
+3000
+6000
+6000
+6000
+6000
+c000
+c000
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 2 32 1 -8
+BITMAP
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 9 32 1 -8
+BITMAP
+c000
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 7 31 1 -8
+BITMAP
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+c0
+00
+60
+00
+60
+00
+60
+00
+60
+00
+30
+00
+30
+00
+18
+00
+18
+00
+0c
+00
+06
+00
+02
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 2 32 1 -8
+BITMAP
+00
+00
+80
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 7 29 1 -5
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 7 31 5 -8
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 5 32 2 -8
+BITMAP
+c0
+c0
+f8
+18
+30
+60
+60
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 7 29 5 -5
+BITMAP
+c0
+c0
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+10
+30
+60
+c0
+60
+30
+18
+18
+18
+18
+18
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 2 32 5 -8
+BITMAP
+00
+00
+00
+00
+00
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+40
+40
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 7 22 1 -5
+BITMAP
+30
+1e
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 8 28 0 -5
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+00
+c0
+c0
+60
+60
+30
+30
+18
+18
+0c
+0c
+06
+06
+0c
+0c
+18
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 8 31 8 -8
+BITMAP
+18
+30
+30
+60
+60
+c0
+c0
+07
+0f
+1b
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 2 32 2 -8
+BITMAP
+00
+c0
+c0
+c0
+00
+00
+00
+00
+40
+40
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 8 26 2 -2
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 9 31 0 -8
+BITMAP
+c080
+c080
+c080
+c080
+c000
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0200
+cc80
+7080
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+0000
+8000
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 2 32 7 -8
+BITMAP
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 9 32 0 -8
+BITMAP
+8000
+8080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c080
+c000
+8000
+8000
+8000
+8000
+8000
+8000
+8000
+8000
+8000
+8000
+8000
+8000
+8000
+8000
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 7 31 2 -8
+BITMAP
+80
+00
+80
+00
+80
+00
+80
+00
+80
+00
+80
+02
+00
+02
+00
+02
+00
+02
+00
+06
+00
+06
+00
+0c
+00
+0c
+00
+18
+00
+30
+00
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 2 32 7 -8
+BITMAP
+40
+00
+c0
+00
+c0
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 7 29 2 -5
+BITMAP
+06
+06
+06
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 7 31 0 -8
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+06
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 5 32 5 -8
+BITMAP
+00
+00
+00
+f8
+f0
+18
+08
+08
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 7 29 0 -5
+BITMAP
+06
+06
+06
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+40
+60
+30
+18
+30
+60
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol24.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol24.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol24.h	(revision 15879)
@@ -0,0 +1,1127 @@
+static unsigned char symbol24_0_bits[] = {
+0x00};
+static unsigned char symbol24_1_bits[] = {
+0x00};
+static unsigned char symbol24_2_bits[] = {
+0x00};
+static unsigned char symbol24_3_bits[] = {
+0x00};
+static unsigned char symbol24_4_bits[] = {
+0x00};
+static unsigned char symbol24_5_bits[] = {
+0x00};
+static unsigned char symbol24_6_bits[] = {
+0x00};
+static unsigned char symbol24_7_bits[] = {
+0x00};
+static unsigned char symbol24_8_bits[] = {
+0x00};
+static unsigned char symbol24_9_bits[] = {
+0x00};
+static unsigned char symbol24_10_bits[] = {
+0x00};
+static unsigned char symbol24_11_bits[] = {
+0x00};
+static unsigned char symbol24_12_bits[] = {
+0x00};
+static unsigned char symbol24_13_bits[] = {
+0x00};
+static unsigned char symbol24_14_bits[] = {
+0x00};
+static unsigned char symbol24_15_bits[] = {
+0x00};
+static unsigned char symbol24_16_bits[] = {
+0x00};
+static unsigned char symbol24_17_bits[] = {
+0x00};
+static unsigned char symbol24_18_bits[] = {
+0x00};
+static unsigned char symbol24_19_bits[] = {
+0x00};
+static unsigned char symbol24_20_bits[] = {
+0x00};
+static unsigned char symbol24_21_bits[] = {
+0x00};
+static unsigned char symbol24_22_bits[] = {
+0x00};
+static unsigned char symbol24_23_bits[] = {
+0x00};
+static unsigned char symbol24_24_bits[] = {
+0x00};
+static unsigned char symbol24_25_bits[] = {
+0x00};
+static unsigned char symbol24_26_bits[] = {
+0x00};
+static unsigned char symbol24_27_bits[] = {
+0x00};
+static unsigned char symbol24_28_bits[] = {
+0x00};
+static unsigned char symbol24_29_bits[] = {
+0x00};
+static unsigned char symbol24_30_bits[] = {
+0x00};
+static unsigned char symbol24_31_bits[] = {
+0x00};
+static unsigned char symbol24_32_bits[] = {
+0x00};
+static unsigned char symbol24_33_bits[] = {
+0x02, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x02, 0x02, 0x02, 0x02, 
+0x00, 0x00, 0x00, 0x03, 0x03};
+static unsigned char symbol24_34_bits[] = {
+0x03, 0x60, 0x03, 0x60, 0x06, 0x30, 0x06, 0x30, 0xfc, 0x1f, 0xfc, 0x1f, 
+0x0c, 0x18, 0x18, 0x0c, 0x18, 0x0c, 0x30, 0x06, 0x30, 0x06, 0x30, 0x06, 
+0x60, 0x03, 0x60, 0x03, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01};
+static unsigned char symbol24_35_bits[] = {
+0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 
+0xfe, 0x07, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0xff, 0x03, 0x44, 0x00, 
+0x44, 0x00, 0x44, 0x00, 0x44, 0x00, 0x44, 0x00, 0x44, 0x00};
+static unsigned char symbol24_36_bits[] = {
+0xff, 0x07, 0xff, 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 
+0x00, 0x06, 0xff, 0x07, 0xff, 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 
+0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0xff, 0x07, 0xff, 0x07};
+static unsigned char symbol24_37_bits[] = {
+0xf8, 0x60, 0x00, 0x9c, 0x7f, 0x00, 0x8e, 0x30, 0x00, 0x86, 0x18, 0x00, 
+0xc7, 0x18, 0x00, 0x43, 0x0c, 0x00, 0x63, 0x06, 0x00, 0x33, 0x06, 0x00, 
+0x1e, 0xe3, 0x01, 0x80, 0x71, 0x03, 0x80, 0x39, 0x02, 0xc0, 0x1c, 0x02, 
+0x60, 0x0c, 0x03, 0x60, 0x0c, 0x01, 0x30, 0x8c, 0x01, 0x18, 0xcc, 0x00, 
+0x18, 0x78, 0x00};
+static unsigned char symbol24_38_bits[] = {
+0xe0, 0x01, 0x30, 0x03, 0x18, 0x02, 0x18, 0x02, 0x18, 0x03, 0xb8, 0x01, 
+0xf0, 0x7c, 0x78, 0x38, 0x7c, 0x18, 0xe6, 0x0c, 0xc3, 0x05, 0x83, 0x07, 
+0x03, 0x03, 0x83, 0x07, 0xc7, 0x4e, 0x7e, 0x7c, 0x3c, 0x38};
+static unsigned char symbol24_39_bits[] = {
+0x0f, 0x3c, 0x70, 0xe0, 0xc0, 0xc0, 0xfe, 0xc0, 0xc0, 0xe0, 0x70, 0x3c, 
+0x0f};
+static unsigned char symbol24_40_bits[] = {
+0x30, 0x18, 0x0c, 0x04, 0x06, 0x06, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x02, 0x06, 0x06, 0x04, 0x0c, 0x18, 0x30};
+static unsigned char symbol24_41_bits[] = {
+0x03, 0x06, 0x0c, 0x08, 0x18, 0x18, 0x10, 0x30, 0x30, 0x30, 0x30, 0x30, 
+0x30, 0x30, 0x30, 0x10, 0x18, 0x18, 0x08, 0x0c, 0x06, 0x03};
+static unsigned char symbol24_42_bits[] = {
+0x18, 0x18, 0xc3, 0xe7, 0x18, 0x18, 0xe7, 0xc3, 0x18, 0x18};
+static unsigned char symbol24_43_bits[] = {
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0xff, 0x03, 0xff, 0x03, 
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00};
+static unsigned char symbol24_44_bits[] = {
+0x06, 0x06, 0x04, 0x06, 0x03, 0x01};
+static unsigned char symbol24_45_bits[] = {
+0xff, 0x07, 0xff, 0x07};
+static unsigned char symbol24_46_bits[] = {
+0x03, 0x03, 0x03};
+static unsigned char symbol24_47_bits[] = {
+0x60, 0x60, 0x60, 0x30, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x0c, 0x06, 
+0x06, 0x06, 0x03, 0x03, 0x03};
+static unsigned char symbol24_48_bits[] = {
+0x78, 0x00, 0xcc, 0x00, 0x86, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x86, 0x01, 0x86, 0x01, 0xcc, 0x00, 0x78, 0x00};
+static unsigned char symbol24_49_bits[] = {
+0x0c, 0x0e, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x3f};
+static unsigned char symbol24_50_bits[] = {
+0x38, 0x00, 0xfe, 0x00, 0xe6, 0x00, 0xc1, 0x01, 0x81, 0x01, 0x80, 0x01, 
+0x80, 0x01, 0xc0, 0x01, 0xc0, 0x00, 0xe0, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x18, 0x00, 0x0c, 0x00, 0x06, 0x02, 0xff, 0x03, 0xff, 0x01};
+static unsigned char symbol24_51_bits[] = {
+0x38, 0x00, 0x7e, 0x00, 0xe2, 0x00, 0xc1, 0x00, 0xc1, 0x00, 0x60, 0x00, 
+0x30, 0x00, 0x78, 0x00, 0xe0, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x80, 0x01, 
+0x80, 0x01, 0xc0, 0x00, 0xe3, 0x00, 0x7f, 0x00, 0x1e, 0x00};
+static unsigned char symbol24_52_bits[] = {
+0xc0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xf0, 0x00, 0xd0, 0x00, 0xd8, 0x00, 
+0xc8, 0x00, 0xcc, 0x00, 0xc4, 0x00, 0xc6, 0x00, 0xc2, 0x00, 0xff, 0x03, 
+0xff, 0x03, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00};
+static unsigned char symbol24_53_bits[] = {
+0xfc, 0x01, 0xfc, 0x00, 0x06, 0x00, 0x02, 0x00, 0x03, 0x00, 0x0f, 0x00, 
+0x3f, 0x00, 0x78, 0x00, 0xe0, 0x00, 0xc0, 0x01, 0x80, 0x01, 0x80, 0x01, 
+0x80, 0x01, 0x80, 0x01, 0xc3, 0x00, 0x7f, 0x00, 0x3e, 0x00};
+static unsigned char symbol24_54_bits[] = {
+0xc0, 0x03, 0x70, 0x00, 0x1c, 0x00, 0x0e, 0x00, 0x06, 0x00, 0x07, 0x00, 
+0xf3, 0x00, 0xcf, 0x01, 0x87, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x07, 0x03, 0x86, 0x03, 0xce, 0x01, 0xf8, 0x00};
+static unsigned char symbol24_55_bits[] = {
+0xfe, 0x03, 0xff, 0x03, 0x03, 0x03, 0x81, 0x01, 0x80, 0x01, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00};
+static unsigned char symbol24_56_bits[] = {
+0x78, 0x00, 0xcc, 0x00, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0xce, 0x00, 
+0x7c, 0x00, 0x38, 0x00, 0xfc, 0x00, 0xc6, 0x01, 0x83, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0xc6, 0x01, 0x7c, 0x00};
+static unsigned char symbol24_57_bits[] = {
+0x78, 0x00, 0xce, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x86, 0x03, 0xce, 0x03, 0x78, 0x03, 0x80, 0x01, 
+0xc0, 0x01, 0xe0, 0x00, 0x70, 0x00, 0x3c, 0x00, 0x0f, 0x00};
+static unsigned char symbol24_58_bits[] = {
+0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03};
+static unsigned char symbol24_59_bits[] = {
+0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x04, 
+0x06, 0x03, 0x01};
+static unsigned char symbol24_60_bits[] = {
+0x00, 0x0e, 0x80, 0x07, 0xe0, 0x01, 0x78, 0x00, 0x1e, 0x00, 0x07, 0x00, 
+0x07, 0x00, 0x1e, 0x00, 0x78, 0x00, 0xe0, 0x01, 0x80, 0x07, 0x00, 0x0e};
+static unsigned char symbol24_61_bits[] = {
+0xff, 0x03, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0xff, 0x03};
+static unsigned char symbol24_62_bits[] = {
+0x07, 0x00, 0x1e, 0x00, 0x78, 0x00, 0xe0, 0x01, 0x80, 0x07, 0x00, 0x0e, 
+0x00, 0x0e, 0x80, 0x07, 0xe0, 0x01, 0x78, 0x00, 0x1e, 0x00, 0x07, 0x00};
+static unsigned char symbol24_63_bits[] = {
+0x3e, 0x63, 0xc1, 0xc3, 0xe3, 0x60, 0x70, 0x30, 0x18, 0x18, 0x08, 0x08, 
+0x08, 0x00, 0x00, 0x0c, 0x0c};
+static unsigned char symbol24_64_bits[] = {
+0x1c, 0x04, 0x3e, 0x06, 0xe3, 0x03, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 
+0xff, 0x07, 0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0xff, 0x07, 0xff, 0x07};
+static unsigned char symbol24_65_bits[] = {
+0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0x80, 0x03, 0x00, 0x80, 0x02, 0x00, 
+0xc0, 0x06, 0x00, 0x40, 0x06, 0x00, 0x40, 0x0c, 0x00, 0x60, 0x0c, 0x00, 
+0x20, 0x0c, 0x00, 0x30, 0x18, 0x00, 0x10, 0x18, 0x00, 0xf0, 0x3f, 0x00, 
+0x18, 0x30, 0x00, 0x08, 0x30, 0x00, 0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 
+0x1f, 0xf0, 0x01};
+static unsigned char symbol24_66_bits[] = {
+0xff, 0x03, 0x0c, 0x07, 0x0c, 0x0e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x06, 0xfc, 0x03, 0x0c, 0x0e, 0x0c, 0x1c, 0x0c, 0x18, 
+0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x1c, 0x0c, 0x0e, 0xff, 0x03};
+static unsigned char symbol24_67_bits[] = {
+0x1f, 0xf8, 0x01, 0x0e, 0x70, 0x00, 0x1c, 0x30, 0x00, 0x38, 0x18, 0x00, 
+0x30, 0x0c, 0x00, 0x60, 0x06, 0x00, 0xe0, 0x03, 0x00, 0xc0, 0x01, 0x00, 
+0x80, 0x01, 0x00, 0xc0, 0x03, 0x00, 0x60, 0x07, 0x00, 0x30, 0x0e, 0x00, 
+0x10, 0x1c, 0x00, 0x18, 0x18, 0x00, 0x0c, 0x38, 0x00, 0x0e, 0x70, 0x00, 
+0x1f, 0xf8, 0x01};
+static unsigned char symbol24_68_bits[] = {
+0xc0, 0x00, 0xc0, 0x00, 0xe0, 0x01, 0x20, 0x01, 0x20, 0x03, 0x30, 0x03, 
+0x10, 0x06, 0x10, 0x06, 0x18, 0x0c, 0x08, 0x0c, 0x0c, 0x18, 0x04, 0x18, 
+0x04, 0x30, 0x06, 0x30, 0x02, 0x60, 0x03, 0x60, 0xff, 0xff};
+static unsigned char symbol24_69_bits[] = {
+0xff, 0x0f, 0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x04, 0x0c, 0x04, 0xfc, 0x07, 0x0c, 0x04, 0x0c, 0x04, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x10, 0x0c, 0x10, 0x0c, 0x18, 0xff, 0x1f};
+static unsigned char symbol24_70_bits[] = {
+0xe0, 0x07, 0x80, 0x01, 0x80, 0x01, 0xf0, 0x0f, 0x9c, 0x39, 0x86, 0x61, 
+0x87, 0xe1, 0x83, 0xc1, 0x83, 0xc1, 0x83, 0xc1, 0x87, 0xe1, 0x86, 0x61, 
+0x9c, 0x39, 0xf0, 0x0f, 0x80, 0x01, 0x80, 0x01, 0xe0, 0x07};
+static unsigned char symbol24_71_bits[] = {
+0xff, 0x1f, 0x0c, 0x18, 0x0c, 0x10, 0x0c, 0x10, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x3f, 0x00};
+static unsigned char symbol24_72_bits[] = {
+0x3f, 0xfc, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 
+0x0c, 0x30, 0x0c, 0x30, 0xfc, 0x3f, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 
+0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x3f, 0xfc};
+static unsigned char symbol24_73_bits[] = {
+0x3f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x3f};
+static unsigned char symbol24_74_bits[] = {
+0xc0, 0x03, 0x60, 0x07, 0x20, 0x06, 0x60, 0x06, 0xc0, 0x0c, 0x8e, 0x0d, 
+0x1f, 0x0f, 0x19, 0x3c, 0x18, 0x0c, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x06, 0x1c, 0x06, 0x38, 0x03, 0xf0, 0x01};
+static unsigned char symbol24_75_bits[] = {
+0x3f, 0x3e, 0x0c, 0x0c, 0x0c, 0x06, 0x0c, 0x03, 0x8c, 0x01, 0xcc, 0x00, 
+0x6c, 0x00, 0x7c, 0x00, 0xfc, 0x00, 0xcc, 0x01, 0x8c, 0x01, 0x8c, 0x03, 
+0x0c, 0x07, 0x0c, 0x0e, 0x0c, 0x1c, 0x0c, 0x38, 0x3f, 0x7c};
+static unsigned char symbol24_76_bits[] = {
+0xc0, 0x00, 0xc0, 0x00, 0xe0, 0x01, 0x20, 0x01, 0x20, 0x03, 0x20, 0x03, 
+0x30, 0x03, 0x10, 0x06, 0x10, 0x06, 0x18, 0x06, 0x08, 0x0c, 0x08, 0x0c, 
+0x0c, 0x0c, 0x04, 0x18, 0x04, 0x18, 0x06, 0x38, 0x1f, 0x7c};
+static unsigned char symbol24_77_bits[] = {
+0x0f, 0x80, 0x0f, 0x1c, 0x80, 0x03, 0x1c, 0xc0, 0x03, 0x3c, 0x40, 0x03, 
+0x34, 0x40, 0x03, 0x74, 0x60, 0x03, 0x64, 0x20, 0x03, 0xe4, 0x30, 0x03, 
+0xc4, 0x10, 0x03, 0xc4, 0x11, 0x03, 0x84, 0x19, 0x03, 0x84, 0x0b, 0x03, 
+0x04, 0x0b, 0x03, 0x04, 0x0f, 0x03, 0x04, 0x06, 0x03, 0x04, 0x06, 0x03, 
+0x1f, 0xc0, 0x0f};
+static unsigned char symbol24_78_bits[] = {
+0x0f, 0xf8, 0x1c, 0x20, 0x1c, 0x20, 0x34, 0x20, 0x74, 0x20, 0x64, 0x20, 
+0xc4, 0x20, 0xc4, 0x20, 0x84, 0x21, 0x84, 0x23, 0x04, 0x23, 0x04, 0x26, 
+0x04, 0x26, 0x04, 0x2c, 0x04, 0x3c, 0x04, 0x38, 0x1f, 0x30};
+static unsigned char symbol24_79_bits[] = {
+0xe0, 0x07, 0x38, 0x1c, 0x0c, 0x30, 0x06, 0x60, 0x06, 0x60, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x06, 0x60, 0x06, 0x60, 0x0c, 0x30, 0x38, 0x1c, 0xe0, 0x07};
+static unsigned char symbol24_80_bits[] = {
+0xff, 0xff, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 
+0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 
+0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x30, 0x3f, 0xfc};
+static unsigned char symbol24_81_bits[] = {
+0xe0, 0x07, 0x38, 0x1c, 0x0c, 0x30, 0x06, 0x60, 0x06, 0x60, 0x13, 0xc8, 
+0x13, 0xc8, 0xf3, 0xcf, 0xf3, 0xcf, 0x13, 0xc8, 0x13, 0xc8, 0x03, 0xc0, 
+0x02, 0x40, 0x06, 0x60, 0x0c, 0x30, 0x38, 0x1c, 0xe0, 0x07};
+static unsigned char symbol24_82_bits[] = {
+0xff, 0x01, 0x0c, 0x07, 0x0c, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x06, 0x0c, 0x07, 0xfc, 0x01, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x3f, 0x00};
+static unsigned char symbol24_83_bits[] = {
+0xff, 0x0f, 0x07, 0x0c, 0x0e, 0x08, 0x1c, 0x00, 0x38, 0x00, 0x70, 0x00, 
+0xe0, 0x00, 0xc0, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 
+0x0c, 0x08, 0x06, 0x08, 0x03, 0x0c, 0xff, 0x0f, 0xff, 0x0f};
+static unsigned char symbol24_84_bits[] = {
+0xff, 0x3f, 0xc3, 0x30, 0xc1, 0x20, 0xc1, 0x20, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xf0, 0x03};
+static unsigned char symbol24_85_bits[] = {
+0x1f, 0xf8, 0x0e, 0x70, 0x0c, 0x30, 0x18, 0x18, 0x38, 0x08, 0x30, 0x0c, 
+0x70, 0x06, 0x60, 0x06, 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01, 
+0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xe0, 0x07};
+static unsigned char symbol24_86_bits[] = {
+0xf8, 0x01, 0xfc, 0x01, 0x06, 0x00, 0x06, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 0xfe, 0x00, 
+0xf8, 0x01, 0x00, 0x01, 0x00, 0x01, 0x80, 0x01, 0xf0, 0x00, 0x70, 0x00};
+static unsigned char symbol24_87_bits[] = {
+0xe0, 0x07, 0x38, 0x1c, 0x0c, 0x30, 0x06, 0x60, 0x06, 0x60, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x07, 0xe0, 0x06, 0x60, 0x0c, 0x30, 
+0x18, 0x18, 0x31, 0x8c, 0x21, 0x84, 0x3f, 0xfc, 0x3f, 0xfc};
+static unsigned char symbol24_88_bits[] = {
+0xfe, 0x1f, 0xfe, 0x1f, 0x06, 0x18, 0x02, 0x10, 0x00, 0x00, 0x08, 0x04, 
+0x08, 0x04, 0xf8, 0x07, 0xf8, 0x07, 0x08, 0x04, 0x08, 0x04, 0x00, 0x00, 
+0x01, 0x20, 0x01, 0x20, 0x03, 0x30, 0xff, 0x3f, 0xff, 0x3f};
+static unsigned char symbol24_89_bits[] = {
+0xc7, 0x8f, 0x03, 0x0e, 0xc3, 0x01, 0x0c, 0xc3, 0x00, 0x0c, 0xc3, 0x00, 
+0x1c, 0xe3, 0x00, 0x1c, 0xe3, 0x00, 0x18, 0x63, 0x00, 0x38, 0x73, 0x00, 
+0xe0, 0x1f, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 
+0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x03, 0x00, 
+0xc0, 0x0f, 0x00};
+static unsigned char symbol24_90_bits[] = {
+0xff, 0x0f, 0x03, 0x0e, 0x01, 0x06, 0x00, 0x07, 0x80, 0x03, 0x80, 0x01, 
+0xc0, 0x01, 0xe0, 0x00, 0x60, 0x00, 0x70, 0x00, 0x38, 0x00, 0x1c, 0x00, 
+0x1c, 0x00, 0x0e, 0x00, 0x06, 0x08, 0x07, 0x0c, 0xff, 0x0f};
+static unsigned char symbol24_91_bits[] = {
+0x1f, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x1f};
+static unsigned char symbol24_92_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c};
+static unsigned char symbol24_93_bits[] = {
+0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f};
+static unsigned char symbol24_94_bits[] = {
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xff, 0x3f, 0xff, 0x3f};
+static unsigned char symbol24_95_bits[] = {
+0xff, 0x1f, 0xff, 0x1f};
+static unsigned char symbol24_96_bits[] = {
+0xff, 0x1f, 0xff, 0x1f};
+static unsigned char symbol24_97_bits[] = {
+0xf8, 0x18, 0x8e, 0x1d, 0x06, 0x0d, 0x07, 0x0f, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x07, 0x07, 0x06, 0x27, 0x8e, 0x3f, 
+0xf8, 0x1c};
+static unsigned char symbol24_98_bits[] = {
+0x7c, 0x00, 0xe6, 0x00, 0xc3, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc3, 0x01, 
+0xc3, 0x00, 0x73, 0x00, 0xf3, 0x00, 0xc3, 0x01, 0x83, 0x01, 0x83, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0x87, 0x01, 0xcf, 0x01, 
+0xfb, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00};
+static unsigned char symbol24_99_bits[] = {
+0x0e, 0x06, 0x1f, 0x06, 0x1b, 0x03, 0x11, 0x03, 0x90, 0x01, 0x90, 0x01, 
+0xd0, 0x00, 0xe0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x70, 0x00, 0x70, 0x00, 
+0x98, 0x00, 0x98, 0x00, 0x8c, 0x08, 0x8c, 0x0d, 0x86, 0x0f, 0x06, 0x07};
+static unsigned char symbol24_100_bits[] = {
+0xf8, 0x00, 0xcc, 0x01, 0x84, 0x01, 0x0c, 0x00, 0x1c, 0x00, 0x38, 0x00, 
+0x70, 0x00, 0xfc, 0x00, 0xce, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x86, 0x01, 0xce, 0x01, 0x78, 0x00};
+static unsigned char symbol24_101_bits[] = {
+0x7c, 0x00, 0xce, 0x00, 0xc7, 0x00, 0xc3, 0x00, 0x07, 0x00, 0x06, 0x00, 
+0x3c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x03, 0x00, 0x07, 0x01, 0x8e, 0x01, 
+0xfc, 0x00};
+static unsigned char symbol24_102_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xf8, 0x01, 0x6c, 0x03, 
+0x66, 0x06, 0x67, 0x0e, 0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 
+0x63, 0x0c, 0x67, 0x0e, 0x66, 0x06, 0x6c, 0x03, 0xf8, 0x01, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char symbol24_103_bits[] = {
+0x0e, 0x06, 0x1f, 0x06, 0x19, 0x06, 0x19, 0x03, 0x18, 0x03, 0x30, 0x03, 
+0xb0, 0x01, 0xb0, 0x01, 0xa0, 0x01, 0xe0, 0x00, 0xe0, 0x00, 0xc0, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char symbol24_104_bits[] = {
+0x8e, 0x03, 0xdf, 0x07, 0x79, 0x0c, 0x38, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 
+0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 
+0x18, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c};
+static unsigned char symbol24_105_bits[] = {
+0x0c, 0x0e, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x4c, 0x7c, 
+0x38};
+static unsigned char symbol24_106_bits[] = {
+0xcc, 0x01, 0xce, 0x03, 0x66, 0x06, 0x63, 0x0e, 0x63, 0x0c, 0x63, 0x0c, 
+0x63, 0x0c, 0x63, 0x0c, 0x63, 0x0c, 0x67, 0x0e, 0x66, 0x06, 0x6c, 0x03, 
+0xf8, 0x01, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char symbol24_107_bits[] = {
+0x0c, 0x0e, 0x0e, 0x0f, 0x8f, 0x0d, 0xcc, 0x00, 0x6c, 0x00, 0x3c, 0x00, 
+0x3c, 0x00, 0x7c, 0x00, 0xec, 0x00, 0xcc, 0x01, 0x8c, 0x03, 0x0c, 0x07, 
+0x8c, 0x0f};
+static unsigned char symbol24_108_bits[] = {
+0x0e, 0x00, 0x1f, 0x00, 0x11, 0x00, 0x10, 0x00, 0x10, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x38, 0x00, 0x78, 0x00, 0x58, 0x00, 0x4c, 0x00, 
+0x4c, 0x00, 0xcc, 0x00, 0x86, 0x00, 0x86, 0x00, 0x86, 0x09, 0x83, 0x0f, 
+0x03, 0x07};
+static unsigned char symbol24_109_bits[] = {
+0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 
+0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0xc7, 0x09, 0xff, 0x0f, 
+0x7b, 0x06, 0x03, 0x00, 0x03, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00};
+static unsigned char symbol24_110_bits[] = {
+0x03, 0x07, 0x03, 0x07, 0x03, 0x06, 0x06, 0x02, 0x06, 0x03, 0x06, 0x01, 
+0x8c, 0x01, 0x8c, 0x00, 0xcc, 0x00, 0x58, 0x00, 0x58, 0x00, 0x70, 0x00, 
+0x30, 0x00};
+static unsigned char symbol24_111_bits[] = {
+0xf8, 0x00, 0x8e, 0x03, 0x06, 0x03, 0x07, 0x07, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x07, 0x07, 0x06, 0x03, 0x8e, 0x03, 
+0xf8, 0x00};
+static unsigned char symbol24_112_bits[] = {
+0xfe, 0x1f, 0xff, 0x1f, 0x19, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x03, 
+0x18, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 0x13, 0x1c, 0x1f, 
+0x0c, 0x0f};
+static unsigned char symbol24_113_bits[] = {
+0x78, 0x00, 0xcc, 0x00, 0x86, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0xff, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x86, 0x01, 0x86, 0x01, 0xcc, 0x00, 0x78, 0x00};
+static unsigned char symbol24_114_bits[] = {
+0x7c, 0x00, 0xc6, 0x01, 0x83, 0x01, 0x83, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x83, 0x03, 0x83, 0x01, 0xc7, 0x01, 
+0x7b, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00};
+static unsigned char symbol24_115_bits[] = {
+0xf8, 0x3f, 0x8e, 0x3f, 0x06, 0x03, 0x07, 0x07, 0x03, 0x06, 0x03, 0x06, 
+0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x07, 0x07, 0x06, 0x03, 0x8e, 0x03, 
+0xf8, 0x00};
+static unsigned char symbol24_116_bits[] = {
+0xfc, 0x03, 0xfe, 0x03, 0x33, 0x00, 0x31, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x01, 0xf0, 0x01, 
+0xe0, 0x00};
+static unsigned char symbol24_117_bits[] = {
+0x0c, 0x07, 0x1e, 0x0c, 0x1b, 0x18, 0x19, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x30, 0x0c, 0x70, 0x07, 
+0xe0, 0x03};
+static unsigned char symbol24_118_bits[] = {
+0xfe, 0xff, 0xff, 0xff, 0x19, 0x18, 0x0c, 0x30, 0x8c, 0x31, 0x86, 0x61, 
+0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x86, 0x61, 0x8c, 0x31, 
+0xdc, 0x3b, 0x78, 0x1e};
+static unsigned char symbol24_119_bits[] = {
+0x18, 0x06, 0x0c, 0x0c, 0x06, 0x18, 0xc6, 0x18, 0xc3, 0x30, 0xc3, 0x30, 
+0xc3, 0x30, 0xc3, 0x30, 0xc3, 0x30, 0xc3, 0x30, 0xc6, 0x18, 0xee, 0x1d, 
+0x3c, 0x0f};
+static unsigned char symbol24_120_bits[] = {
+0x0c, 0x00, 0xc6, 0x01, 0xe6, 0x01, 0xfc, 0x00, 0x0c, 0x00, 0x04, 0x00, 
+0xec, 0x01, 0xf8, 0x01, 0x0c, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x0f, 0x00, 0x3e, 0x00, 0xfc, 0x01, 
+0xf0, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x03, 0xf0, 0x01, 0xf0, 0x00};
+static unsigned char symbol24_121_bits[] = {
+0x83, 0xc1, 0x8e, 0x71, 0x8c, 0x31, 0x9c, 0x39, 0x9c, 0x39, 0x9c, 0x39, 
+0x9c, 0x39, 0x9c, 0x39, 0x9c, 0x39, 0x98, 0x19, 0x98, 0x19, 0xb0, 0x0d, 
+0xe0, 0x07, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01};
+static unsigned char symbol24_122_bits[] = {
+0x0c, 0x00, 0xc6, 0x01, 0xe6, 0x01, 0xfc, 0x00, 0x18, 0x00, 0x0c, 0x00, 
+0x04, 0x00, 0x06, 0x00, 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0x0f, 0x00, 0x3e, 0x00, 0xfc, 0x01, 
+0xf0, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x03, 0xf0, 0x01, 0xf0, 0x00};
+static unsigned char symbol24_123_bits[] = {
+0xe0, 0x30, 0x18, 0x18, 0x18, 0x18, 0x18, 0x08, 0x0c, 0x04, 0x03, 0x04, 
+0x0c, 0x08, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0xe0};
+static unsigned char symbol24_124_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol24_125_bits[] = {
+0x07, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x10, 0x30, 0x20, 0xc0, 0x20, 
+0x30, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x07};
+static unsigned char symbol24_126_bits[] = {
+0x1c, 0x04, 0x3e, 0x06, 0xe3, 0x03, 0xc1, 0x01};
+static unsigned char symbol24_127_bits[] = {
+0x00};
+static unsigned char symbol24_128_bits[] = {
+0x00};
+static unsigned char symbol24_129_bits[] = {
+0x00};
+static unsigned char symbol24_130_bits[] = {
+0x00};
+static unsigned char symbol24_131_bits[] = {
+0x00};
+static unsigned char symbol24_132_bits[] = {
+0x00};
+static unsigned char symbol24_133_bits[] = {
+0x00};
+static unsigned char symbol24_134_bits[] = {
+0x00};
+static unsigned char symbol24_135_bits[] = {
+0x00};
+static unsigned char symbol24_136_bits[] = {
+0x00};
+static unsigned char symbol24_137_bits[] = {
+0x00};
+static unsigned char symbol24_138_bits[] = {
+0x00};
+static unsigned char symbol24_139_bits[] = {
+0x00};
+static unsigned char symbol24_140_bits[] = {
+0x00};
+static unsigned char symbol24_141_bits[] = {
+0x00};
+static unsigned char symbol24_142_bits[] = {
+0x00};
+static unsigned char symbol24_143_bits[] = {
+0x00};
+static unsigned char symbol24_144_bits[] = {
+0x00};
+static unsigned char symbol24_145_bits[] = {
+0x00};
+static unsigned char symbol24_146_bits[] = {
+0x00};
+static unsigned char symbol24_147_bits[] = {
+0x00};
+static unsigned char symbol24_148_bits[] = {
+0x00};
+static unsigned char symbol24_149_bits[] = {
+0x00};
+static unsigned char symbol24_150_bits[] = {
+0x00};
+static unsigned char symbol24_151_bits[] = {
+0x00};
+static unsigned char symbol24_152_bits[] = {
+0x00};
+static unsigned char symbol24_153_bits[] = {
+0x00};
+static unsigned char symbol24_154_bits[] = {
+0x00};
+static unsigned char symbol24_155_bits[] = {
+0x00};
+static unsigned char symbol24_156_bits[] = {
+0x00};
+static unsigned char symbol24_157_bits[] = {
+0x00};
+static unsigned char symbol24_158_bits[] = {
+0x00};
+static unsigned char symbol24_159_bits[] = {
+0x00};
+static unsigned char symbol24_160_bits[] = {
+0x00};
+static unsigned char symbol24_161_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol24_162_bits[] = {
+0x07, 0x0e, 0x0e, 0x1b, 0x1c, 0x1d};
+static unsigned char symbol24_163_bits[] = {
+0xd8, 0x0c, 0x70, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0xf8, 0x01, 0x18, 0x0c};
+static unsigned char symbol24_164_bits[] = {
+0x0e, 0x06, 0x03, 0x01, 0x00, 0x0e, 0x80, 0x07, 0xe0, 0x01, 0x78, 0x00, 
+0x1e, 0x00, 0x07, 0x00, 0x07};
+static unsigned char symbol24_165_bits[] = {
+0x00, 0x1e, 0x00, 0x78, 0x00, 0x40, 0x03, 0x00, 0x0f, 0x00, 0x0c, 0x00, 
+0x00, 0x7f};
+static unsigned char symbol24_166_bits[] = {
+0x0f, 0x1f, 0x0f, 0x00, 0xc0, 0x00, 0x60, 0x10, 0x30, 0x18, 0x18, 0x18, 
+0x0c, 0x0c, 0x06, 0x06, 0x06, 0x03, 0x03, 0x03, 0x1c, 0x1c, 0x7e, 0x1e, 
+0xe3, 0x03, 0xc3, 0x01, 0x63, 0x03, 0x3e, 0x1e, 0x1c, 0x1c, 0x00, 0x0f, 
+0x80, 0x19, 0x80, 0x19, 0xc0, 0x00, 0xc0, 0x00};
+static unsigned char symbol24_167_bits[] = {
+0xc0, 0x00, 0xf8, 0x07, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 
+0x30, 0x00};
+static unsigned char symbol24_168_bits[] = {
+0x33, 0x00, 0x33, 0x00, 0x1b, 0x00, 0x0e, 0x00, 0xe0, 0x01, 0xf0, 0x03, 
+0xf0, 0x03, 0xf0, 0x03, 0xf0, 0x03, 0xee, 0x01, 0xdf, 0x02, 0xff, 0x03, 
+0xff, 0x03};
+static unsigned char symbol24_169_bits[] = {
+0xdf, 0x0e, 0xce, 0x0c, 0xc0, 0x00, 0xe0, 0x01, 0x30, 0x00, 0x30, 0x00, 
+0x78, 0x00, 0xfc, 0x00, 0xfc, 0x00, 0xfe, 0x01, 0xff, 0x03, 0xfe, 0x01, 
+0xfc, 0x00};
+static unsigned char symbol24_170_bits[] = {
+0xfc, 0x00, 0x78, 0x00, 0x30, 0x00, 0x30, 0x00, 0x0e, 0x07, 0x9f, 0x0f, 
+0x9f, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 0xfe, 0x07, 0xfe, 0x07, 
+0xfc, 0x03};
+static unsigned char symbol24_171_bits[] = {
+0xf8, 0x01, 0xf0, 0x00, 0xf0, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0xf0, 0x00, 0xf8, 0x01, 0xfc, 0x03, 0xfe, 0x07, 0xfe, 0x07, 0xff, 0x0f, 
+0xff, 0x0f, 0x6f, 0x0f, 0x66, 0x06, 0x60, 0x00, 0xf0, 0x00, 0x60, 0x00};
+static unsigned char symbol24_172_bits[] = {
+0x06, 0x30, 0x00, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x30, 0x06, 0x00, 
+0x60, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0x00, 0x00, 0x60, 0x0c, 0x00, 
+0x30, 0x18, 0x00, 0x00, 0x30, 0x00, 0x0c, 0x00, 0x00, 0x06, 0x60, 0x00, 
+0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00};
+static unsigned char symbol24_173_bits[] = {
+0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xff, 0x0f, 0xff, 0x01, 0xff, 0x0f, 
+0xff, 0x01, 0x06, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x18, 0x00, 
+0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x60, 0x00, 
+0xf0, 0x00, 0xf8, 0x01, 0x6c, 0x03, 0x66, 0x06, 0x63, 0x0c, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x60, 0x00};
+static unsigned char symbol24_174_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 
+0x0c, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00};
+static unsigned char symbol24_175_bits[] = {
+0x60, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xff, 0x0f, 0xff, 0x01, 0xff, 0x0f, 
+0xff, 0x01, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 
+0x30, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char symbol24_176_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60};
+static unsigned char symbol24_177_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x03, 0x0c, 0x02, 0x06, 0x00, 0x03, 0x00, 0x01, 0x00, 
+0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol24_178_bits[] = {
+0x36, 0x01, 0x41, 0x01, 0x36, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00};
+static unsigned char symbol24_179_bits[] = {
+0x30, 0x00, 0xff, 0x03, 0xff, 0x03, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x03, 0xff, 0x03, 0x98, 0x01, 
+0xdc, 0x01, 0xee, 0x00, 0x66, 0x00};
+static unsigned char symbol24_180_bits[] = {
+0x33, 0x00, 0x11, 0x00, 0x07, 0x00, 0x1e, 0x00, 0x78, 0x00, 0xe0, 0x01, 
+0x80, 0x07, 0x00, 0x06, 0x00, 0x06, 0x80, 0x07};
+static unsigned char symbol24_181_bits[] = {
+0xe0, 0x01, 0x7c, 0x00, 0x0f, 0x00, 0x03, 0x00, 0x00, 0x00, 0xff, 0x0f, 
+0xff, 0x0f};
+static unsigned char symbol24_182_bits[] = {
+0x03, 0x02, 0x06, 0x03, 0x8c, 0x01, 0xd8, 0x00, 0x70, 0x00, 0x70, 0x00, 
+0xd8, 0x00, 0x8c, 0x01, 0x06, 0x03, 0x03, 0x02, 0x1c, 0x00, 0x3e, 0x02, 
+0x63, 0x03, 0xc3, 0x01, 0xe3, 0x03, 0x3e, 0x02, 0x1c, 0x00, 0x7c, 0x00, 
+0xc6, 0x00};
+static unsigned char symbol24_183_bits[] = {
+0x83, 0x01, 0x80, 0x01, 0x00, 0x03, 0x00, 0x03};
+static unsigned char symbol24_184_bits[] = {
+0x00, 0x03, 0x00, 0x03, 0x78, 0x03, 0xce, 0x03, 0x86, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x83, 0x01};
+static unsigned char symbol24_185_bits[] = {
+0x83, 0x01, 0x83, 0x01, 0xc3, 0x00, 0xe6, 0x00, 0x3c, 0x00, 0x3c, 0x02, 
+0xff, 0x03, 0xff, 0x03, 0x7e, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 
+0xff, 0x03};
+static unsigned char symbol24_186_bits[] = {
+0xff, 0x03, 0x00, 0x00, 0x30, 0x00, 0x30, 0x00, 0x80, 0x01, 0x80, 0x01, 
+0xc0, 0x00, 0xc0, 0x00};
+static unsigned char symbol24_187_bits[] = {
+0xff, 0x03, 0xff, 0x03, 0x30, 0x00, 0xff, 0x03, 0xff, 0x03, 0x0c, 0x00, 
+0x0c, 0x00, 0x06, 0x00};
+static unsigned char symbol24_188_bits[] = {
+0x06, 0x00, 0x03, 0x07, 0xff, 0x03, 0x00, 0x00, 0x03};
+static unsigned char symbol24_189_bits[] = {
+0x03, 0x03, 0x03, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x02, 
+0x02, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x03, 0x03, 0x01, 
+0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol24_190_bits[] = {
+0x03, 0x03, 0x03, 0x01, 0x03, 0x03, 0x03, 0x01};
+static unsigned char symbol24_191_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0xff, 0x3f, 0xff, 0x01, 0xff, 0x3f};
+static unsigned char symbol24_192_bits[] = {
+0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 
+0x06, 0x00, 0xff, 0x0f, 0xff, 0x0f, 0x06, 0x00};
+static unsigned char symbol24_193_bits[] = {
+0x04, 0x00, 0x81, 0x01, 0xc3, 0x00, 0xc7, 0x0f, 0x8e, 0x0f, 0x1c, 0x06, 
+0x38, 0x03, 0x3c, 0x01, 0x76, 0x01, 0xe3, 0x01, 0xc3, 0x01, 0xc7, 0x01, 
+0x8f, 0x03, 0x0e, 0x07, 0x0c, 0x0e, 0x0e, 0x0c, 0x07, 0x08, 0xf0, 0x01, 
+0xfc, 0x3f};
+static unsigned char symbol24_194_bits[] = {
+0x0e, 0x1f, 0x00, 0x0c, 0x02, 0x00, 0x02, 0x03, 0x00, 0x03, 0x0c, 0x01, 
+0x38, 0x0e, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x38, 0x00, 0x38, 0x00, 0x00, 
+0x0c, 0x30, 0x00, 0x30, 0x7b, 0x00, 0xf0, 0x0f, 0x00, 0x03, 0x78, 0x00, 
+0x00, 0xfc, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x83, 0x01, 0x00, 0x81, 0x01, 
+0x00, 0x83, 0x01, 0x00, 0x87, 0x01};
+static unsigned char symbol24_195_bits[] = {
+0x00, 0x0e, 0x1d, 0x00, 0x9c, 0x0d, 0x00, 0x18, 0x19, 0x00, 0x88, 0x19, 
+0x00, 0x00, 0x19, 0x00, 0x80, 0x39, 0x00, 0x00, 0x31, 0x00, 0x80, 0x31, 
+0x00, 0x18, 0x61, 0x01, 0xfc, 0x60, 0x01, 0x72, 0xe0, 0x00, 0x60, 0x00, 
+0x30, 0x00, 0x18, 0x3c};
+static unsigned char symbol24_196_bits[] = {
+0x0c, 0x7f, 0x8c, 0x61, 0xc6, 0x60, 0x66, 0x60, 0x36, 0x60, 0x16, 0x30, 
+0x9e, 0x39, 0xce, 0x19, 0x4e, 0x0c, 0x5e, 0x0e, 0xda, 0x07, 0xbb, 0x01, 
+0x31, 0x00, 0x31, 0x00, 0x31, 0x00, 0x1b, 0x00, 0x0e, 0x00};
+static unsigned char symbol24_197_bits[] = {
+0xe0, 0x07, 0x78, 0x1e, 0x1c, 0x38, 0x06, 0x60, 0x16, 0x68, 0x33, 0xcc, 
+0x63, 0xc6, 0xc3, 0xc3, 0x83, 0xc1, 0xc3, 0xc3, 0x63, 0xc6, 0x33, 0xcc, 
+0x16, 0x68, 0x06, 0x60, 0x1c, 0x38, 0x78, 0x1e, 0xe0, 0x07};
+static unsigned char symbol24_198_bits[] = {
+0xe0, 0x07, 0x00, 0x1e, 0x1c, 0x00, 0x86, 0x61, 0x02, 0x61, 0x83, 0x01, 
+0x83, 0xc1, 0x03, 0xdf, 0xfb, 0x03, 0x83, 0xc1, 0x03, 0xc1, 0x83, 0x01, 
+0x86, 0x61, 0x02, 0x60, 0x1c, 0x00, 0x78, 0x1e, 0x00, 0x07, 0xc0, 0x03, 
+0x03, 0xf0, 0x03, 0x01, 0x38, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0c, 0x00, 
+0x00, 0x06, 0x00};
+static unsigned char symbol24_199_bits[] = {
+0x01, 0x06, 0x8c, 0x01, 0x06, 0x86, 0x01, 0x06, 0x83, 0x01, 0x86, 0x81, 
+0x01, 0xc6, 0x80, 0x01, 0x66, 0x80, 0x01, 0x3c, 0xc0, 0x00, 0x1c, 0xc0, 
+0x00, 0x3c};
+static unsigned char symbol24_200_bits[] = {
+0x70, 0x00, 0xf6, 0x3f, 0x00, 0xc3, 0x0f, 0x00, 0xe0, 0x07, 0xf8, 0x1f, 
+0x1c, 0x38, 0x06, 0x60, 0x06, 0x60, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x03, 0xc0};
+static unsigned char symbol24_201_bits[] = {
+0x03, 0x40, 0x03, 0x40, 0x03, 0x40, 0x03, 0x40, 0x03, 0x40, 0x03, 0x40, 
+0x03, 0x40, 0x03, 0x40, 0x03, 0x40, 0x03, 0x40, 0x03, 0x40, 0x03, 0x40};
+static unsigned char symbol24_202_bits[] = {
+0x06, 0x60, 0x06, 0x60, 0x1c, 0x38, 0xf8, 0x1f, 0xe0, 0x07, 0xff, 0x07, 
+0xff, 0x1f, 0x00, 0x38, 0x00, 0x30, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 
+0x00, 0x60, 0x00, 0x30, 0x00, 0x38};
+static unsigned char symbol24_203_bits[] = {
+0xff, 0x1f, 0xff, 0x07, 0xff, 0x07, 0xff, 0x1f, 0x00, 0x38, 0x00, 0x30, 
+0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x30, 0x00, 0x38, 
+0xff, 0x1f, 0xff, 0x07, 0x00, 0x00, 0xff, 0x7f};
+static unsigned char symbol24_204_bits[] = {
+0xff, 0x7f, 0x00, 0x30, 0x00, 0x30, 0xf0, 0x7f, 0xfc, 0x7f, 0x0e, 0x0c, 
+0x06, 0x0c, 0x03, 0x06, 0x03, 0x06, 0x03, 0x03, 0x03, 0x03, 0x86, 0x01};
+static unsigned char symbol24_205_bits[] = {
+0x8e, 0x01, 0xfc, 0x7f, 0xf0, 0x7f, 0x60, 0x00, 0x60, 0x00, 0xf0, 0x7f, 
+0xfc, 0x7f, 0x0e, 0x00, 0x06, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x06, 0x00, 0x0e, 0x00};
+static unsigned char symbol24_206_bits[] = {
+0xfc, 0x0f, 0xf0, 0x0f, 0xf0, 0x0f, 0xfc, 0x0f, 0x0e, 0x00, 0x06, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 0x0e, 0x00, 
+0xfc, 0x0f};
+static unsigned char symbol24_207_bits[] = {
+0xf0, 0x0f, 0x00, 0x00, 0xff, 0x0f, 0xff, 0x0f, 0xf8, 0x0f, 0xfe, 0x0f, 
+0x06, 0x00, 0x03, 0x00, 0x03, 0x00, 0xff, 0x0f, 0xff, 0x0f, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 0xfe, 0x0f, 0xf8, 0x0f};
+static unsigned char symbol24_208_bits[] = {
+0x00, 0x03, 0x00, 0x03, 0xf8, 0x01, 0xfe, 0x0f, 0x00, 0x01, 0x83, 0x01, 
+0xc3, 0x00, 0x01, 0x0f, 0xff, 0x01, 0x63, 0x00, 0x01, 0x00, 0x33, 0x00, 
+0x36, 0x00, 0x00, 0x0f, 0xf8, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol24_209_bits[] = {
+0x00, 0x00, 0x0c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x03, 0x00, 0x80, 0x01, 
+0x00, 0xc0, 0x00, 0x00, 0x60, 0x00, 0x00, 0x30, 0x00, 0x00, 0x18, 0x00, 
+0x00, 0x0c, 0x00, 0x00, 0xfe, 0xff, 0x01, 0xff, 0xff, 0x01, 0xff, 0xff};
+static unsigned char symbol24_210_bits[] = {
+0x03, 0xc0, 0x03, 0x40, 0x06, 0x60, 0x06, 0x20, 0x0c, 0x30, 0x0c, 0x10, 
+0x0c, 0x18, 0x18, 0x08, 0x18, 0x0c, 0x30, 0x04, 0x30, 0x04, 0x60, 0x06, 
+0x60, 0x02, 0xc0, 0x03, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01};
+static unsigned char symbol24_211_bits[] = {
+0xe0, 0x07, 0x78, 0x1e, 0x1c, 0x38, 0x06, 0x60, 0xf6, 0x67, 0x63, 0xce, 
+0x63, 0xcc, 0x63, 0xce, 0xe3, 0xc7, 0x63, 0xc3, 0x63, 0xc6, 0x63, 0xcc, 
+0xf6, 0x7c, 0x06, 0x60, 0x1c, 0x38, 0x78, 0x1e, 0xe0, 0x07};
+static unsigned char symbol24_212_bits[] = {
+0xe0, 0x07, 0x08, 0x1e, 0x1c, 0x08, 0x06, 0x60, 0x06, 0x63, 0x63, 0x06, 
+0x33, 0xc4, 0x03, 0xc0, 0x33, 0x00, 0x33, 0xc0, 0x03, 0xc4, 0x63, 0x06, 
+0xc6, 0x63, 0x06, 0x60, 0x1c, 0x08};
+static unsigned char symbol24_213_bits[] = {
+0x78, 0x1e, 0x00, 0x07, 0xff, 0x01, 0x0e, 0x99, 0x00, 0x06, 0x18, 0x00, 
+0x07, 0x18, 0x00, 0x07, 0x18, 0x00, 0x06, 0x18, 0x00, 0x06, 0x18, 0x00, 
+0x06, 0x18, 0x00, 0x06, 0x18, 0x00, 0x06, 0x3c, 0x01, 0x0f, 0xff, 0x01, 
+0x01, 0x0c, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0c, 0x00, 
+0x00, 0x0c, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x0c, 0x00, 
+0x00, 0x0c, 0x00};
+static unsigned char symbol24_214_bits[] = {
+0x00, 0x0c, 0x60, 0x00, 0x0c, 0x20, 0x00, 0x0c, 0x60, 0x00, 0x0c, 0x20, 
+0x00, 0x0c, 0x60, 0x00, 0x0c, 0x20, 0x00, 0x0c, 0x60, 0x00, 0x0c, 0x20, 
+0x00, 0x0c, 0x60, 0x00, 0x0c, 0x20, 0x00, 0x3f, 0xf8, 0x01, 0x00, 0x20, 
+0x00, 0x20, 0x00, 0x20, 0x00, 0x30, 0x00, 0x30, 0x00, 0x10};
+static unsigned char symbol24_215_bits[] = {
+0x00, 0x00, 0x00};
+static unsigned char symbol24_216_bits[] = {
+0x10, 0x00, 0x18, 0x0c, 0x18, 0x0e, 0x08, 0x1b, 0x08, 0x18, 0x08, 0x30, 
+0x0c, 0x30, 0x0c, 0x60};
+static unsigned char symbol24_217_bits[] = {
+0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x06, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x03, 0x03, 0x03, 0xff, 0x1f, 0xff, 0x1f, 0x00, 0x00};
+static unsigned char symbol24_218_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 
+0xe0, 0x00, 0xb0, 0x01, 0xb0, 0x01, 0x18, 0x03, 0x18, 0x03, 0x0c, 0x06};
+static unsigned char symbol24_219_bits[] = {
+0x0c, 0x06, 0x06, 0x0c, 0x06, 0x0c, 0x03, 0x18, 0x03, 0x18, 0x03, 0x18, 
+0x03, 0x18, 0x06, 0x0c, 0x06, 0x0c, 0x0c, 0x06, 0x0c, 0x06, 0x18, 0x03, 
+0x18, 0x03, 0x30, 0x01, 0xb0, 0x01, 0xe0, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char symbol24_220_bits[] = {
+0x03, 0x30, 0x00, 0x06, 0x18, 0x00, 0x0c, 0xfc, 0x7f, 0x1f, 0xfe, 0x7f, 
+0x3f, 0x07, 0x00, 0x70, 0x07, 0x00, 0x70, 0xfe, 0x7f, 0x3f, 0xfc, 0x7f, 
+0x1f, 0x18, 0x00, 0x0c, 0x30, 0x00, 0x06, 0x60, 0x00, 0x03, 0x60, 0x00};
+static unsigned char symbol24_221_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x0c, 0xff, 0x0f, 0xfe, 0x0f, 
+0x7f, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x0e, 0xff, 0x0f, 0xfc, 0x0f, 
+0x7f, 0x08, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 
+0xf0, 0x00, 0xf8, 0x01, 0x9c, 0x03, 0x9e, 0x07, 0x9b, 0x0d};
+static unsigned char symbol24_222_bits[] = {
+0x98, 0x01, 0x18, 0x01, 0x98, 0x01, 0x98, 0x01, 0x18, 0x01, 0x98, 0x01, 
+0x98, 0x01, 0x18, 0x01, 0x98, 0x01, 0x98, 0x01, 0x18, 0x01, 0x98, 0x01, 
+0x98, 0x01, 0x18, 0x01, 0x98, 0x01, 0x98, 0x01, 0x18, 0x01, 0x00, 0x00};
+static unsigned char symbol24_223_bits[] = {
+0x03, 0x00, 0x00, 0x06, 0x00, 0x00, 0x0c, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 
+0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x0f, 0xff, 0x0f, 0xff, 0x0f, 
+0x1f, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x06, 0x00, 0x00, 0x03, 0x98, 0x01, 
+0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01};
+static unsigned char symbol24_224_bits[] = {
+0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 
+0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x98, 0x01, 0x9b, 0x01, 
+0x9e, 0x03, 0x9c, 0x03, 0xf8, 0x01, 0xf0, 0x00, 0x60, 0x00, 0x30, 0x00};
+static unsigned char symbol24_225_bits[] = {
+0x30, 0x00, 0x78, 0x00, 0x4c, 0x00, 0x4c, 0x00, 0x06, 0x01, 0x06, 0x01, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x06, 0x01};
+static unsigned char symbol24_226_bits[] = {
+0x86, 0x01, 0xcc, 0x00, 0xcc, 0x00, 0x78, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x60, 0x60, 0x30, 0x30, 0x18, 0x18, 0x0c, 0x0c, 0x06, 0x06, 0x03, 0x03, 
+0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 0x60};
+static unsigned char symbol24_227_bits[] = {
+0xe0, 0x07, 0x78, 0x1e, 0x1c, 0x38, 0x06, 0x60, 0xe6, 0x67, 0x63, 0xcc, 
+0x63, 0xcc, 0x63, 0xcc, 0xe3, 0xc7, 0x63, 0xc6, 0x63, 0xcc, 0x63, 0xcc, 
+0x66, 0x4c, 0x06, 0x60, 0x1c, 0x38, 0x78, 0x1e, 0xe0, 0x07};
+static unsigned char symbol24_228_bits[] = {
+0xe0, 0x07, 0x00, 0x1e, 0x1c, 0x00, 0x06, 0x60, 0x02, 0x63, 0xe3, 0x03, 
+0x73, 0xc6, 0x03, 0xc0, 0x33, 0x00, 0x33, 0xc0, 0x03, 0xc6, 0xe3, 0x03, 
+0xc6, 0x63, 0x02, 0x60, 0x1c, 0x00};
+static unsigned char symbol24_229_bits[] = {
+0x78, 0x1e, 0xe0, 0x07, 0x7f, 0x03, 0x03, 0x18, 0x03, 0x03, 0x18, 0x07, 
+0x03, 0x18, 0x87, 0x03, 0x18, 0x0f, 0x03, 0x18, 0x4b, 0x03, 0x18, 0x3b, 
+0x03, 0x18, 0x33, 0x03, 0x18, 0x33, 0x03, 0x18, 0x33, 0x03, 0xff, 0x1f, 
+0x07, 0x18, 0x0e, 0x10};
+static unsigned char symbol24_230_bits[] = {
+0x1c, 0x00, 0x38, 0x00, 0x70, 0x00, 0xe0, 0x00, 0xc0, 0x01, 0x80, 0x01, 
+0x00, 0x01, 0x80, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 
+0x0c, 0x00, 0x06, 0x00, 0x03, 0x00, 0xff, 0x01, 0xff, 0x01, 0x80, 0x01, 
+0xc0, 0x00, 0x60, 0x00, 0x30, 0x00, 0x18, 0x00, 0x18, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x03, 0x00, 
+0x03, 0x00};
+static unsigned char symbol24_231_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00};
+static unsigned char symbol24_232_bits[] = {
+0x03, 0x00, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00};
+static unsigned char symbol24_233_bits[] = {
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 
+0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x18, 0x00, 
+0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0x40};
+static unsigned char symbol24_234_bits[] = {
+0x00, 0x00, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol24_235_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol24_236_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol24_237_bits[] = {
+0x03, 0x03, 0x1f, 0x18, 0x0c, 0x06, 0x06, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol24_238_bits[] = {
+0x03, 0x03, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x08, 0x0c, 0x06, 0x03, 0x06, 0x0c, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18};
+static unsigned char symbol24_239_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02};
+static unsigned char symbol24_240_bits[] = {
+0x00};
+static unsigned char symbol24_241_bits[] = {
+0x0c, 0x78, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol24_242_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x00, 0x03, 0x03, 0x06, 0x06, 0x0c, 0x0c, 0x18, 0x18, 0x30, 0x30, 0x60, 
+0x60, 0x30, 0x30, 0x18};
+static unsigned char symbol24_243_bits[] = {
+0x18, 0x0c, 0x0c, 0x06, 0x06, 0x03, 0x03, 0xe0, 0xf0, 0xd8, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18};
+static unsigned char symbol24_244_bits[] = {
+0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol24_245_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03};
+static unsigned char symbol24_246_bits[] = {
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0x40, 0x00, 0x33, 0x01, 0x0e, 0x01, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x01, 0x00};
+static unsigned char symbol24_247_bits[] = {
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00};
+static unsigned char symbol24_248_bits[] = {
+0x01, 0x00, 0x01, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 
+0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x01, 0x03, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 
+0x01, 0x00, 0x01, 0x00};
+static unsigned char symbol24_249_bits[] = {
+0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x40, 
+0x00, 0x40, 0x00, 0x40, 0x00, 0x40, 0x00, 0x60, 0x00, 0x60, 0x00, 0x30, 
+0x00, 0x30, 0x00, 0x18, 0x00, 0x0c, 0x00};
+static unsigned char symbol24_250_bits[] = {
+0x02, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol24_251_bits[] = {
+0x60, 0x60, 0x60, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol24_252_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 
+0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 
+0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60};
+static unsigned char symbol24_253_bits[] = {
+0x00, 0x00, 0x00, 0x1f, 0x0f, 0x18, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol24_254_bits[] = {
+0x60, 0x60, 0x60, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x02, 0x06, 0x0c, 0x18, 0x0c, 0x06, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char symbol24_255_bits[] = {
+0x00};
+static RotFont symbol24font[] = {
+{5, 1, 1, symbol24_0_bits},
+{5, 1, 1, symbol24_1_bits},
+{5, 1, 1, symbol24_2_bits},
+{5, 1, 1, symbol24_3_bits},
+{5, 1, 1, symbol24_4_bits},
+{5, 1, 1, symbol24_5_bits},
+{5, 1, 1, symbol24_6_bits},
+{5, 1, 1, symbol24_7_bits},
+{5, 1, 1, symbol24_8_bits},
+{5, 1, 1, symbol24_9_bits},
+{5, 1, 1, symbol24_10_bits},
+{5, 1, 1, symbol24_11_bits},
+{5, 1, 1, symbol24_12_bits},
+{5, 1, 1, symbol24_13_bits},
+{5, 1, 1, symbol24_14_bits},
+{5, 1, 1, symbol24_15_bits},
+{5, 1, 1, symbol24_16_bits},
+{5, 1, 1, symbol24_17_bits},
+{5, 1, 1, symbol24_18_bits},
+{5, 1, 1, symbol24_19_bits},
+{5, 1, 1, symbol24_20_bits},
+{5, 1, 1, symbol24_21_bits},
+{5, 1, 1, symbol24_22_bits},
+{5, 1, 1, symbol24_23_bits},
+{5, 1, 1, symbol24_24_bits},
+{5, 1, 1, symbol24_25_bits},
+{5, 1, 1, symbol24_26_bits},
+{5, 1, 1, symbol24_27_bits},
+{5, 1, 1, symbol24_28_bits},
+{5, 1, 1, symbol24_29_bits},
+{5, 1, 1, symbol24_30_bits},
+{5, 1, 1, symbol24_31_bits},
+{1, 1, 1, symbol24_32_bits},
+{3, 17, 17, symbol24_33_bits},
+{15, 17, 17, symbol24_34_bits},
+{11, 17, 17, symbol24_35_bits},
+{11, 17, 17, symbol24_36_bits},
+{18, 17, 17, symbol24_37_bits},
+{15, 17, 17, symbol24_38_bits},
+{8, 13, 13, symbol24_39_bits},
+{6, 22, 17, symbol24_40_bits},
+{6, 22, 17, symbol24_41_bits},
+{8, 10, 17, symbol24_42_bits},
+{10, 10, 12, symbol24_43_bits},
+{3, 6, 2, symbol24_44_bits},
+{11, 2, 8, symbol24_45_bits},
+{2, 3, 3, symbol24_46_bits},
+{7, 17, 17, symbol24_47_bits},
+{10, 17, 17, symbol24_48_bits},
+{6, 17, 17, symbol24_49_bits},
+{10, 17, 17, symbol24_50_bits},
+{9, 17, 17, symbol24_51_bits},
+{10, 17, 17, symbol24_52_bits},
+{9, 17, 17, symbol24_53_bits},
+{10, 17, 17, symbol24_54_bits},
+{10, 17, 17, symbol24_55_bits},
+{10, 17, 17, symbol24_56_bits},
+{10, 17, 17, symbol24_57_bits},
+{2, 11, 11, symbol24_58_bits},
+{3, 15, 11, symbol24_59_bits},
+{12, 12, 13, symbol24_60_bits},
+{10, 6, 10, symbol24_61_bits},
+{12, 12, 13, symbol24_62_bits},
+{8, 17, 17, symbol24_63_bits},
+{11, 12, 13, symbol24_64_bits},
+{17, 17, 17, symbol24_65_bits},
+{13, 17, 17, symbol24_66_bits},
+{17, 17, 17, symbol24_67_bits},
+{16, 17, 17, symbol24_68_bits},
+{13, 17, 17, symbol24_69_bits},
+{16, 17, 17, symbol24_70_bits},
+{13, 17, 17, symbol24_71_bits},
+{16, 17, 17, symbol24_72_bits},
+{6, 17, 17, symbol24_73_bits},
+{14, 17, 17, symbol24_74_bits},
+{15, 17, 17, symbol24_75_bits},
+{15, 17, 17, symbol24_76_bits},
+{20, 17, 17, symbol24_77_bits},
+{16, 17, 17, symbol24_78_bits},
+{16, 17, 17, symbol24_79_bits},
+{16, 17, 17, symbol24_80_bits},
+{16, 17, 17, symbol24_81_bits},
+{12, 17, 17, symbol24_82_bits},
+{12, 17, 17, symbol24_83_bits},
+{14, 17, 17, symbol24_84_bits},
+{16, 17, 17, symbol24_85_bits},
+{9, 18, 13, symbol24_86_bits},
+{16, 17, 17, symbol24_87_bits},
+{14, 17, 17, symbol24_88_bits},
+{18, 17, 17, symbol24_89_bits},
+{12, 17, 17, symbol24_90_bits},
+{5, 22, 17, symbol24_91_bits},
+{12, 10, 10, symbol24_92_bits},
+{5, 22, 17, symbol24_93_bits},
+{14, 17, 17, symbol24_94_bits},
+{13, 2, -3, symbol24_95_bits},
+{13, 2, 23, symbol24_96_bits},
+{14, 13, 13, symbol24_97_bits},
+{10, 24, 19, symbol24_98_bits},
+{12, 18, 13, symbol24_99_bits},
+{10, 18, 18, symbol24_100_bits},
+{9, 13, 13, symbol24_101_bits},
+{12, 22, 17, symbol24_102_bits},
+{11, 18, 13, symbol24_103_bits},
+{12, 18, 13, symbol24_104_bits},
+{7, 13, 13, symbol24_105_bits},
+{12, 18, 13, symbol24_106_bits},
+{12, 13, 13, symbol24_107_bits},
+{12, 19, 19, symbol24_108_bits},
+{12, 18, 13, symbol24_109_bits},
+{11, 13, 13, symbol24_110_bits},
+{11, 13, 13, symbol24_111_bits},
+{13, 13, 13, symbol24_112_bits},
+{10, 17, 17, symbol24_113_bits},
+{10, 18, 13, symbol24_114_bits},
+{14, 13, 13, symbol24_115_bits},
+{10, 13, 13, symbol24_116_bits},
+{13, 13, 13, symbol24_117_bits},
+{16, 14, 14, symbol24_118_bits},
+{14, 13, 13, symbol24_119_bits},
+{10, 24, 19, symbol24_120_bits},
+{16, 18, 13, symbol24_121_bits},
+{10, 24, 19, symbol24_122_bits},
+{8, 22, 17, symbol24_123_bits},
+{2, 22, 17, symbol24_124_bits},
+{8, 22, 17, symbol24_125_bits},
+{11, 4, 9, symbol24_126_bits},
+{5, 1, 1, symbol24_127_bits},
+{5, 1, 1, symbol24_128_bits},
+{5, 1, 1, symbol24_129_bits},
+{5, 1, 1, symbol24_130_bits},
+{5, 1, 1, symbol24_131_bits},
+{5, 1, 1, symbol24_132_bits},
+{5, 1, 1, symbol24_133_bits},
+{5, 1, 1, symbol24_134_bits},
+{5, 1, 1, symbol24_135_bits},
+{5, 1, 1, symbol24_136_bits},
+{5, 1, 1, symbol24_137_bits},
+{5, 1, 1, symbol24_138_bits},
+{5, 1, 1, symbol24_139_bits},
+{5, 1, 1, symbol24_140_bits},
+{5, 1, 1, symbol24_141_bits},
+{5, 1, 1, symbol24_142_bits},
+{5, 1, 1, symbol24_143_bits},
+{5, 1, 1, symbol24_144_bits},
+{5, 1, 1, symbol24_145_bits},
+{5, 1, 1, symbol24_146_bits},
+{5, 1, 1, symbol24_147_bits},
+{5, 1, 1, symbol24_148_bits},
+{5, 1, 1, symbol24_149_bits},
+{5, 1, 1, symbol24_150_bits},
+{5, 1, 1, symbol24_151_bits},
+{5, 1, 1, symbol24_152_bits},
+{5, 1, 1, symbol24_153_bits},
+{5, 1, 1, symbol24_154_bits},
+{5, 1, 1, symbol24_155_bits},
+{5, 1, 1, symbol24_156_bits},
+{5, 1, 1, symbol24_157_bits},
+{5, 1, 1, symbol24_158_bits},
+{5, 1, 1, symbol24_159_bits},
+{5, 1, 1, symbol24_160_bits},
+{13, 17, 17, symbol24_161_bits},
+{5, 6, 18, symbol24_162_bits},
+{12, 15, 15, symbol24_163_bits},
+{8, 17, 17, symbol24_164_bits},
+{15, 7, 11, symbol24_165_bits},
+{13, 22, 17, symbol24_166_bits},
+{14, 13, 13, symbol24_167_bits},
+{10, 13, 13, symbol24_168_bits},
+{12, 13, 13, symbol24_169_bits},
+{12, 13, 13, symbol24_170_bits},
+{24, 12, 13, symbol24_171_bits},
+{25, 12, 13, symbol24_172_bits},
+{12, 31, 23, symbol24_173_bits},
+{25, 12, 13, symbol24_174_bits},
+{12, 29, 24, symbol24_175_bits},
+{7, 7, 17, symbol24_176_bits},
+{10, 14, 14, symbol24_177_bits},
+{9, 6, 18, symbol24_178_bits},
+{12, 15, 15, symbol24_179_bits},
+{11, 10, 12, symbol24_180_bits},
+{14, 7, 11, symbol24_181_bits},
+{10, 19, 19, symbol24_182_bits},
+{8, 8, 11, symbol24_183_bits},
+{10, 8, 11, symbol24_184_bits},
+{10, 13, 13, symbol24_185_bits},
+{11, 8, 11, symbol24_186_bits},
+{11, 8, 11, symbol24_187_bits},
+{18, 3, 3, symbol24_188_bits},
+{2, 32, 24, symbol24_189_bits},
+{25, 2, 8, symbol24_190_bits},
+{14, 16, 16, symbol24_191_bits},
+{12, 16, 16, symbol24_192_bits},
+{14, 19, 18, symbol24_193_bits},
+{17, 18, 18, symbol24_194_bits},
+{15, 20, 15, symbol24_195_bits},
+{16, 17, 17, symbol24_196_bits},
+{16, 17, 17, symbol24_197_bits},
+{18, 17, 17, symbol24_198_bits},
+{16, 13, 13, symbol24_199_bits},
+{16, 13, 13, symbol24_200_bits},
+{15, 12, 12, symbol24_201_bits},
+{15, 15, 12, symbol24_202_bits},
+{15, 16, 14, symbol24_203_bits},
+{15, 12, 12, symbol24_204_bits},
+{15, 15, 12, symbol24_205_bits},
+{12, 13, 13, symbol24_206_bits},
+{12, 17, 15, symbol24_207_bits},
+{17, 16, 16, symbol24_208_bits},
+{16, 18, 18, symbol24_209_bits},
+{16, 17, 17, symbol24_210_bits},
+{16, 17, 17, symbol24_211_bits},
+{20, 10, 17, symbol24_212_bits},
+{17, 21, 18, symbol24_213_bits},
+{14, 23, 23, symbol24_214_bits},
+{2, 3, 9, symbol24_215_bits},
+{15, 8, 8, symbol24_216_bits},
+{13, 12, 12, symbol24_217_bits},
+{13, 12, 12, symbol24_218_bits},
+{23, 12, 12, symbol24_219_bits},
+{23, 12, 12, symbol24_220_bits},
+{12, 23, 23, symbol24_221_bits},
+{23, 12, 12, symbol24_222_bits},
+{12, 23, 23, symbol24_223_bits},
+{10, 18, 18, symbol24_224_bits},
+{7, 22, 17, symbol24_225_bits},
+{16, 17, 17, symbol24_226_bits},
+{16, 17, 17, symbol24_227_bits},
+{18, 10, 17, symbol24_228_bits},
+{14, 20, 18, symbol24_229_bits},
+{9, 31, 23, symbol24_230_bits},
+{2, 32, 24, symbol24_231_bits},
+{9, 32, 24, symbol24_232_bits},
+{7, 31, 23, symbol24_233_bits},
+{2, 32, 24, symbol24_234_bits},
+{7, 29, 24, symbol24_235_bits},
+{7, 31, 23, symbol24_236_bits},
+{5, 32, 24, symbol24_237_bits},
+{7, 29, 24, symbol24_238_bits},
+{2, 32, 24, symbol24_239_bits},
+{5, 1, 1, symbol24_240_bits},
+{7, 22, 17, symbol24_241_bits},
+{8, 28, 23, symbol24_242_bits},
+{8, 31, 23, symbol24_243_bits},
+{2, 32, 24, symbol24_244_bits},
+{8, 26, 24, symbol24_245_bits},
+{9, 31, 23, symbol24_246_bits},
+{2, 32, 24, symbol24_247_bits},
+{9, 32, 24, symbol24_248_bits},
+{7, 31, 23, symbol24_249_bits},
+{2, 32, 24, symbol24_250_bits},
+{7, 29, 24, symbol24_251_bits},
+{7, 31, 23, symbol24_252_bits},
+{5, 32, 24, symbol24_253_bits},
+{7, 29, 24, symbol24_254_bits},
+{5, 1, 1, symbol24_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol8.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol8.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol8.bdf	(revision 15879)
@@ -0,0 +1,2537 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Symbol-Medium-R-Normal--8-80-75-75-P-51-Adobe-FontSpecific
+SIZE 8 75 75
+FONTBOUNDINGBOX 9 11 -1 -3
+STARTPROPERTIES 31
+FOUNDRY "Adobe"
+FAMILY_NAME "Symbol"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 8
+POINT_SIZE 80
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 51
+CHARSET_REGISTRY "Adobe"
+CHARSET_ENCODING "FontSpecific"
+CAP_HEIGHT 6
+X_HEIGHT 4
+FACE_NAME "Symbol"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "No mark"
+_DEC_DEVICE_FONTNAMES "PS=Symbol"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2-1, 18-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+FULL_NAME "Symbol"
+FONT "-Adobe-Symbol-Medium-R-Normal--8-80-75-75-P-51-Adobe-FontSpecific"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 5
+DEFAULT_CHAR 32
+FONT_ASCENT 8
+FONT_DESCENT 2
+ENDPROPERTIES
+CHARS 188
+STARTCHAR space
+ENCODING 32
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 6 1 0
+BITMAP
+80
+80
+80
+80
+00
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+88
+88
+70
+50
+20
+20
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 5 6 -1 0
+BITMAP
+50
+f8
+50
+50
+f8
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+f0
+10
+10
+70
+10
+f0
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+c8
+d0
+20
+58
+98
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+60
+50
+20
+f8
+a0
+58
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 4 0 0
+BITMAP
+c0
+60
+20
+c0
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 8 0 -2
+BITMAP
+40
+80
+80
+80
+80
+80
+80
+40
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 8 1 -2
+BITMAP
+80
+40
+40
+40
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 3 1 2
+BITMAP
+40
+e0
+a0
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+BITMAP
+20
+20
+f8
+20
+20
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 3 0 -2
+BITMAP
+40
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 1 0 2
+BITMAP
+f8
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 1 1 0
+BITMAP
+80
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 6 0 0
+BITMAP
+40
+40
+40
+80
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+40
+a0
+a0
+a0
+a0
+40
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+40
+c0
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+40
+a0
+20
+40
+80
+e0
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+40
+a0
+20
+60
+20
+c0
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 6 0 0
+BITMAP
+20
+60
+a0
+f0
+20
+20
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+e0
+80
+c0
+20
+20
+c0
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+60
+80
+c0
+a0
+a0
+40
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+e0
+a0
+20
+40
+40
+40
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+40
+a0
+40
+a0
+a0
+40
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+40
+a0
+a0
+e0
+20
+c0
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 4 1 0
+BITMAP
+80
+00
+00
+80
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 6 0 -2
+BITMAP
+40
+00
+00
+40
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+18
+60
+c0
+60
+18
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 3 0 1
+BITMAP
+f0
+00
+f0
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+BITMAP
+c0
+30
+18
+30
+c0
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+40
+a0
+20
+40
+00
+40
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+50
+a0
+00
+f0
+00
+f0
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+20
+70
+50
+70
+50
+d8
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+e0
+50
+60
+50
+50
+e0
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+88
+50
+20
+20
+50
+88
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+20
+50
+50
+88
+88
+f8
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+f0
+40
+70
+40
+40
+f0
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+70
+20
+a8
+a8
+20
+70
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+f0
+50
+40
+40
+40
+c0
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+d8
+48
+78
+48
+48
+d8
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 6 0 0
+BITMAP
+c0
+40
+40
+40
+40
+c0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+60
+50
+38
+d0
+50
+60
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+d8
+50
+60
+60
+50
+d8
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 6 0 0
+BITMAP
+20
+30
+48
+48
+48
+cc
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 7 6 0 0
+BITMAP
+c6
+44
+6c
+54
+54
+d6
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+d8
+48
+68
+78
+58
+c8
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+70
+d8
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 6 0 0
+BITMAP
+fc
+48
+48
+48
+48
+d8
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+70
+d8
+a8
+a8
+d8
+70
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+e0
+50
+50
+60
+40
+e0
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+f0
+90
+40
+40
+90
+f0
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+f0
+50
+40
+40
+40
+60
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+d8
+48
+50
+20
+20
+70
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 -2
+BITMAP
+60
+80
+80
+40
+20
+40
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 5 6 1 0
+BITMAP
+20
+50
+88
+88
+50
+d8
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+70
+00
+70
+00
+88
+f8
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 7 6 0 0
+BITMAP
+d6
+54
+54
+7c
+10
+38
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+f0
+90
+20
+40
+90
+f0
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 8 0 -2
+BITMAP
+c0
+80
+80
+80
+80
+80
+80
+c0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 4 1 0
+BITMAP
+40
+00
+00
+90
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 8 1 -2
+BITMAP
+c0
+40
+40
+40
+40
+40
+40
+c0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 1 0
+BITMAP
+40
+40
+40
+40
+40
+f0
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 1 0 -2
+BITMAP
+f0
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 5 1 0 7
+BITMAP
+f8
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 4 0 0
+BITMAP
+50
+b0
+a0
+50
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 9 0 -2
+BITMAP
+40
+a0
+a0
+c0
+a0
+a0
+c0
+80
+80
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 -2
+BITMAP
+b0
+a0
+40
+40
+a0
+b0
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+40
+a0
+80
+40
+a0
+a0
+c0
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 4 0 0
+BITMAP
+60
+e0
+80
+60
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 0 -2
+BITMAP
+40
+40
+60
+d0
+d0
+60
+40
+40
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 -2
+BITMAP
+50
+d0
+60
+20
+40
+40
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 -2
+BITMAP
+60
+d0
+50
+50
+10
+10
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 4 0 0
+BITMAP
+c0
+40
+40
+40
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 -2
+BITMAP
+a0
+d0
+d0
+60
+40
+40
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+BITMAP
+50
+f0
+60
+50
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 7 0 0
+BITMAP
+80
+c0
+40
+20
+60
+90
+98
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 -2
+BITMAP
+a0
+a0
+a0
+d0
+80
+c0
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+BITMAP
+90
+90
+e0
+40
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 4 0 0
+BITMAP
+40
+a0
+a0
+40
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+BITMAP
+f0
+50
+50
+d0
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+40
+a0
+e0
+a0
+a0
+40
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 -2
+BITMAP
+40
+a0
+a0
+c0
+80
+80
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+BITMAP
+70
+a0
+a0
+40
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 4 0 0
+BITMAP
+e0
+40
+40
+60
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+BITMAP
+50
+d0
+50
+60
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+f8
+a8
+a8
+a8
+58
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 4 0 0
+BITMAP
+88
+a8
+a8
+58
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 9 0 -2
+BITMAP
+80
+e0
+40
+60
+80
+80
+40
+20
+60
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 -2
+BITMAP
+a8
+a8
+a8
+70
+20
+20
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 9 0 -2
+BITMAP
+80
+e0
+40
+80
+80
+80
+40
+20
+60
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 9 1 -2
+BITMAP
+20
+40
+40
+40
+80
+40
+40
+40
+20
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 8 0 -2
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 9 1 -2
+BITMAP
+80
+40
+40
+40
+20
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 2 0 1
+BITMAP
+50
+a0
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 3 0 4
+BITMAP
+00
+00
+00
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 4 7 -1 0
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 3 0 1
+BITMAP
+00
+00
+00
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 8 0 -2
+BITMAP
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 1 -1
+BITMAP
+00
+90
+a0
+40
+40
+40
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 -1
+BITMAP
+40
+40
+40
+80
+30
+40
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 1 -1
+BITMAP
+80
+70
+00
+f0
+10
+20
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 1 0
+BITMAP
+20
+40
+40
+40
+80
+50
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 8 5 0 0
+BITMAP
+a8
+50
+30
+40
+e0
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 8 5 0 0
+BITMAP
+40
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 11 0 -3
+BITMAP
+60
+60
+f0
+f0
+40
+40
+20
+70
+f8
+f0
+60
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 8 5 0 0
+BITMAP
+40
+48
+d8
+f8
+f0
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 10 0 -2
+BITMAP
+60
+40
+20
+60
+f0
+f0
+50
+40
+20
+40
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 3 0 3
+BITMAP
+e0
+40
+20
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 6 0 0
+BITMAP
+20
+40
+f8
+40
+20
+20
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 4 3 0 4
+BITMAP
+70
+a0
+20
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 6 0 0
+BITMAP
+20
+20
+20
+20
+20
+20
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+BITMAP
+20
+00
+00
+f0
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 3 0 1
+BITMAP
+00
+00
+20
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+20
+20
+20
+20
+20
+20
+a0
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 3 0 1
+BITMAP
+60
+20
+40
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+BITMAP
+a0
+40
+20
+20
+f0
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 7 0 -2
+BITMAP
+20
+20
+f0
+50
+50
+a0
+c0
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+BITMAP
+20
+10
+e0
+00
+f0
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+BITMAP
+90
+60
+60
+90
+50
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 5 1 1 0
+BITMAP
+a0
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 1 11 2 -3
+BITMAP
+00
+00
+80
+00
+00
+80
+80
+00
+00
+80
+00
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 8 1 0 2
+BITMAP
+60
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+00
+f0
+00
+60
+20
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+20
+f0
+20
+f0
+40
+40
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 7 0 0
+BITMAP
+f0
+00
+f0
+00
+f0
+50
+a0
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 7 0 0
+BITMAP
+00
+50
+a0
+a8
+80
+80
+80
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 5 7 1 -2
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+80
+f8
+08
+08
+48
+f8
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+40
+d8
+48
+68
+78
+d8
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 -1
+BITMAP
+c8
+78
+88
+90
+10
+08
+c8
+78
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 4 0 0
+BITMAP
+58
+a0
+a0
+38
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 4 0 0
+BITMAP
+28
+68
+c8
+40
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 4 0 0
+BITMAP
+98
+a8
+c8
+70
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 -2
+BITMAP
+c0
+40
+70
+d8
+a8
+a8
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 -1
+BITMAP
+d8
+70
+70
+a8
+f8
+a8
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 4 0 0
+BITMAP
+a8
+70
+08
+70
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 -2
+BITMAP
+98
+a8
+a8
+c8
+70
+80
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 4 1 0
+BITMAP
+70
+80
+80
+80
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 6 1 -1
+BITMAP
+80
+80
+80
+70
+f0
+00
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+08
+f0
+f0
+08
+08
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+f0
+00
+f8
+08
+78
+90
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 7 0 -1
+BITMAP
+a0
+78
+40
+78
+80
+80
+78
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 7 0 -1
+BITMAP
+78
+80
+80
+78
+00
+f8
+70
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 8 4 0 2
+BITMAP
+f0
+80
+70
+20
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 6 8 0 -1
+BITMAP
+70
+f0
+c0
+70
+40
+08
+10
+20
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 8 0 0
+BITMAP
+40
+f8
+f8
+88
+88
+50
+70
+20
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 1 1 2
+BITMAP
+00
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 3 0 0
+BITMAP
+c8
+b8
+b0
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+BITMAP
+a0
+c0
+70
+70
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+BITMAP
+80
+b0
+a0
+b0
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 1080 0
+DWIDTH 9 0
+BBX 8 4 0 0
+BITMAP
+88
+70
+fc
+5a
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 7 4 0 0
+BITMAP
+5a
+5a
+fc
+48
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 0 0
+BITMAP
+40
+40
+40
+40
+40
+c0
+00
+00
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 7 4 0 0
+BITMAP
+10
+10
+a0
+a0
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 0 0
+BITMAP
+40
+40
+80
+f0
+00
+00
+20
+50
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+90
+90
+90
+90
+a0
+40
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 8 0 -2
+BITMAP
+00
+40
+c0
+00
+00
+c0
+40
+00
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 7 0 -1
+BITMAP
+40
+60
+f0
+60
+60
+60
+60
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 7 0 -1
+BITMAP
+60
+08
+f8
+f8
+08
+60
+60
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 6 4 0 2
+BITMAP
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 -1
+BITMAP
+60
+40
+20
+50
+c8
+c8
+50
+20
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 11 1 -3
+BITMAP
+40
+40
+80
+80
+80
+80
+40
+40
+40
+80
+80
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 1 11 1 -3
+BITMAP
+80
+80
+80
+00
+00
+80
+80
+80
+80
+80
+00
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 11 1 -3
+BITMAP
+c0
+40
+40
+40
+c0
+80
+40
+40
+00
+40
+80
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 11 1 -3
+BITMAP
+e0
+40
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 1 11 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 11 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 2 11 1 -3
+BITMAP
+40
+c0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 2 11 0 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 2 11 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 1 11 1 -3
+BITMAP
+80
+00
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 8 0 -2
+BITMAP
+80
+40
+40
+40
+40
+80
+40
+40
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 11 1 -3
+BITMAP
+40
+40
+40
+40
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 3 11 1 -3
+BITMAP
+80
+80
+80
+40
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 1 11 -1 -3
+BITMAP
+80
+80
+80
+80
+00
+80
+80
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 3 11 -1 -3
+BITMAP
+80
+80
+20
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 11 0 -3
+BITMAP
+40
+80
+40
+40
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 1 11 1 -3
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 11 0 -3
+BITMAP
+80
+80
+00
+00
+00
+00
+00
+00
+00
+00
+00
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 11 0 -3
+BITMAP
+c0
+c0
+80
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 1 11 1 -3
+BITMAP
+00
+00
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 11 0 -3
+BITMAP
+80
+80
+40
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 2 11 0 -3
+BITMAP
+40
+80
+c0
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 2 11 1 -3
+BITMAP
+40
+40
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 2 11 0 -3
+BITMAP
+80
+80
+40
+40
+40
+40
+40
+40
+40
+40
+40
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol8.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol8.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/symbol8.h	(revision 15879)
@@ -0,0 +1,769 @@
+static unsigned char symbol8_0_bits[] = {
+0x00};
+static unsigned char symbol8_1_bits[] = {
+0x00};
+static unsigned char symbol8_2_bits[] = {
+0x00};
+static unsigned char symbol8_3_bits[] = {
+0x00};
+static unsigned char symbol8_4_bits[] = {
+0x00};
+static unsigned char symbol8_5_bits[] = {
+0x00};
+static unsigned char symbol8_6_bits[] = {
+0x00};
+static unsigned char symbol8_7_bits[] = {
+0x00};
+static unsigned char symbol8_8_bits[] = {
+0x00};
+static unsigned char symbol8_9_bits[] = {
+0x00};
+static unsigned char symbol8_10_bits[] = {
+0x00};
+static unsigned char symbol8_11_bits[] = {
+0x00};
+static unsigned char symbol8_12_bits[] = {
+0x00};
+static unsigned char symbol8_13_bits[] = {
+0x00};
+static unsigned char symbol8_14_bits[] = {
+0x00};
+static unsigned char symbol8_15_bits[] = {
+0x00};
+static unsigned char symbol8_16_bits[] = {
+0x00};
+static unsigned char symbol8_17_bits[] = {
+0x00};
+static unsigned char symbol8_18_bits[] = {
+0x00};
+static unsigned char symbol8_19_bits[] = {
+0x00};
+static unsigned char symbol8_20_bits[] = {
+0x00};
+static unsigned char symbol8_21_bits[] = {
+0x00};
+static unsigned char symbol8_22_bits[] = {
+0x00};
+static unsigned char symbol8_23_bits[] = {
+0x00};
+static unsigned char symbol8_24_bits[] = {
+0x00};
+static unsigned char symbol8_25_bits[] = {
+0x00};
+static unsigned char symbol8_26_bits[] = {
+0x00};
+static unsigned char symbol8_27_bits[] = {
+0x00};
+static unsigned char symbol8_28_bits[] = {
+0x00};
+static unsigned char symbol8_29_bits[] = {
+0x00};
+static unsigned char symbol8_30_bits[] = {
+0x00};
+static unsigned char symbol8_31_bits[] = {
+0x00};
+static unsigned char symbol8_32_bits[] = {
+0x00};
+static unsigned char symbol8_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x00, 0x01};
+static unsigned char symbol8_34_bits[] = {
+0x11, 0x11, 0x0e, 0x0a, 0x04, 0x04};
+static unsigned char symbol8_35_bits[] = {
+0x0a, 0x1f, 0x0a, 0x0a, 0x1f, 0x0a};
+static unsigned char symbol8_36_bits[] = {
+0x0f, 0x08, 0x08, 0x0e, 0x08, 0x0f};
+static unsigned char symbol8_37_bits[] = {
+0x13, 0x0b, 0x04, 0x1a, 0x19};
+static unsigned char symbol8_38_bits[] = {
+0x06, 0x0a, 0x04, 0x1f, 0x05, 0x1a};
+static unsigned char symbol8_39_bits[] = {
+0x03, 0x06, 0x04, 0x03};
+static unsigned char symbol8_40_bits[] = {
+0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02};
+static unsigned char symbol8_41_bits[] = {
+0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01};
+static unsigned char symbol8_42_bits[] = {
+0x02, 0x07, 0x05};
+static unsigned char symbol8_43_bits[] = {
+0x04, 0x04, 0x1f, 0x04, 0x04};
+static unsigned char symbol8_44_bits[] = {
+0x02, 0x02, 0x01};
+static unsigned char symbol8_45_bits[] = {
+0x1f};
+static unsigned char symbol8_46_bits[] = {
+0x01};
+static unsigned char symbol8_47_bits[] = {
+0x02, 0x02, 0x02, 0x01, 0x01, 0x01};
+static unsigned char symbol8_48_bits[] = {
+0x02, 0x05, 0x05, 0x05, 0x05, 0x02};
+static unsigned char symbol8_49_bits[] = {
+0x02, 0x03, 0x02, 0x02, 0x02, 0x07};
+static unsigned char symbol8_50_bits[] = {
+0x02, 0x05, 0x04, 0x02, 0x01, 0x07};
+static unsigned char symbol8_51_bits[] = {
+0x02, 0x05, 0x04, 0x06, 0x04, 0x03};
+static unsigned char symbol8_52_bits[] = {
+0x04, 0x06, 0x05, 0x0f, 0x04, 0x04};
+static unsigned char symbol8_53_bits[] = {
+0x07, 0x01, 0x03, 0x04, 0x04, 0x03};
+static unsigned char symbol8_54_bits[] = {
+0x06, 0x01, 0x03, 0x05, 0x05, 0x02};
+static unsigned char symbol8_55_bits[] = {
+0x07, 0x05, 0x04, 0x02, 0x02, 0x02};
+static unsigned char symbol8_56_bits[] = {
+0x02, 0x05, 0x02, 0x05, 0x05, 0x02};
+static unsigned char symbol8_57_bits[] = {
+0x02, 0x05, 0x05, 0x07, 0x04, 0x03};
+static unsigned char symbol8_58_bits[] = {
+0x01, 0x00, 0x00, 0x01};
+static unsigned char symbol8_59_bits[] = {
+0x02, 0x00, 0x00, 0x02, 0x02, 0x01};
+static unsigned char symbol8_60_bits[] = {
+0x18, 0x06, 0x03, 0x06, 0x18};
+static unsigned char symbol8_61_bits[] = {
+0x0f, 0x00, 0x0f};
+static unsigned char symbol8_62_bits[] = {
+0x03, 0x0c, 0x18, 0x0c, 0x03};
+static unsigned char symbol8_63_bits[] = {
+0x02, 0x05, 0x04, 0x02, 0x00, 0x02};
+static unsigned char symbol8_64_bits[] = {
+0x0a, 0x05, 0x00, 0x0f, 0x00, 0x0f};
+static unsigned char symbol8_65_bits[] = {
+0x04, 0x0e, 0x0a, 0x0e, 0x0a, 0x1b};
+static unsigned char symbol8_66_bits[] = {
+0x07, 0x0a, 0x06, 0x0a, 0x0a, 0x07};
+static unsigned char symbol8_67_bits[] = {
+0x11, 0x0a, 0x04, 0x04, 0x0a, 0x11};
+static unsigned char symbol8_68_bits[] = {
+0x04, 0x0a, 0x0a, 0x11, 0x11, 0x1f};
+static unsigned char symbol8_69_bits[] = {
+0x0f, 0x02, 0x0e, 0x02, 0x02, 0x0f};
+static unsigned char symbol8_70_bits[] = {
+0x0e, 0x04, 0x15, 0x15, 0x04, 0x0e};
+static unsigned char symbol8_71_bits[] = {
+0x0f, 0x0a, 0x02, 0x02, 0x02, 0x03};
+static unsigned char symbol8_72_bits[] = {
+0x1b, 0x12, 0x1e, 0x12, 0x12, 0x1b};
+static unsigned char symbol8_73_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x02, 0x03};
+static unsigned char symbol8_74_bits[] = {
+0x06, 0x0a, 0x1c, 0x0b, 0x0a, 0x06};
+static unsigned char symbol8_75_bits[] = {
+0x1b, 0x0a, 0x06, 0x06, 0x0a, 0x1b};
+static unsigned char symbol8_76_bits[] = {
+0x04, 0x0c, 0x12, 0x12, 0x12, 0x33};
+static unsigned char symbol8_77_bits[] = {
+0x63, 0x22, 0x36, 0x2a, 0x2a, 0x6b};
+static unsigned char symbol8_78_bits[] = {
+0x1b, 0x12, 0x16, 0x1e, 0x1a, 0x13};
+static unsigned char symbol8_79_bits[] = {
+0x0e, 0x1b, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char symbol8_80_bits[] = {
+0x3f, 0x12, 0x12, 0x12, 0x12, 0x1b};
+static unsigned char symbol8_81_bits[] = {
+0x0e, 0x1b, 0x15, 0x15, 0x1b, 0x0e};
+static unsigned char symbol8_82_bits[] = {
+0x07, 0x0a, 0x0a, 0x06, 0x02, 0x07};
+static unsigned char symbol8_83_bits[] = {
+0x0f, 0x09, 0x02, 0x02, 0x09, 0x0f};
+static unsigned char symbol8_84_bits[] = {
+0x0f, 0x0a, 0x02, 0x02, 0x02, 0x06};
+static unsigned char symbol8_85_bits[] = {
+0x1b, 0x12, 0x0a, 0x04, 0x04, 0x0e};
+static unsigned char symbol8_86_bits[] = {
+0x06, 0x01, 0x01, 0x02, 0x04, 0x02};
+static unsigned char symbol8_87_bits[] = {
+0x04, 0x0a, 0x11, 0x11, 0x0a, 0x1b};
+static unsigned char symbol8_88_bits[] = {
+0x0e, 0x00, 0x0e, 0x00, 0x11, 0x1f};
+static unsigned char symbol8_89_bits[] = {
+0x6b, 0x2a, 0x2a, 0x3e, 0x08, 0x1c};
+static unsigned char symbol8_90_bits[] = {
+0x0f, 0x09, 0x04, 0x02, 0x09, 0x0f};
+static unsigned char symbol8_91_bits[] = {
+0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03};
+static unsigned char symbol8_92_bits[] = {
+0x02, 0x00, 0x00, 0x09};
+static unsigned char symbol8_93_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03};
+static unsigned char symbol8_94_bits[] = {
+0x02, 0x02, 0x02, 0x02, 0x02, 0x0f};
+static unsigned char symbol8_95_bits[] = {
+0x0f};
+static unsigned char symbol8_96_bits[] = {
+0x1f};
+static unsigned char symbol8_97_bits[] = {
+0x0a, 0x0d, 0x05, 0x0a};
+static unsigned char symbol8_98_bits[] = {
+0x02, 0x05, 0x05, 0x03, 0x05, 0x05, 0x03, 0x01, 0x01};
+static unsigned char symbol8_99_bits[] = {
+0x0d, 0x05, 0x02, 0x02, 0x05, 0x0d};
+static unsigned char symbol8_100_bits[] = {
+0x02, 0x05, 0x01, 0x02, 0x05, 0x05, 0x03};
+static unsigned char symbol8_101_bits[] = {
+0x06, 0x07, 0x01, 0x06};
+static unsigned char symbol8_102_bits[] = {
+0x02, 0x02, 0x06, 0x0b, 0x0b, 0x06, 0x02, 0x02};
+static unsigned char symbol8_103_bits[] = {
+0x0a, 0x0b, 0x06, 0x04, 0x02, 0x02};
+static unsigned char symbol8_104_bits[] = {
+0x06, 0x0b, 0x0a, 0x0a, 0x08, 0x08};
+static unsigned char symbol8_105_bits[] = {
+0x03, 0x02, 0x02, 0x02};
+static unsigned char symbol8_106_bits[] = {
+0x05, 0x0b, 0x0b, 0x06, 0x02, 0x02};
+static unsigned char symbol8_107_bits[] = {
+0x0a, 0x0f, 0x06, 0x0a};
+static unsigned char symbol8_108_bits[] = {
+0x01, 0x03, 0x02, 0x04, 0x06, 0x09, 0x19};
+static unsigned char symbol8_109_bits[] = {
+0x05, 0x05, 0x05, 0x0b, 0x01, 0x03};
+static unsigned char symbol8_110_bits[] = {
+0x09, 0x09, 0x07, 0x02};
+static unsigned char symbol8_111_bits[] = {
+0x02, 0x05, 0x05, 0x02};
+static unsigned char symbol8_112_bits[] = {
+0x0f, 0x0a, 0x0a, 0x0b};
+static unsigned char symbol8_113_bits[] = {
+0x02, 0x05, 0x07, 0x05, 0x05, 0x02};
+static unsigned char symbol8_114_bits[] = {
+0x02, 0x05, 0x05, 0x03, 0x01, 0x01};
+static unsigned char symbol8_115_bits[] = {
+0x0e, 0x05, 0x05, 0x02};
+static unsigned char symbol8_116_bits[] = {
+0x07, 0x02, 0x02, 0x06};
+static unsigned char symbol8_117_bits[] = {
+0x0a, 0x0b, 0x0a, 0x06};
+static unsigned char symbol8_118_bits[] = {
+0x1f, 0x15, 0x15, 0x15, 0x1a};
+static unsigned char symbol8_119_bits[] = {
+0x11, 0x15, 0x15, 0x1a};
+static unsigned char symbol8_120_bits[] = {
+0x01, 0x07, 0x02, 0x06, 0x01, 0x01, 0x02, 0x04, 0x06};
+static unsigned char symbol8_121_bits[] = {
+0x15, 0x15, 0x15, 0x0e, 0x04, 0x04};
+static unsigned char symbol8_122_bits[] = {
+0x01, 0x07, 0x02, 0x01, 0x01, 0x01, 0x02, 0x04, 0x06};
+static unsigned char symbol8_123_bits[] = {
+0x04, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, 0x02, 0x04};
+static unsigned char symbol8_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_125_bits[] = {
+0x01, 0x02, 0x02, 0x02, 0x04, 0x02, 0x02, 0x02, 0x01};
+static unsigned char symbol8_126_bits[] = {
+0x0a, 0x05};
+static unsigned char symbol8_127_bits[] = {
+0x00};
+static unsigned char symbol8_128_bits[] = {
+0x00};
+static unsigned char symbol8_129_bits[] = {
+0x00};
+static unsigned char symbol8_130_bits[] = {
+0x00};
+static unsigned char symbol8_131_bits[] = {
+0x00};
+static unsigned char symbol8_132_bits[] = {
+0x00};
+static unsigned char symbol8_133_bits[] = {
+0x00};
+static unsigned char symbol8_134_bits[] = {
+0x00};
+static unsigned char symbol8_135_bits[] = {
+0x00};
+static unsigned char symbol8_136_bits[] = {
+0x00};
+static unsigned char symbol8_137_bits[] = {
+0x00};
+static unsigned char symbol8_138_bits[] = {
+0x00};
+static unsigned char symbol8_139_bits[] = {
+0x00};
+static unsigned char symbol8_140_bits[] = {
+0x00};
+static unsigned char symbol8_141_bits[] = {
+0x00};
+static unsigned char symbol8_142_bits[] = {
+0x00};
+static unsigned char symbol8_143_bits[] = {
+0x00};
+static unsigned char symbol8_144_bits[] = {
+0x00};
+static unsigned char symbol8_145_bits[] = {
+0x00};
+static unsigned char symbol8_146_bits[] = {
+0x00};
+static unsigned char symbol8_147_bits[] = {
+0x00};
+static unsigned char symbol8_148_bits[] = {
+0x00};
+static unsigned char symbol8_149_bits[] = {
+0x00};
+static unsigned char symbol8_150_bits[] = {
+0x00};
+static unsigned char symbol8_151_bits[] = {
+0x00};
+static unsigned char symbol8_152_bits[] = {
+0x00};
+static unsigned char symbol8_153_bits[] = {
+0x00};
+static unsigned char symbol8_154_bits[] = {
+0x00};
+static unsigned char symbol8_155_bits[] = {
+0x00};
+static unsigned char symbol8_156_bits[] = {
+0x00};
+static unsigned char symbol8_157_bits[] = {
+0x00};
+static unsigned char symbol8_158_bits[] = {
+0x00};
+static unsigned char symbol8_159_bits[] = {
+0x00};
+static unsigned char symbol8_160_bits[] = {
+0x00};
+static unsigned char symbol8_161_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol8_162_bits[] = {
+0x00, 0x00, 0x00};
+static unsigned char symbol8_163_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol8_164_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol8_165_bits[] = {
+0x00, 0x00, 0x00};
+static unsigned char symbol8_166_bits[] = {
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol8_167_bits[] = {
+0x00, 0x09, 0x05, 0x02, 0x02, 0x02};
+static unsigned char symbol8_168_bits[] = {
+0x02, 0x02, 0x02, 0x01, 0x0c, 0x02};
+static unsigned char symbol8_169_bits[] = {
+0x01, 0x0e, 0x00, 0x0f, 0x08, 0x04};
+static unsigned char symbol8_170_bits[] = {
+0x04, 0x02, 0x02, 0x02, 0x01, 0x0a};
+static unsigned char symbol8_171_bits[] = {
+0x15, 0x0a, 0x0c, 0x02, 0x07};
+static unsigned char symbol8_172_bits[] = {
+0x02, 0x02, 0x02, 0x02, 0x01};
+static unsigned char symbol8_173_bits[] = {
+0x06, 0x06, 0x0f, 0x0f, 0x02, 0x02, 0x04, 0x0e, 0x1f, 0x0f, 0x06};
+static unsigned char symbol8_174_bits[] = {
+0x02, 0x12, 0x1b, 0x1f, 0x0f};
+static unsigned char symbol8_175_bits[] = {
+0x06, 0x02, 0x04, 0x06, 0x0f, 0x0f, 0x0a, 0x02, 0x04, 0x02};
+static unsigned char symbol8_176_bits[] = {
+0x07, 0x02, 0x04};
+static unsigned char symbol8_177_bits[] = {
+0x04, 0x02, 0x1f, 0x02, 0x04, 0x04};
+static unsigned char symbol8_178_bits[] = {
+0x0e, 0x05, 0x04};
+static unsigned char symbol8_179_bits[] = {
+0x04, 0x04, 0x04, 0x04, 0x04, 0x04};
+static unsigned char symbol8_180_bits[] = {
+0x04, 0x00, 0x00, 0x0f};
+static unsigned char symbol8_181_bits[] = {
+0x00, 0x00, 0x04};
+static unsigned char symbol8_182_bits[] = {
+0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05};
+static unsigned char symbol8_183_bits[] = {
+0x06, 0x04, 0x02};
+static unsigned char symbol8_184_bits[] = {
+0x05, 0x02, 0x04, 0x04, 0x0f};
+static unsigned char symbol8_185_bits[] = {
+0x04, 0x04, 0x0f, 0x0a, 0x0a, 0x05, 0x03};
+static unsigned char symbol8_186_bits[] = {
+0x04, 0x08, 0x07, 0x00, 0x0f};
+static unsigned char symbol8_187_bits[] = {
+0x09, 0x06, 0x06, 0x09, 0x0a};
+static unsigned char symbol8_188_bits[] = {
+0x05};
+static unsigned char symbol8_189_bits[] = {
+0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00};
+static unsigned char symbol8_190_bits[] = {
+0x06};
+static unsigned char symbol8_191_bits[] = {
+0x00, 0x0f, 0x00, 0x06, 0x04};
+static unsigned char symbol8_192_bits[] = {
+0x04, 0x0f, 0x04, 0x0f, 0x02, 0x02};
+static unsigned char symbol8_193_bits[] = {
+0x0f, 0x00, 0x0f, 0x00, 0x0f, 0x0a, 0x05};
+static unsigned char symbol8_194_bits[] = {
+0x00, 0x0a, 0x05, 0x15, 0x01, 0x01, 0x01};
+static unsigned char symbol8_195_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_196_bits[] = {
+0x01, 0x1f, 0x10, 0x10, 0x12, 0x1f};
+static unsigned char symbol8_197_bits[] = {
+0x02, 0x1b, 0x12, 0x16, 0x1e, 0x1b};
+static unsigned char symbol8_198_bits[] = {
+0x13, 0x1e, 0x11, 0x09, 0x08, 0x10, 0x13, 0x1e};
+static unsigned char symbol8_199_bits[] = {
+0x1a, 0x05, 0x05, 0x1c};
+static unsigned char symbol8_200_bits[] = {
+0x14, 0x16, 0x13, 0x02};
+static unsigned char symbol8_201_bits[] = {
+0x19, 0x15, 0x13, 0x0e};
+static unsigned char symbol8_202_bits[] = {
+0x03, 0x02, 0x0e, 0x1b, 0x15, 0x15};
+static unsigned char symbol8_203_bits[] = {
+0x1b, 0x0e, 0x0e, 0x15, 0x1f, 0x15};
+static unsigned char symbol8_204_bits[] = {
+0x15, 0x0e, 0x10, 0x0e};
+static unsigned char symbol8_205_bits[] = {
+0x19, 0x15, 0x15, 0x13, 0x0e, 0x01};
+static unsigned char symbol8_206_bits[] = {
+0x0e, 0x01, 0x01, 0x01};
+static unsigned char symbol8_207_bits[] = {
+0x01, 0x01, 0x01, 0x0e, 0x0f, 0x00};
+static unsigned char symbol8_208_bits[] = {
+0x10, 0x0f, 0x0f, 0x10, 0x10};
+static unsigned char symbol8_209_bits[] = {
+0x0f, 0x00, 0x1f, 0x10, 0x1e, 0x09};
+static unsigned char symbol8_210_bits[] = {
+0x05, 0x1e, 0x02, 0x1e, 0x01, 0x01, 0x1e};
+static unsigned char symbol8_211_bits[] = {
+0x1e, 0x01, 0x01, 0x1e, 0x00, 0x1f, 0x0e};
+static unsigned char symbol8_212_bits[] = {
+0x0f, 0x01, 0x0e, 0x04};
+static unsigned char symbol8_213_bits[] = {
+0x0e, 0x0f, 0x03, 0x0e, 0x02, 0x10, 0x08, 0x04};
+static unsigned char symbol8_214_bits[] = {
+0x02, 0x1f, 0x1f, 0x11, 0x11, 0x0a, 0x0e, 0x04};
+static unsigned char symbol8_215_bits[] = {
+0x00};
+static unsigned char symbol8_216_bits[] = {
+0x13, 0x1d, 0x0d};
+static unsigned char symbol8_217_bits[] = {
+0x05, 0x03, 0x0e, 0x0e};
+static unsigned char symbol8_218_bits[] = {
+0x01, 0x0d, 0x05, 0x0d};
+static unsigned char symbol8_219_bits[] = {
+0x11, 0x0e, 0x3f, 0x5a};
+static unsigned char symbol8_220_bits[] = {
+0x5a, 0x5a, 0x3f, 0x12};
+static unsigned char symbol8_221_bits[] = {
+0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x00, 0x00};
+static unsigned char symbol8_222_bits[] = {
+0x08, 0x08, 0x05, 0x05};
+static unsigned char symbol8_223_bits[] = {
+0x02, 0x02, 0x01, 0x0f, 0x00, 0x00, 0x04, 0x0a};
+static unsigned char symbol8_224_bits[] = {
+0x09, 0x09, 0x09, 0x09, 0x05, 0x02};
+static unsigned char symbol8_225_bits[] = {
+0x00, 0x02, 0x03, 0x00, 0x00, 0x03, 0x02, 0x00};
+static unsigned char symbol8_226_bits[] = {
+0x02, 0x06, 0x0f, 0x06, 0x06, 0x06, 0x06};
+static unsigned char symbol8_227_bits[] = {
+0x06, 0x10, 0x1f, 0x1f, 0x10, 0x06, 0x06};
+static unsigned char symbol8_228_bits[] = {
+0x06, 0x06, 0x06, 0x0f};
+static unsigned char symbol8_229_bits[] = {
+0x06, 0x02, 0x04, 0x0a, 0x13, 0x13, 0x0a, 0x04};
+static unsigned char symbol8_230_bits[] = {
+0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x01, 0x01};
+static unsigned char symbol8_231_bits[] = {
+0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00};
+static unsigned char symbol8_232_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x03, 0x01, 0x02, 0x02, 0x00, 0x02, 0x01};
+static unsigned char symbol8_233_bits[] = {
+0x07, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_234_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_235_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_236_bits[] = {
+0x02, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_237_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_238_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_239_bits[] = {
+0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_240_bits[] = {
+0x00};
+static unsigned char symbol8_241_bits[] = {
+0x01, 0x02, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02};
+static unsigned char symbol8_242_bits[] = {
+0x02, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_243_bits[] = {
+0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_244_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol8_245_bits[] = {
+0x01, 0x01, 0x04, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char symbol8_246_bits[] = {
+0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_247_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_248_bits[] = {
+0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+static unsigned char symbol8_249_bits[] = {
+0x03, 0x03, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char symbol8_250_bits[] = {
+0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_251_bits[] = {
+0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char symbol8_252_bits[] = {
+0x02, 0x01, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char symbol8_253_bits[] = {
+0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char symbol8_254_bits[] = {
+0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char symbol8_255_bits[] = {
+0x00};
+static RotFont symbol8font[] = {
+{5, 1, 1, symbol8_0_bits},
+{5, 1, 1, symbol8_1_bits},
+{5, 1, 1, symbol8_2_bits},
+{5, 1, 1, symbol8_3_bits},
+{5, 1, 1, symbol8_4_bits},
+{5, 1, 1, symbol8_5_bits},
+{5, 1, 1, symbol8_6_bits},
+{5, 1, 1, symbol8_7_bits},
+{5, 1, 1, symbol8_8_bits},
+{5, 1, 1, symbol8_9_bits},
+{5, 1, 1, symbol8_10_bits},
+{5, 1, 1, symbol8_11_bits},
+{5, 1, 1, symbol8_12_bits},
+{5, 1, 1, symbol8_13_bits},
+{5, 1, 1, symbol8_14_bits},
+{5, 1, 1, symbol8_15_bits},
+{5, 1, 1, symbol8_16_bits},
+{5, 1, 1, symbol8_17_bits},
+{5, 1, 1, symbol8_18_bits},
+{5, 1, 1, symbol8_19_bits},
+{5, 1, 1, symbol8_20_bits},
+{5, 1, 1, symbol8_21_bits},
+{5, 1, 1, symbol8_22_bits},
+{5, 1, 1, symbol8_23_bits},
+{5, 1, 1, symbol8_24_bits},
+{5, 1, 1, symbol8_25_bits},
+{5, 1, 1, symbol8_26_bits},
+{5, 1, 1, symbol8_27_bits},
+{5, 1, 1, symbol8_28_bits},
+{5, 1, 1, symbol8_29_bits},
+{5, 1, 1, symbol8_30_bits},
+{5, 1, 1, symbol8_31_bits},
+{1, 1, 1, symbol8_32_bits},
+{1, 6, 6, symbol8_33_bits},
+{5, 6, 6, symbol8_34_bits},
+{5, 6, 6, symbol8_35_bits},
+{4, 6, 6, symbol8_36_bits},
+{5, 5, 5, symbol8_37_bits},
+{5, 6, 6, symbol8_38_bits},
+{3, 4, 4, symbol8_39_bits},
+{2, 8, 6, symbol8_40_bits},
+{2, 8, 6, symbol8_41_bits},
+{3, 3, 5, symbol8_42_bits},
+{5, 5, 5, symbol8_43_bits},
+{2, 3, 1, symbol8_44_bits},
+{5, 1, 3, symbol8_45_bits},
+{1, 1, 1, symbol8_46_bits},
+{2, 6, 6, symbol8_47_bits},
+{3, 6, 6, symbol8_48_bits},
+{3, 6, 6, symbol8_49_bits},
+{3, 6, 6, symbol8_50_bits},
+{3, 6, 6, symbol8_51_bits},
+{4, 6, 6, symbol8_52_bits},
+{3, 6, 6, symbol8_53_bits},
+{3, 6, 6, symbol8_54_bits},
+{3, 6, 6, symbol8_55_bits},
+{3, 6, 6, symbol8_56_bits},
+{3, 6, 6, symbol8_57_bits},
+{1, 4, 4, symbol8_58_bits},
+{2, 6, 4, symbol8_59_bits},
+{5, 5, 5, symbol8_60_bits},
+{4, 3, 4, symbol8_61_bits},
+{5, 5, 5, symbol8_62_bits},
+{3, 6, 6, symbol8_63_bits},
+{4, 6, 6, symbol8_64_bits},
+{5, 6, 6, symbol8_65_bits},
+{4, 6, 6, symbol8_66_bits},
+{5, 6, 6, symbol8_67_bits},
+{5, 6, 6, symbol8_68_bits},
+{4, 6, 6, symbol8_69_bits},
+{5, 6, 6, symbol8_70_bits},
+{4, 6, 6, symbol8_71_bits},
+{5, 6, 6, symbol8_72_bits},
+{2, 6, 6, symbol8_73_bits},
+{5, 6, 6, symbol8_74_bits},
+{5, 6, 6, symbol8_75_bits},
+{6, 6, 6, symbol8_76_bits},
+{7, 6, 6, symbol8_77_bits},
+{5, 6, 6, symbol8_78_bits},
+{5, 6, 6, symbol8_79_bits},
+{6, 6, 6, symbol8_80_bits},
+{5, 6, 6, symbol8_81_bits},
+{4, 6, 6, symbol8_82_bits},
+{4, 6, 6, symbol8_83_bits},
+{4, 6, 6, symbol8_84_bits},
+{5, 6, 6, symbol8_85_bits},
+{3, 6, 4, symbol8_86_bits},
+{5, 6, 6, symbol8_87_bits},
+{5, 6, 6, symbol8_88_bits},
+{7, 6, 6, symbol8_89_bits},
+{4, 6, 6, symbol8_90_bits},
+{2, 8, 6, symbol8_91_bits},
+{4, 4, 4, symbol8_92_bits},
+{2, 8, 6, symbol8_93_bits},
+{4, 6, 6, symbol8_94_bits},
+{4, 1, -1, symbol8_95_bits},
+{5, 1, 8, symbol8_96_bits},
+{4, 4, 4, symbol8_97_bits},
+{3, 9, 7, symbol8_98_bits},
+{4, 6, 4, symbol8_99_bits},
+{3, 7, 7, symbol8_100_bits},
+{3, 4, 4, symbol8_101_bits},
+{4, 8, 6, symbol8_102_bits},
+{4, 6, 4, symbol8_103_bits},
+{4, 6, 4, symbol8_104_bits},
+{2, 4, 4, symbol8_105_bits},
+{4, 6, 4, symbol8_106_bits},
+{4, 4, 4, symbol8_107_bits},
+{5, 7, 7, symbol8_108_bits},
+{4, 6, 4, symbol8_109_bits},
+{4, 4, 4, symbol8_110_bits},
+{3, 4, 4, symbol8_111_bits},
+{4, 4, 4, symbol8_112_bits},
+{3, 6, 6, symbol8_113_bits},
+{3, 6, 4, symbol8_114_bits},
+{4, 4, 4, symbol8_115_bits},
+{3, 4, 4, symbol8_116_bits},
+{4, 4, 4, symbol8_117_bits},
+{5, 5, 5, symbol8_118_bits},
+{5, 4, 4, symbol8_119_bits},
+{3, 9, 7, symbol8_120_bits},
+{5, 6, 4, symbol8_121_bits},
+{3, 9, 7, symbol8_122_bits},
+{3, 9, 7, symbol8_123_bits},
+{1, 8, 6, symbol8_124_bits},
+{3, 9, 7, symbol8_125_bits},
+{4, 2, 3, symbol8_126_bits},
+{5, 1, 1, symbol8_127_bits},
+{5, 1, 1, symbol8_128_bits},
+{5, 1, 1, symbol8_129_bits},
+{5, 1, 1, symbol8_130_bits},
+{5, 1, 1, symbol8_131_bits},
+{5, 1, 1, symbol8_132_bits},
+{5, 1, 1, symbol8_133_bits},
+{5, 1, 1, symbol8_134_bits},
+{5, 1, 1, symbol8_135_bits},
+{5, 1, 1, symbol8_136_bits},
+{5, 1, 1, symbol8_137_bits},
+{5, 1, 1, symbol8_138_bits},
+{5, 1, 1, symbol8_139_bits},
+{5, 1, 1, symbol8_140_bits},
+{5, 1, 1, symbol8_141_bits},
+{5, 1, 1, symbol8_142_bits},
+{5, 1, 1, symbol8_143_bits},
+{5, 1, 1, symbol8_144_bits},
+{5, 1, 1, symbol8_145_bits},
+{5, 1, 1, symbol8_146_bits},
+{5, 1, 1, symbol8_147_bits},
+{5, 1, 1, symbol8_148_bits},
+{5, 1, 1, symbol8_149_bits},
+{5, 1, 1, symbol8_150_bits},
+{5, 1, 1, symbol8_151_bits},
+{5, 1, 1, symbol8_152_bits},
+{5, 1, 1, symbol8_153_bits},
+{5, 1, 1, symbol8_154_bits},
+{5, 1, 1, symbol8_155_bits},
+{5, 1, 1, symbol8_156_bits},
+{5, 1, 1, symbol8_157_bits},
+{5, 1, 1, symbol8_158_bits},
+{5, 1, 1, symbol8_159_bits},
+{5, 1, 1, symbol8_160_bits},
+{5, 6, 6, symbol8_161_bits},
+{2, 3, 7, symbol8_162_bits},
+{4, 6, 6, symbol8_163_bits},
+{4, 7, 7, symbol8_164_bits},
+{5, 3, 4, symbol8_165_bits},
+{4, 8, 6, symbol8_166_bits},
+{4, 6, 5, symbol8_167_bits},
+{5, 6, 5, symbol8_168_bits},
+{5, 6, 5, symbol8_169_bits},
+{4, 6, 6, symbol8_170_bits},
+{8, 5, 5, symbol8_171_bits},
+{8, 5, 5, symbol8_172_bits},
+{5, 11, 8, symbol8_173_bits},
+{8, 5, 5, symbol8_174_bits},
+{5, 10, 8, symbol8_175_bits},
+{3, 3, 6, symbol8_176_bits},
+{5, 6, 6, symbol8_177_bits},
+{4, 3, 7, symbol8_178_bits},
+{4, 6, 6, symbol8_179_bits},
+{4, 4, 4, symbol8_180_bits},
+{5, 3, 4, symbol8_181_bits},
+{3, 7, 7, symbol8_182_bits},
+{3, 3, 4, symbol8_183_bits},
+{4, 5, 5, symbol8_184_bits},
+{4, 7, 5, symbol8_185_bits},
+{4, 5, 5, symbol8_186_bits},
+{4, 5, 5, symbol8_187_bits},
+{5, 1, 1, symbol8_188_bits},
+{1, 11, 8, symbol8_189_bits},
+{8, 1, 3, symbol8_190_bits},
+{5, 5, 5, symbol8_191_bits},
+{5, 6, 6, symbol8_192_bits},
+{5, 7, 7, symbol8_193_bits},
+{6, 7, 7, symbol8_194_bits},
+{5, 7, 5, symbol8_195_bits},
+{5, 6, 6, symbol8_196_bits},
+{5, 6, 6, symbol8_197_bits},
+{5, 8, 7, symbol8_198_bits},
+{5, 4, 4, symbol8_199_bits},
+{5, 4, 4, symbol8_200_bits},
+{5, 4, 4, symbol8_201_bits},
+{5, 6, 4, symbol8_202_bits},
+{5, 6, 5, symbol8_203_bits},
+{5, 4, 4, symbol8_204_bits},
+{5, 6, 4, symbol8_205_bits},
+{4, 4, 4, symbol8_206_bits},
+{4, 6, 5, symbol8_207_bits},
+{5, 5, 5, symbol8_208_bits},
+{5, 6, 6, symbol8_209_bits},
+{5, 7, 6, symbol8_210_bits},
+{5, 7, 6, symbol8_211_bits},
+{8, 4, 6, symbol8_212_bits},
+{6, 8, 7, symbol8_213_bits},
+{5, 8, 8, symbol8_214_bits},
+{1, 1, 3, symbol8_215_bits},
+{5, 3, 3, symbol8_216_bits},
+{4, 4, 4, symbol8_217_bits},
+{4, 4, 4, symbol8_218_bits},
+{8, 4, 4, symbol8_219_bits},
+{7, 4, 4, symbol8_220_bits},
+{4, 8, 8, symbol8_221_bits},
+{7, 4, 4, symbol8_222_bits},
+{4, 8, 8, symbol8_223_bits},
+{5, 6, 6, symbol8_224_bits},
+{2, 8, 6, symbol8_225_bits},
+{5, 7, 6, symbol8_226_bits},
+{5, 7, 6, symbol8_227_bits},
+{6, 4, 6, symbol8_228_bits},
+{5, 8, 7, symbol8_229_bits},
+{2, 11, 8, symbol8_230_bits},
+{1, 11, 8, symbol8_231_bits},
+{2, 11, 8, symbol8_232_bits},
+{3, 11, 8, symbol8_233_bits},
+{1, 11, 8, symbol8_234_bits},
+{2, 11, 8, symbol8_235_bits},
+{2, 11, 8, symbol8_236_bits},
+{2, 11, 8, symbol8_237_bits},
+{2, 11, 8, symbol8_238_bits},
+{1, 11, 8, symbol8_239_bits},
+{5, 1, 1, symbol8_240_bits},
+{2, 8, 6, symbol8_241_bits},
+{3, 11, 8, symbol8_242_bits},
+{3, 11, 8, symbol8_243_bits},
+{1, 11, 8, symbol8_244_bits},
+{3, 11, 8, symbol8_245_bits},
+{2, 11, 8, symbol8_246_bits},
+{1, 11, 8, symbol8_247_bits},
+{2, 11, 8, symbol8_248_bits},
+{2, 11, 8, symbol8_249_bits},
+{1, 11, 8, symbol8_250_bits},
+{2, 11, 8, symbol8_251_bits},
+{2, 11, 8, symbol8_252_bits},
+{2, 11, 8, symbol8_253_bits},
+{2, 11, 8, symbol8_254_bits},
+{5, 1, 1, symbol8_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times12.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times12.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times12.bdf	(revision 15879)
@@ -0,0 +1,2973 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Times-Medium-R-Normal--12-120-75-75-P-64-ISO8859-1
+SIZE 12 75 75
+FONTBOUNDINGBOX 12 15 0 -3
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Times"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 12
+POINT_SIZE 120
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 64
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 9
+X_HEIGHT 6
+FACE_NAME "Times Roman"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "Times is a trademark of Linotype-Hell AG and/or its subsidiaries."
+_DEC_DEVICE_FONTNAMES "PS=Times-Roman"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Times Roman"
+FONT "-Adobe-Times-Medium-R-Normal--12-120-75-75-P-64-ISO8859-1"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 7
+DEFAULT_CHAR 32
+FONT_ASCENT 11
+FONT_DESCENT 3
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 9 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+00
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 3 1 6
+BITMAP
+a0
+a0
+a0
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+50
+50
+f8
+50
+50
+f8
+50
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 11 0 -1
+BITMAP
+20
+70
+a8
+a0
+60
+30
+28
+28
+a8
+70
+20
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 8 9 1 0
+BITMAP
+63
+9e
+94
+68
+10
+36
+29
+49
+46
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+1800
+2400
+2400
+1b80
+7900
+ce00
+8400
+ce80
+7b00
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 2 3 1 6
+BITMAP
+c0
+40
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 12 1 -3
+BITMAP
+20
+40
+40
+80
+80
+80
+80
+80
+80
+40
+40
+20
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 12 0 -3
+BITMAP
+80
+40
+40
+20
+20
+20
+20
+20
+20
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 5 0 4
+BITMAP
+20
+a8
+70
+a8
+20
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+20
+20
+f8
+20
+20
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 3 0 -2
+BITMAP
+40
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 1 1 3
+BITMAP
+f8
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 1 1 0
+BITMAP
+80
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 9 0 0
+BITMAP
+20
+20
+20
+40
+40
+40
+80
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+d8
+88
+88
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 9 0 0
+BITMAP
+20
+60
+a0
+20
+20
+20
+20
+20
+70
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+88
+08
+08
+10
+20
+40
+88
+f8
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+88
+08
+10
+70
+08
+08
+88
+70
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+10
+30
+30
+50
+50
+90
+f8
+10
+10
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+38
+40
+40
+70
+18
+08
+08
+98
+70
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+18
+60
+40
+f0
+98
+88
+88
+c8
+70
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+f8
+88
+10
+10
+20
+20
+40
+40
+40
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+88
+88
+c8
+70
+98
+88
+88
+70
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+70
+98
+88
+88
+c8
+78
+10
+30
+c0
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 6 1 0
+BITMAP
+80
+00
+00
+00
+00
+80
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 8 0 -2
+BITMAP
+40
+00
+00
+00
+00
+40
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 0 1
+BITMAP
+0c
+30
+c0
+30
+0c
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 3 1 2
+BITMAP
+f8
+00
+f8
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 5 1 1
+BITMAP
+c0
+30
+0c
+30
+c0
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 9 0 0
+BITMAP
+60
+90
+10
+20
+40
+40
+40
+00
+40
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 10 11 1 -2
+BITMAP
+0f00
+3080
+6040
+4d40
+9240
+a240
+a480
+a480
+9b00
+4000
+3e00
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+0800
+0800
+1400
+1400
+2200
+3e00
+2200
+4100
+e380
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+fc
+46
+42
+46
+7c
+42
+42
+46
+fc
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+3a
+66
+42
+80
+80
+80
+42
+66
+3c
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 1 0
+BITMAP
+fc
+46
+42
+41
+41
+41
+42
+46
+fc
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+fe
+42
+40
+44
+7c
+44
+40
+42
+fe
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+BITMAP
+fe
+42
+40
+44
+7c
+44
+40
+40
+f0
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+3a
+66
+42
+80
+87
+82
+42
+66
+3c
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+e7
+42
+42
+42
+7e
+42
+42
+42
+e7
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 9 0 0
+BITMAP
+e0
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 9 1 0
+BITMAP
+70
+20
+20
+20
+20
+20
+20
+a0
+c0
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+ee
+44
+48
+50
+70
+58
+4c
+46
+e7
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 0 0
+BITMAP
+e0
+40
+40
+40
+40
+40
+40
+44
+fc
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 11 9 0 0
+BITMAP
+c060
+60c0
+60c0
+5140
+5140
+4a40
+4a40
+4440
+e4e0
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+c380
+6100
+6100
+5100
+4900
+4900
+4500
+4300
+e100
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+3c
+66
+42
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+BITMAP
+fc
+46
+42
+46
+7c
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 11 0 -2
+BITMAP
+3c
+66
+42
+81
+81
+81
+42
+66
+3c
+0c
+03
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 8 9 0 0
+BITMAP
+fc
+46
+42
+46
+7c
+48
+44
+42
+e3
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 9 0 0
+BITMAP
+74
+8c
+84
+60
+38
+0c
+84
+cc
+b8
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+BITMAP
+fe
+92
+10
+10
+10
+10
+10
+10
+38
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 1 0
+BITMAP
+e7
+42
+42
+42
+42
+42
+42
+66
+3c
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+e380
+4100
+2200
+2200
+1400
+1400
+1c00
+0800
+0800
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 960 0
+DWIDTH 12 0
+BBX 12 9 0 0
+BITMAP
+ee70
+4420
+6620
+2240
+3740
+1540
+1980
+0880
+0880
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 1 0
+BITMAP
+e7
+42
+24
+38
+18
+2c
+24
+42
+e7
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+e380
+4100
+2200
+1200
+1c00
+0800
+0800
+0800
+1c00
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+fe
+86
+0c
+18
+30
+60
+c0
+82
+fe
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 12 1 -3
+BITMAP
+e0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+e0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 9 0 0
+BITMAP
+80
+80
+80
+40
+40
+40
+20
+20
+20
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 12 0 -3
+BITMAP
+e0
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+e0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 5 0 4
+BITMAP
+20
+50
+50
+88
+88
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 1 0 -3
+BITMAP
+fc
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 2 3 1 6
+BITMAP
+40
+80
+c0
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+60
+90
+70
+90
+90
+68
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+c0
+40
+40
+70
+48
+48
+48
+48
+70
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 6 1 0
+BITMAP
+60
+90
+80
+80
+90
+60
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+30
+10
+10
+70
+90
+90
+90
+90
+68
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+60
+90
+f0
+80
+c8
+70
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 9 0 0
+BITMAP
+20
+40
+40
+e0
+40
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 -3
+BITMAP
+78
+90
+90
+e0
+40
+70
+88
+88
+70
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 0
+BITMAP
+c0
+40
+40
+70
+48
+48
+48
+48
+ec
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 9 0 0
+BITMAP
+40
+00
+00
+c0
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 2 12 0 -3
+BITMAP
+40
+00
+00
+c0
+40
+40
+40
+40
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 0
+BITMAP
+c0
+40
+40
+48
+50
+60
+50
+48
+4c
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 9 0 0
+BITMAP
+c0
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 6 0 0
+BITMAP
+b600
+4900
+4900
+4900
+4900
+ed80
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 6 0 0
+BITMAP
+b0
+48
+48
+48
+48
+ec
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 6 1 0
+BITMAP
+60
+90
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 -3
+BITMAP
+f0
+48
+48
+48
+48
+70
+40
+40
+e0
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 -3
+BITMAP
+70
+90
+90
+90
+90
+70
+10
+10
+38
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 6 0 0
+BITMAP
+b0
+60
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 6 1 0
+BITMAP
+70
+90
+c0
+30
+90
+e0
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 7 0 0
+BITMAP
+40
+f0
+40
+40
+40
+40
+30
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 6 0 0
+BITMAP
+d8
+48
+48
+48
+48
+34
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 6 0 0
+BITMAP
+cc
+48
+58
+50
+30
+20
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 6 0 0
+BITMAP
+ed80
+4900
+6b00
+2a00
+3400
+2400
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 6 1 0
+BITMAP
+d8
+50
+20
+20
+50
+d8
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 -3
+BITMAP
+cc
+48
+58
+50
+30
+20
+20
+40
+c0
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 6 1 0
+BITMAP
+f0
+90
+20
+40
+90
+f0
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 12 1 -3
+BITMAP
+30
+40
+40
+40
+40
+80
+40
+40
+40
+40
+40
+30
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 9 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 12 0 -3
+BITMAP
+c0
+20
+20
+20
+20
+10
+20
+20
+20
+20
+20
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 2 0 3
+BITMAP
+64
+98
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 1 9 1 -3
+BITMAP
+80
+00
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 8 1 -1
+BITMAP
+08
+70
+98
+a0
+a0
+c8
+70
+80
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+30
+48
+40
+40
+f0
+40
+40
+e8
+d8
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 7 1 1
+BITMAP
+84
+78
+48
+48
+48
+78
+84
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 0 0
+BITMAP
+88
+88
+50
+50
+f8
+20
+f8
+20
+70
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 9 1 0
+BITMAP
+80
+80
+80
+00
+00
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 12 1 -3
+BITMAP
+70
+90
+c0
+60
+b0
+90
+90
+d0
+60
+30
+90
+e0
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 1 0 7
+BITMAP
+a0
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 800 0
+DWIDTH 10 0
+BBX 9 9 1 0
+BITMAP
+1c00
+6300
+5d00
+a480
+a080
+a480
+5d00
+6300
+1c00
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 6 1 3
+BITMAP
+c0
+20
+e0
+a0
+00
+e0
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 0
+BITMAP
+28
+50
+a0
+50
+28
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 6 4 1 1
+BITMAP
+fc
+04
+04
+04
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 1 0 3
+BITMAP
+f0
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+1c00
+6300
+5d00
+9280
+9c80
+9480
+d500
+6300
+3c00
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 1 0 7
+BITMAP
+f0
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 4 0 5
+BITMAP
+60
+90
+90
+60
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+20
+20
+f8
+20
+20
+00
+f8
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 4 5 0 4
+BITMAP
+60
+90
+20
+40
+f0
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 5 0 4
+BITMAP
+e0
+20
+40
+20
+c0
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 2 2 1 7
+BITMAP
+40
+80
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 -3
+BITMAP
+d8
+48
+48
+48
+48
+74
+40
+40
+60
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 6 12 0 -3
+BITMAP
+7c
+e8
+e8
+e8
+e8
+68
+28
+28
+28
+28
+28
+28
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 1 1 1 3
+BITMAP
+80
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 3 0 -3
+BITMAP
+40
+20
+e0
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 5 0 4
+BITMAP
+40
+c0
+40
+40
+e0
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 3 6 1 3
+BITMAP
+40
+a0
+a0
+40
+00
+e0
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 0 0
+BITMAP
+a0
+50
+28
+50
+a0
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+4200
+c400
+4400
+4800
+e900
+1300
+1500
+2780
+2100
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+4200
+c400
+4400
+4800
+eb00
+1480
+1100
+2200
+2780
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+e200
+2400
+4400
+2800
+c900
+1300
+1500
+2780
+2100
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 9 0 -3
+BITMAP
+20
+00
+20
+20
+20
+40
+80
+90
+60
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+1000
+0800
+0000
+0800
+0800
+1400
+1400
+2200
+3e00
+2200
+4100
+e380
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+0400
+0800
+0000
+0800
+0800
+1400
+1400
+2200
+3e00
+2200
+4100
+e380
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+0800
+1400
+0000
+0800
+0800
+1400
+1400
+2200
+3e00
+2200
+4100
+e380
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+0a00
+1400
+0000
+0800
+0800
+1400
+1400
+2200
+3e00
+2200
+4100
+e380
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 11 0 0
+BITMAP
+1400
+0000
+0800
+0800
+1400
+1400
+2200
+3e00
+2200
+4100
+e380
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+0800
+1400
+0800
+0800
+0800
+1400
+1400
+2200
+3e00
+2200
+4100
+e380
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 880 0
+DWIDTH 11 0
+BBX 10 9 0 0
+BITMAP
+3fc0
+1840
+2800
+2880
+4f80
+7880
+4800
+8840
+cfc0
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 12 0 -3
+BITMAP
+3a
+66
+42
+80
+80
+80
+42
+66
+3c
+10
+08
+38
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 12 0 0
+BITMAP
+20
+10
+00
+fe
+42
+40
+44
+7c
+44
+40
+42
+fe
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 12 0 0
+BITMAP
+08
+10
+00
+fe
+42
+40
+44
+7c
+44
+40
+42
+fe
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 12 0 0
+BITMAP
+10
+28
+00
+fe
+42
+40
+44
+7c
+44
+40
+42
+fe
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 7 11 0 0
+BITMAP
+28
+00
+fe
+42
+40
+44
+7c
+44
+40
+42
+fe
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 12 0 0
+BITMAP
+80
+40
+00
+e0
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 12 0 0
+BITMAP
+20
+40
+00
+e0
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 12 0 0
+BITMAP
+40
+a0
+00
+e0
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 320 0
+DWIDTH 4 0
+BBX 3 11 0 0
+BITMAP
+a0
+00
+e0
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+fc
+46
+42
+41
+e1
+41
+42
+46
+fc
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+0a00
+1400
+0000
+c380
+6100
+6100
+5100
+4900
+4900
+4500
+4300
+e100
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+20
+10
+00
+3c
+66
+42
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+04
+08
+00
+3c
+66
+42
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+10
+28
+00
+3c
+66
+42
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+14
+28
+00
+3c
+66
+42
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 11 0 0
+BITMAP
+24
+00
+3c
+66
+42
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+88
+50
+20
+50
+88
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 10 0 0
+BITMAP
+0080
+3d00
+6600
+4600
+8900
+8900
+9100
+6200
+6600
+bc00
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 8 12 0 0
+BITMAP
+10
+08
+00
+e7
+42
+42
+42
+42
+42
+42
+66
+3c
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 8 12 0 0
+BITMAP
+04
+08
+00
+e7
+42
+42
+42
+42
+42
+42
+66
+3c
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 8 12 0 0
+BITMAP
+10
+28
+00
+e7
+42
+42
+42
+42
+42
+42
+66
+3c
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 640 0
+DWIDTH 8 0
+BBX 8 11 0 0
+BITMAP
+24
+00
+e7
+42
+42
+42
+42
+42
+42
+66
+3c
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+0400
+0800
+0000
+e380
+4100
+2200
+1200
+1c00
+0800
+0800
+0800
+1c00
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 7 9 0 0
+BITMAP
+e0
+40
+7c
+46
+42
+46
+7c
+40
+e0
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 0
+BITMAP
+30
+48
+48
+50
+70
+48
+44
+44
+d8
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+40
+20
+00
+60
+90
+70
+90
+90
+68
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+10
+20
+00
+60
+90
+70
+90
+90
+68
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+20
+50
+00
+60
+90
+70
+90
+90
+68
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+50
+a0
+00
+60
+90
+70
+90
+90
+68
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 8 1 0
+BITMAP
+50
+00
+60
+90
+70
+90
+90
+68
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+20
+50
+20
+60
+90
+70
+90
+90
+68
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 720 0
+DWIDTH 9 0
+BBX 8 6 1 0
+BITMAP
+6c
+92
+7e
+90
+99
+6e
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 400 0
+DWIDTH 5 0
+BBX 4 9 1 -3
+BITMAP
+60
+90
+80
+80
+90
+60
+40
+20
+e0
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+40
+20
+00
+60
+90
+f0
+80
+c8
+70
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+20
+40
+00
+60
+90
+f0
+80
+c8
+70
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 9 1 0
+BITMAP
+20
+50
+00
+60
+90
+f0
+80
+c8
+70
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 8 1 0
+BITMAP
+50
+00
+60
+90
+f0
+80
+c8
+70
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 9 0 0
+BITMAP
+80
+40
+00
+c0
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 9 0 0
+BITMAP
+40
+80
+00
+c0
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 9 0 0
+BITMAP
+40
+a0
+00
+c0
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 240 0
+DWIDTH 3 0
+BBX 3 8 0 0
+BITMAP
+a0
+00
+c0
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 9 1 0
+BITMAP
+40
+70
+a0
+70
+90
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 0
+BITMAP
+28
+50
+00
+b0
+48
+48
+48
+48
+ec
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 9 1 0
+BITMAP
+40
+20
+00
+60
+90
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 9 1 0
+BITMAP
+20
+40
+00
+60
+90
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 9 1 0
+BITMAP
+20
+50
+00
+60
+90
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 9 1 0
+BITMAP
+50
+a0
+00
+60
+90
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 4 8 1 0
+BITMAP
+a0
+00
+60
+90
+90
+90
+90
+60
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 560 0
+DWIDTH 7 0
+BBX 5 5 1 1
+BITMAP
+20
+00
+f8
+00
+20
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 7 0 -1
+BITMAP
+34
+48
+48
+48
+48
+70
+80
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 0
+BITMAP
+20
+10
+00
+d8
+48
+48
+48
+48
+34
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 0
+BITMAP
+10
+20
+00
+d8
+48
+48
+48
+48
+34
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 9 0 0
+BITMAP
+20
+50
+00
+d8
+48
+48
+48
+48
+34
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 8 0 0
+BITMAP
+50
+00
+d8
+48
+48
+48
+48
+34
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 12 0 -3
+BITMAP
+08
+10
+00
+cc
+48
+58
+50
+30
+20
+20
+40
+c0
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 5 12 0 -3
+BITMAP
+c0
+40
+40
+70
+48
+48
+48
+48
+70
+40
+40
+e0
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 480 0
+DWIDTH 6 0
+BBX 6 11 0 -3
+BITMAP
+48
+00
+cc
+48
+58
+50
+30
+20
+20
+40
+c0
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times12.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times12.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times12.h	(revision 15879)
@@ -0,0 +1,792 @@
+static unsigned char times12_0_bits[] = {
+0x00};
+static unsigned char times12_1_bits[] = {
+0x00};
+static unsigned char times12_2_bits[] = {
+0x00};
+static unsigned char times12_3_bits[] = {
+0x00};
+static unsigned char times12_4_bits[] = {
+0x00};
+static unsigned char times12_5_bits[] = {
+0x00};
+static unsigned char times12_6_bits[] = {
+0x00};
+static unsigned char times12_7_bits[] = {
+0x00};
+static unsigned char times12_8_bits[] = {
+0x00};
+static unsigned char times12_9_bits[] = {
+0x00};
+static unsigned char times12_10_bits[] = {
+0x00};
+static unsigned char times12_11_bits[] = {
+0x00};
+static unsigned char times12_12_bits[] = {
+0x00};
+static unsigned char times12_13_bits[] = {
+0x00};
+static unsigned char times12_14_bits[] = {
+0x00};
+static unsigned char times12_15_bits[] = {
+0x00};
+static unsigned char times12_16_bits[] = {
+0x00};
+static unsigned char times12_17_bits[] = {
+0x00};
+static unsigned char times12_18_bits[] = {
+0x00};
+static unsigned char times12_19_bits[] = {
+0x00};
+static unsigned char times12_20_bits[] = {
+0x00};
+static unsigned char times12_21_bits[] = {
+0x00};
+static unsigned char times12_22_bits[] = {
+0x00};
+static unsigned char times12_23_bits[] = {
+0x00};
+static unsigned char times12_24_bits[] = {
+0x00};
+static unsigned char times12_25_bits[] = {
+0x00};
+static unsigned char times12_26_bits[] = {
+0x00};
+static unsigned char times12_27_bits[] = {
+0x00};
+static unsigned char times12_28_bits[] = {
+0x00};
+static unsigned char times12_29_bits[] = {
+0x00};
+static unsigned char times12_30_bits[] = {
+0x00};
+static unsigned char times12_31_bits[] = {
+0x00};
+static unsigned char times12_32_bits[] = {
+0x00};
+static unsigned char times12_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01};
+static unsigned char times12_34_bits[] = {
+0x05, 0x05, 0x05};
+static unsigned char times12_35_bits[] = {
+0x0a, 0x0a, 0x1f, 0x0a, 0x0a, 0x1f, 0x0a, 0x0a};
+static unsigned char times12_36_bits[] = {
+0x04, 0x0e, 0x15, 0x05, 0x06, 0x0c, 0x14, 0x14, 0x15, 0x0e, 0x04};
+static unsigned char times12_37_bits[] = {
+0xc6, 0x79, 0x29, 0x16, 0x08, 0x6c, 0x94, 0x92, 0x62};
+static unsigned char times12_38_bits[] = {
+0x18, 0x00, 0x24, 0x00, 0x24, 0x00, 0xd8, 0x01, 0x9e, 0x00, 0x73, 0x00, 
+0x21, 0x00, 0x73, 0x01, 0xde, 0x00};
+static unsigned char times12_39_bits[] = {
+0x03, 0x02, 0x01};
+static unsigned char times12_40_bits[] = {
+0x04, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x04};
+static unsigned char times12_41_bits[] = {
+0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x02, 0x01};
+static unsigned char times12_42_bits[] = {
+0x04, 0x15, 0x0e, 0x15, 0x04};
+static unsigned char times12_43_bits[] = {
+0x04, 0x04, 0x1f, 0x04, 0x04};
+static unsigned char times12_44_bits[] = {
+0x02, 0x02, 0x01};
+static unsigned char times12_45_bits[] = {
+0x1f};
+static unsigned char times12_46_bits[] = {
+0x01};
+static unsigned char times12_47_bits[] = {
+0x04, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01};
+static unsigned char times12_48_bits[] = {
+0x0e, 0x1b, 0x11, 0x11, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char times12_49_bits[] = {
+0x04, 0x06, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e};
+static unsigned char times12_50_bits[] = {
+0x0e, 0x11, 0x10, 0x10, 0x08, 0x04, 0x02, 0x11, 0x1f};
+static unsigned char times12_51_bits[] = {
+0x0e, 0x11, 0x10, 0x08, 0x0e, 0x10, 0x10, 0x11, 0x0e};
+static unsigned char times12_52_bits[] = {
+0x08, 0x0c, 0x0c, 0x0a, 0x0a, 0x09, 0x1f, 0x08, 0x08};
+static unsigned char times12_53_bits[] = {
+0x1c, 0x02, 0x02, 0x0e, 0x18, 0x10, 0x10, 0x19, 0x0e};
+static unsigned char times12_54_bits[] = {
+0x18, 0x06, 0x02, 0x0f, 0x19, 0x11, 0x11, 0x13, 0x0e};
+static unsigned char times12_55_bits[] = {
+0x1f, 0x11, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x02};
+static unsigned char times12_56_bits[] = {
+0x0e, 0x11, 0x11, 0x13, 0x0e, 0x19, 0x11, 0x11, 0x0e};
+static unsigned char times12_57_bits[] = {
+0x0e, 0x19, 0x11, 0x11, 0x13, 0x1e, 0x08, 0x0c, 0x03};
+static unsigned char times12_58_bits[] = {
+0x01, 0x00, 0x00, 0x00, 0x00, 0x01};
+static unsigned char times12_59_bits[] = {
+0x02, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x01};
+static unsigned char times12_60_bits[] = {
+0x30, 0x0c, 0x03, 0x0c, 0x30};
+static unsigned char times12_61_bits[] = {
+0x1f, 0x00, 0x1f};
+static unsigned char times12_62_bits[] = {
+0x03, 0x0c, 0x30, 0x0c, 0x03};
+static unsigned char times12_63_bits[] = {
+0x06, 0x09, 0x08, 0x04, 0x02, 0x02, 0x02, 0x00, 0x02};
+static unsigned char times12_64_bits[] = {
+0xf0, 0x00, 0x0c, 0x01, 0x06, 0x02, 0xb2, 0x02, 0x49, 0x02, 0x45, 0x02, 
+0x25, 0x01, 0x25, 0x01, 0xd9, 0x00, 0x02, 0x00, 0x7c, 0x00};
+static unsigned char times12_65_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 
+0x44, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char times12_66_bits[] = {
+0x3f, 0x62, 0x42, 0x62, 0x3e, 0x42, 0x42, 0x62, 0x3f};
+static unsigned char times12_67_bits[] = {
+0x5c, 0x66, 0x42, 0x01, 0x01, 0x01, 0x42, 0x66, 0x3c};
+static unsigned char times12_68_bits[] = {
+0x3f, 0x62, 0x42, 0x82, 0x82, 0x82, 0x42, 0x62, 0x3f};
+static unsigned char times12_69_bits[] = {
+0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 0x7f};
+static unsigned char times12_70_bits[] = {
+0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x02, 0x0f};
+static unsigned char times12_71_bits[] = {
+0x5c, 0x66, 0x42, 0x01, 0xe1, 0x41, 0x42, 0x66, 0x3c};
+static unsigned char times12_72_bits[] = {
+0xe7, 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0xe7};
+static unsigned char times12_73_bits[] = {
+0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_74_bits[] = {
+0x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x03};
+static unsigned char times12_75_bits[] = {
+0x77, 0x22, 0x12, 0x0a, 0x0e, 0x1a, 0x32, 0x62, 0xe7};
+static unsigned char times12_76_bits[] = {
+0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x22, 0x3f};
+static unsigned char times12_77_bits[] = {
+0x03, 0x06, 0x06, 0x03, 0x06, 0x03, 0x8a, 0x02, 0x8a, 0x02, 0x52, 0x02, 
+0x52, 0x02, 0x22, 0x02, 0x27, 0x07};
+static unsigned char times12_78_bits[] = {
+0xc3, 0x01, 0x86, 0x00, 0x86, 0x00, 0x8a, 0x00, 0x92, 0x00, 0x92, 0x00, 
+0xa2, 0x00, 0xc2, 0x00, 0x87, 0x00};
+static unsigned char times12_79_bits[] = {
+0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c};
+static unsigned char times12_80_bits[] = {
+0x3f, 0x62, 0x42, 0x62, 0x3e, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_81_bits[] = {
+0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c, 0x30, 0xc0};
+static unsigned char times12_82_bits[] = {
+0x3f, 0x62, 0x42, 0x62, 0x3e, 0x12, 0x22, 0x42, 0xc7};
+static unsigned char times12_83_bits[] = {
+0x2e, 0x31, 0x21, 0x06, 0x1c, 0x30, 0x21, 0x33, 0x1d};
+static unsigned char times12_84_bits[] = {
+0x7f, 0x49, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1c};
+static unsigned char times12_85_bits[] = {
+0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x66, 0x3c};
+static unsigned char times12_86_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x28, 0x00, 
+0x38, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char times12_87_bits[] = {
+0x77, 0x0e, 0x22, 0x04, 0x66, 0x04, 0x44, 0x02, 0xec, 0x02, 0xa8, 0x02, 
+0x98, 0x01, 0x10, 0x01, 0x10, 0x01};
+static unsigned char times12_88_bits[] = {
+0xe7, 0x42, 0x24, 0x1c, 0x18, 0x34, 0x24, 0x42, 0xe7};
+static unsigned char times12_89_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 0x48, 0x00, 0x38, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x38, 0x00};
+static unsigned char times12_90_bits[] = {
+0x7f, 0x61, 0x30, 0x18, 0x0c, 0x06, 0x03, 0x41, 0x7f};
+static unsigned char times12_91_bits[] = {
+0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07};
+static unsigned char times12_92_bits[] = {
+0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04, 0x04};
+static unsigned char times12_93_bits[] = {
+0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07};
+static unsigned char times12_94_bits[] = {
+0x04, 0x0a, 0x0a, 0x11, 0x11};
+static unsigned char times12_95_bits[] = {
+0x3f};
+static unsigned char times12_96_bits[] = {
+0x02, 0x01, 0x03};
+static unsigned char times12_97_bits[] = {
+0x06, 0x09, 0x0e, 0x09, 0x09, 0x16};
+static unsigned char times12_98_bits[] = {
+0x03, 0x02, 0x02, 0x0e, 0x12, 0x12, 0x12, 0x12, 0x0e};
+static unsigned char times12_99_bits[] = {
+0x06, 0x09, 0x01, 0x01, 0x09, 0x06};
+static unsigned char times12_100_bits[] = {
+0x0c, 0x08, 0x08, 0x0e, 0x09, 0x09, 0x09, 0x09, 0x16};
+static unsigned char times12_101_bits[] = {
+0x06, 0x09, 0x0f, 0x01, 0x13, 0x0e};
+static unsigned char times12_102_bits[] = {
+0x04, 0x02, 0x02, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02};
+static unsigned char times12_103_bits[] = {
+0x1e, 0x09, 0x09, 0x07, 0x02, 0x0e, 0x11, 0x11, 0x0e};
+static unsigned char times12_104_bits[] = {
+0x03, 0x02, 0x02, 0x0e, 0x12, 0x12, 0x12, 0x12, 0x37};
+static unsigned char times12_105_bits[] = {
+0x02, 0x00, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_106_bits[] = {
+0x02, 0x00, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01};
+static unsigned char times12_107_bits[] = {
+0x03, 0x02, 0x02, 0x12, 0x0a, 0x06, 0x0a, 0x12, 0x32};
+static unsigned char times12_108_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_109_bits[] = {
+0x6d, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0xb7, 0x01};
+static unsigned char times12_110_bits[] = {
+0x0d, 0x12, 0x12, 0x12, 0x12, 0x37};
+static unsigned char times12_111_bits[] = {
+0x06, 0x09, 0x09, 0x09, 0x09, 0x06};
+static unsigned char times12_112_bits[] = {
+0x0f, 0x12, 0x12, 0x12, 0x12, 0x0e, 0x02, 0x02, 0x07};
+static unsigned char times12_113_bits[] = {
+0x0e, 0x09, 0x09, 0x09, 0x09, 0x0e, 0x08, 0x08, 0x1c};
+static unsigned char times12_114_bits[] = {
+0x0d, 0x06, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_115_bits[] = {
+0x0e, 0x09, 0x03, 0x0c, 0x09, 0x07};
+static unsigned char times12_116_bits[] = {
+0x02, 0x0f, 0x02, 0x02, 0x02, 0x02, 0x0c};
+static unsigned char times12_117_bits[] = {
+0x1b, 0x12, 0x12, 0x12, 0x12, 0x2c};
+static unsigned char times12_118_bits[] = {
+0x33, 0x12, 0x1a, 0x0a, 0x0c, 0x04};
+static unsigned char times12_119_bits[] = {
+0xb7, 0x01, 0x92, 0x00, 0xd6, 0x00, 0x54, 0x00, 0x2c, 0x00, 0x24, 0x00};
+static unsigned char times12_120_bits[] = {
+0x1b, 0x0a, 0x04, 0x04, 0x0a, 0x1b};
+static unsigned char times12_121_bits[] = {
+0x33, 0x12, 0x1a, 0x0a, 0x0c, 0x04, 0x04, 0x02, 0x03};
+static unsigned char times12_122_bits[] = {
+0x0f, 0x09, 0x04, 0x02, 0x09, 0x0f};
+static unsigned char times12_123_bits[] = {
+0x0c, 0x02, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c};
+static unsigned char times12_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times12_125_bits[] = {
+0x03, 0x04, 0x04, 0x04, 0x04, 0x08, 0x04, 0x04, 0x04, 0x04, 0x04, 0x03};
+static unsigned char times12_126_bits[] = {
+0x26, 0x19};
+static unsigned char times12_127_bits[] = {
+0x00};
+static unsigned char times12_128_bits[] = {
+0x00};
+static unsigned char times12_129_bits[] = {
+0x00};
+static unsigned char times12_130_bits[] = {
+0x00};
+static unsigned char times12_131_bits[] = {
+0x00};
+static unsigned char times12_132_bits[] = {
+0x00};
+static unsigned char times12_133_bits[] = {
+0x00};
+static unsigned char times12_134_bits[] = {
+0x00};
+static unsigned char times12_135_bits[] = {
+0x00};
+static unsigned char times12_136_bits[] = {
+0x00};
+static unsigned char times12_137_bits[] = {
+0x00};
+static unsigned char times12_138_bits[] = {
+0x00};
+static unsigned char times12_139_bits[] = {
+0x00};
+static unsigned char times12_140_bits[] = {
+0x00};
+static unsigned char times12_141_bits[] = {
+0x00};
+static unsigned char times12_142_bits[] = {
+0x00};
+static unsigned char times12_143_bits[] = {
+0x00};
+static unsigned char times12_144_bits[] = {
+0x00};
+static unsigned char times12_145_bits[] = {
+0x00};
+static unsigned char times12_146_bits[] = {
+0x00};
+static unsigned char times12_147_bits[] = {
+0x00};
+static unsigned char times12_148_bits[] = {
+0x00};
+static unsigned char times12_149_bits[] = {
+0x00};
+static unsigned char times12_150_bits[] = {
+0x00};
+static unsigned char times12_151_bits[] = {
+0x00};
+static unsigned char times12_152_bits[] = {
+0x00};
+static unsigned char times12_153_bits[] = {
+0x00};
+static unsigned char times12_154_bits[] = {
+0x00};
+static unsigned char times12_155_bits[] = {
+0x00};
+static unsigned char times12_156_bits[] = {
+0x00};
+static unsigned char times12_157_bits[] = {
+0x00};
+static unsigned char times12_158_bits[] = {
+0x00};
+static unsigned char times12_159_bits[] = {
+0x00};
+static unsigned char times12_160_bits[] = {
+0x00};
+static unsigned char times12_161_bits[] = {
+0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times12_162_bits[] = {
+0x10, 0x0e, 0x19, 0x05, 0x05, 0x13, 0x0e, 0x01};
+static unsigned char times12_163_bits[] = {
+0x0c, 0x12, 0x02, 0x02, 0x0f, 0x02, 0x02, 0x17, 0x1b};
+static unsigned char times12_164_bits[] = {
+0x21, 0x1e, 0x12, 0x12, 0x12, 0x1e, 0x21};
+static unsigned char times12_165_bits[] = {
+0x11, 0x11, 0x0a, 0x0a, 0x1f, 0x04, 0x1f, 0x04, 0x0e};
+static unsigned char times12_166_bits[] = {
+0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times12_167_bits[] = {
+0x0e, 0x09, 0x03, 0x06, 0x0d, 0x09, 0x09, 0x0b, 0x06, 0x0c, 0x09, 0x07};
+static unsigned char times12_168_bits[] = {
+0x05};
+static unsigned char times12_169_bits[] = {
+0x38, 0x00, 0xc6, 0x00, 0xba, 0x00, 0x25, 0x01, 0x05, 0x01, 0x25, 0x01, 
+0xba, 0x00, 0xc6, 0x00, 0x38, 0x00};
+static unsigned char times12_170_bits[] = {
+0x03, 0x04, 0x07, 0x05, 0x00, 0x07};
+static unsigned char times12_171_bits[] = {
+0x14, 0x0a, 0x05, 0x0a, 0x14};
+static unsigned char times12_172_bits[] = {
+0x3f, 0x20, 0x20, 0x20};
+static unsigned char times12_173_bits[] = {
+0x0f};
+static unsigned char times12_174_bits[] = {
+0x38, 0x00, 0xc6, 0x00, 0xba, 0x00, 0x49, 0x01, 0x39, 0x01, 0x29, 0x01, 
+0xab, 0x00, 0xc6, 0x00, 0x3c, 0x00};
+static unsigned char times12_175_bits[] = {
+0x0f};
+static unsigned char times12_176_bits[] = {
+0x06, 0x09, 0x09, 0x06};
+static unsigned char times12_177_bits[] = {
+0x04, 0x04, 0x1f, 0x04, 0x04, 0x00, 0x1f};
+static unsigned char times12_178_bits[] = {
+0x06, 0x09, 0x04, 0x02, 0x0f};
+static unsigned char times12_179_bits[] = {
+0x07, 0x04, 0x02, 0x04, 0x03};
+static unsigned char times12_180_bits[] = {
+0x02, 0x01};
+static unsigned char times12_181_bits[] = {
+0x1b, 0x12, 0x12, 0x12, 0x12, 0x2e, 0x02, 0x02, 0x06};
+static unsigned char times12_182_bits[] = {
+0x3e, 0x17, 0x17, 0x17, 0x17, 0x16, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14};
+static unsigned char times12_183_bits[] = {
+0x01};
+static unsigned char times12_184_bits[] = {
+0x02, 0x04, 0x07};
+static unsigned char times12_185_bits[] = {
+0x02, 0x03, 0x02, 0x02, 0x07};
+static unsigned char times12_186_bits[] = {
+0x02, 0x05, 0x05, 0x02, 0x00, 0x07};
+static unsigned char times12_187_bits[] = {
+0x05, 0x0a, 0x14, 0x0a, 0x05};
+static unsigned char times12_188_bits[] = {
+0x42, 0x00, 0x23, 0x00, 0x22, 0x00, 0x12, 0x00, 0x97, 0x00, 0xc8, 0x00, 
+0xa8, 0x00, 0xe4, 0x01, 0x84, 0x00};
+static unsigned char times12_189_bits[] = {
+0x42, 0x00, 0x23, 0x00, 0x22, 0x00, 0x12, 0x00, 0xd7, 0x00, 0x28, 0x01, 
+0x88, 0x00, 0x44, 0x00, 0xe4, 0x01};
+static unsigned char times12_190_bits[] = {
+0x47, 0x00, 0x24, 0x00, 0x22, 0x00, 0x14, 0x00, 0x93, 0x00, 0xc8, 0x00, 
+0xa8, 0x00, 0xe4, 0x01, 0x84, 0x00};
+static unsigned char times12_191_bits[] = {
+0x04, 0x00, 0x04, 0x04, 0x04, 0x02, 0x01, 0x09, 0x06};
+static unsigned char times12_192_bits[] = {
+0x08, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x44, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char times12_193_bits[] = {
+0x20, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x44, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char times12_194_bits[] = {
+0x10, 0x00, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x44, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char times12_195_bits[] = {
+0x50, 0x00, 0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x44, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char times12_196_bits[] = {
+0x28, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 0x28, 0x00, 
+0x44, 0x00, 0x7c, 0x00, 0x44, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char times12_197_bits[] = {
+0x10, 0x00, 0x28, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x44, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char times12_198_bits[] = {
+0xfc, 0x03, 0x18, 0x02, 0x14, 0x00, 0x14, 0x01, 0xf2, 0x01, 0x1e, 0x01, 
+0x12, 0x00, 0x11, 0x02, 0xf3, 0x03};
+static unsigned char times12_199_bits[] = {
+0x5c, 0x66, 0x42, 0x01, 0x01, 0x01, 0x42, 0x66, 0x3c, 0x08, 0x10, 0x1c};
+static unsigned char times12_200_bits[] = {
+0x04, 0x08, 0x00, 0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 0x7f};
+static unsigned char times12_201_bits[] = {
+0x10, 0x08, 0x00, 0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 0x7f};
+static unsigned char times12_202_bits[] = {
+0x08, 0x14, 0x00, 0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 0x7f};
+static unsigned char times12_203_bits[] = {
+0x14, 0x00, 0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 0x7f};
+static unsigned char times12_204_bits[] = {
+0x01, 0x02, 0x00, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_205_bits[] = {
+0x04, 0x02, 0x00, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_206_bits[] = {
+0x02, 0x05, 0x00, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_207_bits[] = {
+0x05, 0x00, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_208_bits[] = {
+0x3f, 0x62, 0x42, 0x82, 0x87, 0x82, 0x42, 0x62, 0x3f};
+static unsigned char times12_209_bits[] = {
+0x50, 0x00, 0x28, 0x00, 0x00, 0x00, 0xc3, 0x01, 0x86, 0x00, 0x86, 0x00, 
+0x8a, 0x00, 0x92, 0x00, 0x92, 0x00, 0xa2, 0x00, 0xc2, 0x00, 0x87, 0x00};
+static unsigned char times12_210_bits[] = {
+0x04, 0x08, 0x00, 0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c};
+static unsigned char times12_211_bits[] = {
+0x20, 0x10, 0x00, 0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c};
+static unsigned char times12_212_bits[] = {
+0x08, 0x14, 0x00, 0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c};
+static unsigned char times12_213_bits[] = {
+0x28, 0x14, 0x00, 0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c};
+static unsigned char times12_214_bits[] = {
+0x24, 0x00, 0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c};
+static unsigned char times12_215_bits[] = {
+0x11, 0x0a, 0x04, 0x0a, 0x11};
+static unsigned char times12_216_bits[] = {
+0x00, 0x01, 0xbc, 0x00, 0x66, 0x00, 0x62, 0x00, 0x91, 0x00, 0x91, 0x00, 
+0x89, 0x00, 0x46, 0x00, 0x66, 0x00, 0x3d, 0x00};
+static unsigned char times12_217_bits[] = {
+0x08, 0x10, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x66, 0x3c};
+static unsigned char times12_218_bits[] = {
+0x20, 0x10, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x66, 0x3c};
+static unsigned char times12_219_bits[] = {
+0x08, 0x14, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x66, 0x3c};
+static unsigned char times12_220_bits[] = {
+0x24, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x66, 0x3c};
+static unsigned char times12_221_bits[] = {
+0x20, 0x00, 0x10, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 
+0x48, 0x00, 0x38, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x38, 0x00};
+static unsigned char times12_222_bits[] = {
+0x07, 0x02, 0x3e, 0x62, 0x42, 0x62, 0x3e, 0x02, 0x07};
+static unsigned char times12_223_bits[] = {
+0x0c, 0x12, 0x12, 0x0a, 0x0e, 0x12, 0x22, 0x22, 0x1b};
+static unsigned char times12_224_bits[] = {
+0x02, 0x04, 0x00, 0x06, 0x09, 0x0e, 0x09, 0x09, 0x16};
+static unsigned char times12_225_bits[] = {
+0x08, 0x04, 0x00, 0x06, 0x09, 0x0e, 0x09, 0x09, 0x16};
+static unsigned char times12_226_bits[] = {
+0x04, 0x0a, 0x00, 0x06, 0x09, 0x0e, 0x09, 0x09, 0x16};
+static unsigned char times12_227_bits[] = {
+0x0a, 0x05, 0x00, 0x06, 0x09, 0x0e, 0x09, 0x09, 0x16};
+static unsigned char times12_228_bits[] = {
+0x0a, 0x00, 0x06, 0x09, 0x0e, 0x09, 0x09, 0x16};
+static unsigned char times12_229_bits[] = {
+0x04, 0x0a, 0x04, 0x06, 0x09, 0x0e, 0x09, 0x09, 0x16};
+static unsigned char times12_230_bits[] = {
+0x36, 0x49, 0x7e, 0x09, 0x99, 0x76};
+static unsigned char times12_231_bits[] = {
+0x06, 0x09, 0x01, 0x01, 0x09, 0x06, 0x02, 0x04, 0x07};
+static unsigned char times12_232_bits[] = {
+0x02, 0x04, 0x00, 0x06, 0x09, 0x0f, 0x01, 0x13, 0x0e};
+static unsigned char times12_233_bits[] = {
+0x04, 0x02, 0x00, 0x06, 0x09, 0x0f, 0x01, 0x13, 0x0e};
+static unsigned char times12_234_bits[] = {
+0x04, 0x0a, 0x00, 0x06, 0x09, 0x0f, 0x01, 0x13, 0x0e};
+static unsigned char times12_235_bits[] = {
+0x0a, 0x00, 0x06, 0x09, 0x0f, 0x01, 0x13, 0x0e};
+static unsigned char times12_236_bits[] = {
+0x01, 0x02, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_237_bits[] = {
+0x02, 0x01, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_238_bits[] = {
+0x02, 0x05, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_239_bits[] = {
+0x05, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times12_240_bits[] = {
+0x02, 0x0e, 0x05, 0x0e, 0x09, 0x09, 0x09, 0x09, 0x06};
+static unsigned char times12_241_bits[] = {
+0x14, 0x0a, 0x00, 0x0d, 0x12, 0x12, 0x12, 0x12, 0x37};
+static unsigned char times12_242_bits[] = {
+0x02, 0x04, 0x00, 0x06, 0x09, 0x09, 0x09, 0x09, 0x06};
+static unsigned char times12_243_bits[] = {
+0x04, 0x02, 0x00, 0x06, 0x09, 0x09, 0x09, 0x09, 0x06};
+static unsigned char times12_244_bits[] = {
+0x04, 0x0a, 0x00, 0x06, 0x09, 0x09, 0x09, 0x09, 0x06};
+static unsigned char times12_245_bits[] = {
+0x0a, 0x05, 0x00, 0x06, 0x09, 0x09, 0x09, 0x09, 0x06};
+static unsigned char times12_246_bits[] = {
+0x05, 0x00, 0x06, 0x09, 0x09, 0x09, 0x09, 0x06};
+static unsigned char times12_247_bits[] = {
+0x04, 0x00, 0x1f, 0x00, 0x04};
+static unsigned char times12_248_bits[] = {
+0x2c, 0x12, 0x12, 0x12, 0x12, 0x0e, 0x01};
+static unsigned char times12_249_bits[] = {
+0x04, 0x08, 0x00, 0x1b, 0x12, 0x12, 0x12, 0x12, 0x2c};
+static unsigned char times12_250_bits[] = {
+0x08, 0x04, 0x00, 0x1b, 0x12, 0x12, 0x12, 0x12, 0x2c};
+static unsigned char times12_251_bits[] = {
+0x04, 0x0a, 0x00, 0x1b, 0x12, 0x12, 0x12, 0x12, 0x2c};
+static unsigned char times12_252_bits[] = {
+0x0a, 0x00, 0x1b, 0x12, 0x12, 0x12, 0x12, 0x2c};
+static unsigned char times12_253_bits[] = {
+0x10, 0x08, 0x00, 0x33, 0x12, 0x1a, 0x0a, 0x0c, 0x04, 0x04, 0x02, 0x03};
+static unsigned char times12_254_bits[] = {
+0x03, 0x02, 0x02, 0x0e, 0x12, 0x12, 0x12, 0x12, 0x0e, 0x02, 0x02, 0x07};
+static unsigned char times12_255_bits[] = {
+0x12, 0x00, 0x33, 0x12, 0x1a, 0x0a, 0x0c, 0x04, 0x04, 0x02, 0x03};
+static RotFont times12font[] = {
+{5, 1, 1, times12_0_bits},
+{5, 1, 1, times12_1_bits},
+{5, 1, 1, times12_2_bits},
+{5, 1, 1, times12_3_bits},
+{5, 1, 1, times12_4_bits},
+{5, 1, 1, times12_5_bits},
+{5, 1, 1, times12_6_bits},
+{5, 1, 1, times12_7_bits},
+{5, 1, 1, times12_8_bits},
+{5, 1, 1, times12_9_bits},
+{5, 1, 1, times12_10_bits},
+{5, 1, 1, times12_11_bits},
+{5, 1, 1, times12_12_bits},
+{5, 1, 1, times12_13_bits},
+{5, 1, 1, times12_14_bits},
+{5, 1, 1, times12_15_bits},
+{5, 1, 1, times12_16_bits},
+{5, 1, 1, times12_17_bits},
+{5, 1, 1, times12_18_bits},
+{5, 1, 1, times12_19_bits},
+{5, 1, 1, times12_20_bits},
+{5, 1, 1, times12_21_bits},
+{5, 1, 1, times12_22_bits},
+{5, 1, 1, times12_23_bits},
+{5, 1, 1, times12_24_bits},
+{5, 1, 1, times12_25_bits},
+{5, 1, 1, times12_26_bits},
+{5, 1, 1, times12_27_bits},
+{5, 1, 1, times12_28_bits},
+{5, 1, 1, times12_29_bits},
+{5, 1, 1, times12_30_bits},
+{5, 1, 1, times12_31_bits},
+{5, 1, 1, times12_32_bits},
+{1, 9, 9, times12_33_bits},
+{3, 3, 9, times12_34_bits},
+{5, 8, 8, times12_35_bits},
+{5, 11, 10, times12_36_bits},
+{8, 9, 9, times12_37_bits},
+{9, 9, 9, times12_38_bits},
+{2, 3, 9, times12_39_bits},
+{3, 12, 9, times12_40_bits},
+{3, 12, 9, times12_41_bits},
+{5, 5, 9, times12_42_bits},
+{5, 5, 6, times12_43_bits},
+{2, 3, 1, times12_44_bits},
+{5, 1, 4, times12_45_bits},
+{1, 1, 1, times12_46_bits},
+{3, 9, 9, times12_47_bits},
+{5, 9, 9, times12_48_bits},
+{4, 9, 9, times12_49_bits},
+{5, 9, 9, times12_50_bits},
+{5, 9, 9, times12_51_bits},
+{5, 9, 9, times12_52_bits},
+{5, 9, 9, times12_53_bits},
+{5, 9, 9, times12_54_bits},
+{5, 9, 9, times12_55_bits},
+{5, 9, 9, times12_56_bits},
+{5, 9, 9, times12_57_bits},
+{1, 6, 6, times12_58_bits},
+{2, 8, 6, times12_59_bits},
+{6, 5, 6, times12_60_bits},
+{5, 3, 5, times12_61_bits},
+{6, 5, 6, times12_62_bits},
+{4, 9, 9, times12_63_bits},
+{10, 11, 9, times12_64_bits},
+{9, 9, 9, times12_65_bits},
+{7, 9, 9, times12_66_bits},
+{7, 9, 9, times12_67_bits},
+{8, 9, 9, times12_68_bits},
+{7, 9, 9, times12_69_bits},
+{7, 9, 9, times12_70_bits},
+{8, 9, 9, times12_71_bits},
+{8, 9, 9, times12_72_bits},
+{3, 9, 9, times12_73_bits},
+{4, 9, 9, times12_74_bits},
+{8, 9, 9, times12_75_bits},
+{6, 9, 9, times12_76_bits},
+{11, 9, 9, times12_77_bits},
+{9, 9, 9, times12_78_bits},
+{8, 9, 9, times12_79_bits},
+{7, 9, 9, times12_80_bits},
+{8, 11, 9, times12_81_bits},
+{8, 9, 9, times12_82_bits},
+{6, 9, 9, times12_83_bits},
+{7, 9, 9, times12_84_bits},
+{8, 9, 9, times12_85_bits},
+{9, 9, 9, times12_86_bits},
+{12, 9, 9, times12_87_bits},
+{8, 9, 9, times12_88_bits},
+{9, 9, 9, times12_89_bits},
+{7, 9, 9, times12_90_bits},
+{3, 12, 9, times12_91_bits},
+{3, 9, 9, times12_92_bits},
+{3, 12, 9, times12_93_bits},
+{5, 5, 9, times12_94_bits},
+{6, 1, -2, times12_95_bits},
+{2, 3, 9, times12_96_bits},
+{5, 6, 6, times12_97_bits},
+{5, 9, 9, times12_98_bits},
+{4, 6, 6, times12_99_bits},
+{5, 9, 9, times12_100_bits},
+{5, 6, 6, times12_101_bits},
+{3, 9, 9, times12_102_bits},
+{5, 9, 6, times12_103_bits},
+{6, 9, 9, times12_104_bits},
+{3, 9, 9, times12_105_bits},
+{2, 12, 9, times12_106_bits},
+{6, 9, 9, times12_107_bits},
+{3, 9, 9, times12_108_bits},
+{9, 6, 6, times12_109_bits},
+{6, 6, 6, times12_110_bits},
+{4, 6, 6, times12_111_bits},
+{5, 9, 6, times12_112_bits},
+{5, 9, 6, times12_113_bits},
+{4, 6, 6, times12_114_bits},
+{4, 6, 6, times12_115_bits},
+{4, 7, 7, times12_116_bits},
+{6, 6, 6, times12_117_bits},
+{6, 6, 6, times12_118_bits},
+{9, 6, 6, times12_119_bits},
+{5, 6, 6, times12_120_bits},
+{6, 9, 6, times12_121_bits},
+{4, 6, 6, times12_122_bits},
+{4, 12, 9, times12_123_bits},
+{1, 9, 9, times12_124_bits},
+{4, 12, 9, times12_125_bits},
+{6, 2, 5, times12_126_bits},
+{5, 1, 1, times12_127_bits},
+{5, 1, 1, times12_128_bits},
+{5, 1, 1, times12_129_bits},
+{5, 1, 1, times12_130_bits},
+{5, 1, 1, times12_131_bits},
+{5, 1, 1, times12_132_bits},
+{5, 1, 1, times12_133_bits},
+{5, 1, 1, times12_134_bits},
+{5, 1, 1, times12_135_bits},
+{5, 1, 1, times12_136_bits},
+{5, 1, 1, times12_137_bits},
+{5, 1, 1, times12_138_bits},
+{5, 1, 1, times12_139_bits},
+{5, 1, 1, times12_140_bits},
+{5, 1, 1, times12_141_bits},
+{5, 1, 1, times12_142_bits},
+{5, 1, 1, times12_143_bits},
+{5, 1, 1, times12_144_bits},
+{5, 1, 1, times12_145_bits},
+{5, 1, 1, times12_146_bits},
+{5, 1, 1, times12_147_bits},
+{5, 1, 1, times12_148_bits},
+{5, 1, 1, times12_149_bits},
+{5, 1, 1, times12_150_bits},
+{5, 1, 1, times12_151_bits},
+{5, 1, 1, times12_152_bits},
+{5, 1, 1, times12_153_bits},
+{5, 1, 1, times12_154_bits},
+{5, 1, 1, times12_155_bits},
+{5, 1, 1, times12_156_bits},
+{5, 1, 1, times12_157_bits},
+{5, 1, 1, times12_158_bits},
+{5, 1, 1, times12_159_bits},
+{1, 1, 1, times12_160_bits},
+{1, 9, 6, times12_161_bits},
+{5, 8, 7, times12_162_bits},
+{5, 9, 9, times12_163_bits},
+{6, 7, 8, times12_164_bits},
+{5, 9, 9, times12_165_bits},
+{1, 9, 9, times12_166_bits},
+{4, 12, 9, times12_167_bits},
+{3, 1, 8, times12_168_bits},
+{9, 9, 9, times12_169_bits},
+{3, 6, 9, times12_170_bits},
+{5, 5, 5, times12_171_bits},
+{6, 4, 5, times12_172_bits},
+{4, 1, 4, times12_173_bits},
+{9, 9, 9, times12_174_bits},
+{4, 1, 8, times12_175_bits},
+{4, 4, 9, times12_176_bits},
+{5, 7, 7, times12_177_bits},
+{4, 5, 9, times12_178_bits},
+{3, 5, 9, times12_179_bits},
+{2, 2, 9, times12_180_bits},
+{6, 9, 6, times12_181_bits},
+{6, 12, 9, times12_182_bits},
+{1, 1, 4, times12_183_bits},
+{3, 3, 0, times12_184_bits},
+{3, 5, 9, times12_185_bits},
+{3, 6, 9, times12_186_bits},
+{5, 5, 5, times12_187_bits},
+{9, 9, 9, times12_188_bits},
+{9, 9, 9, times12_189_bits},
+{9, 9, 9, times12_190_bits},
+{4, 9, 6, times12_191_bits},
+{9, 12, 12, times12_192_bits},
+{9, 12, 12, times12_193_bits},
+{9, 12, 12, times12_194_bits},
+{9, 12, 12, times12_195_bits},
+{9, 11, 11, times12_196_bits},
+{9, 12, 12, times12_197_bits},
+{10, 9, 9, times12_198_bits},
+{7, 12, 9, times12_199_bits},
+{7, 12, 12, times12_200_bits},
+{7, 12, 12, times12_201_bits},
+{7, 12, 12, times12_202_bits},
+{7, 11, 11, times12_203_bits},
+{3, 12, 12, times12_204_bits},
+{3, 12, 12, times12_205_bits},
+{3, 12, 12, times12_206_bits},
+{3, 11, 11, times12_207_bits},
+{8, 9, 9, times12_208_bits},
+{9, 12, 12, times12_209_bits},
+{8, 12, 12, times12_210_bits},
+{8, 12, 12, times12_211_bits},
+{8, 12, 12, times12_212_bits},
+{8, 12, 12, times12_213_bits},
+{8, 11, 11, times12_214_bits},
+{5, 5, 6, times12_215_bits},
+{9, 10, 10, times12_216_bits},
+{8, 12, 12, times12_217_bits},
+{8, 12, 12, times12_218_bits},
+{8, 12, 12, times12_219_bits},
+{8, 11, 11, times12_220_bits},
+{9, 12, 12, times12_221_bits},
+{7, 9, 9, times12_222_bits},
+{6, 9, 9, times12_223_bits},
+{5, 9, 9, times12_224_bits},
+{5, 9, 9, times12_225_bits},
+{5, 9, 9, times12_226_bits},
+{5, 9, 9, times12_227_bits},
+{5, 8, 8, times12_228_bits},
+{5, 9, 9, times12_229_bits},
+{8, 6, 6, times12_230_bits},
+{4, 9, 6, times12_231_bits},
+{5, 9, 9, times12_232_bits},
+{5, 9, 9, times12_233_bits},
+{5, 9, 9, times12_234_bits},
+{5, 8, 8, times12_235_bits},
+{3, 9, 9, times12_236_bits},
+{3, 9, 9, times12_237_bits},
+{3, 9, 9, times12_238_bits},
+{3, 8, 8, times12_239_bits},
+{4, 9, 9, times12_240_bits},
+{6, 9, 9, times12_241_bits},
+{4, 9, 9, times12_242_bits},
+{4, 9, 9, times12_243_bits},
+{4, 9, 9, times12_244_bits},
+{4, 9, 9, times12_245_bits},
+{4, 8, 8, times12_246_bits},
+{5, 5, 6, times12_247_bits},
+{6, 7, 6, times12_248_bits},
+{6, 9, 9, times12_249_bits},
+{6, 9, 9, times12_250_bits},
+{6, 9, 9, times12_251_bits},
+{6, 8, 8, times12_252_bits},
+{6, 12, 9, times12_253_bits},
+{5, 12, 9, times12_254_bits},
+{6, 11, 8, times12_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times14.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times14.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times14.bdf	(revision 15879)
@@ -0,0 +1,3205 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Times-Medium-R-Normal--14-100-100-100-P-74-ISO8859-1
+SIZE 10 100 100
+FONTBOUNDINGBOX 14 17 -1 -3
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Times"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 14
+POINT_SIZE 100
+RESOLUTION_X 100
+RESOLUTION_Y 100
+SPACING "P"
+AVERAGE_WIDTH 74
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 10
+X_HEIGHT 7
+FACE_NAME "Times Roman"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "Times is a trademark of Linotype-Hell AG and/or its subsidiaries."
+_DEC_DEVICE_FONTNAMES "PS=Times-Roman"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Times Roman"
+FONT "-Adobe-Times-Medium-R-Normal--14-100-100-100-P-74-ISO8859-1"
+WEIGHT 10
+RESOLUTION 138
+QUAD_WIDTH 8
+DEFAULT_CHAR 32
+FONT_ASCENT 12
+FONT_DESCENT 3
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 1 10 2 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+00
+80
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 432 0
+DWIDTH 6 0
+BBX 3 3 1 7
+BITMAP
+a0
+a0
+a0
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 10 0 0
+BITMAP
+14
+14
+7e
+28
+28
+28
+fc
+50
+50
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 12 1 -1
+BITMAP
+20
+78
+a8
+a0
+a0
+70
+28
+28
+28
+a8
+f0
+20
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 864 0
+DWIDTH 12 0
+BBX 9 10 1 0
+BITMAP
+7180
+df00
+9200
+9400
+6800
+0b00
+1680
+2480
+4480
+4300
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 10 10 1 0
+BITMAP
+1800
+2400
+2400
+3800
+1380
+7900
+ca00
+8400
+ce40
+7380
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 2 3 1 7
+BITMAP
+c0
+40
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 13 1 -3
+BITMAP
+20
+20
+40
+40
+80
+80
+80
+80
+80
+40
+40
+20
+20
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 13 1 -3
+BITMAP
+80
+80
+40
+40
+20
+20
+20
+20
+20
+40
+40
+80
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 6 1 4
+BITMAP
+20
+a8
+70
+70
+a8
+20
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+10
+10
+10
+fe
+10
+10
+10
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 2 3 1 -2
+BITMAP
+c0
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 6 1 1 3
+BITMAP
+fc
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 2 1 1 0
+BITMAP
+c0
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 12 0 -2
+BITMAP
+10
+10
+10
+20
+20
+20
+40
+40
+40
+80
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+78
+cc
+84
+84
+84
+84
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+20
+e0
+20
+20
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+70
+d8
+88
+08
+18
+10
+20
+40
+88
+f8
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+78
+8c
+04
+08
+30
+38
+04
+04
+cc
+78
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+08
+18
+18
+28
+68
+48
+88
+fc
+08
+08
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+78
+40
+80
+e0
+30
+18
+08
+08
+90
+e0
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+0c
+10
+20
+40
+78
+cc
+84
+84
+cc
+78
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+fc
+84
+08
+08
+10
+10
+20
+20
+40
+40
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+70
+98
+88
+c8
+70
+98
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+78
+cc
+84
+84
+cc
+78
+08
+10
+20
+c0
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 2 7 1 0
+BITMAP
+c0
+00
+00
+00
+00
+00
+c0
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 2 9 1 -2
+BITMAP
+c0
+00
+00
+00
+00
+00
+c0
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+06
+18
+60
+c0
+60
+18
+06
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 3 0 2
+BITMAP
+fe
+00
+fe
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+c0
+30
+0c
+06
+0c
+30
+c0
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 432 0
+DWIDTH 6 0
+BBX 5 10 0 0
+BITMAP
+70
+88
+88
+08
+10
+20
+20
+00
+20
+20
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 936 0
+DWIDTH 13 0
+BBX 12 12 0 -2
+BITMAP
+0f80
+3060
+6020
+4690
+8910
+9110
+9110
+9320
+cdc0
+4000
+30c0
+0f00
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+0800
+0800
+1400
+1400
+2200
+2200
+3e00
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+fc
+46
+42
+46
+7c
+46
+42
+42
+46
+fc
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+3d
+63
+41
+81
+80
+80
+80
+c1
+62
+3c
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 9 10 0 0
+BITMAP
+fe00
+2300
+2100
+2080
+2080
+2080
+2080
+2100
+2300
+fe00
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+fe
+42
+40
+44
+7c
+44
+40
+42
+42
+fe
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 10 1 0
+BITMAP
+fe
+42
+40
+44
+7c
+44
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+3d00
+6300
+4100
+8100
+8000
+8780
+8100
+c100
+6300
+3e00
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+e7
+42
+42
+42
+7e
+42
+42
+42
+42
+e7
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 10 1 0
+BITMAP
+e0
+40
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 432 0
+DWIDTH 6 0
+BBX 4 10 1 0
+BITMAP
+70
+20
+20
+20
+20
+20
+20
+20
+a0
+c0
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+ee
+44
+48
+50
+70
+50
+48
+44
+46
+e7
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+e0
+40
+40
+40
+40
+40
+40
+40
+42
+fe
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 936 0
+DWIDTH 13 0
+BBX 11 10 1 0
+BITMAP
+e0e0
+60c0
+5140
+5140
+5b40
+4a40
+4a40
+4e40
+4440
+e4e0
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 10 1 0
+BITMAP
+e380
+6100
+5100
+5900
+4900
+4d00
+4500
+4500
+4300
+e300
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+3c
+66
+42
+81
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 10 1 0
+BITMAP
+f8
+4c
+44
+44
+4c
+78
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 13 1 -3
+BITMAP
+3c
+66
+42
+81
+81
+81
+81
+42
+66
+3c
+08
+06
+03
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 10 0 0
+BITMAP
+fc00
+2600
+2200
+2200
+2600
+3c00
+2400
+2200
+2300
+f180
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 10 1 0
+BITMAP
+74
+cc
+84
+c0
+70
+18
+04
+84
+cc
+b8
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 10 1 0
+BITMAP
+fe
+92
+92
+10
+10
+10
+10
+10
+10
+38
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 10 1 0
+BITMAP
+e7
+42
+42
+42
+42
+42
+42
+42
+66
+3c
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 10 0 0
+BITMAP
+e380
+4100
+6300
+2200
+2200
+3600
+1400
+1c00
+0800
+0800
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 936 0
+DWIDTH 13 0
+BBX 13 10 0 0
+BITMAP
+e738
+4210
+6230
+2220
+2520
+3560
+1540
+18c0
+0880
+0880
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 10 10 0 0
+BITMAP
+7380
+2100
+1200
+1200
+0c00
+0c00
+1200
+2100
+6180
+f3c0
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 10 0 0
+BITMAP
+e380
+4100
+2200
+2200
+1400
+0800
+0800
+0800
+0800
+1c00
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 8 10 0 0
+BITMAP
+7f
+43
+02
+04
+08
+10
+20
+40
+c1
+ff
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 13 1 -3
+BITMAP
+e0
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+e0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 10 0 0
+BITMAP
+80
+80
+40
+40
+40
+20
+20
+20
+10
+10
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 13 1 -3
+BITMAP
+e0
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+20
+e0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 5 1 5
+BITMAP
+20
+50
+50
+88
+88
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 1 0 -3
+BITMAP
+fe
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 2 3 1 7
+BITMAP
+40
+80
+c0
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 7 1 0
+BITMAP
+70
+c8
+18
+68
+88
+c8
+74
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+c0
+40
+40
+58
+6c
+44
+44
+44
+4c
+78
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 7 1 0
+BITMAP
+78
+cc
+80
+80
+80
+c4
+78
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+18
+08
+08
+78
+c8
+88
+88
+88
+d8
+74
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 7 1 0
+BITMAP
+70
+88
+f8
+80
+80
+c4
+78
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 5 10 0 0
+BITMAP
+38
+60
+40
+f8
+40
+40
+40
+40
+40
+f0
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 1 -3
+BITMAP
+78
+d0
+88
+c8
+70
+40
+78
+84
+cc
+70
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 10 0 0
+BITMAP
+c0
+40
+40
+58
+6c
+44
+44
+44
+44
+ee
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 3 10 0 0
+BITMAP
+40
+40
+00
+c0
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 3 13 0 -3
+BITMAP
+20
+20
+00
+60
+20
+20
+20
+20
+20
+20
+20
+a0
+c0
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 10 0 0
+BITMAP
+c0
+40
+40
+4c
+48
+70
+50
+48
+4c
+e6
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 3 10 0 0
+BITMAP
+c0
+40
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 11 7 0 0
+BITMAP
+db80
+6ec0
+4440
+4440
+4440
+4440
+eee0
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 7 0 0
+BITMAP
+d8
+6c
+44
+44
+44
+44
+ee
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 7 1 0
+BITMAP
+70
+d8
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 0 -3
+BITMAP
+d8
+6c
+44
+44
+44
+6c
+58
+40
+40
+e0
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 1 -3
+BITMAP
+78
+c8
+88
+88
+88
+d8
+68
+08
+08
+1c
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 5 7 0 0
+BITMAP
+b8
+60
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 432 0
+DWIDTH 6 0
+BBX 4 7 1 0
+BITMAP
+70
+90
+c0
+60
+30
+90
+e0
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 8 0 0
+BITMAP
+40
+f0
+40
+40
+40
+40
+40
+30
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 7 0 0
+BITMAP
+cc
+44
+44
+44
+44
+6c
+36
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 7 0 0
+BITMAP
+ee
+44
+44
+28
+28
+10
+10
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 11 7 0 0
+BITMAP
+eee0
+4440
+4440
+2480
+3b80
+1100
+1100
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 7 0 0
+BITMAP
+ee
+44
+38
+10
+38
+44
+ee
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 10 0 -3
+BITMAP
+ee
+44
+44
+28
+28
+10
+30
+20
+a0
+c0
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 432 0
+DWIDTH 6 0
+BBX 6 7 0 0
+BITMAP
+fc
+88
+18
+30
+60
+c4
+fc
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 13 1 -3
+BITMAP
+18
+20
+20
+20
+20
+40
+80
+40
+20
+20
+20
+20
+18
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 1 10 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 13 1 -3
+BITMAP
+c0
+20
+20
+20
+20
+10
+08
+10
+20
+20
+20
+20
+c0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 2 0 3
+BITMAP
+62
+9c
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 1 10 2 -3
+BITMAP
+80
+80
+00
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 9 0 -1
+BITMAP
+04
+7c
+cc
+90
+90
+a0
+e4
+78
+80
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 10 0 0
+BITMAP
+1c
+34
+20
+20
+f8
+20
+20
+20
+e2
+bc
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 7 1 1
+BITMAP
+88
+70
+88
+88
+88
+70
+88
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 10 0 0
+BITMAP
+ee
+44
+6c
+28
+7c
+10
+7c
+10
+10
+38
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 1 10 1 0
+BITMAP
+80
+80
+80
+80
+00
+00
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 13 1 -3
+BITMAP
+38
+58
+40
+60
+70
+98
+88
+c8
+70
+30
+10
+d0
+e0
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 2 1 8
+BITMAP
+a0
+a0
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 864 0
+DWIDTH 12 0
+BBX 10 10 1 0
+BITMAP
+1e00
+6180
+4e80
+9240
+9040
+9040
+9240
+4c80
+6180
+1e00
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 3 6 0 4
+BITMAP
+e0
+20
+a0
+e0
+00
+e0
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 6 0 0
+BITMAP
+24
+48
+90
+90
+48
+24
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 4 1 2
+BITMAP
+fe
+02
+02
+02
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 3 1 0 3
+BITMAP
+e0
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 864 0
+DWIDTH 12 0
+BBX 10 10 1 0
+BITMAP
+1e00
+6180
+5c80
+9240
+9c40
+9440
+9240
+5280
+6180
+1e00
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 1 0 8
+BITMAP
+f0
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 432 0
+DWIDTH 6 0
+BBX 4 4 1 6
+BITMAP
+60
+90
+90
+60
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 7 0 0
+BITMAP
+10
+10
+fe
+10
+10
+00
+fe
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 6 0 4
+BITMAP
+60
+90
+10
+20
+40
+f0
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 4 6 0 4
+BITMAP
+60
+90
+20
+10
+90
+60
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 3 1 8
+BITMAP
+20
+60
+80
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 10 0 -3
+BITMAP
+cc
+44
+44
+44
+44
+6c
+76
+40
+40
+60
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 13 0 -3
+BITMAP
+3e
+74
+f4
+f4
+f4
+74
+34
+14
+14
+14
+14
+14
+14
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 1 2 2 3
+BITMAP
+80
+80
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 3 1 -3
+BITMAP
+40
+20
+c0
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 288 0
+DWIDTH 4 0
+BBX 3 6 0 4
+BITMAP
+40
+c0
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 4 6 0 4
+BITMAP
+60
+90
+90
+60
+00
+f0
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 6 1 0
+BITMAP
+90
+48
+24
+24
+48
+90
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 10 10 0 0
+BITMAP
+4100
+c200
+4200
+4400
+4480
+e980
+0a80
+1480
+17c0
+2080
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 10 10 0 0
+BITMAP
+4100
+c200
+4200
+4400
+4580
+ea40
+0840
+1080
+1100
+23c0
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 10 10 0 0
+BITMAP
+6100
+9200
+2200
+1400
+9480
+6980
+0a80
+1480
+17c0
+2080
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 432 0
+DWIDTH 6 0
+BBX 5 10 0 -3
+BITMAP
+20
+20
+00
+20
+20
+40
+80
+88
+88
+70
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+1000
+1800
+0400
+0000
+0800
+0800
+1400
+1400
+2200
+2200
+3e00
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+0400
+0c00
+1000
+0000
+0800
+0800
+1400
+1400
+2200
+2200
+3e00
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+0800
+1c00
+2200
+0000
+0800
+0800
+1400
+1400
+2200
+2200
+3e00
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+1200
+2a00
+2400
+0000
+0800
+0800
+1400
+1400
+2200
+2200
+3e00
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 13 1 0
+BITMAP
+2400
+2400
+0000
+0800
+0800
+1400
+1400
+2200
+2200
+3e00
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+1800
+2400
+1800
+0000
+0800
+0800
+1400
+1400
+2200
+2200
+3e00
+4100
+4100
+e380
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 936 0
+DWIDTH 13 0
+BBX 11 10 1 0
+BITMAP
+1fe0
+0c20
+1400
+1440
+27c0
+2440
+3c00
+4420
+4420
+efe0
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 13 1 -3
+BITMAP
+3d
+63
+41
+81
+80
+80
+80
+c1
+62
+3c
+08
+04
+18
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+20
+30
+08
+00
+fe
+42
+40
+44
+7c
+44
+40
+42
+42
+fe
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+04
+0c
+10
+00
+fe
+42
+40
+44
+7c
+44
+40
+42
+42
+fe
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 14 1 0
+BITMAP
+10
+38
+44
+00
+fe
+42
+40
+44
+7c
+44
+40
+42
+42
+fe
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+24
+24
+00
+fe
+42
+40
+44
+7c
+44
+40
+42
+42
+fe
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 14 1 0
+BITMAP
+80
+c0
+20
+00
+e0
+40
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 14 1 0
+BITMAP
+20
+60
+80
+00
+e0
+40
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 5 14 0 0
+BITMAP
+20
+70
+88
+00
+70
+20
+20
+20
+20
+20
+20
+20
+20
+70
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 360 0
+DWIDTH 5 0
+BBX 3 13 1 0
+BITMAP
+a0
+a0
+00
+e0
+40
+40
+40
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 9 10 0 0
+BITMAP
+fe00
+2300
+2100
+2080
+f880
+2080
+2080
+2100
+2300
+fe00
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 14 1 0
+BITMAP
+1200
+2a00
+2400
+0000
+e380
+6100
+5100
+5900
+4900
+4d00
+4500
+4500
+4300
+e300
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+20
+30
+08
+00
+3c
+66
+42
+81
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+04
+0c
+10
+00
+3c
+66
+42
+81
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+10
+38
+44
+00
+3c
+66
+42
+81
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+24
+54
+48
+00
+3c
+66
+42
+81
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+24
+24
+00
+3c
+66
+42
+81
+81
+81
+81
+42
+66
+3c
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 7 1 0
+BITMAP
+82
+44
+28
+10
+28
+44
+82
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 9 12 0 -1
+BITMAP
+0080
+1f00
+3100
+2300
+4480
+4c80
+4880
+5080
+3100
+6300
+5e00
+8000
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+20
+30
+08
+00
+e7
+42
+42
+42
+42
+42
+42
+42
+66
+3c
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+04
+0c
+10
+00
+e7
+42
+42
+42
+42
+42
+42
+42
+66
+3c
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 14 1 0
+BITMAP
+10
+38
+44
+00
+e7
+42
+42
+42
+42
+42
+42
+42
+66
+3c
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 720 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+24
+24
+00
+e7
+42
+42
+42
+42
+42
+42
+42
+66
+3c
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 648 0
+DWIDTH 9 0
+BBX 9 14 0 0
+BITMAP
+0200
+0600
+0800
+0000
+e380
+4100
+2200
+2200
+1400
+0800
+0800
+0800
+0800
+1c00
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 6 10 1 0
+BITMAP
+e0
+40
+78
+4c
+44
+44
+4c
+78
+40
+e0
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 0 0
+BITMAP
+38
+6c
+44
+48
+70
+58
+4c
+44
+54
+d8
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 1 0
+BITMAP
+40
+60
+10
+00
+70
+c8
+18
+68
+88
+c8
+74
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 1 0
+BITMAP
+08
+18
+20
+00
+70
+c8
+18
+68
+88
+c8
+74
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 1 0
+BITMAP
+20
+70
+88
+00
+70
+c8
+18
+68
+88
+c8
+74
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 1 0
+BITMAP
+48
+a8
+90
+00
+70
+c8
+18
+68
+88
+c8
+74
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+50
+50
+00
+70
+c8
+18
+68
+88
+c8
+74
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 1 0
+BITMAP
+30
+48
+30
+00
+70
+c8
+18
+68
+88
+c8
+74
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 792 0
+DWIDTH 11 0
+BBX 9 7 1 0
+BITMAP
+7f00
+c980
+1f00
+6800
+8800
+cc80
+7700
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 1 -3
+BITMAP
+70
+c8
+80
+80
+80
+c4
+78
+20
+10
+60
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 1 0
+BITMAP
+40
+60
+10
+00
+70
+88
+f8
+80
+80
+c4
+78
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 1 0
+BITMAP
+08
+18
+20
+00
+70
+88
+f8
+80
+80
+c4
+78
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 11 1 0
+BITMAP
+20
+70
+88
+00
+70
+88
+f8
+80
+80
+c4
+78
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 10 1 0
+BITMAP
+50
+50
+00
+70
+88
+f8
+80
+80
+c4
+78
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 3 11 0 0
+BITMAP
+80
+c0
+20
+00
+c0
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 3 11 0 0
+BITMAP
+20
+60
+80
+00
+c0
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 5 11 -1 0
+BITMAP
+20
+70
+88
+00
+60
+20
+20
+20
+20
+20
+70
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 216 0
+DWIDTH 3 0
+BBX 3 10 0 0
+BITMAP
+a0
+a0
+00
+c0
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+d8
+60
+90
+78
+d8
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 11 0 0
+BITMAP
+24
+54
+48
+00
+d8
+6c
+44
+44
+44
+44
+ee
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 11 1 0
+BITMAP
+40
+60
+10
+00
+70
+d8
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 11 1 0
+BITMAP
+10
+30
+40
+00
+70
+d8
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 11 1 0
+BITMAP
+20
+70
+88
+00
+70
+d8
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 11 1 0
+BITMAP
+48
+a8
+90
+00
+70
+d8
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 5 10 1 0
+BITMAP
+50
+50
+00
+70
+d8
+88
+88
+88
+d8
+70
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 576 0
+DWIDTH 8 0
+BBX 7 7 1 0
+BITMAP
+10
+10
+00
+fe
+00
+10
+10
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 9 0 -1
+BITMAP
+02
+3c
+6c
+44
+44
+44
+6c
+78
+80
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 11 0 0
+BITMAP
+20
+30
+08
+00
+cc
+44
+44
+44
+44
+6c
+36
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 11 0 0
+BITMAP
+08
+18
+20
+00
+cc
+44
+44
+44
+44
+6c
+36
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 11 0 0
+BITMAP
+10
+38
+44
+00
+cc
+44
+44
+44
+44
+6c
+36
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 10 0 0
+BITMAP
+28
+28
+00
+cc
+44
+44
+44
+44
+6c
+36
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 14 0 -3
+BITMAP
+04
+0c
+10
+00
+ee
+44
+44
+28
+28
+10
+30
+20
+a0
+c0
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 6 13 0 -3
+BITMAP
+c0
+40
+40
+58
+6c
+44
+44
+44
+6c
+58
+40
+40
+e0
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 504 0
+DWIDTH 7 0
+BBX 7 13 0 -3
+BITMAP
+28
+28
+00
+ee
+44
+44
+28
+28
+10
+30
+20
+a0
+c0
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times14.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times14.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times14.h	(revision 15879)
@@ -0,0 +1,840 @@
+static unsigned char times14_0_bits[] = {
+0x00};
+static unsigned char times14_1_bits[] = {
+0x00};
+static unsigned char times14_2_bits[] = {
+0x00};
+static unsigned char times14_3_bits[] = {
+0x00};
+static unsigned char times14_4_bits[] = {
+0x00};
+static unsigned char times14_5_bits[] = {
+0x00};
+static unsigned char times14_6_bits[] = {
+0x00};
+static unsigned char times14_7_bits[] = {
+0x00};
+static unsigned char times14_8_bits[] = {
+0x00};
+static unsigned char times14_9_bits[] = {
+0x00};
+static unsigned char times14_10_bits[] = {
+0x00};
+static unsigned char times14_11_bits[] = {
+0x00};
+static unsigned char times14_12_bits[] = {
+0x00};
+static unsigned char times14_13_bits[] = {
+0x00};
+static unsigned char times14_14_bits[] = {
+0x00};
+static unsigned char times14_15_bits[] = {
+0x00};
+static unsigned char times14_16_bits[] = {
+0x00};
+static unsigned char times14_17_bits[] = {
+0x00};
+static unsigned char times14_18_bits[] = {
+0x00};
+static unsigned char times14_19_bits[] = {
+0x00};
+static unsigned char times14_20_bits[] = {
+0x00};
+static unsigned char times14_21_bits[] = {
+0x00};
+static unsigned char times14_22_bits[] = {
+0x00};
+static unsigned char times14_23_bits[] = {
+0x00};
+static unsigned char times14_24_bits[] = {
+0x00};
+static unsigned char times14_25_bits[] = {
+0x00};
+static unsigned char times14_26_bits[] = {
+0x00};
+static unsigned char times14_27_bits[] = {
+0x00};
+static unsigned char times14_28_bits[] = {
+0x00};
+static unsigned char times14_29_bits[] = {
+0x00};
+static unsigned char times14_30_bits[] = {
+0x00};
+static unsigned char times14_31_bits[] = {
+0x00};
+static unsigned char times14_32_bits[] = {
+0x00};
+static unsigned char times14_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01};
+static unsigned char times14_34_bits[] = {
+0x05, 0x05, 0x05};
+static unsigned char times14_35_bits[] = {
+0x28, 0x28, 0x7e, 0x14, 0x14, 0x14, 0x3f, 0x0a, 0x0a, 0x0a};
+static unsigned char times14_36_bits[] = {
+0x04, 0x1e, 0x15, 0x05, 0x05, 0x0e, 0x14, 0x14, 0x14, 0x15, 0x0f, 0x04};
+static unsigned char times14_37_bits[] = {
+0x8e, 0x01, 0xfb, 0x00, 0x49, 0x00, 0x29, 0x00, 0x16, 0x00, 0xd0, 0x00, 
+0x68, 0x01, 0x24, 0x01, 0x22, 0x01, 0xc2, 0x00};
+static unsigned char times14_38_bits[] = {
+0x18, 0x00, 0x24, 0x00, 0x24, 0x00, 0x1c, 0x00, 0xc8, 0x01, 0x9e, 0x00, 
+0x53, 0x00, 0x21, 0x00, 0x73, 0x02, 0xce, 0x01};
+static unsigned char times14_39_bits[] = {
+0x03, 0x02, 0x01};
+static unsigned char times14_40_bits[] = {
+0x04, 0x04, 0x02, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x04, 
+0x04};
+static unsigned char times14_41_bits[] = {
+0x01, 0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x02, 0x01, 
+0x01};
+static unsigned char times14_42_bits[] = {
+0x04, 0x15, 0x0e, 0x0e, 0x15, 0x04};
+static unsigned char times14_43_bits[] = {
+0x08, 0x08, 0x08, 0x7f, 0x08, 0x08, 0x08};
+static unsigned char times14_44_bits[] = {
+0x03, 0x02, 0x01};
+static unsigned char times14_45_bits[] = {
+0x3f};
+static unsigned char times14_46_bits[] = {
+0x03};
+static unsigned char times14_47_bits[] = {
+0x08, 0x08, 0x08, 0x04, 0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01, 0x01};
+static unsigned char times14_48_bits[] = {
+0x1e, 0x33, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char times14_49_bits[] = {
+0x04, 0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char times14_50_bits[] = {
+0x0e, 0x1b, 0x11, 0x10, 0x18, 0x08, 0x04, 0x02, 0x11, 0x1f};
+static unsigned char times14_51_bits[] = {
+0x1e, 0x31, 0x20, 0x10, 0x0c, 0x1c, 0x20, 0x20, 0x33, 0x1e};
+static unsigned char times14_52_bits[] = {
+0x10, 0x18, 0x18, 0x14, 0x16, 0x12, 0x11, 0x3f, 0x10, 0x10};
+static unsigned char times14_53_bits[] = {
+0x1e, 0x02, 0x01, 0x07, 0x0c, 0x18, 0x10, 0x10, 0x09, 0x07};
+static unsigned char times14_54_bits[] = {
+0x30, 0x08, 0x04, 0x02, 0x1e, 0x33, 0x21, 0x21, 0x33, 0x1e};
+static unsigned char times14_55_bits[] = {
+0x3f, 0x21, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02};
+static unsigned char times14_56_bits[] = {
+0x0e, 0x19, 0x11, 0x13, 0x0e, 0x19, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char times14_57_bits[] = {
+0x1e, 0x33, 0x21, 0x21, 0x33, 0x1e, 0x10, 0x08, 0x04, 0x03};
+static unsigned char times14_58_bits[] = {
+0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03};
+static unsigned char times14_59_bits[] = {
+0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x02, 0x01};
+static unsigned char times14_60_bits[] = {
+0x60, 0x18, 0x06, 0x03, 0x06, 0x18, 0x60};
+static unsigned char times14_61_bits[] = {
+0x7f, 0x00, 0x7f};
+static unsigned char times14_62_bits[] = {
+0x03, 0x0c, 0x30, 0x60, 0x30, 0x0c, 0x03};
+static unsigned char times14_63_bits[] = {
+0x0e, 0x11, 0x11, 0x10, 0x08, 0x04, 0x04, 0x00, 0x04, 0x04};
+static unsigned char times14_64_bits[] = {
+0xf0, 0x01, 0x0c, 0x06, 0x06, 0x04, 0x62, 0x09, 0x91, 0x08, 0x89, 0x08, 
+0x89, 0x08, 0xc9, 0x04, 0xb3, 0x03, 0x02, 0x00, 0x0c, 0x03, 0xf0, 0x00};
+static unsigned char times14_65_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 
+0x7c, 0x00, 0x82, 0x00, 0x82, 0x00, 0xc7, 0x01};
+static unsigned char times14_66_bits[] = {
+0x3f, 0x62, 0x42, 0x62, 0x3e, 0x62, 0x42, 0x42, 0x62, 0x3f};
+static unsigned char times14_67_bits[] = {
+0xbc, 0xc6, 0x82, 0x81, 0x01, 0x01, 0x01, 0x83, 0x46, 0x3c};
+static unsigned char times14_68_bits[] = {
+0x7f, 0x00, 0xc4, 0x00, 0x84, 0x00, 0x04, 0x01, 0x04, 0x01, 0x04, 0x01, 
+0x04, 0x01, 0x84, 0x00, 0xc4, 0x00, 0x7f, 0x00};
+static unsigned char times14_69_bits[] = {
+0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 0x42, 0x7f};
+static unsigned char times14_70_bits[] = {
+0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times14_71_bits[] = {
+0xbc, 0x00, 0xc6, 0x00, 0x82, 0x00, 0x81, 0x00, 0x01, 0x00, 0xe1, 0x01, 
+0x81, 0x00, 0x83, 0x00, 0xc6, 0x00, 0x7c, 0x00};
+static unsigned char times14_72_bits[] = {
+0xe7, 0x42, 0x42, 0x42, 0x7e, 0x42, 0x42, 0x42, 0x42, 0xe7};
+static unsigned char times14_73_bits[] = {
+0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times14_74_bits[] = {
+0x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x03};
+static unsigned char times14_75_bits[] = {
+0x77, 0x22, 0x12, 0x0a, 0x0e, 0x0a, 0x12, 0x22, 0x62, 0xe7};
+static unsigned char times14_76_bits[] = {
+0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x42, 0x7f};
+static unsigned char times14_77_bits[] = {
+0x07, 0x07, 0x06, 0x03, 0x8a, 0x02, 0x8a, 0x02, 0xda, 0x02, 0x52, 0x02, 
+0x52, 0x02, 0x72, 0x02, 0x22, 0x02, 0x27, 0x07};
+static unsigned char times14_78_bits[] = {
+0xc7, 0x01, 0x86, 0x00, 0x8a, 0x00, 0x9a, 0x00, 0x92, 0x00, 0xb2, 0x00, 
+0xa2, 0x00, 0xa2, 0x00, 0xc2, 0x00, 0xc7, 0x00};
+static unsigned char times14_79_bits[] = {
+0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c};
+static unsigned char times14_80_bits[] = {
+0x1f, 0x32, 0x22, 0x22, 0x32, 0x1e, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times14_81_bits[] = {
+0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x66, 0x3c, 0x10, 0x60, 
+0xc0};
+static unsigned char times14_82_bits[] = {
+0x3f, 0x00, 0x64, 0x00, 0x44, 0x00, 0x44, 0x00, 0x64, 0x00, 0x3c, 0x00, 
+0x24, 0x00, 0x44, 0x00, 0xc4, 0x00, 0x8f, 0x01};
+static unsigned char times14_83_bits[] = {
+0x2e, 0x33, 0x21, 0x03, 0x0e, 0x18, 0x20, 0x21, 0x33, 0x1d};
+static unsigned char times14_84_bits[] = {
+0x7f, 0x49, 0x49, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x1c};
+static unsigned char times14_85_bits[] = {
+0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x66, 0x3c};
+static unsigned char times14_86_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0xc6, 0x00, 0x44, 0x00, 0x44, 0x00, 0x6c, 0x00, 
+0x28, 0x00, 0x38, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char times14_87_bits[] = {
+0xe7, 0x1c, 0x42, 0x08, 0x46, 0x0c, 0x44, 0x04, 0xa4, 0x04, 0xac, 0x06, 
+0xa8, 0x02, 0x18, 0x03, 0x10, 0x01, 0x10, 0x01};
+static unsigned char times14_88_bits[] = {
+0xce, 0x01, 0x84, 0x00, 0x48, 0x00, 0x48, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x48, 0x00, 0x84, 0x00, 0x86, 0x01, 0xcf, 0x03};
+static unsigned char times14_89_bits[] = {
+0xc7, 0x01, 0x82, 0x00, 0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x38, 0x00};
+static unsigned char times14_90_bits[] = {
+0xfe, 0xc2, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x83, 0xff};
+static unsigned char times14_91_bits[] = {
+0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x07};
+static unsigned char times14_92_bits[] = {
+0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04, 0x04, 0x08, 0x08};
+static unsigned char times14_93_bits[] = {
+0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x07};
+static unsigned char times14_94_bits[] = {
+0x04, 0x0a, 0x0a, 0x11, 0x11};
+static unsigned char times14_95_bits[] = {
+0x7f};
+static unsigned char times14_96_bits[] = {
+0x02, 0x01, 0x03};
+static unsigned char times14_97_bits[] = {
+0x0e, 0x13, 0x18, 0x16, 0x11, 0x13, 0x2e};
+static unsigned char times14_98_bits[] = {
+0x03, 0x02, 0x02, 0x1a, 0x36, 0x22, 0x22, 0x22, 0x32, 0x1e};
+static unsigned char times14_99_bits[] = {
+0x1e, 0x33, 0x01, 0x01, 0x01, 0x23, 0x1e};
+static unsigned char times14_100_bits[] = {
+0x18, 0x10, 0x10, 0x1e, 0x13, 0x11, 0x11, 0x11, 0x1b, 0x2e};
+static unsigned char times14_101_bits[] = {
+0x0e, 0x11, 0x1f, 0x01, 0x01, 0x23, 0x1e};
+static unsigned char times14_102_bits[] = {
+0x1c, 0x06, 0x02, 0x1f, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0f};
+static unsigned char times14_103_bits[] = {
+0x1e, 0x0b, 0x11, 0x13, 0x0e, 0x02, 0x1e, 0x21, 0x33, 0x0e};
+static unsigned char times14_104_bits[] = {
+0x03, 0x02, 0x02, 0x1a, 0x36, 0x22, 0x22, 0x22, 0x22, 0x77};
+static unsigned char times14_105_bits[] = {
+0x02, 0x02, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times14_106_bits[] = {
+0x04, 0x04, 0x00, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 
+0x03};
+static unsigned char times14_107_bits[] = {
+0x03, 0x02, 0x02, 0x32, 0x12, 0x0e, 0x0a, 0x12, 0x32, 0x67};
+static unsigned char times14_108_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times14_109_bits[] = {
+0xdb, 0x01, 0x76, 0x03, 0x22, 0x02, 0x22, 0x02, 0x22, 0x02, 0x22, 0x02, 
+0x77, 0x07};
+static unsigned char times14_110_bits[] = {
+0x1b, 0x36, 0x22, 0x22, 0x22, 0x22, 0x77};
+static unsigned char times14_111_bits[] = {
+0x0e, 0x1b, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char times14_112_bits[] = {
+0x1b, 0x36, 0x22, 0x22, 0x22, 0x36, 0x1a, 0x02, 0x02, 0x07};
+static unsigned char times14_113_bits[] = {
+0x1e, 0x13, 0x11, 0x11, 0x11, 0x1b, 0x16, 0x10, 0x10, 0x38};
+static unsigned char times14_114_bits[] = {
+0x1d, 0x06, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times14_115_bits[] = {
+0x0e, 0x09, 0x03, 0x06, 0x0c, 0x09, 0x07};
+static unsigned char times14_116_bits[] = {
+0x02, 0x0f, 0x02, 0x02, 0x02, 0x02, 0x02, 0x0c};
+static unsigned char times14_117_bits[] = {
+0x33, 0x22, 0x22, 0x22, 0x22, 0x36, 0x6c};
+static unsigned char times14_118_bits[] = {
+0x77, 0x22, 0x22, 0x14, 0x14, 0x08, 0x08};
+static unsigned char times14_119_bits[] = {
+0x77, 0x07, 0x22, 0x02, 0x22, 0x02, 0x24, 0x01, 0xdc, 0x01, 0x88, 0x00, 
+0x88, 0x00};
+static unsigned char times14_120_bits[] = {
+0x77, 0x22, 0x1c, 0x08, 0x1c, 0x22, 0x77};
+static unsigned char times14_121_bits[] = {
+0x77, 0x22, 0x22, 0x14, 0x14, 0x08, 0x0c, 0x04, 0x05, 0x03};
+static unsigned char times14_122_bits[] = {
+0x3f, 0x11, 0x18, 0x0c, 0x06, 0x23, 0x3f};
+static unsigned char times14_123_bits[] = {
+0x18, 0x04, 0x04, 0x04, 0x04, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 
+0x18};
+static unsigned char times14_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times14_125_bits[] = {
+0x03, 0x04, 0x04, 0x04, 0x04, 0x08, 0x10, 0x08, 0x04, 0x04, 0x04, 0x04, 
+0x03};
+static unsigned char times14_126_bits[] = {
+0x46, 0x39};
+static unsigned char times14_127_bits[] = {
+0x00};
+static unsigned char times14_128_bits[] = {
+0x00};
+static unsigned char times14_129_bits[] = {
+0x00};
+static unsigned char times14_130_bits[] = {
+0x00};
+static unsigned char times14_131_bits[] = {
+0x00};
+static unsigned char times14_132_bits[] = {
+0x00};
+static unsigned char times14_133_bits[] = {
+0x00};
+static unsigned char times14_134_bits[] = {
+0x00};
+static unsigned char times14_135_bits[] = {
+0x00};
+static unsigned char times14_136_bits[] = {
+0x00};
+static unsigned char times14_137_bits[] = {
+0x00};
+static unsigned char times14_138_bits[] = {
+0x00};
+static unsigned char times14_139_bits[] = {
+0x00};
+static unsigned char times14_140_bits[] = {
+0x00};
+static unsigned char times14_141_bits[] = {
+0x00};
+static unsigned char times14_142_bits[] = {
+0x00};
+static unsigned char times14_143_bits[] = {
+0x00};
+static unsigned char times14_144_bits[] = {
+0x00};
+static unsigned char times14_145_bits[] = {
+0x00};
+static unsigned char times14_146_bits[] = {
+0x00};
+static unsigned char times14_147_bits[] = {
+0x00};
+static unsigned char times14_148_bits[] = {
+0x00};
+static unsigned char times14_149_bits[] = {
+0x00};
+static unsigned char times14_150_bits[] = {
+0x00};
+static unsigned char times14_151_bits[] = {
+0x00};
+static unsigned char times14_152_bits[] = {
+0x00};
+static unsigned char times14_153_bits[] = {
+0x00};
+static unsigned char times14_154_bits[] = {
+0x00};
+static unsigned char times14_155_bits[] = {
+0x00};
+static unsigned char times14_156_bits[] = {
+0x00};
+static unsigned char times14_157_bits[] = {
+0x00};
+static unsigned char times14_158_bits[] = {
+0x00};
+static unsigned char times14_159_bits[] = {
+0x00};
+static unsigned char times14_160_bits[] = {
+0x00};
+static unsigned char times14_161_bits[] = {
+0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times14_162_bits[] = {
+0x20, 0x3e, 0x33, 0x09, 0x09, 0x05, 0x27, 0x1e, 0x01};
+static unsigned char times14_163_bits[] = {
+0x38, 0x2c, 0x04, 0x04, 0x1f, 0x04, 0x04, 0x04, 0x47, 0x3d};
+static unsigned char times14_164_bits[] = {
+0x11, 0x0e, 0x11, 0x11, 0x11, 0x0e, 0x11};
+static unsigned char times14_165_bits[] = {
+0x77, 0x22, 0x36, 0x14, 0x3e, 0x08, 0x3e, 0x08, 0x08, 0x1c};
+static unsigned char times14_166_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times14_167_bits[] = {
+0x1c, 0x1a, 0x02, 0x06, 0x0e, 0x19, 0x11, 0x13, 0x0e, 0x0c, 0x08, 0x0b, 
+0x07};
+static unsigned char times14_168_bits[] = {
+0x05, 0x05};
+static unsigned char times14_169_bits[] = {
+0x78, 0x00, 0x86, 0x01, 0x72, 0x01, 0x49, 0x02, 0x09, 0x02, 0x09, 0x02, 
+0x49, 0x02, 0x32, 0x01, 0x86, 0x01, 0x78, 0x00};
+static unsigned char times14_170_bits[] = {
+0x07, 0x04, 0x05, 0x07, 0x00, 0x07};
+static unsigned char times14_171_bits[] = {
+0x24, 0x12, 0x09, 0x09, 0x12, 0x24};
+static unsigned char times14_172_bits[] = {
+0x7f, 0x40, 0x40, 0x40};
+static unsigned char times14_173_bits[] = {
+0x07};
+static unsigned char times14_174_bits[] = {
+0x78, 0x00, 0x86, 0x01, 0x3a, 0x01, 0x49, 0x02, 0x39, 0x02, 0x29, 0x02, 
+0x49, 0x02, 0x4a, 0x01, 0x86, 0x01, 0x78, 0x00};
+static unsigned char times14_175_bits[] = {
+0x0f};
+static unsigned char times14_176_bits[] = {
+0x06, 0x09, 0x09, 0x06};
+static unsigned char times14_177_bits[] = {
+0x08, 0x08, 0x7f, 0x08, 0x08, 0x00, 0x7f};
+static unsigned char times14_178_bits[] = {
+0x06, 0x09, 0x08, 0x04, 0x02, 0x0f};
+static unsigned char times14_179_bits[] = {
+0x06, 0x09, 0x04, 0x08, 0x09, 0x06};
+static unsigned char times14_180_bits[] = {
+0x04, 0x06, 0x01};
+static unsigned char times14_181_bits[] = {
+0x33, 0x22, 0x22, 0x22, 0x22, 0x36, 0x6e, 0x02, 0x02, 0x06};
+static unsigned char times14_182_bits[] = {
+0x7c, 0x2e, 0x2f, 0x2f, 0x2f, 0x2e, 0x2c, 0x28, 0x28, 0x28, 0x28, 0x28, 
+0x28};
+static unsigned char times14_183_bits[] = {
+0x01, 0x01};
+static unsigned char times14_184_bits[] = {
+0x02, 0x04, 0x03};
+static unsigned char times14_185_bits[] = {
+0x02, 0x03, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times14_186_bits[] = {
+0x06, 0x09, 0x09, 0x06, 0x00, 0x0f};
+static unsigned char times14_187_bits[] = {
+0x09, 0x12, 0x24, 0x24, 0x12, 0x09};
+static unsigned char times14_188_bits[] = {
+0x82, 0x00, 0x43, 0x00, 0x42, 0x00, 0x22, 0x00, 0x22, 0x01, 0x97, 0x01, 
+0x50, 0x01, 0x28, 0x01, 0xe8, 0x03, 0x04, 0x01};
+static unsigned char times14_189_bits[] = {
+0x82, 0x00, 0x43, 0x00, 0x42, 0x00, 0x22, 0x00, 0xa2, 0x01, 0x57, 0x02, 
+0x10, 0x02, 0x08, 0x01, 0x88, 0x00, 0xc4, 0x03};
+static unsigned char times14_190_bits[] = {
+0x86, 0x00, 0x49, 0x00, 0x44, 0x00, 0x28, 0x00, 0x29, 0x01, 0x96, 0x01, 
+0x50, 0x01, 0x28, 0x01, 0xe8, 0x03, 0x04, 0x01};
+static unsigned char times14_191_bits[] = {
+0x04, 0x04, 0x00, 0x04, 0x04, 0x02, 0x01, 0x11, 0x11, 0x0e};
+static unsigned char times14_192_bits[] = {
+0x08, 0x00, 0x18, 0x00, 0x20, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0xc7, 0x01};
+static unsigned char times14_193_bits[] = {
+0x20, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0xc7, 0x01};
+static unsigned char times14_194_bits[] = {
+0x10, 0x00, 0x38, 0x00, 0x44, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0xc7, 0x01};
+static unsigned char times14_195_bits[] = {
+0x48, 0x00, 0x54, 0x00, 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0xc7, 0x01};
+static unsigned char times14_196_bits[] = {
+0x24, 0x00, 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x28, 0x00, 
+0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 0x82, 0x00, 
+0xc7, 0x01};
+static unsigned char times14_197_bits[] = {
+0x18, 0x00, 0x24, 0x00, 0x18, 0x00, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x28, 0x00, 0x28, 0x00, 0x44, 0x00, 0x44, 0x00, 0x7c, 0x00, 0x82, 0x00, 
+0x82, 0x00, 0xc7, 0x01};
+static unsigned char times14_198_bits[] = {
+0xf8, 0x07, 0x30, 0x04, 0x28, 0x00, 0x28, 0x02, 0xe4, 0x03, 0x24, 0x02, 
+0x3c, 0x00, 0x22, 0x04, 0x22, 0x04, 0xf7, 0x07};
+static unsigned char times14_199_bits[] = {
+0xbc, 0xc6, 0x82, 0x81, 0x01, 0x01, 0x01, 0x83, 0x46, 0x3c, 0x10, 0x20, 
+0x18};
+static unsigned char times14_200_bits[] = {
+0x04, 0x0c, 0x10, 0x00, 0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 
+0x42, 0x7f};
+static unsigned char times14_201_bits[] = {
+0x20, 0x30, 0x08, 0x00, 0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 
+0x42, 0x7f};
+static unsigned char times14_202_bits[] = {
+0x08, 0x1c, 0x22, 0x00, 0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 
+0x42, 0x7f};
+static unsigned char times14_203_bits[] = {
+0x24, 0x24, 0x00, 0x7f, 0x42, 0x02, 0x22, 0x3e, 0x22, 0x02, 0x42, 0x42, 
+0x7f};
+static unsigned char times14_204_bits[] = {
+0x01, 0x03, 0x04, 0x00, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 
+0x02, 0x07};
+static unsigned char times14_205_bits[] = {
+0x04, 0x06, 0x01, 0x00, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 
+0x02, 0x07};
+static unsigned char times14_206_bits[] = {
+0x04, 0x0e, 0x11, 0x00, 0x0e, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 
+0x04, 0x0e};
+static unsigned char times14_207_bits[] = {
+0x05, 0x05, 0x00, 0x07, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 
+0x07};
+static unsigned char times14_208_bits[] = {
+0x7f, 0x00, 0xc4, 0x00, 0x84, 0x00, 0x04, 0x01, 0x1f, 0x01, 0x04, 0x01, 
+0x04, 0x01, 0x84, 0x00, 0xc4, 0x00, 0x7f, 0x00};
+static unsigned char times14_209_bits[] = {
+0x48, 0x00, 0x54, 0x00, 0x24, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x86, 0x00, 
+0x8a, 0x00, 0x9a, 0x00, 0x92, 0x00, 0xb2, 0x00, 0xa2, 0x00, 0xa2, 0x00, 
+0xc2, 0x00, 0xc7, 0x00};
+static unsigned char times14_210_bits[] = {
+0x04, 0x0c, 0x10, 0x00, 0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 
+0x66, 0x3c};
+static unsigned char times14_211_bits[] = {
+0x20, 0x30, 0x08, 0x00, 0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 
+0x66, 0x3c};
+static unsigned char times14_212_bits[] = {
+0x08, 0x1c, 0x22, 0x00, 0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 
+0x66, 0x3c};
+static unsigned char times14_213_bits[] = {
+0x24, 0x2a, 0x12, 0x00, 0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 
+0x66, 0x3c};
+static unsigned char times14_214_bits[] = {
+0x24, 0x24, 0x00, 0x3c, 0x66, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x66, 
+0x3c};
+static unsigned char times14_215_bits[] = {
+0x41, 0x22, 0x14, 0x08, 0x14, 0x22, 0x41};
+static unsigned char times14_216_bits[] = {
+0x00, 0x01, 0xf8, 0x00, 0x8c, 0x00, 0xc4, 0x00, 0x22, 0x01, 0x32, 0x01, 
+0x12, 0x01, 0x0a, 0x01, 0x8c, 0x00, 0xc6, 0x00, 0x7a, 0x00, 0x01, 0x00};
+static unsigned char times14_217_bits[] = {
+0x04, 0x0c, 0x10, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 
+0x66, 0x3c};
+static unsigned char times14_218_bits[] = {
+0x20, 0x30, 0x08, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 
+0x66, 0x3c};
+static unsigned char times14_219_bits[] = {
+0x08, 0x1c, 0x22, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 
+0x66, 0x3c};
+static unsigned char times14_220_bits[] = {
+0x24, 0x24, 0x00, 0xe7, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x66, 
+0x3c};
+static unsigned char times14_221_bits[] = {
+0x40, 0x00, 0x60, 0x00, 0x10, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x82, 0x00, 
+0x44, 0x00, 0x44, 0x00, 0x28, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 
+0x10, 0x00, 0x38, 0x00};
+static unsigned char times14_222_bits[] = {
+0x07, 0x02, 0x1e, 0x32, 0x22, 0x22, 0x32, 0x1e, 0x02, 0x07};
+static unsigned char times14_223_bits[] = {
+0x1c, 0x36, 0x22, 0x12, 0x0e, 0x1a, 0x32, 0x22, 0x2a, 0x1b};
+static unsigned char times14_224_bits[] = {
+0x02, 0x06, 0x08, 0x00, 0x0e, 0x13, 0x18, 0x16, 0x11, 0x13, 0x2e};
+static unsigned char times14_225_bits[] = {
+0x10, 0x18, 0x04, 0x00, 0x0e, 0x13, 0x18, 0x16, 0x11, 0x13, 0x2e};
+static unsigned char times14_226_bits[] = {
+0x04, 0x0e, 0x11, 0x00, 0x0e, 0x13, 0x18, 0x16, 0x11, 0x13, 0x2e};
+static unsigned char times14_227_bits[] = {
+0x12, 0x15, 0x09, 0x00, 0x0e, 0x13, 0x18, 0x16, 0x11, 0x13, 0x2e};
+static unsigned char times14_228_bits[] = {
+0x0a, 0x0a, 0x00, 0x0e, 0x13, 0x18, 0x16, 0x11, 0x13, 0x2e};
+static unsigned char times14_229_bits[] = {
+0x0c, 0x12, 0x0c, 0x00, 0x0e, 0x13, 0x18, 0x16, 0x11, 0x13, 0x2e};
+static unsigned char times14_230_bits[] = {
+0xfe, 0x00, 0x93, 0x01, 0xf8, 0x00, 0x16, 0x00, 0x11, 0x00, 0x33, 0x01, 
+0xee, 0x00};
+static unsigned char times14_231_bits[] = {
+0x0e, 0x13, 0x01, 0x01, 0x01, 0x23, 0x1e, 0x04, 0x08, 0x06};
+static unsigned char times14_232_bits[] = {
+0x02, 0x06, 0x08, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x01, 0x23, 0x1e};
+static unsigned char times14_233_bits[] = {
+0x10, 0x18, 0x04, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x01, 0x23, 0x1e};
+static unsigned char times14_234_bits[] = {
+0x04, 0x0e, 0x11, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x01, 0x23, 0x1e};
+static unsigned char times14_235_bits[] = {
+0x0a, 0x0a, 0x00, 0x0e, 0x11, 0x1f, 0x01, 0x01, 0x23, 0x1e};
+static unsigned char times14_236_bits[] = {
+0x01, 0x03, 0x04, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times14_237_bits[] = {
+0x04, 0x06, 0x01, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times14_238_bits[] = {
+0x04, 0x0e, 0x11, 0x00, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x0e};
+static unsigned char times14_239_bits[] = {
+0x05, 0x05, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times14_240_bits[] = {
+0x1b, 0x06, 0x09, 0x1e, 0x1b, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char times14_241_bits[] = {
+0x24, 0x2a, 0x12, 0x00, 0x1b, 0x36, 0x22, 0x22, 0x22, 0x22, 0x77};
+static unsigned char times14_242_bits[] = {
+0x02, 0x06, 0x08, 0x00, 0x0e, 0x1b, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char times14_243_bits[] = {
+0x08, 0x0c, 0x02, 0x00, 0x0e, 0x1b, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char times14_244_bits[] = {
+0x04, 0x0e, 0x11, 0x00, 0x0e, 0x1b, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char times14_245_bits[] = {
+0x12, 0x15, 0x09, 0x00, 0x0e, 0x1b, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char times14_246_bits[] = {
+0x0a, 0x0a, 0x00, 0x0e, 0x1b, 0x11, 0x11, 0x11, 0x1b, 0x0e};
+static unsigned char times14_247_bits[] = {
+0x08, 0x08, 0x00, 0x7f, 0x00, 0x08, 0x08};
+static unsigned char times14_248_bits[] = {
+0x40, 0x3c, 0x36, 0x22, 0x22, 0x22, 0x36, 0x1e, 0x01};
+static unsigned char times14_249_bits[] = {
+0x04, 0x0c, 0x10, 0x00, 0x33, 0x22, 0x22, 0x22, 0x22, 0x36, 0x6c};
+static unsigned char times14_250_bits[] = {
+0x10, 0x18, 0x04, 0x00, 0x33, 0x22, 0x22, 0x22, 0x22, 0x36, 0x6c};
+static unsigned char times14_251_bits[] = {
+0x08, 0x1c, 0x22, 0x00, 0x33, 0x22, 0x22, 0x22, 0x22, 0x36, 0x6c};
+static unsigned char times14_252_bits[] = {
+0x14, 0x14, 0x00, 0x33, 0x22, 0x22, 0x22, 0x22, 0x36, 0x6c};
+static unsigned char times14_253_bits[] = {
+0x20, 0x30, 0x08, 0x00, 0x77, 0x22, 0x22, 0x14, 0x14, 0x08, 0x0c, 0x04, 
+0x05, 0x03};
+static unsigned char times14_254_bits[] = {
+0x03, 0x02, 0x02, 0x1a, 0x36, 0x22, 0x22, 0x22, 0x36, 0x1a, 0x02, 0x02, 
+0x07};
+static unsigned char times14_255_bits[] = {
+0x14, 0x14, 0x00, 0x77, 0x22, 0x22, 0x14, 0x14, 0x08, 0x0c, 0x04, 0x05, 
+0x03};
+static RotFont times14font[] = {
+{5, 1, 1, times14_0_bits},
+{5, 1, 1, times14_1_bits},
+{5, 1, 1, times14_2_bits},
+{5, 1, 1, times14_3_bits},
+{5, 1, 1, times14_4_bits},
+{5, 1, 1, times14_5_bits},
+{5, 1, 1, times14_6_bits},
+{5, 1, 1, times14_7_bits},
+{5, 1, 1, times14_8_bits},
+{5, 1, 1, times14_9_bits},
+{5, 1, 1, times14_10_bits},
+{5, 1, 1, times14_11_bits},
+{5, 1, 1, times14_12_bits},
+{5, 1, 1, times14_13_bits},
+{5, 1, 1, times14_14_bits},
+{5, 1, 1, times14_15_bits},
+{5, 1, 1, times14_16_bits},
+{5, 1, 1, times14_17_bits},
+{5, 1, 1, times14_18_bits},
+{5, 1, 1, times14_19_bits},
+{5, 1, 1, times14_20_bits},
+{5, 1, 1, times14_21_bits},
+{5, 1, 1, times14_22_bits},
+{5, 1, 1, times14_23_bits},
+{5, 1, 1, times14_24_bits},
+{5, 1, 1, times14_25_bits},
+{5, 1, 1, times14_26_bits},
+{5, 1, 1, times14_27_bits},
+{5, 1, 1, times14_28_bits},
+{5, 1, 1, times14_29_bits},
+{5, 1, 1, times14_30_bits},
+{5, 1, 1, times14_31_bits},
+{6, 1, 1, times14_32_bits},
+{1, 10, 10, times14_33_bits},
+{3, 3, 10, times14_34_bits},
+{7, 10, 10, times14_35_bits},
+{5, 12, 11, times14_36_bits},
+{9, 10, 10, times14_37_bits},
+{10, 10, 10, times14_38_bits},
+{2, 3, 10, times14_39_bits},
+{3, 13, 10, times14_40_bits},
+{3, 13, 10, times14_41_bits},
+{5, 6, 10, times14_42_bits},
+{7, 7, 7, times14_43_bits},
+{2, 3, 1, times14_44_bits},
+{6, 1, 4, times14_45_bits},
+{2, 1, 1, times14_46_bits},
+{4, 12, 10, times14_47_bits},
+{6, 10, 10, times14_48_bits},
+{5, 10, 10, times14_49_bits},
+{5, 10, 10, times14_50_bits},
+{6, 10, 10, times14_51_bits},
+{6, 10, 10, times14_52_bits},
+{5, 10, 10, times14_53_bits},
+{6, 10, 10, times14_54_bits},
+{6, 10, 10, times14_55_bits},
+{5, 10, 10, times14_56_bits},
+{6, 10, 10, times14_57_bits},
+{2, 7, 7, times14_58_bits},
+{2, 9, 7, times14_59_bits},
+{7, 7, 7, times14_60_bits},
+{7, 3, 5, times14_61_bits},
+{7, 7, 7, times14_62_bits},
+{5, 10, 10, times14_63_bits},
+{12, 12, 10, times14_64_bits},
+{9, 10, 10, times14_65_bits},
+{7, 10, 10, times14_66_bits},
+{8, 10, 10, times14_67_bits},
+{9, 10, 10, times14_68_bits},
+{7, 10, 10, times14_69_bits},
+{7, 10, 10, times14_70_bits},
+{9, 10, 10, times14_71_bits},
+{8, 10, 10, times14_72_bits},
+{3, 10, 10, times14_73_bits},
+{4, 10, 10, times14_74_bits},
+{8, 10, 10, times14_75_bits},
+{7, 10, 10, times14_76_bits},
+{11, 10, 10, times14_77_bits},
+{9, 10, 10, times14_78_bits},
+{8, 10, 10, times14_79_bits},
+{6, 10, 10, times14_80_bits},
+{8, 13, 10, times14_81_bits},
+{9, 10, 10, times14_82_bits},
+{6, 10, 10, times14_83_bits},
+{7, 10, 10, times14_84_bits},
+{8, 10, 10, times14_85_bits},
+{9, 10, 10, times14_86_bits},
+{13, 10, 10, times14_87_bits},
+{10, 10, 10, times14_88_bits},
+{9, 10, 10, times14_89_bits},
+{8, 10, 10, times14_90_bits},
+{3, 13, 10, times14_91_bits},
+{4, 10, 10, times14_92_bits},
+{3, 13, 10, times14_93_bits},
+{5, 5, 10, times14_94_bits},
+{7, 1, -2, times14_95_bits},
+{2, 3, 10, times14_96_bits},
+{6, 7, 7, times14_97_bits},
+{6, 10, 10, times14_98_bits},
+{6, 7, 7, times14_99_bits},
+{6, 10, 10, times14_100_bits},
+{6, 7, 7, times14_101_bits},
+{5, 10, 10, times14_102_bits},
+{6, 10, 7, times14_103_bits},
+{7, 10, 10, times14_104_bits},
+{3, 10, 10, times14_105_bits},
+{3, 13, 10, times14_106_bits},
+{7, 10, 10, times14_107_bits},
+{3, 10, 10, times14_108_bits},
+{11, 7, 7, times14_109_bits},
+{7, 7, 7, times14_110_bits},
+{5, 7, 7, times14_111_bits},
+{6, 10, 7, times14_112_bits},
+{6, 10, 7, times14_113_bits},
+{5, 7, 7, times14_114_bits},
+{4, 7, 7, times14_115_bits},
+{4, 8, 8, times14_116_bits},
+{7, 7, 7, times14_117_bits},
+{7, 7, 7, times14_118_bits},
+{11, 7, 7, times14_119_bits},
+{7, 7, 7, times14_120_bits},
+{7, 10, 7, times14_121_bits},
+{6, 7, 7, times14_122_bits},
+{5, 13, 10, times14_123_bits},
+{1, 10, 10, times14_124_bits},
+{5, 13, 10, times14_125_bits},
+{7, 2, 5, times14_126_bits},
+{5, 1, 1, times14_127_bits},
+{5, 1, 1, times14_128_bits},
+{5, 1, 1, times14_129_bits},
+{5, 1, 1, times14_130_bits},
+{5, 1, 1, times14_131_bits},
+{5, 1, 1, times14_132_bits},
+{5, 1, 1, times14_133_bits},
+{5, 1, 1, times14_134_bits},
+{5, 1, 1, times14_135_bits},
+{5, 1, 1, times14_136_bits},
+{5, 1, 1, times14_137_bits},
+{5, 1, 1, times14_138_bits},
+{5, 1, 1, times14_139_bits},
+{5, 1, 1, times14_140_bits},
+{5, 1, 1, times14_141_bits},
+{5, 1, 1, times14_142_bits},
+{5, 1, 1, times14_143_bits},
+{5, 1, 1, times14_144_bits},
+{5, 1, 1, times14_145_bits},
+{5, 1, 1, times14_146_bits},
+{5, 1, 1, times14_147_bits},
+{5, 1, 1, times14_148_bits},
+{5, 1, 1, times14_149_bits},
+{5, 1, 1, times14_150_bits},
+{5, 1, 1, times14_151_bits},
+{5, 1, 1, times14_152_bits},
+{5, 1, 1, times14_153_bits},
+{5, 1, 1, times14_154_bits},
+{5, 1, 1, times14_155_bits},
+{5, 1, 1, times14_156_bits},
+{5, 1, 1, times14_157_bits},
+{5, 1, 1, times14_158_bits},
+{5, 1, 1, times14_159_bits},
+{1, 1, 1, times14_160_bits},
+{1, 10, 7, times14_161_bits},
+{6, 9, 8, times14_162_bits},
+{7, 10, 10, times14_163_bits},
+{5, 7, 8, times14_164_bits},
+{7, 10, 10, times14_165_bits},
+{1, 10, 10, times14_166_bits},
+{5, 13, 10, times14_167_bits},
+{3, 2, 10, times14_168_bits},
+{10, 10, 10, times14_169_bits},
+{3, 6, 10, times14_170_bits},
+{6, 6, 6, times14_171_bits},
+{7, 4, 6, times14_172_bits},
+{3, 1, 4, times14_173_bits},
+{10, 10, 10, times14_174_bits},
+{4, 1, 9, times14_175_bits},
+{4, 4, 10, times14_176_bits},
+{7, 7, 7, times14_177_bits},
+{4, 6, 10, times14_178_bits},
+{4, 6, 10, times14_179_bits},
+{3, 3, 11, times14_180_bits},
+{7, 10, 7, times14_181_bits},
+{7, 13, 10, times14_182_bits},
+{1, 2, 5, times14_183_bits},
+{3, 3, 0, times14_184_bits},
+{3, 6, 10, times14_185_bits},
+{4, 6, 10, times14_186_bits},
+{6, 6, 6, times14_187_bits},
+{10, 10, 10, times14_188_bits},
+{10, 10, 10, times14_189_bits},
+{10, 10, 10, times14_190_bits},
+{5, 10, 7, times14_191_bits},
+{9, 14, 14, times14_192_bits},
+{9, 14, 14, times14_193_bits},
+{9, 14, 14, times14_194_bits},
+{9, 14, 14, times14_195_bits},
+{9, 13, 13, times14_196_bits},
+{9, 14, 14, times14_197_bits},
+{11, 10, 10, times14_198_bits},
+{8, 13, 10, times14_199_bits},
+{7, 14, 14, times14_200_bits},
+{7, 14, 14, times14_201_bits},
+{7, 14, 14, times14_202_bits},
+{7, 13, 13, times14_203_bits},
+{3, 14, 14, times14_204_bits},
+{3, 14, 14, times14_205_bits},
+{5, 14, 14, times14_206_bits},
+{3, 13, 13, times14_207_bits},
+{9, 10, 10, times14_208_bits},
+{9, 14, 14, times14_209_bits},
+{8, 14, 14, times14_210_bits},
+{8, 14, 14, times14_211_bits},
+{8, 14, 14, times14_212_bits},
+{8, 14, 14, times14_213_bits},
+{8, 13, 13, times14_214_bits},
+{7, 7, 7, times14_215_bits},
+{9, 12, 11, times14_216_bits},
+{8, 14, 14, times14_217_bits},
+{8, 14, 14, times14_218_bits},
+{8, 14, 14, times14_219_bits},
+{8, 13, 13, times14_220_bits},
+{9, 14, 14, times14_221_bits},
+{6, 10, 10, times14_222_bits},
+{6, 10, 10, times14_223_bits},
+{6, 11, 11, times14_224_bits},
+{6, 11, 11, times14_225_bits},
+{6, 11, 11, times14_226_bits},
+{6, 11, 11, times14_227_bits},
+{6, 10, 10, times14_228_bits},
+{6, 11, 11, times14_229_bits},
+{9, 7, 7, times14_230_bits},
+{6, 10, 7, times14_231_bits},
+{6, 11, 11, times14_232_bits},
+{6, 11, 11, times14_233_bits},
+{6, 11, 11, times14_234_bits},
+{6, 10, 10, times14_235_bits},
+{3, 11, 11, times14_236_bits},
+{3, 11, 11, times14_237_bits},
+{5, 11, 11, times14_238_bits},
+{3, 10, 10, times14_239_bits},
+{5, 10, 10, times14_240_bits},
+{7, 11, 11, times14_241_bits},
+{5, 11, 11, times14_242_bits},
+{5, 11, 11, times14_243_bits},
+{5, 11, 11, times14_244_bits},
+{5, 11, 11, times14_245_bits},
+{5, 10, 10, times14_246_bits},
+{7, 7, 7, times14_247_bits},
+{7, 9, 8, times14_248_bits},
+{7, 11, 11, times14_249_bits},
+{7, 11, 11, times14_250_bits},
+{7, 11, 11, times14_251_bits},
+{7, 10, 10, times14_252_bits},
+{7, 14, 11, times14_253_bits},
+{6, 13, 10, times14_254_bits},
+{7, 13, 10, times14_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times18.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times18.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times18.bdf	(revision 15879)
@@ -0,0 +1,3675 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Times-Medium-R-Normal--18-180-75-75-P-94-ISO8859-1
+SIZE 18 75 75
+FONTBOUNDINGBOX 19 21 -1 -4
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Times"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 18
+POINT_SIZE 180
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 94
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 13
+X_HEIGHT 9
+FACE_NAME "Times Roman"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "Times is a trademark of Linotype-Hell AG and/or its subsidiaries."
+_DEC_DEVICE_FONTNAMES "PS=Times-Roman"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2-1, 22-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Times Roman"
+FONT "-Adobe-Times-Medium-R-Normal--18-180-75-75-P-94-ISO8859-1"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 10
+DEFAULT_CHAR 32
+FONT_ASCENT 15
+FONT_DESCENT 4
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 1 1 1 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 13 1 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+40
+40
+40
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 6 4 1 9
+BITMAP
+cc
+cc
+cc
+88
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 11 13 -1 0
+BITMAP
+0d80
+0d80
+0d80
+0d80
+7fe0
+1b00
+1b00
+1b00
+ffc0
+3600
+3600
+3600
+3600
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 16 1 -2
+BITMAP
+10
+7c
+d6
+d2
+d0
+f0
+78
+3c
+1c
+16
+16
+96
+d6
+7c
+10
+10
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+3830
+6fe0
+c440
+c480
+cd80
+fb00
+7270
+06d8
+0d88
+0988
+1998
+31f0
+20e0
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+1c00
+3200
+3200
+3200
+3400
+19e0
+38c0
+6d80
+cf00
+c700
+c780
+edf0
+78e0
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 3 4 1 9
+BITMAP
+c0
+e0
+20
+40
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 17 1 -4
+BITMAP
+18
+30
+60
+60
+40
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+40
+60
+60
+30
+18
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 17 1 -4
+BITMAP
+c0
+60
+30
+30
+10
+18
+18
+18
+18
+18
+18
+18
+10
+30
+30
+60
+c0
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 8 1 6
+BITMAP
+10
+10
+d6
+54
+38
+d6
+92
+10
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 9 1 0
+BITMAP
+0800
+0800
+0800
+0800
+ff80
+0800
+0800
+0800
+0800
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 3 5 0 -3
+BITMAP
+60
+60
+20
+60
+c0
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 1 1 4
+BITMAP
+ff
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 2 1 0
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 15 0 -2
+BITMAP
+08
+08
+18
+10
+10
+30
+20
+20
+60
+40
+40
+c0
+80
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+3c
+66
+42
+c3
+c3
+c3
+c3
+c3
+c3
+c3
+42
+66
+3c
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 6 13 2 0
+BITMAP
+30
+70
+f0
+30
+30
+30
+30
+30
+30
+30
+30
+78
+fc
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+3c
+7e
+ce
+86
+06
+06
+0c
+0c
+18
+30
+62
+fe
+fe
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+7c
+ce
+86
+06
+0c
+38
+3c
+0e
+06
+06
+06
+cc
+f8
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+06
+0e
+0e
+16
+26
+66
+46
+86
+ff
+ff
+06
+06
+06
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+7e
+7c
+c0
+c0
+f0
+3c
+0c
+0e
+06
+06
+0c
+dc
+f0
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+07
+1c
+30
+60
+60
+fc
+c6
+c3
+c3
+c3
+e3
+76
+3c
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+fe
+fe
+84
+0c
+08
+18
+18
+10
+30
+30
+20
+60
+60
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+3c
+66
+62
+62
+74
+3c
+3c
+6e
+c7
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+3c
+6e
+c6
+c3
+c3
+c3
+e3
+7f
+06
+06
+0c
+38
+e0
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 9 1 0
+BITMAP
+c0
+c0
+00
+00
+00
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 3 12 0 -3
+BITMAP
+60
+60
+00
+00
+00
+00
+00
+60
+60
+20
+60
+c0
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+0180
+0700
+1c00
+7000
+c000
+7000
+1c00
+0700
+0180
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 3 1 3
+BITMAP
+ff
+00
+ff
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 9 1 0
+BITMAP
+c000
+7000
+1c00
+0700
+0180
+0700
+1c00
+7000
+c000
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 6 13 1 0
+BITMAP
+78
+8c
+c4
+cc
+0c
+18
+18
+30
+20
+20
+00
+30
+30
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 906 0
+DWIDTH 17 0
+BBX 14 16 1 -3
+BITMAP
+07e0
+0e30
+3818
+3008
+63ec
+67e4
+c664
+cc64
+cccc
+ccc8
+cdd8
+6770
+6000
+3000
+1c30
+07e0
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+0200
+0700
+0700
+0500
+0d80
+0980
+19c0
+10c0
+1fc0
+30e0
+2060
+6070
+f0f8
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 13 1 0
+BITMAP
+ff00
+6380
+6180
+6180
+6180
+6300
+7f80
+61c0
+60c0
+60c0
+60c0
+6180
+ff00
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 11 13 1 0
+BITMAP
+0f20
+30e0
+6060
+6020
+c000
+c000
+c000
+c000
+c000
+6000
+6060
+38c0
+0f00
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+ff00
+6380
+60c0
+60c0
+6060
+6060
+6060
+6060
+6060
+60c0
+60c0
+6380
+ff00
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 1 0
+BITMAP
+ff80
+6180
+6080
+6000
+6000
+6100
+7f00
+6100
+6000
+6000
+6080
+6180
+ff80
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 13 1 0
+BITMAP
+ff80
+6180
+6080
+6000
+6000
+6100
+7f00
+6100
+6000
+6000
+6000
+6000
+f000
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+0f20
+30e0
+6060
+6020
+c000
+c000
+c0f0
+c060
+c060
+6060
+6060
+39c0
+0f00
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+f1e0
+60c0
+60c0
+60c0
+60c0
+60c0
+7fc0
+60c0
+60c0
+60c0
+60c0
+60c0
+f1e0
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 13 1 0
+BITMAP
+f0
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 6 13 0 0
+BITMAP
+3c
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+d8
+f0
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+f3c0
+6180
+6300
+6600
+6c00
+7800
+7800
+6c00
+6600
+6300
+6380
+61c0
+f0e0
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 13 1 0
+BITMAP
+f000
+6000
+6000
+6000
+6000
+6000
+6000
+6000
+6000
+6000
+6040
+60c0
+ffc0
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 853 0
+DWIDTH 16 0
+BBX 14 13 1 0
+BITMAP
+e01c
+7038
+7038
+7878
+5858
+58d8
+5cd8
+4c98
+4d98
+4718
+4718
+4218
+e23c
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+e0e0
+6040
+7040
+7840
+5840
+4c40
+4e40
+4740
+4340
+41c0
+41c0
+40c0
+e040
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 13 1 0
+BITMAP
+0f00
+30c0
+6060
+6060
+c030
+c030
+c030
+c030
+c030
+6060
+6060
+30c0
+0f00
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 13 1 0
+BITMAP
+ff00
+6380
+6180
+6180
+6180
+6300
+7e00
+6000
+6000
+6000
+6000
+6000
+f000
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 17 1 -4
+BITMAP
+0f00
+30c0
+6060
+6060
+c030
+c030
+c030
+c030
+c030
+6060
+6060
+30c0
+0f00
+0600
+0300
+01c0
+00f0
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 11 13 1 0
+BITMAP
+ff00
+6380
+6180
+6180
+6180
+6300
+7e00
+6600
+6300
+6180
+6180
+60c0
+f0e0
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 13 1 0
+BITMAP
+3a
+66
+c2
+c0
+e0
+78
+3c
+0e
+07
+03
+83
+c6
+bc
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 13 1 0
+BITMAP
+ffc0
+ccc0
+8c40
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+0c00
+1e00
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+f0e0
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+70c0
+3980
+1f00
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 13 13 0 0
+BITMAP
+f878
+7030
+3020
+3820
+1860
+1840
+1c40
+0cc0
+0e80
+0680
+0780
+0300
+0300
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 960 0
+DWIDTH 18 0
+BBX 18 13 0 0
+BITMAP
+f9e3c0
+30c180
+30c100
+18c100
+186300
+186200
+1ce200
+0ca600
+0cb400
+0d3400
+073c00
+061800
+061800
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 12 13 0 0
+BITMAP
+f070
+7060
+38c0
+1980
+0d00
+0e00
+0600
+0f00
+1b00
+1180
+31c0
+60e0
+f0f0
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 12 13 0 0
+BITMAP
+f0f0
+7060
+30c0
+1880
+1900
+0f00
+0600
+0600
+0600
+0600
+0600
+0600
+0f00
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 10 13 1 0
+BITMAP
+7fc0
+61c0
+4180
+0380
+0700
+0600
+0e00
+1c00
+3800
+3000
+7040
+e0c0
+ffc0
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 16 2 -3
+BITMAP
+f0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+f0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 13 0 0
+BITMAP
+80
+80
+c0
+40
+60
+60
+20
+30
+30
+10
+18
+08
+08
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 16 0 -3
+BITMAP
+f0
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+f0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 7 1 6
+BITMAP
+10
+38
+28
+6c
+44
+c6
+82
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 1 0 -4
+BITMAP
+ff80
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 3 4 1 9
+BITMAP
+40
+80
+e0
+60
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+78
+cc
+cc
+1c
+6c
+cc
+cc
+fc
+66
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+e0
+60
+60
+60
+6e
+77
+63
+63
+63
+63
+63
+76
+3c
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+3c
+66
+c6
+c0
+c0
+c0
+c0
+62
+3c
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+0e
+06
+06
+06
+3e
+66
+c6
+c6
+c6
+c6
+c6
+66
+3f
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 8 9 0 0
+BITMAP
+3c
+66
+c3
+ff
+c0
+c0
+e1
+76
+3c
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 6 13 0 0
+BITMAP
+1c
+34
+20
+60
+f8
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 8 13 0 -4
+BITMAP
+3e
+cc
+c4
+c4
+cc
+78
+40
+7c
+7f
+83
+c1
+e2
+7c
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 13 0 0
+BITMAP
+e000
+6000
+6000
+6000
+6600
+6f00
+7300
+6300
+6300
+6300
+6300
+6300
+f380
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 4 13 0 0
+BITMAP
+60
+60
+00
+00
+e0
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 4 17 -1 -4
+BITMAP
+30
+30
+00
+00
+70
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+e0
+c0
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 13 0 0
+BITMAP
+e000
+6000
+6000
+6000
+6700
+6200
+6400
+6800
+7800
+6c00
+6600
+6300
+e380
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 4 13 0 0
+BITMAP
+e0
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 14 9 0 0
+BITMAP
+e630
+6f78
+7398
+6318
+6318
+6318
+6318
+6318
+f7bc
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 9 0 0
+BITMAP
+e600
+6f00
+7300
+6300
+6300
+6300
+6300
+6300
+f380
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 9 0 0
+BITMAP
+3c
+66
+c3
+c3
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 -4
+BITMAP
+ee
+77
+63
+63
+63
+63
+63
+76
+6c
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 -4
+BITMAP
+3e
+66
+c6
+c6
+c6
+c6
+c6
+66
+3e
+06
+06
+06
+0f
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 6 9 0 0
+BITMAP
+ec
+6c
+70
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 9 0 0
+BITMAP
+68
+d8
+c8
+e0
+70
+38
+98
+d8
+b0
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 6 11 0 0
+BITMAP
+20
+60
+f8
+60
+60
+60
+60
+60
+60
+74
+38
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 9 -1 0
+BITMAP
+e700
+6300
+6300
+6300
+6300
+6300
+6300
+7700
+3b80
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 9 -1 0
+BITMAP
+f380
+6300
+6200
+3200
+3600
+1400
+1c00
+0800
+0800
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 13 9 -1 0
+BITMAP
+e738
+6630
+6260
+3660
+3760
+1d40
+1dc0
+0880
+0880
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 9 0 0
+BITMAP
+e380
+6300
+3600
+1c00
+0c00
+1c00
+3600
+6300
+e380
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 9 13 -1 -4
+BITMAP
+f380
+6100
+7300
+3200
+3600
+1c00
+1c00
+0c00
+1800
+1800
+1000
+f000
+e000
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 7 9 0 0
+BITMAP
+fe
+ce
+8c
+18
+30
+30
+62
+e6
+fe
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 17 1 -4
+BITMAP
+0e
+18
+30
+30
+30
+30
+30
+60
+c0
+60
+30
+30
+30
+30
+30
+18
+0e
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 160 0
+DWIDTH 3 0
+BBX 1 13 1 0
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 17 1 -4
+BITMAP
+e0
+30
+18
+18
+18
+18
+18
+0c
+06
+0c
+18
+18
+18
+18
+18
+30
+e0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 2 1 4
+BITMAP
+7980
+cf00
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 1 1 1 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 13 1 -4
+BITMAP
+c0
+c0
+00
+00
+80
+80
+80
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 1 -2
+BITMAP
+06
+04
+3e
+6b
+cb
+c8
+d8
+d0
+d0
+72
+7c
+40
+c0
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 10 13 0 0
+BITMAP
+0f00
+1980
+1980
+1800
+1800
+1800
+7e00
+1800
+1800
+1000
+7840
+bfc0
+e780
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 7 1 3
+BITMAP
+dd80
+f780
+6300
+4100
+6300
+f780
+dd80
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+f7
+62
+62
+76
+34
+34
+7e
+18
+7e
+18
+18
+18
+7e
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 160 0
+DWIDTH 3 0
+BBX 1 13 1 0
+BITMAP
+80
+80
+80
+80
+80
+00
+00
+00
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 16 1 -3
+BITMAP
+3c
+66
+66
+70
+38
+7c
+8e
+c7
+e3
+71
+3e
+1c
+0e
+66
+66
+3c
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 2 0 10
+BITMAP
+d8
+d8
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+0f80
+3060
+4010
+4790
+8888
+9008
+9008
+9008
+8888
+4710
+4010
+3060
+0f80
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 8 0 5
+BITMAP
+60
+90
+10
+70
+90
+e8
+00
+f8
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 7 1 1
+BITMAP
+11
+33
+66
+cc
+66
+33
+11
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 5 1 1
+BITMAP
+ff80
+0080
+0080
+0080
+0080
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 5 2 0 4
+BITMAP
+f8
+f8
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 13 1 0
+BITMAP
+0f80
+3060
+4010
+5f10
+8888
+8888
+8f08
+8908
+8888
+5cd0
+4010
+3060
+0f80
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 1 0 11
+BITMAP
+f8
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 373 0
+DWIDTH 7 0
+BBX 5 5 1 8
+BITMAP
+70
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 10 1 0
+BITMAP
+0800
+0800
+0800
+0800
+ff80
+0800
+0800
+0800
+0000
+ff80
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 8 0 5
+BITMAP
+70
+98
+18
+10
+20
+20
+40
+f8
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 8 0 5
+BITMAP
+70
+88
+18
+70
+18
+08
+88
+70
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 4 3 0 10
+BITMAP
+30
+60
+80
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 13 0 -4
+BITMAP
+e700
+6300
+6300
+6300
+6300
+6300
+6300
+7700
+7b80
+4000
+4000
+6000
+6000
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 7 17 1 -4
+BITMAP
+3e
+74
+f4
+f4
+f4
+f4
+f4
+74
+14
+14
+14
+14
+14
+14
+14
+14
+14
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 213 0
+DWIDTH 4 0
+BBX 2 2 1 4
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 5 1 -4
+BITMAP
+20
+20
+10
+b0
+60
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 3 8 1 5
+BITMAP
+40
+c0
+40
+40
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 5 8 0 5
+BITMAP
+70
+d8
+88
+88
+d8
+70
+00
+f8
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 7 1 1
+BITMAP
+88
+cc
+66
+33
+66
+cc
+88
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+4080
+c180
+4100
+4300
+4600
+4440
+4cc0
+e940
+1b40
+3240
+27e0
+6040
+4040
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 13 1 0
+BITMAP
+4080
+c180
+4100
+4300
+4600
+45c0
+4e60
+e860
+1840
+3080
+2080
+6100
+43e0
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 13 13 -1 0
+BITMAP
+7020
+8860
+1840
+70c0
+1980
+0910
+8b30
+7250
+06d0
+0c90
+09f8
+1810
+1010
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 6 13 1 -4
+BITMAP
+30
+30
+00
+10
+10
+30
+60
+60
+c0
+cc
+8c
+c4
+78
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+0c00
+0600
+0100
+0000
+0200
+0700
+0700
+0500
+0d80
+0980
+19c0
+10c0
+1fc0
+30e0
+2060
+6070
+f0f8
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+00c0
+0180
+0200
+0000
+0200
+0700
+0700
+0500
+0d80
+0980
+19c0
+10c0
+1fc0
+30e0
+2060
+6070
+f0f8
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+0200
+0700
+0880
+0000
+0200
+0700
+0700
+0500
+0d80
+0980
+19c0
+10c0
+1fc0
+30e0
+2060
+6070
+f0f8
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 16 1 0
+BITMAP
+0740
+0b80
+0000
+0200
+0700
+0700
+0500
+0d80
+0980
+19c0
+10c0
+1fc0
+30e0
+2060
+6070
+f0f8
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 16 1 0
+BITMAP
+0d80
+0d80
+0000
+0200
+0700
+0700
+0500
+0d80
+0980
+19c0
+10c0
+1fc0
+30e0
+2060
+6070
+f0f8
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 800 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+0300
+0480
+0480
+0300
+0200
+0700
+0700
+0500
+0d80
+0980
+19c0
+10c0
+1fc0
+30e0
+2060
+6070
+f0f8
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 906 0
+DWIDTH 17 0
+BBX 15 13 1 0
+BITMAP
+0ffc
+078c
+0584
+0580
+0d80
+0988
+19f8
+1f88
+1180
+3180
+2182
+6186
+f7fe
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 11 17 1 -4
+BITMAP
+0f20
+30e0
+6060
+6020
+c000
+c000
+c000
+c000
+c000
+6000
+6060
+38c0
+0f00
+0400
+0200
+1600
+0c00
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+3000
+1800
+0400
+0000
+ff80
+6180
+6080
+6000
+6000
+6100
+7f00
+6100
+6000
+6000
+6080
+6180
+ff80
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+0600
+0c00
+1000
+0000
+ff80
+6180
+6080
+6000
+6000
+6100
+7f00
+6100
+6000
+6000
+6080
+6180
+ff80
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+0800
+1c00
+2200
+0000
+ff80
+6180
+6080
+6000
+6000
+6100
+7f00
+6100
+6000
+6000
+6080
+6180
+ff80
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 586 0
+DWIDTH 11 0
+BBX 9 16 1 0
+BITMAP
+3300
+3300
+0000
+ff80
+6180
+6080
+6000
+6000
+6100
+7f00
+6100
+6000
+6000
+6080
+6180
+ff80
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 17 1 0
+BITMAP
+c0
+60
+10
+00
+f0
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 4 17 1 0
+BITMAP
+30
+60
+80
+00
+f0
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 5 17 1 0
+BITMAP
+20
+70
+88
+00
+f0
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 320 0
+DWIDTH 6 0
+BBX 6 16 0 0
+BITMAP
+cc
+cc
+00
+78
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+78
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 12 13 0 0
+BITMAP
+7f80
+31c0
+3060
+3060
+3030
+3030
+fc30
+3030
+3030
+3060
+3060
+31c0
+7f80
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 16 1 0
+BITMAP
+0e80
+1700
+0000
+e0e0
+6040
+7040
+7840
+5840
+4c40
+4e40
+4740
+4340
+41c0
+41c0
+40c0
+e040
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 17 1 0
+BITMAP
+1800
+0c00
+0200
+0000
+0f00
+30c0
+6060
+6060
+c030
+c030
+c030
+c030
+c030
+6060
+6060
+30c0
+0f00
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 17 1 0
+BITMAP
+00c0
+0180
+0200
+0000
+0f00
+30c0
+6060
+6060
+c030
+c030
+c030
+c030
+c030
+6060
+6060
+30c0
+0f00
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 17 1 0
+BITMAP
+0200
+0700
+0880
+0000
+0f00
+30c0
+6060
+6060
+c030
+c030
+c030
+c030
+c030
+6060
+6060
+30c0
+0f00
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 16 1 0
+BITMAP
+0e80
+1700
+0000
+0f00
+30c0
+6060
+6060
+c030
+c030
+c030
+c030
+c030
+6060
+6060
+30c0
+0f00
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 16 1 0
+BITMAP
+1980
+1980
+0000
+0f00
+30c0
+6060
+6060
+c030
+c030
+c030
+c030
+c030
+6060
+6060
+30c0
+0f00
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 7 1 1
+BITMAP
+c3
+66
+3c
+18
+3c
+66
+c3
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 746 0
+DWIDTH 14 0
+BBX 12 15 1 -1
+BITMAP
+0030
+0f60
+30c0
+60e0
+61a0
+c330
+c330
+c630
+cc30
+cc30
+5860
+7060
+30c0
+6f00
+c000
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+1800
+0c00
+0200
+0000
+f0e0
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+70c0
+3980
+1f00
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+0180
+0300
+0400
+0000
+f0e0
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+70c0
+3980
+1f00
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+0400
+0e00
+1100
+0000
+f0e0
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+70c0
+3980
+1f00
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 693 0
+DWIDTH 13 0
+BBX 11 16 1 0
+BITMAP
+1980
+1980
+0000
+f0e0
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+6040
+70c0
+3980
+1f00
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 12 17 0 0
+BITMAP
+0180
+0300
+0400
+0000
+f0f0
+7060
+30c0
+1880
+1900
+0f00
+0600
+0600
+0600
+0600
+0600
+0600
+0f00
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 13 1 0
+BITMAP
+f000
+6000
+6000
+7f00
+6380
+6180
+6180
+6180
+6300
+7e00
+6000
+6000
+f000
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+1c
+36
+23
+63
+63
+66
+7c
+66
+63
+63
+6b
+6b
+ee
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+c0
+60
+10
+00
+78
+c8
+cc
+1c
+6c
+cc
+cc
+fc
+66
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+0c
+18
+20
+00
+78
+c8
+cc
+1c
+6c
+cc
+cc
+fc
+66
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+10
+38
+44
+00
+78
+c8
+cc
+1c
+6c
+cc
+cc
+fc
+66
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+34
+58
+00
+78
+c8
+cc
+1c
+6c
+cc
+cc
+fc
+66
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 12 1 0
+BITMAP
+6c
+6c
+00
+78
+c8
+cc
+1c
+6c
+cc
+cc
+fc
+66
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 7 13 1 0
+BITMAP
+30
+48
+48
+30
+78
+c8
+cc
+1c
+6c
+cc
+cc
+fc
+66
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 640 0
+DWIDTH 12 0
+BBX 11 9 0 0
+BITMAP
+7bc0
+ce60
+cc20
+1fe0
+6c00
+cc00
+cc00
+fe60
+63c0
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 7 13 0 -4
+BITMAP
+3c
+66
+c0
+c0
+c0
+c0
+c0
+66
+3c
+10
+08
+58
+30
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 7 13 0 0
+BITMAP
+60
+30
+08
+00
+3c
+66
+c2
+fe
+c0
+c0
+c0
+66
+3c
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 7 13 0 0
+BITMAP
+06
+0c
+10
+00
+3c
+66
+c2
+fe
+c0
+c0
+c0
+66
+3c
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 7 13 0 0
+BITMAP
+10
+38
+44
+00
+3c
+66
+c2
+fe
+c0
+c0
+c0
+66
+3c
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 7 12 0 0
+BITMAP
+6c
+6c
+00
+3c
+66
+c2
+fe
+c0
+c0
+c0
+66
+3c
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 4 13 0 0
+BITMAP
+c0
+60
+10
+00
+e0
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 4 13 0 0
+BITMAP
+30
+60
+80
+00
+e0
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 13 0 0
+BITMAP
+20
+70
+88
+00
+e0
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 266 0
+DWIDTH 5 0
+BBX 5 12 0 0
+BITMAP
+d8
+d8
+00
+e0
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+60
+36
+38
+4c
+3e
+66
+c3
+c3
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 9 12 0 0
+BITMAP
+3a00
+5c00
+0000
+e600
+6f00
+7300
+6300
+6300
+6300
+6300
+6300
+f380
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+60
+30
+08
+00
+3c
+66
+c3
+c3
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+06
+0c
+10
+00
+3c
+66
+c3
+c3
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 13 0 0
+BITMAP
+10
+38
+44
+00
+3c
+66
+c3
+c3
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+1a
+2c
+00
+3c
+66
+c3
+c3
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 12 0 0
+BITMAP
+6c
+6c
+00
+3c
+66
+c3
+c3
+c3
+c3
+c3
+66
+3c
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 533 0
+DWIDTH 10 0
+BBX 8 7 1 1
+BITMAP
+18
+18
+00
+ff
+00
+18
+18
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 11 0 -1
+BITMAP
+01
+3f
+66
+cf
+cb
+db
+d3
+f3
+66
+7c
+c0
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 13 0 0
+BITMAP
+3000
+1800
+0400
+0000
+e700
+6300
+6300
+6300
+6300
+6300
+6300
+7700
+3b80
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 13 0 0
+BITMAP
+0600
+0c00
+1000
+0000
+e700
+6300
+6300
+6300
+6300
+6300
+6300
+7700
+3b80
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 13 0 0
+BITMAP
+0800
+1c00
+2200
+0000
+e700
+6300
+6300
+6300
+6300
+6300
+6300
+7700
+3b80
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 9 12 0 0
+BITMAP
+3600
+3600
+0000
+e700
+6300
+6300
+6300
+6300
+6300
+6300
+7700
+3b80
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 8 17 -1 -4
+BITMAP
+03
+06
+08
+00
+f3
+63
+72
+32
+36
+1c
+1c
+0c
+08
+18
+10
+f0
+e0
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 480 0
+DWIDTH 9 0
+BBX 8 17 0 -4
+BITMAP
+e0
+60
+60
+60
+6e
+77
+63
+63
+63
+63
+63
+76
+7c
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 426 0
+DWIDTH 8 0
+BBX 8 16 -1 -4
+BITMAP
+36
+36
+00
+f3
+63
+72
+32
+36
+1c
+1c
+0c
+08
+18
+10
+f0
+e0
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times18.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times18.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times18.h	(revision 15879)
@@ -0,0 +1,980 @@
+static unsigned char times18_0_bits[] = {
+0x00};
+static unsigned char times18_1_bits[] = {
+0x00};
+static unsigned char times18_2_bits[] = {
+0x00};
+static unsigned char times18_3_bits[] = {
+0x00};
+static unsigned char times18_4_bits[] = {
+0x00};
+static unsigned char times18_5_bits[] = {
+0x00};
+static unsigned char times18_6_bits[] = {
+0x00};
+static unsigned char times18_7_bits[] = {
+0x00};
+static unsigned char times18_8_bits[] = {
+0x00};
+static unsigned char times18_9_bits[] = {
+0x00};
+static unsigned char times18_10_bits[] = {
+0x00};
+static unsigned char times18_11_bits[] = {
+0x00};
+static unsigned char times18_12_bits[] = {
+0x00};
+static unsigned char times18_13_bits[] = {
+0x00};
+static unsigned char times18_14_bits[] = {
+0x00};
+static unsigned char times18_15_bits[] = {
+0x00};
+static unsigned char times18_16_bits[] = {
+0x00};
+static unsigned char times18_17_bits[] = {
+0x00};
+static unsigned char times18_18_bits[] = {
+0x00};
+static unsigned char times18_19_bits[] = {
+0x00};
+static unsigned char times18_20_bits[] = {
+0x00};
+static unsigned char times18_21_bits[] = {
+0x00};
+static unsigned char times18_22_bits[] = {
+0x00};
+static unsigned char times18_23_bits[] = {
+0x00};
+static unsigned char times18_24_bits[] = {
+0x00};
+static unsigned char times18_25_bits[] = {
+0x00};
+static unsigned char times18_26_bits[] = {
+0x00};
+static unsigned char times18_27_bits[] = {
+0x00};
+static unsigned char times18_28_bits[] = {
+0x00};
+static unsigned char times18_29_bits[] = {
+0x00};
+static unsigned char times18_30_bits[] = {
+0x00};
+static unsigned char times18_31_bits[] = {
+0x00};
+static unsigned char times18_32_bits[] = {
+0x00};
+static unsigned char times18_33_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02, 0x02, 0x02, 0x00, 0x00, 0x03, 
+0x03};
+static unsigned char times18_34_bits[] = {
+0x33, 0x33, 0x33, 0x11};
+static unsigned char times18_35_bits[] = {
+0xb0, 0x01, 0xb0, 0x01, 0xb0, 0x01, 0xb0, 0x01, 0xfe, 0x07, 0xd8, 0x00, 
+0xd8, 0x00, 0xd8, 0x00, 0xff, 0x03, 0x6c, 0x00, 0x6c, 0x00, 0x6c, 0x00, 
+0x6c, 0x00};
+static unsigned char times18_36_bits[] = {
+0x08, 0x3e, 0x6b, 0x4b, 0x0b, 0x0f, 0x1e, 0x3c, 0x38, 0x68, 0x68, 0x69, 
+0x6b, 0x3e, 0x08, 0x08};
+static unsigned char times18_37_bits[] = {
+0x1c, 0x0c, 0xf6, 0x07, 0x23, 0x02, 0x23, 0x01, 0xb3, 0x01, 0xdf, 0x00, 
+0x4e, 0x0e, 0x60, 0x1b, 0xb0, 0x11, 0x90, 0x11, 0x98, 0x19, 0x8c, 0x0f, 
+0x04, 0x07};
+static unsigned char times18_38_bits[] = {
+0x38, 0x00, 0x4c, 0x00, 0x4c, 0x00, 0x4c, 0x00, 0x2c, 0x00, 0x98, 0x07, 
+0x1c, 0x03, 0xb6, 0x01, 0xf3, 0x00, 0xe3, 0x00, 0xe3, 0x01, 0xb7, 0x0f, 
+0x1e, 0x07};
+static unsigned char times18_39_bits[] = {
+0x03, 0x07, 0x04, 0x02};
+static unsigned char times18_40_bits[] = {
+0x18, 0x0c, 0x06, 0x06, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x02, 0x06, 0x06, 0x0c, 0x18};
+static unsigned char times18_41_bits[] = {
+0x03, 0x06, 0x0c, 0x0c, 0x08, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x08, 0x0c, 0x0c, 0x06, 0x03};
+static unsigned char times18_42_bits[] = {
+0x08, 0x08, 0x6b, 0x2a, 0x1c, 0x6b, 0x49, 0x08};
+static unsigned char times18_43_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0xff, 0x01, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char times18_44_bits[] = {
+0x06, 0x06, 0x04, 0x06, 0x03};
+static unsigned char times18_45_bits[] = {
+0xff};
+static unsigned char times18_46_bits[] = {
+0x03, 0x03};
+static unsigned char times18_47_bits[] = {
+0x10, 0x10, 0x18, 0x08, 0x08, 0x0c, 0x04, 0x04, 0x06, 0x02, 0x02, 0x03, 
+0x01, 0x01, 0x01};
+static unsigned char times18_48_bits[] = {
+0x3c, 0x66, 0x42, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x42, 0x66, 
+0x3c};
+static unsigned char times18_49_bits[] = {
+0x0c, 0x0e, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x1e, 
+0x3f};
+static unsigned char times18_50_bits[] = {
+0x3c, 0x7e, 0x73, 0x61, 0x60, 0x60, 0x30, 0x30, 0x18, 0x0c, 0x46, 0x7f, 
+0x7f};
+static unsigned char times18_51_bits[] = {
+0x3e, 0x73, 0x61, 0x60, 0x30, 0x1c, 0x3c, 0x70, 0x60, 0x60, 0x60, 0x33, 
+0x1f};
+static unsigned char times18_52_bits[] = {
+0x60, 0x70, 0x70, 0x68, 0x64, 0x66, 0x62, 0x61, 0xff, 0xff, 0x60, 0x60, 
+0x60};
+static unsigned char times18_53_bits[] = {
+0x7e, 0x3e, 0x03, 0x03, 0x0f, 0x3c, 0x30, 0x70, 0x60, 0x60, 0x30, 0x3b, 
+0x0f};
+static unsigned char times18_54_bits[] = {
+0xe0, 0x38, 0x0c, 0x06, 0x06, 0x3f, 0x63, 0xc3, 0xc3, 0xc3, 0xc7, 0x6e, 
+0x3c};
+static unsigned char times18_55_bits[] = {
+0x7f, 0x7f, 0x21, 0x30, 0x10, 0x18, 0x18, 0x08, 0x0c, 0x0c, 0x04, 0x06, 
+0x06};
+static unsigned char times18_56_bits[] = {
+0x3c, 0x66, 0x46, 0x46, 0x2e, 0x3c, 0x3c, 0x76, 0xe3, 0xc3, 0xc3, 0x66, 
+0x3c};
+static unsigned char times18_57_bits[] = {
+0x3c, 0x76, 0x63, 0xc3, 0xc3, 0xc3, 0xc7, 0xfe, 0x60, 0x60, 0x30, 0x1c, 
+0x07};
+static unsigned char times18_58_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03};
+static unsigned char times18_59_bits[] = {
+0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x04, 0x06, 0x03};
+static unsigned char times18_60_bits[] = {
+0x80, 0x01, 0xe0, 0x00, 0x38, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x0e, 0x00, 
+0x38, 0x00, 0xe0, 0x00, 0x80, 0x01};
+static unsigned char times18_61_bits[] = {
+0xff, 0x00, 0xff};
+static unsigned char times18_62_bits[] = {
+0x03, 0x00, 0x0e, 0x00, 0x38, 0x00, 0xe0, 0x00, 0x80, 0x01, 0xe0, 0x00, 
+0x38, 0x00, 0x0e, 0x00, 0x03, 0x00};
+static unsigned char times18_63_bits[] = {
+0x1e, 0x31, 0x23, 0x33, 0x30, 0x18, 0x18, 0x0c, 0x04, 0x04, 0x00, 0x0c, 
+0x0c};
+static unsigned char times18_64_bits[] = {
+0xe0, 0x07, 0x70, 0x0c, 0x1c, 0x18, 0x0c, 0x10, 0xc6, 0x37, 0xe6, 0x27, 
+0x63, 0x26, 0x33, 0x26, 0x33, 0x33, 0x33, 0x13, 0xb3, 0x1b, 0xe6, 0x0e, 
+0x06, 0x00, 0x0c, 0x00, 0x38, 0x0c, 0xe0, 0x07};
+static unsigned char times18_65_bits[] = {
+0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xa0, 0x00, 0xb0, 0x01, 0x90, 0x01, 
+0x98, 0x03, 0x08, 0x03, 0xf8, 0x03, 0x0c, 0x07, 0x04, 0x06, 0x06, 0x0e, 
+0x0f, 0x1f};
+static unsigned char times18_66_bits[] = {
+0xff, 0x00, 0xc6, 0x01, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0xc6, 0x00, 
+0xfe, 0x01, 0x86, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x86, 0x01, 
+0xff, 0x00};
+static unsigned char times18_67_bits[] = {
+0xf0, 0x04, 0x0c, 0x07, 0x06, 0x06, 0x06, 0x04, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 0x06, 0x06, 0x1c, 0x03, 
+0xf0, 0x00};
+static unsigned char times18_68_bits[] = {
+0xff, 0x00, 0xc6, 0x01, 0x06, 0x03, 0x06, 0x03, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x03, 0x06, 0x03, 0xc6, 0x01, 
+0xff, 0x00};
+static unsigned char times18_69_bits[] = {
+0xff, 0x01, 0x86, 0x01, 0x06, 0x01, 0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 
+0xfe, 0x00, 0x86, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x01, 0x86, 0x01, 
+0xff, 0x01};
+static unsigned char times18_70_bits[] = {
+0xff, 0x01, 0x86, 0x01, 0x06, 0x01, 0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 
+0xfe, 0x00, 0x86, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 
+0x0f, 0x00};
+static unsigned char times18_71_bits[] = {
+0xf0, 0x04, 0x0c, 0x07, 0x06, 0x06, 0x06, 0x04, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x0f, 0x03, 0x06, 0x03, 0x06, 0x06, 0x06, 0x06, 0x06, 0x9c, 0x03, 
+0xf0, 0x00};
+static unsigned char times18_72_bits[] = {
+0x8f, 0x07, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0xfe, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x8f, 0x07};
+static unsigned char times18_73_bits[] = {
+0x0f, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x0f};
+static unsigned char times18_74_bits[] = {
+0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1b, 
+0x0f};
+static unsigned char times18_75_bits[] = {
+0xcf, 0x03, 0x86, 0x01, 0xc6, 0x00, 0x66, 0x00, 0x36, 0x00, 0x1e, 0x00, 
+0x1e, 0x00, 0x36, 0x00, 0x66, 0x00, 0xc6, 0x00, 0xc6, 0x01, 0x86, 0x03, 
+0x0f, 0x07};
+static unsigned char times18_76_bits[] = {
+0x0f, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 
+0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x02, 0x06, 0x03, 
+0xff, 0x03};
+static unsigned char times18_77_bits[] = {
+0x07, 0x38, 0x0e, 0x1c, 0x0e, 0x1c, 0x1e, 0x1e, 0x1a, 0x1a, 0x1a, 0x1b, 
+0x3a, 0x1b, 0x32, 0x19, 0xb2, 0x19, 0xe2, 0x18, 0xe2, 0x18, 0x42, 0x18, 
+0x47, 0x3c};
+static unsigned char times18_78_bits[] = {
+0x07, 0x07, 0x06, 0x02, 0x0e, 0x02, 0x1e, 0x02, 0x1a, 0x02, 0x32, 0x02, 
+0x72, 0x02, 0xe2, 0x02, 0xc2, 0x02, 0x82, 0x03, 0x82, 0x03, 0x02, 0x03, 
+0x07, 0x02};
+static unsigned char times18_79_bits[] = {
+0xf0, 0x00, 0x0c, 0x03, 0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c, 
+0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x03, 
+0xf0, 0x00};
+static unsigned char times18_80_bits[] = {
+0xff, 0x00, 0xc6, 0x01, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0xc6, 0x00, 
+0x7e, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 
+0x0f, 0x00};
+static unsigned char times18_81_bits[] = {
+0xf0, 0x00, 0x0c, 0x03, 0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c, 
+0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x03, 
+0xf0, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x80, 0x03, 0x00, 0x0f};
+static unsigned char times18_82_bits[] = {
+0xff, 0x00, 0xc6, 0x01, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0xc6, 0x00, 
+0x7e, 0x00, 0x66, 0x00, 0xc6, 0x00, 0x86, 0x01, 0x86, 0x01, 0x06, 0x03, 
+0x0f, 0x07};
+static unsigned char times18_83_bits[] = {
+0x5c, 0x66, 0x43, 0x03, 0x07, 0x1e, 0x3c, 0x70, 0xe0, 0xc0, 0xc1, 0x63, 
+0x3d};
+static unsigned char times18_84_bits[] = {
+0xff, 0x03, 0x33, 0x03, 0x31, 0x02, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 
+0x78, 0x00};
+static unsigned char times18_85_bits[] = {
+0x0f, 0x07, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 
+0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x0e, 0x03, 0x9c, 0x01, 
+0xf8, 0x00};
+static unsigned char times18_86_bits[] = {
+0x1f, 0x1e, 0x0e, 0x0c, 0x0c, 0x04, 0x1c, 0x04, 0x18, 0x06, 0x18, 0x02, 
+0x38, 0x02, 0x30, 0x03, 0x70, 0x01, 0x60, 0x01, 0xe0, 0x01, 0xc0, 0x00, 
+0xc0, 0x00};
+static unsigned char times18_87_bits[] = {
+0x9f, 0xc7, 0x03, 0x0c, 0x83, 0x01, 0x0c, 0x83, 0x00, 0x18, 0x83, 0x00, 
+0x18, 0xc6, 0x00, 0x18, 0x46, 0x00, 0x38, 0x47, 0x00, 0x30, 0x65, 0x00, 
+0x30, 0x2d, 0x00, 0xb0, 0x2c, 0x00, 0xe0, 0x3c, 0x00, 0x60, 0x18, 0x00, 
+0x60, 0x18, 0x00};
+static unsigned char times18_88_bits[] = {
+0x0f, 0x0e, 0x0e, 0x06, 0x1c, 0x03, 0x98, 0x01, 0xb0, 0x00, 0x70, 0x00, 
+0x60, 0x00, 0xf0, 0x00, 0xd8, 0x00, 0x88, 0x01, 0x8c, 0x03, 0x06, 0x07, 
+0x0f, 0x0f};
+static unsigned char times18_89_bits[] = {
+0x0f, 0x0f, 0x0e, 0x06, 0x0c, 0x03, 0x18, 0x01, 0x98, 0x00, 0xf0, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0xf0, 0x00};
+static unsigned char times18_90_bits[] = {
+0xfe, 0x03, 0x86, 0x03, 0x82, 0x01, 0xc0, 0x01, 0xe0, 0x00, 0x60, 0x00, 
+0x70, 0x00, 0x38, 0x00, 0x1c, 0x00, 0x0c, 0x00, 0x0e, 0x02, 0x07, 0x03, 
+0xff, 0x03};
+static unsigned char times18_91_bits[] = {
+0x0f, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x0f};
+static unsigned char times18_92_bits[] = {
+0x01, 0x01, 0x03, 0x02, 0x06, 0x06, 0x04, 0x0c, 0x0c, 0x08, 0x18, 0x10, 
+0x10};
+static unsigned char times18_93_bits[] = {
+0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0f};
+static unsigned char times18_94_bits[] = {
+0x08, 0x1c, 0x14, 0x36, 0x22, 0x63, 0x41};
+static unsigned char times18_95_bits[] = {
+0xff, 0x01};
+static unsigned char times18_96_bits[] = {
+0x02, 0x01, 0x07, 0x06};
+static unsigned char times18_97_bits[] = {
+0x1e, 0x33, 0x33, 0x38, 0x36, 0x33, 0x33, 0x3f, 0x66};
+static unsigned char times18_98_bits[] = {
+0x07, 0x06, 0x06, 0x06, 0x76, 0xee, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6e, 
+0x3c};
+static unsigned char times18_99_bits[] = {
+0x3c, 0x66, 0x63, 0x03, 0x03, 0x03, 0x03, 0x46, 0x3c};
+static unsigned char times18_100_bits[] = {
+0x70, 0x60, 0x60, 0x60, 0x7c, 0x66, 0x63, 0x63, 0x63, 0x63, 0x63, 0x66, 
+0xfc};
+static unsigned char times18_101_bits[] = {
+0x3c, 0x66, 0xc3, 0xff, 0x03, 0x03, 0x87, 0x6e, 0x3c};
+static unsigned char times18_102_bits[] = {
+0x38, 0x2c, 0x04, 0x06, 0x1f, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x0f};
+static unsigned char times18_103_bits[] = {
+0x7c, 0x33, 0x23, 0x23, 0x33, 0x1e, 0x02, 0x3e, 0xfe, 0xc1, 0x83, 0x47, 
+0x3e};
+static unsigned char times18_104_bits[] = {
+0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x66, 0x00, 0xf6, 0x00, 
+0xce, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 
+0xcf, 0x01};
+static unsigned char times18_105_bits[] = {
+0x06, 0x06, 0x00, 0x00, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x0f};
+static unsigned char times18_106_bits[] = {
+0x0c, 0x0c, 0x00, 0x00, 0x0e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x07, 0x03};
+static unsigned char times18_107_bits[] = {
+0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0xe6, 0x00, 0x46, 0x00, 
+0x26, 0x00, 0x16, 0x00, 0x1e, 0x00, 0x36, 0x00, 0x66, 0x00, 0xc6, 0x00, 
+0xc7, 0x01};
+static unsigned char times18_108_bits[] = {
+0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x0f};
+static unsigned char times18_109_bits[] = {
+0x67, 0x0c, 0xf6, 0x1e, 0xce, 0x19, 0xc6, 0x18, 0xc6, 0x18, 0xc6, 0x18, 
+0xc6, 0x18, 0xc6, 0x18, 0xef, 0x3d};
+static unsigned char times18_110_bits[] = {
+0x67, 0x00, 0xf6, 0x00, 0xce, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 
+0xc6, 0x00, 0xc6, 0x00, 0xcf, 0x01};
+static unsigned char times18_111_bits[] = {
+0x3c, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c};
+static unsigned char times18_112_bits[] = {
+0x77, 0xee, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6e, 0x36, 0x06, 0x06, 0x06, 
+0x0f};
+static unsigned char times18_113_bits[] = {
+0x7c, 0x66, 0x63, 0x63, 0x63, 0x63, 0x63, 0x66, 0x7c, 0x60, 0x60, 0x60, 
+0xf0};
+static unsigned char times18_114_bits[] = {
+0x37, 0x36, 0x0e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f};
+static unsigned char times18_115_bits[] = {
+0x16, 0x1b, 0x13, 0x07, 0x0e, 0x1c, 0x19, 0x1b, 0x0d};
+static unsigned char times18_116_bits[] = {
+0x04, 0x06, 0x1f, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x2e, 0x1c};
+static unsigned char times18_117_bits[] = {
+0xe7, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 
+0xc6, 0x00, 0xee, 0x00, 0xdc, 0x01};
+static unsigned char times18_118_bits[] = {
+0xcf, 0x01, 0xc6, 0x00, 0x46, 0x00, 0x4c, 0x00, 0x6c, 0x00, 0x28, 0x00, 
+0x38, 0x00, 0x10, 0x00, 0x10, 0x00};
+static unsigned char times18_119_bits[] = {
+0xe7, 0x1c, 0x66, 0x0c, 0x46, 0x06, 0x6c, 0x06, 0xec, 0x06, 0xb8, 0x02, 
+0xb8, 0x03, 0x10, 0x01, 0x10, 0x01};
+static unsigned char times18_120_bits[] = {
+0xc7, 0x01, 0xc6, 0x00, 0x6c, 0x00, 0x38, 0x00, 0x30, 0x00, 0x38, 0x00, 
+0x6c, 0x00, 0xc6, 0x00, 0xc7, 0x01};
+static unsigned char times18_121_bits[] = {
+0xcf, 0x01, 0x86, 0x00, 0xce, 0x00, 0x4c, 0x00, 0x6c, 0x00, 0x38, 0x00, 
+0x38, 0x00, 0x30, 0x00, 0x18, 0x00, 0x18, 0x00, 0x08, 0x00, 0x0f, 0x00, 
+0x07, 0x00};
+static unsigned char times18_122_bits[] = {
+0x7f, 0x73, 0x31, 0x18, 0x0c, 0x0c, 0x46, 0x67, 0x7f};
+static unsigned char times18_123_bits[] = {
+0x70, 0x18, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x06, 0x03, 0x06, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x18, 0x70};
+static unsigned char times18_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 
+0x01};
+static unsigned char times18_125_bits[] = {
+0x07, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0x60, 0x30, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x0c, 0x07};
+static unsigned char times18_126_bits[] = {
+0x9e, 0x01, 0xf3, 0x00};
+static unsigned char times18_127_bits[] = {
+0x00};
+static unsigned char times18_128_bits[] = {
+0x00};
+static unsigned char times18_129_bits[] = {
+0x00};
+static unsigned char times18_130_bits[] = {
+0x00};
+static unsigned char times18_131_bits[] = {
+0x00};
+static unsigned char times18_132_bits[] = {
+0x00};
+static unsigned char times18_133_bits[] = {
+0x00};
+static unsigned char times18_134_bits[] = {
+0x00};
+static unsigned char times18_135_bits[] = {
+0x00};
+static unsigned char times18_136_bits[] = {
+0x00};
+static unsigned char times18_137_bits[] = {
+0x00};
+static unsigned char times18_138_bits[] = {
+0x00};
+static unsigned char times18_139_bits[] = {
+0x00};
+static unsigned char times18_140_bits[] = {
+0x00};
+static unsigned char times18_141_bits[] = {
+0x00};
+static unsigned char times18_142_bits[] = {
+0x00};
+static unsigned char times18_143_bits[] = {
+0x00};
+static unsigned char times18_144_bits[] = {
+0x00};
+static unsigned char times18_145_bits[] = {
+0x00};
+static unsigned char times18_146_bits[] = {
+0x00};
+static unsigned char times18_147_bits[] = {
+0x00};
+static unsigned char times18_148_bits[] = {
+0x00};
+static unsigned char times18_149_bits[] = {
+0x00};
+static unsigned char times18_150_bits[] = {
+0x00};
+static unsigned char times18_151_bits[] = {
+0x00};
+static unsigned char times18_152_bits[] = {
+0x00};
+static unsigned char times18_153_bits[] = {
+0x00};
+static unsigned char times18_154_bits[] = {
+0x00};
+static unsigned char times18_155_bits[] = {
+0x00};
+static unsigned char times18_156_bits[] = {
+0x00};
+static unsigned char times18_157_bits[] = {
+0x00};
+static unsigned char times18_158_bits[] = {
+0x00};
+static unsigned char times18_159_bits[] = {
+0x00};
+static unsigned char times18_160_bits[] = {
+0x00};
+static unsigned char times18_161_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x01, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03};
+static unsigned char times18_162_bits[] = {
+0x60, 0x20, 0x7c, 0xd6, 0xd3, 0x13, 0x1b, 0x0b, 0x0b, 0x4e, 0x3e, 0x02, 
+0x03};
+static unsigned char times18_163_bits[] = {
+0xf0, 0x00, 0x98, 0x01, 0x98, 0x01, 0x18, 0x00, 0x18, 0x00, 0x18, 0x00, 
+0x7e, 0x00, 0x18, 0x00, 0x18, 0x00, 0x08, 0x00, 0x1e, 0x02, 0xfd, 0x03, 
+0xe7, 0x01};
+static unsigned char times18_164_bits[] = {
+0xbb, 0x01, 0xef, 0x01, 0xc6, 0x00, 0x82, 0x00, 0xc6, 0x00, 0xef, 0x01, 
+0xbb, 0x01};
+static unsigned char times18_165_bits[] = {
+0xef, 0x46, 0x46, 0x6e, 0x2c, 0x2c, 0x7e, 0x18, 0x7e, 0x18, 0x18, 0x18, 
+0x7e};
+static unsigned char times18_166_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 
+0x01};
+static unsigned char times18_167_bits[] = {
+0x3c, 0x66, 0x66, 0x0e, 0x1c, 0x3e, 0x71, 0xe3, 0xc7, 0x8e, 0x7c, 0x38, 
+0x70, 0x66, 0x66, 0x3c};
+static unsigned char times18_168_bits[] = {
+0x1b, 0x1b};
+static unsigned char times18_169_bits[] = {
+0xf0, 0x01, 0x0c, 0x06, 0x02, 0x08, 0xe2, 0x09, 0x11, 0x11, 0x09, 0x10, 
+0x09, 0x10, 0x09, 0x10, 0x11, 0x11, 0xe2, 0x08, 0x02, 0x08, 0x0c, 0x06, 
+0xf0, 0x01};
+static unsigned char times18_170_bits[] = {
+0x06, 0x09, 0x08, 0x0e, 0x09, 0x17, 0x00, 0x1f};
+static unsigned char times18_171_bits[] = {
+0x88, 0xcc, 0x66, 0x33, 0x66, 0xcc, 0x88};
+static unsigned char times18_172_bits[] = {
+0xff, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01};
+static unsigned char times18_173_bits[] = {
+0x1f, 0x1f};
+static unsigned char times18_174_bits[] = {
+0xf0, 0x01, 0x0c, 0x06, 0x02, 0x08, 0xfa, 0x08, 0x11, 0x11, 0x11, 0x11, 
+0xf1, 0x10, 0x91, 0x10, 0x11, 0x11, 0x3a, 0x0b, 0x02, 0x08, 0x0c, 0x06, 
+0xf0, 0x01};
+static unsigned char times18_175_bits[] = {
+0x1f};
+static unsigned char times18_176_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char times18_177_bits[] = {
+0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0xff, 0x01, 0x10, 0x00, 
+0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0xff, 0x01};
+static unsigned char times18_178_bits[] = {
+0x0e, 0x19, 0x18, 0x08, 0x04, 0x04, 0x02, 0x1f};
+static unsigned char times18_179_bits[] = {
+0x0e, 0x11, 0x18, 0x0e, 0x18, 0x10, 0x11, 0x0e};
+static unsigned char times18_180_bits[] = {
+0x0c, 0x06, 0x01};
+static unsigned char times18_181_bits[] = {
+0xe7, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 
+0xc6, 0x00, 0xee, 0x00, 0xde, 0x01, 0x02, 0x00, 0x02, 0x00, 0x06, 0x00, 
+0x06, 0x00};
+static unsigned char times18_182_bits[] = {
+0x7c, 0x2e, 0x2f, 0x2f, 0x2f, 0x2f, 0x2f, 0x2e, 0x28, 0x28, 0x28, 0x28, 
+0x28, 0x28, 0x28, 0x28, 0x28};
+static unsigned char times18_183_bits[] = {
+0x03, 0x03};
+static unsigned char times18_184_bits[] = {
+0x04, 0x04, 0x08, 0x0d, 0x06};
+static unsigned char times18_185_bits[] = {
+0x02, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times18_186_bits[] = {
+0x0e, 0x1b, 0x11, 0x11, 0x1b, 0x0e, 0x00, 0x1f};
+static unsigned char times18_187_bits[] = {
+0x11, 0x33, 0x66, 0xcc, 0x66, 0x33, 0x11};
+static unsigned char times18_188_bits[] = {
+0x02, 0x01, 0x83, 0x01, 0x82, 0x00, 0xc2, 0x00, 0x62, 0x00, 0x22, 0x02, 
+0x32, 0x03, 0x97, 0x02, 0xd8, 0x02, 0x4c, 0x02, 0xe4, 0x07, 0x06, 0x02, 
+0x02, 0x02};
+static unsigned char times18_189_bits[] = {
+0x02, 0x01, 0x83, 0x01, 0x82, 0x00, 0xc2, 0x00, 0x62, 0x00, 0xa2, 0x03, 
+0x72, 0x06, 0x17, 0x06, 0x18, 0x02, 0x0c, 0x01, 0x04, 0x01, 0x86, 0x00, 
+0xc2, 0x07};
+static unsigned char times18_190_bits[] = {
+0x0e, 0x04, 0x11, 0x06, 0x18, 0x02, 0x0e, 0x03, 0x98, 0x01, 0x90, 0x08, 
+0xd1, 0x0c, 0x4e, 0x0a, 0x60, 0x0b, 0x30, 0x09, 0x90, 0x1f, 0x18, 0x08, 
+0x08, 0x08};
+static unsigned char times18_191_bits[] = {
+0x0c, 0x0c, 0x00, 0x08, 0x08, 0x0c, 0x06, 0x06, 0x03, 0x33, 0x31, 0x23, 
+0x1e};
+static unsigned char times18_192_bits[] = {
+0x30, 0x00, 0x60, 0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x00, 
+0xe0, 0x00, 0xa0, 0x00, 0xb0, 0x01, 0x90, 0x01, 0x98, 0x03, 0x08, 0x03, 
+0xf8, 0x03, 0x0c, 0x07, 0x04, 0x06, 0x06, 0x0e, 0x0f, 0x1f};
+static unsigned char times18_193_bits[] = {
+0x00, 0x03, 0x80, 0x01, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x00, 
+0xe0, 0x00, 0xa0, 0x00, 0xb0, 0x01, 0x90, 0x01, 0x98, 0x03, 0x08, 0x03, 
+0xf8, 0x03, 0x0c, 0x07, 0x04, 0x06, 0x06, 0x0e, 0x0f, 0x1f};
+static unsigned char times18_194_bits[] = {
+0x40, 0x00, 0xe0, 0x00, 0x10, 0x01, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x00, 
+0xe0, 0x00, 0xa0, 0x00, 0xb0, 0x01, 0x90, 0x01, 0x98, 0x03, 0x08, 0x03, 
+0xf8, 0x03, 0x0c, 0x07, 0x04, 0x06, 0x06, 0x0e, 0x0f, 0x1f};
+static unsigned char times18_195_bits[] = {
+0xe0, 0x02, 0xd0, 0x01, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 
+0xa0, 0x00, 0xb0, 0x01, 0x90, 0x01, 0x98, 0x03, 0x08, 0x03, 0xf8, 0x03, 
+0x0c, 0x07, 0x04, 0x06, 0x06, 0x0e, 0x0f, 0x1f};
+static unsigned char times18_196_bits[] = {
+0xb0, 0x01, 0xb0, 0x01, 0x00, 0x00, 0x40, 0x00, 0xe0, 0x00, 0xe0, 0x00, 
+0xa0, 0x00, 0xb0, 0x01, 0x90, 0x01, 0x98, 0x03, 0x08, 0x03, 0xf8, 0x03, 
+0x0c, 0x07, 0x04, 0x06, 0x06, 0x0e, 0x0f, 0x1f};
+static unsigned char times18_197_bits[] = {
+0xc0, 0x00, 0x20, 0x01, 0x20, 0x01, 0xc0, 0x00, 0x40, 0x00, 0xe0, 0x00, 
+0xe0, 0x00, 0xa0, 0x00, 0xb0, 0x01, 0x90, 0x01, 0x98, 0x03, 0x08, 0x03, 
+0xf8, 0x03, 0x0c, 0x07, 0x04, 0x06, 0x06, 0x0e, 0x0f, 0x1f};
+static unsigned char times18_198_bits[] = {
+0xf0, 0x3f, 0xe0, 0x31, 0xa0, 0x21, 0xa0, 0x01, 0xb0, 0x01, 0x90, 0x11, 
+0x98, 0x1f, 0xf8, 0x11, 0x88, 0x01, 0x8c, 0x01, 0x84, 0x41, 0x86, 0x61, 
+0xef, 0x7f};
+static unsigned char times18_199_bits[] = {
+0xf0, 0x04, 0x0c, 0x07, 0x06, 0x06, 0x06, 0x04, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x06, 0x00, 0x06, 0x06, 0x1c, 0x03, 
+0xf0, 0x00, 0x20, 0x00, 0x40, 0x00, 0x68, 0x00, 0x30, 0x00};
+static unsigned char times18_200_bits[] = {
+0x0c, 0x00, 0x18, 0x00, 0x20, 0x00, 0x00, 0x00, 0xff, 0x01, 0x86, 0x01, 
+0x06, 0x01, 0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 0xfe, 0x00, 0x86, 0x00, 
+0x06, 0x00, 0x06, 0x00, 0x06, 0x01, 0x86, 0x01, 0xff, 0x01};
+static unsigned char times18_201_bits[] = {
+0x60, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x00, 0xff, 0x01, 0x86, 0x01, 
+0x06, 0x01, 0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 0xfe, 0x00, 0x86, 0x00, 
+0x06, 0x00, 0x06, 0x00, 0x06, 0x01, 0x86, 0x01, 0xff, 0x01};
+static unsigned char times18_202_bits[] = {
+0x10, 0x00, 0x38, 0x00, 0x44, 0x00, 0x00, 0x00, 0xff, 0x01, 0x86, 0x01, 
+0x06, 0x01, 0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 0xfe, 0x00, 0x86, 0x00, 
+0x06, 0x00, 0x06, 0x00, 0x06, 0x01, 0x86, 0x01, 0xff, 0x01};
+static unsigned char times18_203_bits[] = {
+0xcc, 0x00, 0xcc, 0x00, 0x00, 0x00, 0xff, 0x01, 0x86, 0x01, 0x06, 0x01, 
+0x06, 0x00, 0x06, 0x00, 0x86, 0x00, 0xfe, 0x00, 0x86, 0x00, 0x06, 0x00, 
+0x06, 0x00, 0x06, 0x01, 0x86, 0x01, 0xff, 0x01};
+static unsigned char times18_204_bits[] = {
+0x03, 0x06, 0x08, 0x00, 0x0f, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x0f};
+static unsigned char times18_205_bits[] = {
+0x0c, 0x06, 0x01, 0x00, 0x0f, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x0f};
+static unsigned char times18_206_bits[] = {
+0x04, 0x0e, 0x11, 0x00, 0x0f, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x0f};
+static unsigned char times18_207_bits[] = {
+0x33, 0x33, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x1e};
+static unsigned char times18_208_bits[] = {
+0xfe, 0x01, 0x8c, 0x03, 0x0c, 0x06, 0x0c, 0x06, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x3f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x06, 0x0c, 0x06, 0x8c, 0x03, 
+0xfe, 0x01};
+static unsigned char times18_209_bits[] = {
+0x70, 0x01, 0xe8, 0x00, 0x00, 0x00, 0x07, 0x07, 0x06, 0x02, 0x0e, 0x02, 
+0x1e, 0x02, 0x1a, 0x02, 0x32, 0x02, 0x72, 0x02, 0xe2, 0x02, 0xc2, 0x02, 
+0x82, 0x03, 0x82, 0x03, 0x02, 0x03, 0x07, 0x02};
+static unsigned char times18_210_bits[] = {
+0x18, 0x00, 0x30, 0x00, 0x40, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0c, 0x03, 
+0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 
+0x03, 0x0c, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x03, 0xf0, 0x00};
+static unsigned char times18_211_bits[] = {
+0x00, 0x03, 0x80, 0x01, 0x40, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0c, 0x03, 
+0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 
+0x03, 0x0c, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x03, 0xf0, 0x00};
+static unsigned char times18_212_bits[] = {
+0x40, 0x00, 0xe0, 0x00, 0x10, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x0c, 0x03, 
+0x06, 0x06, 0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 
+0x03, 0x0c, 0x06, 0x06, 0x06, 0x06, 0x0c, 0x03, 0xf0, 0x00};
+static unsigned char times18_213_bits[] = {
+0x70, 0x01, 0xe8, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x0c, 0x03, 0x06, 0x06, 
+0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 
+0x06, 0x06, 0x06, 0x06, 0x0c, 0x03, 0xf0, 0x00};
+static unsigned char times18_214_bits[] = {
+0x98, 0x01, 0x98, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x0c, 0x03, 0x06, 0x06, 
+0x06, 0x06, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 0x03, 0x0c, 
+0x06, 0x06, 0x06, 0x06, 0x0c, 0x03, 0xf0, 0x00};
+static unsigned char times18_215_bits[] = {
+0xc3, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0xc3};
+static unsigned char times18_216_bits[] = {
+0x00, 0x0c, 0xf0, 0x06, 0x0c, 0x03, 0x06, 0x07, 0x86, 0x05, 0xc3, 0x0c, 
+0xc3, 0x0c, 0x63, 0x0c, 0x33, 0x0c, 0x33, 0x0c, 0x1a, 0x06, 0x0e, 0x06, 
+0x0c, 0x03, 0xf6, 0x00, 0x03, 0x00};
+static unsigned char times18_217_bits[] = {
+0x18, 0x00, 0x30, 0x00, 0x40, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x06, 0x02, 
+0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 
+0x06, 0x02, 0x06, 0x02, 0x0e, 0x03, 0x9c, 0x01, 0xf8, 0x00};
+static unsigned char times18_218_bits[] = {
+0x80, 0x01, 0xc0, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x06, 0x02, 
+0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 
+0x06, 0x02, 0x06, 0x02, 0x0e, 0x03, 0x9c, 0x01, 0xf8, 0x00};
+static unsigned char times18_219_bits[] = {
+0x20, 0x00, 0x70, 0x00, 0x88, 0x00, 0x00, 0x00, 0x0f, 0x07, 0x06, 0x02, 
+0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 
+0x06, 0x02, 0x06, 0x02, 0x0e, 0x03, 0x9c, 0x01, 0xf8, 0x00};
+static unsigned char times18_220_bits[] = {
+0x98, 0x01, 0x98, 0x01, 0x00, 0x00, 0x0f, 0x07, 0x06, 0x02, 0x06, 0x02, 
+0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 0x06, 0x02, 
+0x06, 0x02, 0x0e, 0x03, 0x9c, 0x01, 0xf8, 0x00};
+static unsigned char times18_221_bits[] = {
+0x80, 0x01, 0xc0, 0x00, 0x20, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x0e, 0x06, 
+0x0c, 0x03, 0x18, 0x01, 0x98, 0x00, 0xf0, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xf0, 0x00};
+static unsigned char times18_222_bits[] = {
+0x0f, 0x00, 0x06, 0x00, 0x06, 0x00, 0xfe, 0x00, 0xc6, 0x01, 0x86, 0x01, 
+0x86, 0x01, 0x86, 0x01, 0xc6, 0x00, 0x7e, 0x00, 0x06, 0x00, 0x06, 0x00, 
+0x0f, 0x00};
+static unsigned char times18_223_bits[] = {
+0x38, 0x6c, 0xc4, 0xc6, 0xc6, 0x66, 0x3e, 0x66, 0xc6, 0xc6, 0xd6, 0xd6, 
+0x77};
+static unsigned char times18_224_bits[] = {
+0x03, 0x06, 0x08, 0x00, 0x1e, 0x13, 0x33, 0x38, 0x36, 0x33, 0x33, 0x3f, 
+0x66};
+static unsigned char times18_225_bits[] = {
+0x30, 0x18, 0x04, 0x00, 0x1e, 0x13, 0x33, 0x38, 0x36, 0x33, 0x33, 0x3f, 
+0x66};
+static unsigned char times18_226_bits[] = {
+0x08, 0x1c, 0x22, 0x00, 0x1e, 0x13, 0x33, 0x38, 0x36, 0x33, 0x33, 0x3f, 
+0x66};
+static unsigned char times18_227_bits[] = {
+0x2c, 0x1a, 0x00, 0x1e, 0x13, 0x33, 0x38, 0x36, 0x33, 0x33, 0x3f, 0x66};
+static unsigned char times18_228_bits[] = {
+0x36, 0x36, 0x00, 0x1e, 0x13, 0x33, 0x38, 0x36, 0x33, 0x33, 0x3f, 0x66};
+static unsigned char times18_229_bits[] = {
+0x0c, 0x12, 0x12, 0x0c, 0x1e, 0x13, 0x33, 0x38, 0x36, 0x33, 0x33, 0x3f, 
+0x66};
+static unsigned char times18_230_bits[] = {
+0xde, 0x03, 0x73, 0x06, 0x33, 0x04, 0xf8, 0x07, 0x36, 0x00, 0x33, 0x00, 
+0x33, 0x00, 0x7f, 0x06, 0xc6, 0x03};
+static unsigned char times18_231_bits[] = {
+0x3c, 0x66, 0x03, 0x03, 0x03, 0x03, 0x03, 0x66, 0x3c, 0x08, 0x10, 0x1a, 
+0x0c};
+static unsigned char times18_232_bits[] = {
+0x06, 0x0c, 0x10, 0x00, 0x3c, 0x66, 0x43, 0x7f, 0x03, 0x03, 0x03, 0x66, 
+0x3c};
+static unsigned char times18_233_bits[] = {
+0x60, 0x30, 0x08, 0x00, 0x3c, 0x66, 0x43, 0x7f, 0x03, 0x03, 0x03, 0x66, 
+0x3c};
+static unsigned char times18_234_bits[] = {
+0x08, 0x1c, 0x22, 0x00, 0x3c, 0x66, 0x43, 0x7f, 0x03, 0x03, 0x03, 0x66, 
+0x3c};
+static unsigned char times18_235_bits[] = {
+0x36, 0x36, 0x00, 0x3c, 0x66, 0x43, 0x7f, 0x03, 0x03, 0x03, 0x66, 0x3c};
+static unsigned char times18_236_bits[] = {
+0x03, 0x06, 0x08, 0x00, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x0f};
+static unsigned char times18_237_bits[] = {
+0x0c, 0x06, 0x01, 0x00, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x0f};
+static unsigned char times18_238_bits[] = {
+0x04, 0x0e, 0x11, 0x00, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x0f};
+static unsigned char times18_239_bits[] = {
+0x1b, 0x1b, 0x00, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f};
+static unsigned char times18_240_bits[] = {
+0x06, 0x6c, 0x1c, 0x32, 0x7c, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 
+0x3c};
+static unsigned char times18_241_bits[] = {
+0x5c, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x67, 0x00, 0xf6, 0x00, 0xce, 0x00, 
+0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xcf, 0x01};
+static unsigned char times18_242_bits[] = {
+0x06, 0x0c, 0x10, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 
+0x3c};
+static unsigned char times18_243_bits[] = {
+0x60, 0x30, 0x08, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 
+0x3c};
+static unsigned char times18_244_bits[] = {
+0x08, 0x1c, 0x22, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 
+0x3c};
+static unsigned char times18_245_bits[] = {
+0x58, 0x34, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c};
+static unsigned char times18_246_bits[] = {
+0x36, 0x36, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0x66, 0x3c};
+static unsigned char times18_247_bits[] = {
+0x18, 0x18, 0x00, 0xff, 0x00, 0x18, 0x18};
+static unsigned char times18_248_bits[] = {
+0x80, 0xfc, 0x66, 0xf3, 0xd3, 0xdb, 0xcb, 0xcf, 0x66, 0x3e, 0x03};
+static unsigned char times18_249_bits[] = {
+0x0c, 0x00, 0x18, 0x00, 0x20, 0x00, 0x00, 0x00, 0xe7, 0x00, 0xc6, 0x00, 
+0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xee, 0x00, 
+0xdc, 0x01};
+static unsigned char times18_250_bits[] = {
+0x60, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x00, 0xe7, 0x00, 0xc6, 0x00, 
+0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xee, 0x00, 
+0xdc, 0x01};
+static unsigned char times18_251_bits[] = {
+0x10, 0x00, 0x38, 0x00, 0x44, 0x00, 0x00, 0x00, 0xe7, 0x00, 0xc6, 0x00, 
+0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xee, 0x00, 
+0xdc, 0x01};
+static unsigned char times18_252_bits[] = {
+0x6c, 0x00, 0x6c, 0x00, 0x00, 0x00, 0xe7, 0x00, 0xc6, 0x00, 0xc6, 0x00, 
+0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xc6, 0x00, 0xee, 0x00, 0xdc, 0x01};
+static unsigned char times18_253_bits[] = {
+0xc0, 0x60, 0x10, 0x00, 0xcf, 0xc6, 0x4e, 0x4c, 0x6c, 0x38, 0x38, 0x30, 
+0x10, 0x18, 0x08, 0x0f, 0x07};
+static unsigned char times18_254_bits[] = {
+0x07, 0x06, 0x06, 0x06, 0x76, 0xee, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6e, 
+0x3e, 0x06, 0x06, 0x06, 0x0f};
+static unsigned char times18_255_bits[] = {
+0x6c, 0x6c, 0x00, 0xcf, 0xc6, 0x4e, 0x4c, 0x6c, 0x38, 0x38, 0x30, 0x10, 
+0x18, 0x08, 0x0f, 0x07};
+static RotFont times18font[] = {
+{5, 1, 1, times18_0_bits},
+{5, 1, 1, times18_1_bits},
+{5, 1, 1, times18_2_bits},
+{5, 1, 1, times18_3_bits},
+{5, 1, 1, times18_4_bits},
+{5, 1, 1, times18_5_bits},
+{5, 1, 1, times18_6_bits},
+{5, 1, 1, times18_7_bits},
+{5, 1, 1, times18_8_bits},
+{5, 1, 1, times18_9_bits},
+{5, 1, 1, times18_10_bits},
+{5, 1, 1, times18_11_bits},
+{5, 1, 1, times18_12_bits},
+{5, 1, 1, times18_13_bits},
+{5, 1, 1, times18_14_bits},
+{5, 1, 1, times18_15_bits},
+{5, 1, 1, times18_16_bits},
+{5, 1, 1, times18_17_bits},
+{5, 1, 1, times18_18_bits},
+{5, 1, 1, times18_19_bits},
+{5, 1, 1, times18_20_bits},
+{5, 1, 1, times18_21_bits},
+{5, 1, 1, times18_22_bits},
+{5, 1, 1, times18_23_bits},
+{5, 1, 1, times18_24_bits},
+{5, 1, 1, times18_25_bits},
+{5, 1, 1, times18_26_bits},
+{5, 1, 1, times18_27_bits},
+{5, 1, 1, times18_28_bits},
+{5, 1, 1, times18_29_bits},
+{5, 1, 1, times18_30_bits},
+{5, 1, 1, times18_31_bits},
+{8, 1, 1, times18_32_bits},
+{2, 13, 13, times18_33_bits},
+{6, 4, 13, times18_34_bits},
+{11, 13, 13, times18_35_bits},
+{7, 16, 14, times18_36_bits},
+{13, 13, 13, times18_37_bits},
+{12, 13, 13, times18_38_bits},
+{3, 4, 13, times18_39_bits},
+{5, 17, 13, times18_40_bits},
+{5, 17, 13, times18_41_bits},
+{7, 8, 14, times18_42_bits},
+{9, 9, 9, times18_43_bits},
+{3, 5, 2, times18_44_bits},
+{8, 1, 5, times18_45_bits},
+{2, 2, 2, times18_46_bits},
+{5, 15, 13, times18_47_bits},
+{8, 13, 13, times18_48_bits},
+{6, 13, 13, times18_49_bits},
+{7, 13, 13, times18_50_bits},
+{7, 13, 13, times18_51_bits},
+{8, 13, 13, times18_52_bits},
+{7, 13, 13, times18_53_bits},
+{8, 13, 13, times18_54_bits},
+{7, 13, 13, times18_55_bits},
+{8, 13, 13, times18_56_bits},
+{8, 13, 13, times18_57_bits},
+{2, 9, 9, times18_58_bits},
+{3, 12, 9, times18_59_bits},
+{9, 9, 9, times18_60_bits},
+{8, 3, 6, times18_61_bits},
+{9, 9, 9, times18_62_bits},
+{6, 13, 13, times18_63_bits},
+{14, 16, 13, times18_64_bits},
+{13, 13, 13, times18_65_bits},
+{10, 13, 13, times18_66_bits},
+{11, 13, 13, times18_67_bits},
+{11, 13, 13, times18_68_bits},
+{9, 13, 13, times18_69_bits},
+{9, 13, 13, times18_70_bits},
+{12, 13, 13, times18_71_bits},
+{11, 13, 13, times18_72_bits},
+{4, 13, 13, times18_73_bits},
+{6, 13, 13, times18_74_bits},
+{11, 13, 13, times18_75_bits},
+{10, 13, 13, times18_76_bits},
+{14, 13, 13, times18_77_bits},
+{11, 13, 13, times18_78_bits},
+{12, 13, 13, times18_79_bits},
+{9, 13, 13, times18_80_bits},
+{12, 17, 13, times18_81_bits},
+{11, 13, 13, times18_82_bits},
+{8, 13, 13, times18_83_bits},
+{10, 13, 13, times18_84_bits},
+{11, 13, 13, times18_85_bits},
+{13, 13, 13, times18_86_bits},
+{18, 13, 13, times18_87_bits},
+{12, 13, 13, times18_88_bits},
+{12, 13, 13, times18_89_bits},
+{10, 13, 13, times18_90_bits},
+{4, 16, 13, times18_91_bits},
+{5, 13, 13, times18_92_bits},
+{4, 16, 13, times18_93_bits},
+{7, 7, 13, times18_94_bits},
+{9, 1, -3, times18_95_bits},
+{3, 4, 13, times18_96_bits},
+{7, 9, 9, times18_97_bits},
+{8, 13, 13, times18_98_bits},
+{7, 9, 9, times18_99_bits},
+{8, 13, 13, times18_100_bits},
+{8, 9, 9, times18_101_bits},
+{6, 13, 13, times18_102_bits},
+{8, 13, 9, times18_103_bits},
+{9, 13, 13, times18_104_bits},
+{4, 13, 13, times18_105_bits},
+{4, 17, 13, times18_106_bits},
+{9, 13, 13, times18_107_bits},
+{4, 13, 13, times18_108_bits},
+{14, 9, 9, times18_109_bits},
+{9, 9, 9, times18_110_bits},
+{8, 9, 9, times18_111_bits},
+{8, 13, 9, times18_112_bits},
+{8, 13, 9, times18_113_bits},
+{6, 9, 9, times18_114_bits},
+{5, 9, 9, times18_115_bits},
+{6, 11, 11, times18_116_bits},
+{9, 9, 9, times18_117_bits},
+{9, 9, 9, times18_118_bits},
+{13, 9, 9, times18_119_bits},
+{9, 9, 9, times18_120_bits},
+{9, 13, 9, times18_121_bits},
+{7, 9, 9, times18_122_bits},
+{7, 17, 13, times18_123_bits},
+{1, 13, 13, times18_124_bits},
+{7, 17, 13, times18_125_bits},
+{9, 2, 6, times18_126_bits},
+{5, 1, 1, times18_127_bits},
+{5, 1, 1, times18_128_bits},
+{5, 1, 1, times18_129_bits},
+{5, 1, 1, times18_130_bits},
+{5, 1, 1, times18_131_bits},
+{5, 1, 1, times18_132_bits},
+{5, 1, 1, times18_133_bits},
+{5, 1, 1, times18_134_bits},
+{5, 1, 1, times18_135_bits},
+{5, 1, 1, times18_136_bits},
+{5, 1, 1, times18_137_bits},
+{5, 1, 1, times18_138_bits},
+{5, 1, 1, times18_139_bits},
+{5, 1, 1, times18_140_bits},
+{5, 1, 1, times18_141_bits},
+{5, 1, 1, times18_142_bits},
+{5, 1, 1, times18_143_bits},
+{5, 1, 1, times18_144_bits},
+{5, 1, 1, times18_145_bits},
+{5, 1, 1, times18_146_bits},
+{5, 1, 1, times18_147_bits},
+{5, 1, 1, times18_148_bits},
+{5, 1, 1, times18_149_bits},
+{5, 1, 1, times18_150_bits},
+{5, 1, 1, times18_151_bits},
+{5, 1, 1, times18_152_bits},
+{5, 1, 1, times18_153_bits},
+{5, 1, 1, times18_154_bits},
+{5, 1, 1, times18_155_bits},
+{5, 1, 1, times18_156_bits},
+{5, 1, 1, times18_157_bits},
+{5, 1, 1, times18_158_bits},
+{5, 1, 1, times18_159_bits},
+{1, 1, 1, times18_160_bits},
+{2, 13, 9, times18_161_bits},
+{8, 13, 11, times18_162_bits},
+{10, 13, 13, times18_163_bits},
+{9, 7, 10, times18_164_bits},
+{8, 13, 13, times18_165_bits},
+{1, 13, 13, times18_166_bits},
+{8, 16, 13, times18_167_bits},
+{5, 2, 12, times18_168_bits},
+{13, 13, 13, times18_169_bits},
+{5, 8, 13, times18_170_bits},
+{8, 7, 8, times18_171_bits},
+{9, 5, 6, times18_172_bits},
+{5, 2, 6, times18_173_bits},
+{13, 13, 13, times18_174_bits},
+{5, 1, 12, times18_175_bits},
+{5, 5, 13, times18_176_bits},
+{9, 10, 10, times18_177_bits},
+{5, 8, 13, times18_178_bits},
+{5, 8, 13, times18_179_bits},
+{4, 3, 13, times18_180_bits},
+{9, 13, 9, times18_181_bits},
+{7, 17, 13, times18_182_bits},
+{2, 2, 6, times18_183_bits},
+{4, 5, 1, times18_184_bits},
+{3, 8, 13, times18_185_bits},
+{5, 8, 13, times18_186_bits},
+{8, 7, 8, times18_187_bits},
+{11, 13, 13, times18_188_bits},
+{11, 13, 13, times18_189_bits},
+{13, 13, 13, times18_190_bits},
+{6, 13, 9, times18_191_bits},
+{13, 17, 17, times18_192_bits},
+{13, 17, 17, times18_193_bits},
+{13, 17, 17, times18_194_bits},
+{13, 16, 16, times18_195_bits},
+{13, 16, 16, times18_196_bits},
+{13, 17, 17, times18_197_bits},
+{15, 13, 13, times18_198_bits},
+{11, 17, 13, times18_199_bits},
+{9, 17, 17, times18_200_bits},
+{9, 17, 17, times18_201_bits},
+{9, 17, 17, times18_202_bits},
+{9, 16, 16, times18_203_bits},
+{4, 17, 17, times18_204_bits},
+{4, 17, 17, times18_205_bits},
+{5, 17, 17, times18_206_bits},
+{6, 16, 16, times18_207_bits},
+{12, 13, 13, times18_208_bits},
+{11, 16, 16, times18_209_bits},
+{12, 17, 17, times18_210_bits},
+{12, 17, 17, times18_211_bits},
+{12, 17, 17, times18_212_bits},
+{12, 16, 16, times18_213_bits},
+{12, 16, 16, times18_214_bits},
+{8, 7, 8, times18_215_bits},
+{12, 15, 14, times18_216_bits},
+{11, 17, 17, times18_217_bits},
+{11, 17, 17, times18_218_bits},
+{11, 17, 17, times18_219_bits},
+{11, 16, 16, times18_220_bits},
+{12, 17, 17, times18_221_bits},
+{9, 13, 13, times18_222_bits},
+{8, 13, 13, times18_223_bits},
+{7, 13, 13, times18_224_bits},
+{7, 13, 13, times18_225_bits},
+{7, 13, 13, times18_226_bits},
+{7, 12, 12, times18_227_bits},
+{7, 12, 12, times18_228_bits},
+{7, 13, 13, times18_229_bits},
+{11, 9, 9, times18_230_bits},
+{7, 13, 9, times18_231_bits},
+{7, 13, 13, times18_232_bits},
+{7, 13, 13, times18_233_bits},
+{7, 13, 13, times18_234_bits},
+{7, 12, 12, times18_235_bits},
+{4, 13, 13, times18_236_bits},
+{4, 13, 13, times18_237_bits},
+{5, 13, 13, times18_238_bits},
+{5, 12, 12, times18_239_bits},
+{8, 13, 13, times18_240_bits},
+{9, 12, 12, times18_241_bits},
+{8, 13, 13, times18_242_bits},
+{8, 13, 13, times18_243_bits},
+{8, 13, 13, times18_244_bits},
+{8, 12, 12, times18_245_bits},
+{8, 12, 12, times18_246_bits},
+{8, 7, 8, times18_247_bits},
+{8, 11, 10, times18_248_bits},
+{9, 13, 13, times18_249_bits},
+{9, 13, 13, times18_250_bits},
+{9, 13, 13, times18_251_bits},
+{9, 12, 12, times18_252_bits},
+{8, 17, 13, times18_253_bits},
+{8, 17, 13, times18_254_bits},
+{8, 16, 12, times18_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times24.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times24.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times24.bdf	(revision 15879)
@@ -0,0 +1,4377 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Times-Medium-R-Normal--24-240-75-75-P-124-ISO8859-1
+SIZE 24 75 75
+FONTBOUNDINGBOX 24 28 -1 -6
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Times"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 24
+POINT_SIZE 240
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 124
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 17
+X_HEIGHT 12
+FACE_NAME "Times Roman"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "Times is a trademark of Linotype-Hell AG and/or its subsidiaries."
+_DEC_DEVICE_FONTNAMES "PS=Times-Roman"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2-1, 22-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Times Roman"
+FONT "-Adobe-Times-Medium-R-Normal--24-240-75-75-P-124-ISO8859-1"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 14
+DEFAULT_CHAR 32
+FONT_ASCENT 20
+FONT_DESCENT 6
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 2 17 3 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+00
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 6 5 1 12
+BITMAP
+cc
+cc
+cc
+cc
+88
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+0880
+0880
+0880
+0880
+0880
+7fe0
+7fe0
+1100
+1100
+1100
+ffc0
+ffc0
+2200
+2200
+2200
+2200
+2200
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 11 21 0 -2
+BITMAP
+0400
+0400
+1f80
+34e0
+6460
+6420
+6400
+7400
+3c00
+1e00
+0780
+07c0
+04e0
+0460
+8460
+8460
+c4c0
+e5c0
+3f00
+0400
+0400
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 17 16 1 0
+BITMAP
+1e0c00
+33fc00
+611800
+c11000
+c13000
+c26000
+e44000
+78c000
+018f00
+011980
+033080
+066080
+046080
+0c6100
+187200
+303c00
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+0780
+0cc0
+1840
+1840
+18c0
+1d80
+0f00
+0e3e
+1e18
+3710
+6320
+c1a0
+c1c0
+c0c0
+e1e1
+7f7e
+3c3c
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 3 5 3 12
+BITMAP
+c0
+e0
+20
+60
+c0
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 22 1 -5
+BITMAP
+04
+08
+10
+30
+20
+60
+60
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+60
+60
+20
+30
+10
+08
+04
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 22 1 -5
+BITMAP
+80
+40
+20
+30
+10
+18
+18
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+0c
+18
+18
+10
+30
+20
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 9 9 2 8
+BITMAP
+0800
+1c00
+c980
+eb80
+1c00
+eb80
+c980
+1c00
+0800
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 12 1 1
+BITMAP
+0600
+0600
+0600
+0600
+0600
+fff0
+fff0
+0600
+0600
+0600
+0600
+0600
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 3 5 2 -3
+BITMAP
+c0
+e0
+20
+60
+c0
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 2 1 6
+BITMAP
+fff0
+fff0
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 2 2 0
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 8 20 -1 -3
+BITMAP
+03
+03
+03
+06
+06
+04
+0c
+0c
+08
+18
+18
+10
+30
+30
+20
+60
+60
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1e00
+3300
+6180
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+e1c0
+6180
+6180
+3300
+1e00
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 8 17 2 0
+BITMAP
+08
+18
+78
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+ff
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1c00
+7f00
+4380
+8180
+8180
+0180
+0180
+0300
+0300
+0600
+0400
+0c00
+1800
+3000
+6040
+ffc0
+ff80
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 9 17 1 0
+BITMAP
+1c00
+7e00
+4700
+8300
+8300
+0600
+0c00
+1e00
+0700
+0380
+0180
+0180
+0180
+0100
+c300
+e600
+7800
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+0300
+0700
+0700
+0b00
+1b00
+1300
+3300
+2300
+6300
+4300
+c300
+ffc0
+ffc0
+0300
+0300
+0300
+0300
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1fc0
+1f80
+2000
+2000
+6000
+7800
+7e00
+0f80
+0380
+01c0
+00c0
+00c0
+00c0
+00c0
+c180
+e380
+7e00
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+03c0
+0e00
+1800
+3000
+7000
+6000
+ee00
+f380
+c180
+c0c0
+c0c0
+c0c0
+c0c0
+e0c0
+6180
+7b80
+1e00
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+7fc0
+ffc0
+c0c0
+8180
+0180
+0100
+0300
+0300
+0200
+0600
+0600
+0400
+0c00
+0c00
+0c00
+1800
+1800
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1e00
+3300
+6180
+6180
+6180
+3300
+1e00
+1e00
+3700
+6180
+41c0
+c0c0
+c0c0
+c0c0
+e180
+7380
+1e00
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1e00
+7780
+6180
+c1c0
+c0c0
+c0c0
+c0c0
+c0c0
+61c0
+73c0
+1d80
+0180
+0380
+0300
+0600
+1c00
+f000
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 11 2 0
+BITMAP
+c0
+c0
+00
+00
+00
+00
+00
+00
+00
+c0
+c0
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 3 14 2 -3
+BITMAP
+c0
+c0
+00
+00
+00
+00
+00
+00
+00
+c0
+e0
+20
+60
+c0
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 11 1 1
+BITMAP
+0060
+01c0
+0700
+1c00
+7000
+c000
+7000
+1c00
+0700
+01c0
+0060
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 6 1 4
+BITMAP
+fff0
+fff0
+0000
+0000
+fff0
+fff0
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 11 1 1
+BITMAP
+c000
+7000
+1c00
+0700
+01c0
+0060
+01c0
+0700
+1c00
+7000
+c000
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 8 17 2 0
+BITMAP
+7c
+c6
+83
+c3
+c3
+07
+0e
+0c
+18
+18
+10
+10
+10
+00
+00
+30
+30
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 880 0
+DWIDTH 22 0
+BBX 18 20 2 -3
+BITMAP
+03f800
+0f0e00
+1c0300
+380180
+700080
+60ecc0
+e1fc40
+c38c40
+c30c40
+c60c40
+c61840
+c618c0
+c61880
+c63980
+637b00
+61de00
+300000
+180000
+0e0c00
+03f000
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 17 17 0 0
+BITMAP
+008000
+01c000
+01c000
+016000
+026000
+023000
+063000
+043000
+041800
+0c1800
+0ff800
+080c00
+180c00
+100c00
+100600
+300600
+fc1f80
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 17 1 0
+BITMAP
+ffc0
+3070
+3030
+3018
+3018
+3018
+3030
+3040
+3fe0
+3038
+3018
+300c
+300c
+300c
+3018
+3078
+ffe0
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 17 1 0
+BITMAP
+07e4
+1c3c
+380c
+6004
+6004
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+6000
+6004
+3808
+1e38
+07e0
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 15 17 1 0
+BITMAP
+ffc0
+3070
+3038
+300c
+300c
+3006
+3006
+3006
+3006
+3006
+3006
+3006
+300c
+300c
+3038
+3070
+ffc0
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+fff0
+3030
+3010
+3010
+3000
+3000
+3040
+3040
+3fc0
+3040
+3040
+3000
+3000
+3008
+3008
+3018
+fff8
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 17 1 0
+BITMAP
+fff0
+3030
+3010
+3010
+3000
+3000
+3020
+3020
+3fe0
+3020
+3020
+3000
+3000
+3000
+3000
+3000
+fc00
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+07e4
+1c3c
+380c
+6004
+6004
+c000
+c000
+c000
+c000
+c03f
+c00c
+c00c
+600c
+600c
+381c
+1e38
+07e0
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 17 17 1 0
+BITMAP
+fc1f80
+300600
+300600
+300600
+300600
+300600
+300600
+300600
+3ffe00
+300600
+300600
+300600
+300600
+300600
+300600
+300600
+fc1f80
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 17 1 0
+BITMAP
+fc
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+fc
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+1f80
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+0600
+c600
+cc00
+7800
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 16 17 1 0
+BITMAP
+fc7e
+3018
+3030
+3060
+30c0
+3180
+3300
+3e00
+3f00
+3380
+31c0
+30e0
+3070
+3038
+301c
+300e
+fc1f
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 13 17 1 0
+BITMAP
+fc00
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+3008
+3008
+3018
+fff8
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 880 0
+DWIDTH 22 0
+BBX 21 17 1 0
+BITMAP
+f000f8
+3000e0
+380160
+380160
+2c0260
+2c0260
+260260
+260460
+230460
+230860
+218860
+218860
+20d060
+20d060
+206060
+206060
+f821f8
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+f01f
+3004
+3804
+3804
+2c04
+2604
+2604
+2304
+2184
+2184
+20c4
+2064
+2064
+2034
+201c
+201c
+f80c
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+07e0
+1c38
+381c
+6006
+6006
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+6006
+6006
+381c
+1c38
+07e0
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+ffc0
+3070
+3030
+3018
+3018
+3018
+3030
+3070
+3fc0
+3000
+3000
+3000
+3000
+3000
+3000
+3000
+fc00
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 22 1 -5
+BITMAP
+07e0
+1c38
+381c
+6006
+6006
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+6006
+6006
+381c
+1c38
+07e0
+01c0
+00e0
+0070
+0038
+000f
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 15 17 1 0
+BITMAP
+ffc0
+3070
+3030
+3038
+3018
+3038
+3030
+3070
+3fc0
+3380
+31c0
+30c0
+3060
+3070
+3038
+301c
+fc1e
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+1e40
+63c0
+c0c0
+c040
+c040
+e000
+7800
+1e00
+0f80
+03c0
+00e0
+0060
+8060
+8060
+c0c0
+f180
+9e00
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 17 1 0
+BITMAP
+fffc
+c30c
+8304
+8304
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0300
+0fc0
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+fc1f
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3008
+1808
+1c30
+07e0
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 17 17 0 0
+BITMAP
+fc1f80
+300600
+300400
+180c00
+180800
+180800
+0c1800
+0c1000
+063000
+062000
+062000
+036000
+034000
+03c000
+018000
+018000
+018000
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 920 0
+DWIDTH 23 0
+BBX 23 17 0 0
+BITMAP
+fc7e7e
+301818
+301810
+181810
+181830
+182c20
+0c2c20
+0c2c60
+064c60
+064c40
+064640
+0346c0
+034680
+038780
+018380
+018300
+018300
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 18 17 0 0
+BITMAP
+7e0f80
+1c0600
+0e0c00
+060800
+031000
+03a000
+01c000
+00c000
+00e000
+017000
+023800
+061800
+040c00
+080e00
+180700
+300380
+fc0fc0
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 16 17 0 0
+BITMAP
+fc3f
+300c
+3808
+1818
+1c10
+0c30
+0620
+0660
+0340
+03c0
+0180
+0180
+0180
+0180
+0180
+0180
+07e0
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+fff0
+c070
+80e0
+80c0
+01c0
+0380
+0300
+0700
+0600
+0e00
+1c00
+1800
+3800
+3008
+7008
+e018
+fff8
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 5 21 2 -4
+BITMAP
+f8
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+f8
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 7 17 0 0
+BITMAP
+c0
+c0
+40
+60
+60
+20
+30
+30
+10
+18
+18
+08
+0c
+0c
+04
+06
+06
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 5 21 1 -4
+BITMAP
+f8
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+f8
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 9 1 8
+BITMAP
+0800
+1c00
+1400
+3600
+2200
+6300
+4100
+c180
+8080
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 13 2 0 -5
+BITMAP
+fff8
+fff8
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 3 5 2 12
+BITMAP
+60
+c0
+80
+e0
+60
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+3e00
+6700
+6300
+0300
+0f00
+3b00
+6300
+c300
+c300
+c700
+fb00
+7180
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+e000
+6000
+6000
+6000
+6000
+6e00
+7380
+6180
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+6180
+7380
+5e00
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+1f00
+6380
+4180
+c000
+c000
+c000
+c000
+c000
+e000
+7080
+7f00
+1e00
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+0380
+0180
+0180
+0180
+0180
+1d80
+7380
+6180
+c180
+c180
+c180
+c180
+c180
+c180
+6180
+7380
+1ec0
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 12 1 0
+BITMAP
+1e00
+6300
+4180
+c180
+ff80
+c000
+c000
+c000
+e000
+7080
+7f00
+1e00
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 7 17 0 0
+BITMAP
+0e
+16
+30
+30
+30
+fe
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+78
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 11 17 1 -5
+BITMAP
+1fc0
+3300
+6180
+6180
+6180
+6180
+3300
+3e00
+3000
+6000
+7f00
+3fc0
+6060
+c020
+c060
+f1c0
+3f00
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+e000
+6000
+6000
+6000
+6000
+6700
+6f80
+71c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+f1e0
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 4 17 1 0
+BITMAP
+60
+60
+00
+00
+00
+e0
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 4 22 0 -5
+BITMAP
+30
+30
+00
+00
+00
+70
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+e0
+c0
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 11 17 1 0
+BITMAP
+e000
+6000
+6000
+6000
+6000
+67c0
+6300
+6600
+6400
+6800
+7800
+6c00
+6e00
+6700
+6380
+61c0
+f3e0
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 4 17 1 0
+BITMAP
+e0
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 800 0
+DWIDTH 20 0
+BBX 18 12 1 0
+BITMAP
+e70e00
+6f9f00
+71e380
+60c180
+60c180
+60c180
+60c180
+60c180
+60c180
+60c180
+60c180
+f1e3c0
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 12 1 0
+BITMAP
+e700
+6f80
+71c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+f1e0
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 12 1 0
+BITMAP
+1e00
+7380
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+7380
+1e00
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 -5
+BITMAP
+ee00
+7380
+6180
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+6180
+7380
+6e00
+6000
+6000
+6000
+6000
+f000
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 -5
+BITMAP
+1d80
+7380
+6180
+c180
+c180
+c180
+c180
+c180
+c180
+6180
+7380
+1d80
+0180
+0180
+0180
+0180
+03c0
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 7 12 1 0
+BITMAP
+e6
+6e
+76
+60
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 8 12 1 0
+BITMAP
+3e
+66
+c2
+e0
+70
+7c
+1e
+07
+03
+83
+c6
+f8
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 7 15 0 0
+BITMAP
+10
+30
+70
+fe
+30
+30
+30
+30
+30
+30
+30
+30
+30
+32
+1c
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 12 1 0
+BITMAP
+e1c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+71c0
+3ec0
+1ce0
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 11 12 0 0
+BITMAP
+f1e0
+60c0
+6080
+3080
+3080
+3100
+1900
+1900
+1a00
+0e00
+0e00
+0400
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 17 12 0 0
+BITMAP
+f1e780
+60c300
+60c200
+30c200
+30c200
+316400
+196400
+1a6400
+1a2800
+0e3800
+0e3800
+041000
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 12 1 0
+BITMAP
+f1e0
+60c0
+3180
+3900
+1a00
+0c00
+0e00
+1b00
+3380
+2180
+60c0
+f1e0
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 11 17 0 -5
+BITMAP
+f1e0
+60c0
+6080
+3080
+3080
+3100
+1900
+1900
+1a00
+0e00
+0e00
+0400
+0c00
+0800
+1800
+f000
+e000
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 8 12 1 0
+BITMAP
+ff
+c3
+86
+0e
+1c
+18
+38
+30
+70
+61
+c3
+ff
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 8 22 1 -5
+BITMAP
+07
+0c
+18
+18
+18
+18
+18
+10
+30
+20
+c0
+20
+30
+10
+18
+18
+18
+18
+18
+18
+0c
+07
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 17 2 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 400 0
+DWIDTH 10 0
+BBX 8 22 1 -5
+BITMAP
+e0
+30
+18
+18
+18
+18
+18
+08
+0c
+04
+03
+04
+0c
+08
+18
+18
+18
+18
+18
+18
+30
+e0
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 4 1 5
+BITMAP
+3820
+7c60
+c7c0
+8380
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 2 17 4 -5
+BITMAP
+c0
+c0
+00
+00
+00
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 9 16 1 -2
+BITMAP
+0100
+0100
+1f00
+6380
+4380
+c400
+c400
+c800
+c800
+c800
+d000
+7080
+7f00
+3e00
+4000
+4000
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+0f00
+1980
+3180
+3000
+3000
+3000
+3000
+fc00
+3000
+3000
+3000
+3000
+3000
+3000
+7840
+bec0
+e780
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 12 1 3
+BITMAP
+c060
+eee0
+7fc0
+3180
+60c0
+60c0
+60c0
+60c0
+3180
+7fc0
+eee0
+c060
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 14 17 0 0
+BITMAP
+f87c
+7030
+3020
+1860
+1840
+0cc0
+0c80
+0780
+0300
+1fe0
+0300
+1fe0
+0300
+0300
+0300
+0300
+0fc0
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 17 2 0
+BITMAP
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+00
+00
+00
+c0
+c0
+c0
+c0
+c0
+c0
+c0
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 8 20 2 -2
+BITMAP
+1c
+26
+46
+60
+70
+38
+3c
+4e
+87
+83
+c3
+e2
+74
+38
+1c
+0e
+06
+62
+64
+38
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 2 1 14
+BITMAP
+cc
+cc
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 17 17 1 0
+BITMAP
+07f000
+1c1c00
+300600
+61e300
+473100
+c41980
+8c0080
+880080
+880080
+880080
+8c0080
+c41980
+477100
+61c300
+300600
+1c1c00
+07f000
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 7 9 0 8
+BITMAP
+78
+cc
+0c
+7c
+cc
+cc
+76
+00
+7e
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 9 10 2 1
+BITMAP
+0880
+1980
+3300
+6600
+cc00
+cc00
+6600
+3300
+1980
+0880
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 7 1 3
+BITMAP
+fff0
+fff0
+0030
+0030
+0030
+0030
+0030
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 360 0
+DWIDTH 9 0
+BBX 7 2 1 5
+BITMAP
+fe
+fe
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 760 0
+DWIDTH 19 0
+BBX 17 17 1 0
+BITMAP
+07f000
+1c1c00
+300600
+67e300
+423100
+c21180
+821080
+823080
+83e080
+824080
+822080
+c23180
+471900
+600300
+300600
+1c1c00
+07f000
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 2 1 14
+BITMAP
+fc
+fc
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 360 0
+DWIDTH 9 0
+BBX 7 7 1 10
+BITMAP
+38
+44
+82
+82
+82
+44
+38
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 15 1 0
+BITMAP
+0600
+0600
+0600
+0600
+0600
+fff0
+fff0
+0600
+0600
+0600
+0600
+0600
+0000
+fff0
+fff0
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 6 10 0 7
+BITMAP
+38
+4c
+8c
+0c
+08
+10
+30
+20
+44
+fc
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 6 10 0 7
+BITMAP
+38
+4c
+8c
+08
+30
+08
+0c
+8c
+88
+70
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 5 4 2 13
+BITMAP
+18
+38
+60
+80
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 17 1 -5
+BITMAP
+e1c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+71c0
+7ec0
+5ce0
+4000
+4000
+c000
+e000
+4000
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 22 1 -5
+BITMAP
+1f80
+3900
+7900
+7900
+f900
+f900
+f900
+7900
+7900
+3900
+1900
+0900
+0900
+0900
+0900
+0900
+0900
+0900
+0900
+0900
+0900
+0900
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 2 2 2 6
+BITMAP
+c0
+c0
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 6 1 -6
+BITMAP
+10
+30
+3c
+0c
+cc
+78
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 280 0
+DWIDTH 7 0
+BBX 5 10 1 7
+BITMAP
+20
+60
+a0
+20
+20
+20
+20
+20
+20
+f8
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 9 1 8
+BITMAP
+78
+cc
+cc
+cc
+cc
+cc
+78
+00
+fc
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 9 10 2 1
+BITMAP
+8800
+cc00
+6600
+3300
+1980
+1980
+3300
+6600
+cc00
+8800
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 17 1 0
+BITMAP
+2008
+6018
+a030
+2020
+2060
+2040
+20c0
+2184
+210c
+fb1c
+0214
+0624
+0c64
+0844
+18ff
+1004
+3004
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 15 17 1 0
+BITMAP
+2008
+6018
+a030
+2020
+2060
+2040
+20c0
+219c
+2126
+fb46
+0206
+0604
+0c08
+0818
+1810
+1022
+307e
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 17 17 0 0
+BITMAP
+380400
+4c0c00
+8c1800
+081000
+303000
+082000
+0c6000
+8cc200
+888600
+718e00
+010a00
+031200
+063200
+042200
+0c7f80
+080200
+180200
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 8 17 1 -5
+BITMAP
+0c
+0c
+00
+00
+08
+08
+18
+18
+38
+30
+70
+e0
+c3
+c3
+c1
+63
+3e
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 17 22 0 0
+BITMAP
+030000
+038000
+00c000
+002000
+000000
+008000
+01c000
+01c000
+016000
+026000
+023000
+063000
+043000
+041800
+0c1800
+0ff800
+080c00
+180c00
+100c00
+100600
+300600
+fc1f80
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 17 22 0 0
+BITMAP
+003000
+007000
+00c000
+010000
+000000
+008000
+01c000
+01c000
+016000
+026000
+023000
+063000
+043000
+041800
+0c1800
+0ff800
+080c00
+180c00
+100c00
+100600
+300600
+fc1f80
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 17 22 0 0
+BITMAP
+018000
+03c000
+066000
+081000
+000000
+008000
+01c000
+01c000
+016000
+026000
+023000
+063000
+043000
+041800
+0c1800
+0ff800
+080c00
+180c00
+100c00
+100600
+300600
+fc1f80
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 17 21 0 0
+BITMAP
+039000
+04e000
+000000
+000000
+008000
+01c000
+01c000
+016000
+026000
+023000
+063000
+043000
+041800
+0c1800
+0ff800
+080c00
+180c00
+100c00
+100600
+300700
+fc1f80
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 17 21 0 0
+BITMAP
+063000
+063000
+000000
+000000
+008000
+01c000
+01c000
+016000
+026000
+023000
+063000
+043000
+041800
+0c1800
+0ff800
+080c00
+180c00
+100c00
+100600
+300600
+fc1f80
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 17 21 0 0
+BITMAP
+01c000
+022000
+022000
+01c000
+008000
+01c000
+01c000
+016000
+026000
+023000
+063000
+043000
+041800
+0c1800
+0ff800
+080c00
+180c00
+100c00
+100600
+300600
+fc1f80
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 840 0
+DWIDTH 21 0
+BBX 20 17 0 0
+BITMAP
+03ffe0
+01e060
+016020
+016020
+026000
+026000
+066080
+046080
+047f80
+0c6080
+0fe080
+086000
+186000
+106010
+106010
+306030
+f9fff0
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 23 1 -6
+BITMAP
+07e4
+1c3c
+380c
+6004
+6004
+c000
+c000
+c000
+c000
+c000
+c000
+c000
+6000
+6004
+3808
+1e38
+07e0
+0100
+0300
+03c0
+00c0
+0cc0
+0780
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 22 1 0
+BITMAP
+1800
+1c00
+0600
+0100
+0000
+fff0
+3030
+3010
+3010
+3000
+3000
+3040
+3040
+3fc0
+3040
+3040
+3000
+3000
+3008
+3008
+3018
+fff8
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 22 1 0
+BITMAP
+00c0
+01c0
+0300
+0400
+0000
+fff0
+3030
+3010
+3010
+3000
+3000
+3040
+3040
+3fc0
+3040
+3040
+3000
+3000
+3008
+3008
+3018
+fff8
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 22 1 0
+BITMAP
+0300
+0780
+0cc0
+1020
+0000
+fff0
+3030
+3010
+3010
+3000
+3000
+3040
+3040
+3fc0
+3040
+3040
+3000
+3000
+3008
+3008
+3018
+fff8
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 21 1 0
+BITMAP
+1980
+1980
+0000
+0000
+fff0
+3030
+3010
+3010
+3000
+3000
+3040
+3040
+3fc0
+3040
+3040
+3000
+3000
+3008
+3008
+3018
+fff8
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 22 1 0
+BITMAP
+c0
+e0
+30
+08
+00
+fc
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+fc
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 22 1 0
+BITMAP
+0c
+1c
+30
+40
+00
+fc
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+fc
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 8 22 1 0
+BITMAP
+18
+3c
+66
+81
+00
+7e
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+18
+7e
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 320 0
+DWIDTH 8 0
+BBX 6 21 1 0
+BITMAP
+cc
+cc
+00
+00
+fc
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+fc
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 680 0
+DWIDTH 17 0
+BBX 16 17 0 0
+BITMAP
+7fe0
+1838
+181c
+1806
+1806
+1803
+1803
+1803
+ff03
+1803
+1803
+1803
+1806
+1806
+181c
+1838
+7fe0
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 21 1 0
+BITMAP
+0390
+04e0
+0000
+0000
+f01f
+3004
+3804
+3804
+2c04
+2604
+2604
+2304
+2184
+2184
+20c4
+2064
+2064
+2034
+201c
+201c
+f80c
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 22 1 0
+BITMAP
+0600
+0700
+0180
+0040
+0000
+07e0
+1c38
+381c
+6006
+6006
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+6006
+6006
+381c
+1c38
+07e0
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 22 1 0
+BITMAP
+0030
+0070
+00c0
+0100
+0000
+07e0
+1c38
+381c
+6006
+6006
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+6006
+6006
+381c
+1c38
+07e0
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 22 1 0
+BITMAP
+0180
+03c0
+0660
+0810
+0000
+07e0
+1c38
+381c
+6006
+6006
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+6006
+6006
+381c
+1c38
+07e0
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 21 1 0
+BITMAP
+0390
+04e0
+0000
+0000
+07e0
+1c38
+381c
+6006
+6006
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+6006
+6006
+381c
+1c38
+07e0
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 21 1 0
+BITMAP
+0660
+0660
+0000
+0000
+07e0
+1c38
+381c
+6006
+6006
+c003
+c003
+c003
+c003
+c003
+c003
+c003
+6006
+6006
+381c
+1c38
+07e0
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 10 11 2 1
+BITMAP
+8040
+c0c0
+6180
+3300
+1e00
+0c00
+1e00
+3300
+6180
+c0c0
+8040
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 19 1 -1
+BITMAP
+0004
+07e4
+1c38
+381c
+6026
+6046
+c043
+c083
+c083
+c103
+c103
+c203
+c203
+6406
+6806
+381c
+1c38
+27e0
+2000
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 22 1 0
+BITMAP
+0600
+0700
+0180
+0040
+0000
+fc1f
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3008
+1808
+1c30
+07e0
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 22 1 0
+BITMAP
+0030
+0070
+00c0
+0100
+0000
+fc1f
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3008
+1808
+1c30
+07e0
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 22 1 0
+BITMAP
+0180
+03c0
+0660
+0810
+0000
+fc1f
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3008
+1808
+1c30
+07e0
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 720 0
+DWIDTH 18 0
+BBX 16 21 1 0
+BITMAP
+0630
+0630
+0000
+0000
+fc1f
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3004
+3008
+1808
+1c30
+07e0
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 16 22 0 0
+BITMAP
+0030
+0070
+00c0
+0100
+0000
+fc3f
+300c
+3808
+1818
+1c10
+0c30
+0620
+0660
+0340
+03c0
+0180
+0180
+0180
+0180
+0180
+0180
+07e0
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 600 0
+DWIDTH 15 0
+BBX 13 17 1 0
+BITMAP
+fc00
+3000
+3000
+3000
+3fc0
+3070
+3030
+3018
+3018
+3018
+3030
+3070
+3fc0
+3000
+3000
+3000
+fc00
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+1e00
+3300
+6180
+6180
+6180
+6180
+6300
+6c00
+6700
+6380
+6180
+61c0
+60c0
+60c0
+6cc0
+6c80
+e700
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+6000
+7000
+1800
+0400
+0000
+3e00
+6700
+6300
+0300
+0f00
+3b00
+6300
+c300
+c300
+c700
+fb00
+7180
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+0300
+0700
+0c00
+1000
+0000
+3e00
+6700
+6300
+0300
+0f00
+3b00
+6300
+c300
+c300
+c700
+fb00
+7180
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+1800
+3c00
+2400
+4200
+0000
+3e00
+6700
+6300
+0300
+0f00
+3b00
+6300
+c300
+c300
+c700
+fb00
+7180
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 16 1 0
+BITMAP
+3a00
+5c00
+0000
+0000
+3e00
+6700
+6300
+0300
+0f00
+3b00
+6300
+c300
+c300
+c700
+fb00
+7180
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 16 1 0
+BITMAP
+6600
+6600
+0000
+0000
+3e00
+6700
+6300
+0300
+0f00
+3b00
+6300
+c300
+c300
+c700
+fb00
+7180
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+1c00
+2200
+2200
+1c00
+0000
+3e00
+6700
+6300
+0300
+0f00
+3b00
+6300
+c300
+c300
+c700
+fb00
+7180
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 640 0
+DWIDTH 16 0
+BBX 14 12 1 0
+BITMAP
+3cf0
+6798
+630c
+030c
+0ffc
+3b00
+6300
+c300
+c300
+c784
+fbf8
+70f0
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 18 1 -6
+BITMAP
+1f00
+6380
+4180
+c000
+c000
+c000
+c000
+c000
+e000
+7080
+7f00
+1e00
+0800
+1800
+1e00
+0600
+6600
+3c00
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+6000
+7000
+1800
+0400
+0000
+1e00
+6300
+4180
+c180
+ff80
+c000
+c000
+c000
+e000
+7080
+7f00
+1e00
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+0300
+0700
+0c00
+1000
+0000
+1e00
+6300
+4180
+c180
+ff80
+c000
+c000
+c000
+e000
+7080
+7f00
+1e00
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 17 1 0
+BITMAP
+0c00
+1e00
+1200
+2100
+0000
+1e00
+6300
+4180
+c180
+ff80
+c000
+c000
+c000
+e000
+7080
+7f00
+1e00
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 9 16 1 0
+BITMAP
+3300
+3300
+0000
+0000
+1e00
+6300
+4180
+c180
+ff80
+c000
+c000
+c000
+e000
+7080
+7f00
+1e00
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 5 17 0 0
+BITMAP
+c0
+e0
+30
+08
+00
+70
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+78
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 5 17 1 0
+BITMAP
+18
+38
+60
+80
+00
+e0
+60
+60
+60
+60
+60
+60
+60
+60
+60
+60
+f0
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 6 17 0 0
+BITMAP
+30
+78
+48
+84
+00
+70
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+78
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 240 0
+DWIDTH 6 0
+BBX 6 16 0 0
+BITMAP
+cc
+cc
+00
+00
+70
+30
+30
+30
+30
+30
+30
+30
+30
+30
+30
+78
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+c000
+7180
+1e00
+3c00
+c600
+1f00
+7380
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+7380
+1e00
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 16 1 0
+BITMAP
+1c80
+2700
+0000
+0000
+e700
+6f80
+71c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+f1e0
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+3000
+3800
+0c00
+0200
+0000
+1e00
+7380
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+7380
+1e00
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+0180
+0380
+0600
+0800
+0000
+1e00
+7380
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+7380
+1e00
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 17 1 0
+BITMAP
+0c00
+1e00
+1200
+2100
+0000
+1e00
+7380
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+7380
+1e00
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 16 1 0
+BITMAP
+1c80
+2700
+0000
+0000
+1e00
+7380
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+7380
+1e00
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 16 1 0
+BITMAP
+3300
+3300
+0000
+0000
+1e00
+7380
+6180
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+c0c0
+6180
+7380
+1e00
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 560 0
+DWIDTH 14 0
+BBX 12 10 1 2
+BITMAP
+0600
+0600
+0000
+0000
+fff0
+fff0
+0000
+0000
+0600
+0600
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 14 1 -1
+BITMAP
+00c0
+1ec0
+7380
+6380
+c6c0
+c4c0
+ccc0
+c8c0
+d8c0
+d0c0
+7180
+7380
+de00
+c000
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+3000
+3800
+0c00
+0200
+0000
+e1c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+71c0
+3ec0
+1ce0
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+0180
+0380
+0600
+0800
+0000
+e1c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+71c0
+3ec0
+1ce0
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 17 1 0
+BITMAP
+0c00
+1e00
+1200
+2100
+0000
+e1c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+71c0
+3ec0
+1ce0
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 520 0
+DWIDTH 13 0
+BBX 11 16 1 0
+BITMAP
+3300
+3300
+0000
+0000
+e1c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+71c0
+3ec0
+1ce0
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 11 22 0 -5
+BITMAP
+0180
+0380
+0600
+0800
+0000
+f1e0
+60c0
+6080
+3080
+3080
+3100
+1900
+1900
+1a00
+0e00
+0e00
+0400
+0c00
+0800
+1800
+f000
+e000
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 480 0
+DWIDTH 12 0
+BBX 10 22 1 -5
+BITMAP
+e000
+6000
+6000
+6000
+6000
+6e00
+7380
+6180
+60c0
+60c0
+60c0
+60c0
+60c0
+60c0
+6180
+7380
+6e00
+6000
+6000
+6000
+6000
+f000
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 440 0
+DWIDTH 11 0
+BBX 11 21 0 -5
+BITMAP
+3300
+3300
+0000
+0000
+f1e0
+60c0
+6080
+3080
+3080
+3100
+1900
+1900
+1a00
+0e00
+0e00
+0400
+0c00
+0800
+1800
+f000
+e000
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times24.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times24.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times24.h	(revision 15879)
@@ -0,0 +1,1110 @@
+static unsigned char times24_0_bits[] = {
+0x00};
+static unsigned char times24_1_bits[] = {
+0x00};
+static unsigned char times24_2_bits[] = {
+0x00};
+static unsigned char times24_3_bits[] = {
+0x00};
+static unsigned char times24_4_bits[] = {
+0x00};
+static unsigned char times24_5_bits[] = {
+0x00};
+static unsigned char times24_6_bits[] = {
+0x00};
+static unsigned char times24_7_bits[] = {
+0x00};
+static unsigned char times24_8_bits[] = {
+0x00};
+static unsigned char times24_9_bits[] = {
+0x00};
+static unsigned char times24_10_bits[] = {
+0x00};
+static unsigned char times24_11_bits[] = {
+0x00};
+static unsigned char times24_12_bits[] = {
+0x00};
+static unsigned char times24_13_bits[] = {
+0x00};
+static unsigned char times24_14_bits[] = {
+0x00};
+static unsigned char times24_15_bits[] = {
+0x00};
+static unsigned char times24_16_bits[] = {
+0x00};
+static unsigned char times24_17_bits[] = {
+0x00};
+static unsigned char times24_18_bits[] = {
+0x00};
+static unsigned char times24_19_bits[] = {
+0x00};
+static unsigned char times24_20_bits[] = {
+0x00};
+static unsigned char times24_21_bits[] = {
+0x00};
+static unsigned char times24_22_bits[] = {
+0x00};
+static unsigned char times24_23_bits[] = {
+0x00};
+static unsigned char times24_24_bits[] = {
+0x00};
+static unsigned char times24_25_bits[] = {
+0x00};
+static unsigned char times24_26_bits[] = {
+0x00};
+static unsigned char times24_27_bits[] = {
+0x00};
+static unsigned char times24_28_bits[] = {
+0x00};
+static unsigned char times24_29_bits[] = {
+0x00};
+static unsigned char times24_30_bits[] = {
+0x00};
+static unsigned char times24_31_bits[] = {
+0x00};
+static unsigned char times24_32_bits[] = {
+0x00};
+static unsigned char times24_33_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x00, 0x00, 0x00, 0x03, 0x03};
+static unsigned char times24_34_bits[] = {
+0x33, 0x33, 0x33, 0x33, 0x11};
+static unsigned char times24_35_bits[] = {
+0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0xfe, 0x07, 
+0xfe, 0x07, 0x88, 0x00, 0x88, 0x00, 0x88, 0x00, 0xff, 0x03, 0xff, 0x03, 
+0x44, 0x00, 0x44, 0x00, 0x44, 0x00, 0x44, 0x00, 0x44, 0x00};
+static unsigned char times24_36_bits[] = {
+0x20, 0x00, 0x20, 0x00, 0xf8, 0x01, 0x2c, 0x07, 0x26, 0x06, 0x26, 0x04, 
+0x26, 0x00, 0x2e, 0x00, 0x3c, 0x00, 0x78, 0x00, 0xe0, 0x01, 0xe0, 0x03, 
+0x20, 0x07, 0x20, 0x06, 0x21, 0x06, 0x21, 0x06, 0x23, 0x03, 0xa7, 0x03, 
+0xfc, 0x00, 0x20, 0x00, 0x20, 0x00};
+static unsigned char times24_37_bits[] = {
+0x78, 0x30, 0x00, 0xcc, 0x3f, 0x00, 0x86, 0x18, 0x00, 0x83, 0x08, 0x00, 
+0x83, 0x0c, 0x00, 0x43, 0x06, 0x00, 0x27, 0x02, 0x00, 0x1e, 0x03, 0x00, 
+0x80, 0xf1, 0x00, 0x80, 0x98, 0x01, 0xc0, 0x0c, 0x01, 0x60, 0x06, 0x01, 
+0x20, 0x06, 0x01, 0x30, 0x86, 0x00, 0x18, 0x4e, 0x00, 0x0c, 0x3c, 0x00};
+static unsigned char times24_38_bits[] = {
+0xe0, 0x01, 0x30, 0x03, 0x18, 0x02, 0x18, 0x02, 0x18, 0x03, 0xb8, 0x01, 
+0xf0, 0x00, 0x70, 0x7c, 0x78, 0x18, 0xec, 0x08, 0xc6, 0x04, 0x83, 0x05, 
+0x83, 0x03, 0x03, 0x03, 0x87, 0x87, 0xfe, 0x7e, 0x3c, 0x3c};
+static unsigned char times24_39_bits[] = {
+0x03, 0x07, 0x04, 0x06, 0x03};
+static unsigned char times24_40_bits[] = {
+0x20, 0x10, 0x08, 0x0c, 0x04, 0x06, 0x06, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x06, 0x06, 0x04, 0x0c, 0x08, 0x10, 0x20};
+static unsigned char times24_41_bits[] = {
+0x01, 0x02, 0x04, 0x0c, 0x08, 0x18, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 
+0x30, 0x30, 0x30, 0x18, 0x18, 0x08, 0x0c, 0x04, 0x02, 0x01};
+static unsigned char times24_42_bits[] = {
+0x10, 0x00, 0x38, 0x00, 0x93, 0x01, 0xd7, 0x01, 0x38, 0x00, 0xd7, 0x01, 
+0x93, 0x01, 0x38, 0x00, 0x10, 0x00};
+static unsigned char times24_43_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xff, 0x0f, 
+0xff, 0x0f, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char times24_44_bits[] = {
+0x03, 0x07, 0x04, 0x06, 0x03};
+static unsigned char times24_45_bits[] = {
+0xff, 0x0f, 0xff, 0x0f};
+static unsigned char times24_46_bits[] = {
+0x03, 0x03};
+static unsigned char times24_47_bits[] = {
+0xc0, 0xc0, 0xc0, 0x60, 0x60, 0x20, 0x30, 0x30, 0x10, 0x18, 0x18, 0x08, 
+0x0c, 0x0c, 0x04, 0x06, 0x06, 0x03, 0x03, 0x03};
+static unsigned char times24_48_bits[] = {
+0x78, 0x00, 0xcc, 0x00, 0x86, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x87, 0x03, 0x86, 0x01, 0x86, 0x01, 0xcc, 0x00, 0x78, 0x00};
+static unsigned char times24_49_bits[] = {
+0x10, 0x18, 0x1e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0xff};
+static unsigned char times24_50_bits[] = {
+0x38, 0x00, 0xfe, 0x00, 0xc2, 0x01, 0x81, 0x01, 0x81, 0x01, 0x80, 0x01, 
+0x80, 0x01, 0xc0, 0x00, 0xc0, 0x00, 0x60, 0x00, 0x20, 0x00, 0x30, 0x00, 
+0x18, 0x00, 0x0c, 0x00, 0x06, 0x02, 0xff, 0x03, 0xff, 0x01};
+static unsigned char times24_51_bits[] = {
+0x38, 0x00, 0x7e, 0x00, 0xe2, 0x00, 0xc1, 0x00, 0xc1, 0x00, 0x60, 0x00, 
+0x30, 0x00, 0x78, 0x00, 0xe0, 0x00, 0xc0, 0x01, 0x80, 0x01, 0x80, 0x01, 
+0x80, 0x01, 0x80, 0x00, 0xc3, 0x00, 0x67, 0x00, 0x1e, 0x00};
+static unsigned char times24_52_bits[] = {
+0xc0, 0x00, 0xe0, 0x00, 0xe0, 0x00, 0xd0, 0x00, 0xd8, 0x00, 0xc8, 0x00, 
+0xcc, 0x00, 0xc4, 0x00, 0xc6, 0x00, 0xc2, 0x00, 0xc3, 0x00, 0xff, 0x03, 
+0xff, 0x03, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00};
+static unsigned char times24_53_bits[] = {
+0xf8, 0x03, 0xf8, 0x01, 0x04, 0x00, 0x04, 0x00, 0x06, 0x00, 0x1e, 0x00, 
+0x7e, 0x00, 0xf0, 0x01, 0xc0, 0x01, 0x80, 0x03, 0x00, 0x03, 0x00, 0x03, 
+0x00, 0x03, 0x00, 0x03, 0x83, 0x01, 0xc7, 0x01, 0x7e, 0x00};
+static unsigned char times24_54_bits[] = {
+0xc0, 0x03, 0x70, 0x00, 0x18, 0x00, 0x0c, 0x00, 0x0e, 0x00, 0x06, 0x00, 
+0x77, 0x00, 0xcf, 0x01, 0x83, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x07, 0x03, 0x86, 0x01, 0xde, 0x01, 0x78, 0x00};
+static unsigned char times24_55_bits[] = {
+0xfe, 0x03, 0xff, 0x03, 0x03, 0x03, 0x81, 0x01, 0x80, 0x01, 0x80, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0x40, 0x00, 0x60, 0x00, 0x60, 0x00, 0x20, 0x00, 
+0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x18, 0x00, 0x18, 0x00};
+static unsigned char times24_56_bits[] = {
+0x78, 0x00, 0xcc, 0x00, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0xcc, 0x00, 
+0x78, 0x00, 0x78, 0x00, 0xec, 0x00, 0x86, 0x01, 0x82, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x87, 0x01, 0xce, 0x01, 0x78, 0x00};
+static unsigned char times24_57_bits[] = {
+0x78, 0x00, 0xee, 0x01, 0x86, 0x01, 0x83, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x86, 0x03, 0xce, 0x03, 0xb8, 0x01, 0x80, 0x01, 
+0xc0, 0x01, 0xc0, 0x00, 0x60, 0x00, 0x38, 0x00, 0x0f, 0x00};
+static unsigned char times24_58_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03};
+static unsigned char times24_59_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x04, 
+0x06, 0x03};
+static unsigned char times24_60_bits[] = {
+0x00, 0x06, 0x80, 0x03, 0xe0, 0x00, 0x38, 0x00, 0x0e, 0x00, 0x03, 0x00, 
+0x0e, 0x00, 0x38, 0x00, 0xe0, 0x00, 0x80, 0x03, 0x00, 0x06};
+static unsigned char times24_61_bits[] = {
+0xff, 0x0f, 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0xff, 0x0f};
+static unsigned char times24_62_bits[] = {
+0x03, 0x00, 0x0e, 0x00, 0x38, 0x00, 0xe0, 0x00, 0x80, 0x03, 0x00, 0x06, 
+0x80, 0x03, 0xe0, 0x00, 0x38, 0x00, 0x0e, 0x00, 0x03, 0x00};
+static unsigned char times24_63_bits[] = {
+0x3e, 0x63, 0xc1, 0xc3, 0xc3, 0xe0, 0x70, 0x30, 0x18, 0x18, 0x08, 0x08, 
+0x08, 0x00, 0x00, 0x0c, 0x0c};
+static unsigned char times24_64_bits[] = {
+0xc0, 0x1f, 0x00, 0xf0, 0x70, 0x00, 0x38, 0xc0, 0x00, 0x1c, 0x80, 0x01, 
+0x0e, 0x00, 0x01, 0x06, 0x37, 0x03, 0x87, 0x3f, 0x02, 0xc3, 0x31, 0x02, 
+0xc3, 0x30, 0x02, 0x63, 0x30, 0x02, 0x63, 0x18, 0x02, 0x63, 0x18, 0x03, 
+0x63, 0x18, 0x01, 0x63, 0x9c, 0x01, 0xc6, 0xde, 0x00, 0x86, 0x7b, 0x00, 
+0x0c, 0x00, 0x00, 0x18, 0x00, 0x00, 0x70, 0x30, 0x00, 0xc0, 0x0f, 0x00};
+static unsigned char times24_65_bits[] = {
+0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0x80, 0x03, 0x00, 0x80, 0x06, 0x00, 
+0x40, 0x06, 0x00, 0x40, 0x0c, 0x00, 0x60, 0x0c, 0x00, 0x20, 0x0c, 0x00, 
+0x20, 0x18, 0x00, 0x30, 0x18, 0x00, 0xf0, 0x1f, 0x00, 0x10, 0x30, 0x00, 
+0x18, 0x30, 0x00, 0x08, 0x30, 0x00, 0x08, 0x60, 0x00, 0x0c, 0x60, 0x00, 
+0x3f, 0xf8, 0x01};
+static unsigned char times24_66_bits[] = {
+0xff, 0x03, 0x0c, 0x0e, 0x0c, 0x0c, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 
+0x0c, 0x0c, 0x0c, 0x02, 0xfc, 0x07, 0x0c, 0x1c, 0x0c, 0x18, 0x0c, 0x30, 
+0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x18, 0x0c, 0x1e, 0xff, 0x07};
+static unsigned char times24_67_bits[] = {
+0xe0, 0x27, 0x38, 0x3c, 0x1c, 0x30, 0x06, 0x20, 0x06, 0x20, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x06, 0x00, 0x06, 0x20, 0x1c, 0x10, 0x78, 0x1c, 0xe0, 0x07};
+static unsigned char times24_68_bits[] = {
+0xff, 0x03, 0x0c, 0x0e, 0x0c, 0x1c, 0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x60, 
+0x0c, 0x60, 0x0c, 0x60, 0x0c, 0x60, 0x0c, 0x60, 0x0c, 0x60, 0x0c, 0x60, 
+0x0c, 0x30, 0x0c, 0x30, 0x0c, 0x1c, 0x0c, 0x0e, 0xff, 0x03};
+static unsigned char times24_69_bits[] = {
+0xff, 0x0f, 0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x08, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x02, 0x0c, 0x02, 0xfc, 0x03, 0x0c, 0x02, 0x0c, 0x02, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x10, 0x0c, 0x10, 0x0c, 0x18, 0xff, 0x1f};
+static unsigned char times24_70_bits[] = {
+0xff, 0x0f, 0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x08, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x04, 0x0c, 0x04, 0xfc, 0x07, 0x0c, 0x04, 0x0c, 0x04, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x3f, 0x00};
+static unsigned char times24_71_bits[] = {
+0xe0, 0x27, 0x38, 0x3c, 0x1c, 0x30, 0x06, 0x20, 0x06, 0x20, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0xfc, 0x03, 0x30, 0x03, 0x30, 
+0x06, 0x30, 0x06, 0x30, 0x1c, 0x38, 0x78, 0x1c, 0xe0, 0x07};
+static unsigned char times24_72_bits[] = {
+0x3f, 0xf8, 0x01, 0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 
+0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 
+0xfc, 0x7f, 0x00, 0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 
+0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 0x0c, 0x60, 0x00, 
+0x3f, 0xf8, 0x01};
+static unsigned char times24_73_bits[] = {
+0x3f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x3f};
+static unsigned char times24_74_bits[] = {
+0xf8, 0x01, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x60, 0x00, 0x60, 0x00, 0x63, 0x00, 0x33, 0x00, 0x1e, 0x00};
+static unsigned char times24_75_bits[] = {
+0x3f, 0x7e, 0x0c, 0x18, 0x0c, 0x0c, 0x0c, 0x06, 0x0c, 0x03, 0x8c, 0x01, 
+0xcc, 0x00, 0x7c, 0x00, 0xfc, 0x00, 0xcc, 0x01, 0x8c, 0x03, 0x0c, 0x07, 
+0x0c, 0x0e, 0x0c, 0x1c, 0x0c, 0x38, 0x0c, 0x70, 0x3f, 0xf8};
+static unsigned char times24_76_bits[] = {
+0x3f, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x10, 0x0c, 0x10, 0x0c, 0x18, 0xff, 0x1f};
+static unsigned char times24_77_bits[] = {
+0x0f, 0x00, 0x1f, 0x0c, 0x00, 0x07, 0x1c, 0x80, 0x06, 0x1c, 0x80, 0x06, 
+0x34, 0x40, 0x06, 0x34, 0x40, 0x06, 0x64, 0x40, 0x06, 0x64, 0x20, 0x06, 
+0xc4, 0x20, 0x06, 0xc4, 0x10, 0x06, 0x84, 0x11, 0x06, 0x84, 0x11, 0x06, 
+0x04, 0x0b, 0x06, 0x04, 0x0b, 0x06, 0x04, 0x06, 0x06, 0x04, 0x06, 0x06, 
+0x1f, 0x84, 0x1f};
+static unsigned char times24_78_bits[] = {
+0x0f, 0xf8, 0x0c, 0x20, 0x1c, 0x20, 0x1c, 0x20, 0x34, 0x20, 0x64, 0x20, 
+0x64, 0x20, 0xc4, 0x20, 0x84, 0x21, 0x84, 0x21, 0x04, 0x23, 0x04, 0x26, 
+0x04, 0x26, 0x04, 0x2c, 0x04, 0x38, 0x04, 0x38, 0x1f, 0x30};
+static unsigned char times24_79_bits[] = {
+0xe0, 0x07, 0x38, 0x1c, 0x1c, 0x38, 0x06, 0x60, 0x06, 0x60, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x06, 0x60, 0x06, 0x60, 0x1c, 0x38, 0x38, 0x1c, 0xe0, 0x07};
+static unsigned char times24_80_bits[] = {
+0xff, 0x03, 0x0c, 0x0e, 0x0c, 0x0c, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 
+0x0c, 0x0c, 0x0c, 0x0e, 0xfc, 0x03, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x3f, 0x00};
+static unsigned char times24_81_bits[] = {
+0xe0, 0x07, 0x38, 0x1c, 0x1c, 0x38, 0x06, 0x60, 0x06, 0x60, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x06, 0x60, 0x06, 0x60, 0x1c, 0x38, 0x38, 0x1c, 0xe0, 0x07, 0x80, 0x03, 
+0x00, 0x07, 0x00, 0x0e, 0x00, 0x1c, 0x00, 0xf0};
+static unsigned char times24_82_bits[] = {
+0xff, 0x03, 0x0c, 0x0e, 0x0c, 0x0c, 0x0c, 0x1c, 0x0c, 0x18, 0x0c, 0x1c, 
+0x0c, 0x0c, 0x0c, 0x0e, 0xfc, 0x03, 0xcc, 0x01, 0x8c, 0x03, 0x0c, 0x03, 
+0x0c, 0x06, 0x0c, 0x0e, 0x0c, 0x1c, 0x0c, 0x38, 0x3f, 0x78};
+static unsigned char times24_83_bits[] = {
+0x78, 0x02, 0xc6, 0x03, 0x03, 0x03, 0x03, 0x02, 0x03, 0x02, 0x07, 0x00, 
+0x1e, 0x00, 0x78, 0x00, 0xf0, 0x01, 0xc0, 0x03, 0x00, 0x07, 0x00, 0x06, 
+0x01, 0x06, 0x01, 0x06, 0x03, 0x03, 0x8f, 0x01, 0x79, 0x00};
+static unsigned char times24_84_bits[] = {
+0xff, 0x3f, 0xc3, 0x30, 0xc1, 0x20, 0xc1, 0x20, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xf0, 0x03};
+static unsigned char times24_85_bits[] = {
+0x3f, 0xf8, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 
+0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 
+0x0c, 0x20, 0x0c, 0x10, 0x18, 0x10, 0x38, 0x0c, 0xe0, 0x07};
+static unsigned char times24_86_bits[] = {
+0x3f, 0xf8, 0x01, 0x0c, 0x60, 0x00, 0x0c, 0x20, 0x00, 0x18, 0x30, 0x00, 
+0x18, 0x10, 0x00, 0x18, 0x10, 0x00, 0x30, 0x18, 0x00, 0x30, 0x08, 0x00, 
+0x60, 0x0c, 0x00, 0x60, 0x04, 0x00, 0x60, 0x04, 0x00, 0xc0, 0x06, 0x00, 
+0xc0, 0x02, 0x00, 0xc0, 0x03, 0x00, 0x80, 0x01, 0x00, 0x80, 0x01, 0x00, 
+0x80, 0x01, 0x00};
+static unsigned char times24_87_bits[] = {
+0x3f, 0x7e, 0x7e, 0x0c, 0x18, 0x18, 0x0c, 0x18, 0x08, 0x18, 0x18, 0x08, 
+0x18, 0x18, 0x0c, 0x18, 0x34, 0x04, 0x30, 0x34, 0x04, 0x30, 0x34, 0x06, 
+0x60, 0x32, 0x06, 0x60, 0x32, 0x02, 0x60, 0x62, 0x02, 0xc0, 0x62, 0x03, 
+0xc0, 0x62, 0x01, 0xc0, 0xe1, 0x01, 0x80, 0xc1, 0x01, 0x80, 0xc1, 0x00, 
+0x80, 0xc1, 0x00};
+static unsigned char times24_88_bits[] = {
+0x7e, 0xf0, 0x01, 0x38, 0x60, 0x00, 0x70, 0x30, 0x00, 0x60, 0x10, 0x00, 
+0xc0, 0x08, 0x00, 0xc0, 0x05, 0x00, 0x80, 0x03, 0x00, 0x00, 0x03, 0x00, 
+0x00, 0x07, 0x00, 0x80, 0x0e, 0x00, 0x40, 0x1c, 0x00, 0x60, 0x18, 0x00, 
+0x20, 0x30, 0x00, 0x10, 0x70, 0x00, 0x18, 0xe0, 0x00, 0x0c, 0xc0, 0x01, 
+0x3f, 0xf0, 0x03};
+static unsigned char times24_89_bits[] = {
+0x3f, 0xfc, 0x0c, 0x30, 0x1c, 0x10, 0x18, 0x18, 0x38, 0x08, 0x30, 0x0c, 
+0x60, 0x04, 0x60, 0x06, 0xc0, 0x02, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01, 
+0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xe0, 0x07};
+static unsigned char times24_90_bits[] = {
+0xff, 0x0f, 0x03, 0x0e, 0x01, 0x07, 0x01, 0x03, 0x80, 0x03, 0xc0, 0x01, 
+0xc0, 0x00, 0xe0, 0x00, 0x60, 0x00, 0x70, 0x00, 0x38, 0x00, 0x18, 0x00, 
+0x1c, 0x00, 0x0c, 0x10, 0x0e, 0x10, 0x07, 0x18, 0xff, 0x1f};
+static unsigned char times24_91_bits[] = {
+0x1f, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x1f};
+static unsigned char times24_92_bits[] = {
+0x03, 0x03, 0x02, 0x06, 0x06, 0x04, 0x0c, 0x0c, 0x08, 0x18, 0x18, 0x10, 
+0x30, 0x30, 0x20, 0x60, 0x60};
+static unsigned char times24_93_bits[] = {
+0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f};
+static unsigned char times24_94_bits[] = {
+0x10, 0x00, 0x38, 0x00, 0x28, 0x00, 0x6c, 0x00, 0x44, 0x00, 0xc6, 0x00, 
+0x82, 0x00, 0x83, 0x01, 0x01, 0x01};
+static unsigned char times24_95_bits[] = {
+0xff, 0x1f, 0xff, 0x1f};
+static unsigned char times24_96_bits[] = {
+0x06, 0x03, 0x01, 0x07, 0x06};
+static unsigned char times24_97_bits[] = {
+0x7c, 0x00, 0xe6, 0x00, 0xc6, 0x00, 0xc0, 0x00, 0xf0, 0x00, 0xdc, 0x00, 
+0xc6, 0x00, 0xc3, 0x00, 0xc3, 0x00, 0xe3, 0x00, 0xdf, 0x00, 0x8e, 0x01};
+static unsigned char times24_98_bits[] = {
+0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x76, 0x00, 
+0xce, 0x01, 0x86, 0x01, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x86, 0x01, 0xce, 0x01, 0x7a, 0x00};
+static unsigned char times24_99_bits[] = {
+0xf8, 0x00, 0xc6, 0x01, 0x82, 0x01, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0e, 0x01, 0xfe, 0x00, 0x78, 0x00};
+static unsigned char times24_100_bits[] = {
+0xc0, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xb8, 0x01, 
+0xce, 0x01, 0x86, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 
+0x83, 0x01, 0x83, 0x01, 0x86, 0x01, 0xce, 0x01, 0x78, 0x03};
+static unsigned char times24_101_bits[] = {
+0x78, 0x00, 0xc6, 0x00, 0x82, 0x01, 0x83, 0x01, 0xff, 0x01, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0e, 0x01, 0xfe, 0x00, 0x78, 0x00};
+static unsigned char times24_102_bits[] = {
+0x70, 0x68, 0x0c, 0x0c, 0x0c, 0x7f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x1e};
+static unsigned char times24_103_bits[] = {
+0xf8, 0x03, 0xcc, 0x00, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 
+0xcc, 0x00, 0x7c, 0x00, 0x0c, 0x00, 0x06, 0x00, 0xfe, 0x00, 0xfc, 0x03, 
+0x06, 0x06, 0x03, 0x04, 0x03, 0x06, 0x8f, 0x03, 0xfc, 0x00};
+static unsigned char times24_104_bits[] = {
+0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0xe6, 0x00, 
+0xf6, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x8f, 0x07};
+static unsigned char times24_105_bits[] = {
+0x06, 0x06, 0x00, 0x00, 0x00, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x0f};
+static unsigned char times24_106_bits[] = {
+0x0c, 0x0c, 0x00, 0x00, 0x00, 0x0e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x07, 0x03};
+static unsigned char times24_107_bits[] = {
+0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0xe6, 0x03, 
+0xc6, 0x00, 0x66, 0x00, 0x26, 0x00, 0x16, 0x00, 0x1e, 0x00, 0x36, 0x00, 
+0x76, 0x00, 0xe6, 0x00, 0xc6, 0x01, 0x86, 0x03, 0xcf, 0x07};
+static unsigned char times24_108_bits[] = {
+0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x0f};
+static unsigned char times24_109_bits[] = {
+0xe7, 0x70, 0x00, 0xf6, 0xf9, 0x00, 0x8e, 0xc7, 0x01, 0x06, 0x83, 0x01, 
+0x06, 0x83, 0x01, 0x06, 0x83, 0x01, 0x06, 0x83, 0x01, 0x06, 0x83, 0x01, 
+0x06, 0x83, 0x01, 0x06, 0x83, 0x01, 0x06, 0x83, 0x01, 0x8f, 0xc7, 0x03};
+static unsigned char times24_110_bits[] = {
+0xe7, 0x00, 0xf6, 0x01, 0x8e, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x8f, 0x07};
+static unsigned char times24_111_bits[] = {
+0x78, 0x00, 0xce, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x86, 0x01, 0xce, 0x01, 0x78, 0x00};
+static unsigned char times24_112_bits[] = {
+0x77, 0x00, 0xce, 0x01, 0x86, 0x01, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x86, 0x01, 0xce, 0x01, 0x76, 0x00, 
+0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x0f, 0x00};
+static unsigned char times24_113_bits[] = {
+0xb8, 0x01, 0xce, 0x01, 0x86, 0x01, 0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 
+0x83, 0x01, 0x83, 0x01, 0x83, 0x01, 0x86, 0x01, 0xce, 0x01, 0xb8, 0x01, 
+0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xc0, 0x03};
+static unsigned char times24_114_bits[] = {
+0x67, 0x76, 0x6e, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x0f};
+static unsigned char times24_115_bits[] = {
+0x7c, 0x66, 0x43, 0x07, 0x0e, 0x3e, 0x78, 0xe0, 0xc0, 0xc1, 0x63, 0x1f};
+static unsigned char times24_116_bits[] = {
+0x08, 0x0c, 0x0e, 0x7f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x4c, 0x38};
+static unsigned char times24_117_bits[] = {
+0x87, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x8e, 0x03, 0x7c, 0x03, 0x38, 0x07};
+static unsigned char times24_118_bits[] = {
+0x8f, 0x07, 0x06, 0x03, 0x06, 0x01, 0x0c, 0x01, 0x0c, 0x01, 0x8c, 0x00, 
+0x98, 0x00, 0x98, 0x00, 0x58, 0x00, 0x70, 0x00, 0x70, 0x00, 0x20, 0x00};
+static unsigned char times24_119_bits[] = {
+0x8f, 0xe7, 0x01, 0x06, 0xc3, 0x00, 0x06, 0x43, 0x00, 0x0c, 0x43, 0x00, 
+0x0c, 0x43, 0x00, 0x8c, 0x26, 0x00, 0x98, 0x26, 0x00, 0x58, 0x26, 0x00, 
+0x58, 0x14, 0x00, 0x70, 0x1c, 0x00, 0x70, 0x1c, 0x00, 0x20, 0x08, 0x00};
+static unsigned char times24_120_bits[] = {
+0x8f, 0x07, 0x06, 0x03, 0x8c, 0x01, 0x9c, 0x00, 0x58, 0x00, 0x30, 0x00, 
+0x70, 0x00, 0xd8, 0x00, 0xcc, 0x01, 0x84, 0x01, 0x06, 0x03, 0x8f, 0x07};
+static unsigned char times24_121_bits[] = {
+0x8f, 0x07, 0x06, 0x03, 0x06, 0x01, 0x0c, 0x01, 0x0c, 0x01, 0x8c, 0x00, 
+0x98, 0x00, 0x98, 0x00, 0x58, 0x00, 0x70, 0x00, 0x70, 0x00, 0x20, 0x00, 
+0x30, 0x00, 0x10, 0x00, 0x18, 0x00, 0x0f, 0x00, 0x07, 0x00};
+static unsigned char times24_122_bits[] = {
+0xff, 0xc3, 0x61, 0x70, 0x38, 0x18, 0x1c, 0x0c, 0x0e, 0x86, 0xc3, 0xff};
+static unsigned char times24_123_bits[] = {
+0xe0, 0x30, 0x18, 0x18, 0x18, 0x18, 0x18, 0x08, 0x0c, 0x04, 0x03, 0x04, 
+0x0c, 0x08, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x30, 0xe0};
+static unsigned char times24_124_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char times24_125_bits[] = {
+0x07, 0x0c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x10, 0x30, 0x20, 0xc0, 0x20, 
+0x30, 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0c, 0x07};
+static unsigned char times24_126_bits[] = {
+0x1c, 0x04, 0x3e, 0x06, 0xe3, 0x03, 0xc1, 0x01};
+static unsigned char times24_127_bits[] = {
+0x00};
+static unsigned char times24_128_bits[] = {
+0x00};
+static unsigned char times24_129_bits[] = {
+0x00};
+static unsigned char times24_130_bits[] = {
+0x00};
+static unsigned char times24_131_bits[] = {
+0x00};
+static unsigned char times24_132_bits[] = {
+0x00};
+static unsigned char times24_133_bits[] = {
+0x00};
+static unsigned char times24_134_bits[] = {
+0x00};
+static unsigned char times24_135_bits[] = {
+0x00};
+static unsigned char times24_136_bits[] = {
+0x00};
+static unsigned char times24_137_bits[] = {
+0x00};
+static unsigned char times24_138_bits[] = {
+0x00};
+static unsigned char times24_139_bits[] = {
+0x00};
+static unsigned char times24_140_bits[] = {
+0x00};
+static unsigned char times24_141_bits[] = {
+0x00};
+static unsigned char times24_142_bits[] = {
+0x00};
+static unsigned char times24_143_bits[] = {
+0x00};
+static unsigned char times24_144_bits[] = {
+0x00};
+static unsigned char times24_145_bits[] = {
+0x00};
+static unsigned char times24_146_bits[] = {
+0x00};
+static unsigned char times24_147_bits[] = {
+0x00};
+static unsigned char times24_148_bits[] = {
+0x00};
+static unsigned char times24_149_bits[] = {
+0x00};
+static unsigned char times24_150_bits[] = {
+0x00};
+static unsigned char times24_151_bits[] = {
+0x00};
+static unsigned char times24_152_bits[] = {
+0x00};
+static unsigned char times24_153_bits[] = {
+0x00};
+static unsigned char times24_154_bits[] = {
+0x00};
+static unsigned char times24_155_bits[] = {
+0x00};
+static unsigned char times24_156_bits[] = {
+0x00};
+static unsigned char times24_157_bits[] = {
+0x00};
+static unsigned char times24_158_bits[] = {
+0x00};
+static unsigned char times24_159_bits[] = {
+0x00};
+static unsigned char times24_160_bits[] = {
+0x00};
+static unsigned char times24_161_bits[] = {
+0x03, 0x03, 0x00, 0x00, 0x00, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char times24_162_bits[] = {
+0x80, 0x00, 0x80, 0x00, 0xf8, 0x00, 0xc6, 0x01, 0xc2, 0x01, 0x23, 0x00, 
+0x23, 0x00, 0x13, 0x00, 0x13, 0x00, 0x13, 0x00, 0x0b, 0x00, 0x0e, 0x01, 
+0xfe, 0x00, 0x7c, 0x00, 0x02, 0x00, 0x02, 0x00};
+static unsigned char times24_163_bits[] = {
+0xf0, 0x00, 0x98, 0x01, 0x8c, 0x01, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x3f, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x00, 0x0c, 0x00, 0x1e, 0x02, 0x7d, 0x03, 0xe7, 0x01};
+static unsigned char times24_164_bits[] = {
+0x03, 0x06, 0x77, 0x07, 0xfe, 0x03, 0x8c, 0x01, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x8c, 0x01, 0xfe, 0x03, 0x77, 0x07, 0x03, 0x06};
+static unsigned char times24_165_bits[] = {
+0x1f, 0x3e, 0x0e, 0x0c, 0x0c, 0x04, 0x18, 0x06, 0x18, 0x02, 0x30, 0x03, 
+0x30, 0x01, 0xe0, 0x01, 0xc0, 0x00, 0xf8, 0x07, 0xc0, 0x00, 0xf8, 0x07, 
+0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xc0, 0x00, 0xf0, 0x03};
+static unsigned char times24_166_bits[] = {
+0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x03};
+static unsigned char times24_167_bits[] = {
+0x38, 0x64, 0x62, 0x06, 0x0e, 0x1c, 0x3c, 0x72, 0xe1, 0xc1, 0xc3, 0x47, 
+0x2e, 0x1c, 0x38, 0x70, 0x60, 0x46, 0x26, 0x1c};
+static unsigned char times24_168_bits[] = {
+0x33, 0x33};
+static unsigned char times24_169_bits[] = {
+0xe0, 0x0f, 0x00, 0x38, 0x38, 0x00, 0x0c, 0x60, 0x00, 0x86, 0xc7, 0x00, 
+0xe2, 0x8c, 0x00, 0x23, 0x98, 0x01, 0x31, 0x00, 0x01, 0x11, 0x00, 0x01, 
+0x11, 0x00, 0x01, 0x11, 0x00, 0x01, 0x31, 0x00, 0x01, 0x23, 0x98, 0x01, 
+0xe2, 0x8e, 0x00, 0x86, 0xc3, 0x00, 0x0c, 0x60, 0x00, 0x38, 0x38, 0x00, 
+0xe0, 0x0f, 0x00};
+static unsigned char times24_170_bits[] = {
+0x1e, 0x33, 0x30, 0x3e, 0x33, 0x33, 0x6e, 0x00, 0x7e};
+static unsigned char times24_171_bits[] = {
+0x10, 0x01, 0x98, 0x01, 0xcc, 0x00, 0x66, 0x00, 0x33, 0x00, 0x33, 0x00, 
+0x66, 0x00, 0xcc, 0x00, 0x98, 0x01, 0x10, 0x01};
+static unsigned char times24_172_bits[] = {
+0xff, 0x0f, 0xff, 0x0f, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 
+0x00, 0x0c};
+static unsigned char times24_173_bits[] = {
+0x7f, 0x7f};
+static unsigned char times24_174_bits[] = {
+0xe0, 0x0f, 0x00, 0x38, 0x38, 0x00, 0x0c, 0x60, 0x00, 0xe6, 0xc7, 0x00, 
+0x42, 0x8c, 0x00, 0x43, 0x88, 0x01, 0x41, 0x08, 0x01, 0x41, 0x0c, 0x01, 
+0xc1, 0x07, 0x01, 0x41, 0x02, 0x01, 0x41, 0x04, 0x01, 0x43, 0x8c, 0x01, 
+0xe2, 0x98, 0x00, 0x06, 0xc0, 0x00, 0x0c, 0x60, 0x00, 0x38, 0x38, 0x00, 
+0xe0, 0x0f, 0x00};
+static unsigned char times24_175_bits[] = {
+0x3f, 0x3f};
+static unsigned char times24_176_bits[] = {
+0x1c, 0x22, 0x41, 0x41, 0x41, 0x22, 0x1c};
+static unsigned char times24_177_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0xff, 0x0f, 
+0xff, 0x0f, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 0x60, 0x00, 
+0x00, 0x00, 0xff, 0x0f, 0xff, 0x0f};
+static unsigned char times24_178_bits[] = {
+0x1c, 0x32, 0x31, 0x30, 0x10, 0x08, 0x0c, 0x04, 0x22, 0x3f};
+static unsigned char times24_179_bits[] = {
+0x1c, 0x32, 0x31, 0x10, 0x0c, 0x10, 0x30, 0x31, 0x11, 0x0e};
+static unsigned char times24_180_bits[] = {
+0x18, 0x1c, 0x06, 0x01};
+static unsigned char times24_181_bits[] = {
+0x87, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x8e, 0x03, 0x7e, 0x03, 0x3a, 0x07, 
+0x02, 0x00, 0x02, 0x00, 0x03, 0x00, 0x07, 0x00, 0x02, 0x00};
+static unsigned char times24_182_bits[] = {
+0xf8, 0x01, 0x9c, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x9f, 0x00, 0x9f, 0x00, 
+0x9f, 0x00, 0x9e, 0x00, 0x9e, 0x00, 0x9c, 0x00, 0x98, 0x00, 0x90, 0x00, 
+0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 
+0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0x90, 0x00};
+static unsigned char times24_183_bits[] = {
+0x03, 0x03};
+static unsigned char times24_184_bits[] = {
+0x08, 0x0c, 0x3c, 0x30, 0x33, 0x1e};
+static unsigned char times24_185_bits[] = {
+0x04, 0x06, 0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1f};
+static unsigned char times24_186_bits[] = {
+0x1e, 0x33, 0x33, 0x33, 0x33, 0x33, 0x1e, 0x00, 0x3f};
+static unsigned char times24_187_bits[] = {
+0x11, 0x00, 0x33, 0x00, 0x66, 0x00, 0xcc, 0x00, 0x98, 0x01, 0x98, 0x01, 
+0xcc, 0x00, 0x66, 0x00, 0x33, 0x00, 0x11, 0x00};
+static unsigned char times24_188_bits[] = {
+0x04, 0x10, 0x06, 0x18, 0x05, 0x0c, 0x04, 0x04, 0x04, 0x06, 0x04, 0x02, 
+0x04, 0x03, 0x84, 0x21, 0x84, 0x30, 0xdf, 0x38, 0x40, 0x28, 0x60, 0x24, 
+0x30, 0x26, 0x10, 0x22, 0x18, 0xff, 0x08, 0x20, 0x0c, 0x20};
+static unsigned char times24_189_bits[] = {
+0x04, 0x10, 0x06, 0x18, 0x05, 0x0c, 0x04, 0x04, 0x04, 0x06, 0x04, 0x02, 
+0x04, 0x03, 0x84, 0x39, 0x84, 0x64, 0xdf, 0x62, 0x40, 0x60, 0x60, 0x20, 
+0x30, 0x10, 0x10, 0x18, 0x18, 0x08, 0x08, 0x44, 0x0c, 0x7e};
+static unsigned char times24_190_bits[] = {
+0x1c, 0x20, 0x00, 0x32, 0x30, 0x00, 0x31, 0x18, 0x00, 0x10, 0x08, 0x00, 
+0x0c, 0x0c, 0x00, 0x10, 0x04, 0x00, 0x30, 0x06, 0x00, 0x31, 0x43, 0x00, 
+0x11, 0x61, 0x00, 0x8e, 0x71, 0x00, 0x80, 0x50, 0x00, 0xc0, 0x48, 0x00, 
+0x60, 0x4c, 0x00, 0x20, 0x44, 0x00, 0x30, 0xfe, 0x01, 0x10, 0x40, 0x00, 
+0x18, 0x40, 0x00};
+static unsigned char times24_191_bits[] = {
+0x30, 0x30, 0x00, 0x00, 0x10, 0x10, 0x18, 0x18, 0x1c, 0x0c, 0x0e, 0x07, 
+0xc3, 0xc3, 0x83, 0xc6, 0x7c};
+static unsigned char times24_192_bits[] = {
+0xc0, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x04, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0x80, 0x03, 0x00, 
+0x80, 0x06, 0x00, 0x40, 0x06, 0x00, 0x40, 0x0c, 0x00, 0x60, 0x0c, 0x00, 
+0x20, 0x0c, 0x00, 0x20, 0x18, 0x00, 0x30, 0x18, 0x00, 0xf0, 0x1f, 0x00, 
+0x10, 0x30, 0x00, 0x18, 0x30, 0x00, 0x08, 0x30, 0x00, 0x08, 0x60, 0x00, 
+0x0c, 0x60, 0x00, 0x3f, 0xf8, 0x01};
+static unsigned char times24_193_bits[] = {
+0x00, 0x0c, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x03, 0x00, 0x80, 0x00, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0x80, 0x03, 0x00, 
+0x80, 0x06, 0x00, 0x40, 0x06, 0x00, 0x40, 0x0c, 0x00, 0x60, 0x0c, 0x00, 
+0x20, 0x0c, 0x00, 0x20, 0x18, 0x00, 0x30, 0x18, 0x00, 0xf0, 0x1f, 0x00, 
+0x10, 0x30, 0x00, 0x18, 0x30, 0x00, 0x08, 0x30, 0x00, 0x08, 0x60, 0x00, 
+0x0c, 0x60, 0x00, 0x3f, 0xf8, 0x01};
+static unsigned char times24_194_bits[] = {
+0x80, 0x01, 0x00, 0xc0, 0x03, 0x00, 0x60, 0x06, 0x00, 0x10, 0x08, 0x00, 
+0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0x80, 0x03, 0x00, 
+0x80, 0x06, 0x00, 0x40, 0x06, 0x00, 0x40, 0x0c, 0x00, 0x60, 0x0c, 0x00, 
+0x20, 0x0c, 0x00, 0x20, 0x18, 0x00, 0x30, 0x18, 0x00, 0xf0, 0x1f, 0x00, 
+0x10, 0x30, 0x00, 0x18, 0x30, 0x00, 0x08, 0x30, 0x00, 0x08, 0x60, 0x00, 
+0x0c, 0x60, 0x00, 0x3f, 0xf8, 0x01};
+static unsigned char times24_195_bits[] = {
+0xc0, 0x09, 0x00, 0x20, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0x80, 0x03, 0x00, 0x80, 0x06, 0x00, 
+0x40, 0x06, 0x00, 0x40, 0x0c, 0x00, 0x60, 0x0c, 0x00, 0x20, 0x0c, 0x00, 
+0x20, 0x18, 0x00, 0x30, 0x18, 0x00, 0xf0, 0x1f, 0x00, 0x10, 0x30, 0x00, 
+0x18, 0x30, 0x00, 0x08, 0x30, 0x00, 0x08, 0x60, 0x00, 0x0c, 0xe0, 0x00, 
+0x3f, 0xf8, 0x01};
+static unsigned char times24_196_bits[] = {
+0x60, 0x0c, 0x00, 0x60, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0x80, 0x03, 0x00, 0x80, 0x06, 0x00, 
+0x40, 0x06, 0x00, 0x40, 0x0c, 0x00, 0x60, 0x0c, 0x00, 0x20, 0x0c, 0x00, 
+0x20, 0x18, 0x00, 0x30, 0x18, 0x00, 0xf0, 0x1f, 0x00, 0x10, 0x30, 0x00, 
+0x18, 0x30, 0x00, 0x08, 0x30, 0x00, 0x08, 0x60, 0x00, 0x0c, 0x60, 0x00, 
+0x3f, 0xf8, 0x01};
+static unsigned char times24_197_bits[] = {
+0x80, 0x03, 0x00, 0x40, 0x04, 0x00, 0x40, 0x04, 0x00, 0x80, 0x03, 0x00, 
+0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0x80, 0x03, 0x00, 0x80, 0x06, 0x00, 
+0x40, 0x06, 0x00, 0x40, 0x0c, 0x00, 0x60, 0x0c, 0x00, 0x20, 0x0c, 0x00, 
+0x20, 0x18, 0x00, 0x30, 0x18, 0x00, 0xf0, 0x1f, 0x00, 0x10, 0x30, 0x00, 
+0x18, 0x30, 0x00, 0x08, 0x30, 0x00, 0x08, 0x60, 0x00, 0x0c, 0x60, 0x00, 
+0x3f, 0xf8, 0x01};
+static unsigned char times24_198_bits[] = {
+0xc0, 0xff, 0x07, 0x80, 0x07, 0x06, 0x80, 0x06, 0x04, 0x80, 0x06, 0x04, 
+0x40, 0x06, 0x00, 0x40, 0x06, 0x00, 0x60, 0x06, 0x01, 0x20, 0x06, 0x01, 
+0x20, 0xfe, 0x01, 0x30, 0x06, 0x01, 0xf0, 0x07, 0x01, 0x10, 0x06, 0x00, 
+0x18, 0x06, 0x00, 0x08, 0x06, 0x08, 0x08, 0x06, 0x08, 0x0c, 0x06, 0x0c, 
+0x9f, 0xff, 0x0f};
+static unsigned char times24_199_bits[] = {
+0xe0, 0x27, 0x38, 0x3c, 0x1c, 0x30, 0x06, 0x20, 0x06, 0x20, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x06, 0x00, 0x06, 0x20, 0x1c, 0x10, 0x78, 0x1c, 0xe0, 0x07, 0x80, 0x00, 
+0xc0, 0x00, 0xc0, 0x03, 0x00, 0x03, 0x30, 0x03, 0xe0, 0x01};
+static unsigned char times24_200_bits[] = {
+0x18, 0x00, 0x38, 0x00, 0x60, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0x0f, 
+0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x08, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x02, 
+0x0c, 0x02, 0xfc, 0x03, 0x0c, 0x02, 0x0c, 0x02, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x10, 0x0c, 0x10, 0x0c, 0x18, 0xff, 0x1f};
+static unsigned char times24_201_bits[] = {
+0x00, 0x03, 0x80, 0x03, 0xc0, 0x00, 0x20, 0x00, 0x00, 0x00, 0xff, 0x0f, 
+0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x08, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x02, 
+0x0c, 0x02, 0xfc, 0x03, 0x0c, 0x02, 0x0c, 0x02, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x10, 0x0c, 0x10, 0x0c, 0x18, 0xff, 0x1f};
+static unsigned char times24_202_bits[] = {
+0xc0, 0x00, 0xe0, 0x01, 0x30, 0x03, 0x08, 0x04, 0x00, 0x00, 0xff, 0x0f, 
+0x0c, 0x0c, 0x0c, 0x08, 0x0c, 0x08, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x02, 
+0x0c, 0x02, 0xfc, 0x03, 0x0c, 0x02, 0x0c, 0x02, 0x0c, 0x00, 0x0c, 0x00, 
+0x0c, 0x10, 0x0c, 0x10, 0x0c, 0x18, 0xff, 0x1f};
+static unsigned char times24_203_bits[] = {
+0x98, 0x01, 0x98, 0x01, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0x0c, 0x0c, 
+0x0c, 0x08, 0x0c, 0x08, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x02, 0x0c, 0x02, 
+0xfc, 0x03, 0x0c, 0x02, 0x0c, 0x02, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x10, 
+0x0c, 0x10, 0x0c, 0x18, 0xff, 0x1f};
+static unsigned char times24_204_bits[] = {
+0x03, 0x07, 0x0c, 0x10, 0x00, 0x3f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3f};
+static unsigned char times24_205_bits[] = {
+0x30, 0x38, 0x0c, 0x02, 0x00, 0x3f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3f};
+static unsigned char times24_206_bits[] = {
+0x18, 0x3c, 0x66, 0x81, 0x00, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 
+0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e};
+static unsigned char times24_207_bits[] = {
+0x33, 0x33, 0x00, 0x00, 0x3f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3f};
+static unsigned char times24_208_bits[] = {
+0xfe, 0x07, 0x18, 0x1c, 0x18, 0x38, 0x18, 0x60, 0x18, 0x60, 0x18, 0xc0, 
+0x18, 0xc0, 0x18, 0xc0, 0xff, 0xc0, 0x18, 0xc0, 0x18, 0xc0, 0x18, 0xc0, 
+0x18, 0x60, 0x18, 0x60, 0x18, 0x38, 0x18, 0x1c, 0xfe, 0x07};
+static unsigned char times24_209_bits[] = {
+0xc0, 0x09, 0x20, 0x07, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xf8, 0x0c, 0x20, 
+0x1c, 0x20, 0x1c, 0x20, 0x34, 0x20, 0x64, 0x20, 0x64, 0x20, 0xc4, 0x20, 
+0x84, 0x21, 0x84, 0x21, 0x04, 0x23, 0x04, 0x26, 0x04, 0x26, 0x04, 0x2c, 
+0x04, 0x38, 0x04, 0x38, 0x1f, 0x30};
+static unsigned char times24_210_bits[] = {
+0x60, 0x00, 0xe0, 0x00, 0x80, 0x01, 0x00, 0x02, 0x00, 0x00, 0xe0, 0x07, 
+0x38, 0x1c, 0x1c, 0x38, 0x06, 0x60, 0x06, 0x60, 0x03, 0xc0, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x06, 0x60, 
+0x06, 0x60, 0x1c, 0x38, 0x38, 0x1c, 0xe0, 0x07};
+static unsigned char times24_211_bits[] = {
+0x00, 0x0c, 0x00, 0x0e, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0xe0, 0x07, 
+0x38, 0x1c, 0x1c, 0x38, 0x06, 0x60, 0x06, 0x60, 0x03, 0xc0, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x06, 0x60, 
+0x06, 0x60, 0x1c, 0x38, 0x38, 0x1c, 0xe0, 0x07};
+static unsigned char times24_212_bits[] = {
+0x80, 0x01, 0xc0, 0x03, 0x60, 0x06, 0x10, 0x08, 0x00, 0x00, 0xe0, 0x07, 
+0x38, 0x1c, 0x1c, 0x38, 0x06, 0x60, 0x06, 0x60, 0x03, 0xc0, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x06, 0x60, 
+0x06, 0x60, 0x1c, 0x38, 0x38, 0x1c, 0xe0, 0x07};
+static unsigned char times24_213_bits[] = {
+0xc0, 0x09, 0x20, 0x07, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x38, 0x1c, 
+0x1c, 0x38, 0x06, 0x60, 0x06, 0x60, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x06, 0x60, 0x06, 0x60, 
+0x1c, 0x38, 0x38, 0x1c, 0xe0, 0x07};
+static unsigned char times24_214_bits[] = {
+0x60, 0x06, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x38, 0x1c, 
+0x1c, 0x38, 0x06, 0x60, 0x06, 0x60, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 
+0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x06, 0x60, 0x06, 0x60, 
+0x1c, 0x38, 0x38, 0x1c, 0xe0, 0x07};
+static unsigned char times24_215_bits[] = {
+0x01, 0x02, 0x03, 0x03, 0x86, 0x01, 0xcc, 0x00, 0x78, 0x00, 0x30, 0x00, 
+0x78, 0x00, 0xcc, 0x00, 0x86, 0x01, 0x03, 0x03, 0x01, 0x02};
+static unsigned char times24_216_bits[] = {
+0x00, 0x20, 0xe0, 0x27, 0x38, 0x1c, 0x1c, 0x38, 0x06, 0x64, 0x06, 0x62, 
+0x03, 0xc2, 0x03, 0xc1, 0x03, 0xc1, 0x83, 0xc0, 0x83, 0xc0, 0x43, 0xc0, 
+0x43, 0xc0, 0x26, 0x60, 0x16, 0x60, 0x1c, 0x38, 0x38, 0x1c, 0xe4, 0x07, 
+0x04, 0x00};
+static unsigned char times24_217_bits[] = {
+0x60, 0x00, 0xe0, 0x00, 0x80, 0x01, 0x00, 0x02, 0x00, 0x00, 0x3f, 0xf8, 
+0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 
+0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 
+0x0c, 0x10, 0x18, 0x10, 0x38, 0x0c, 0xe0, 0x07};
+static unsigned char times24_218_bits[] = {
+0x00, 0x0c, 0x00, 0x0e, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x3f, 0xf8, 
+0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 
+0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 
+0x0c, 0x10, 0x18, 0x10, 0x38, 0x0c, 0xe0, 0x07};
+static unsigned char times24_219_bits[] = {
+0x80, 0x01, 0xc0, 0x03, 0x60, 0x06, 0x10, 0x08, 0x00, 0x00, 0x3f, 0xf8, 
+0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 
+0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 
+0x0c, 0x10, 0x18, 0x10, 0x38, 0x0c, 0xe0, 0x07};
+static unsigned char times24_220_bits[] = {
+0x60, 0x0c, 0x60, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x3f, 0xf8, 0x0c, 0x20, 
+0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 
+0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x20, 0x0c, 0x10, 
+0x18, 0x10, 0x38, 0x0c, 0xe0, 0x07};
+static unsigned char times24_221_bits[] = {
+0x00, 0x0c, 0x00, 0x0e, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x3f, 0xfc, 
+0x0c, 0x30, 0x1c, 0x10, 0x18, 0x18, 0x38, 0x08, 0x30, 0x0c, 0x60, 0x04, 
+0x60, 0x06, 0xc0, 0x02, 0xc0, 0x03, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 
+0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xe0, 0x07};
+static unsigned char times24_222_bits[] = {
+0x3f, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xfc, 0x03, 0x0c, 0x0e, 
+0x0c, 0x0c, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x18, 0x0c, 0x0c, 0x0c, 0x0e, 
+0xfc, 0x03, 0x0c, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x3f, 0x00};
+static unsigned char times24_223_bits[] = {
+0x78, 0x00, 0xcc, 0x00, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 0x86, 0x01, 
+0xc6, 0x00, 0x36, 0x00, 0xe6, 0x00, 0xc6, 0x01, 0x86, 0x01, 0x86, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x36, 0x03, 0x36, 0x01, 0xe7, 0x00};
+static unsigned char times24_224_bits[] = {
+0x06, 0x00, 0x0e, 0x00, 0x18, 0x00, 0x20, 0x00, 0x00, 0x00, 0x7c, 0x00, 
+0xe6, 0x00, 0xc6, 0x00, 0xc0, 0x00, 0xf0, 0x00, 0xdc, 0x00, 0xc6, 0x00, 
+0xc3, 0x00, 0xc3, 0x00, 0xe3, 0x00, 0xdf, 0x00, 0x8e, 0x01};
+static unsigned char times24_225_bits[] = {
+0xc0, 0x00, 0xe0, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x00, 0x7c, 0x00, 
+0xe6, 0x00, 0xc6, 0x00, 0xc0, 0x00, 0xf0, 0x00, 0xdc, 0x00, 0xc6, 0x00, 
+0xc3, 0x00, 0xc3, 0x00, 0xe3, 0x00, 0xdf, 0x00, 0x8e, 0x01};
+static unsigned char times24_226_bits[] = {
+0x18, 0x00, 0x3c, 0x00, 0x24, 0x00, 0x42, 0x00, 0x00, 0x00, 0x7c, 0x00, 
+0xe6, 0x00, 0xc6, 0x00, 0xc0, 0x00, 0xf0, 0x00, 0xdc, 0x00, 0xc6, 0x00, 
+0xc3, 0x00, 0xc3, 0x00, 0xe3, 0x00, 0xdf, 0x00, 0x8e, 0x01};
+static unsigned char times24_227_bits[] = {
+0x5c, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0xe6, 0x00, 
+0xc6, 0x00, 0xc0, 0x00, 0xf0, 0x00, 0xdc, 0x00, 0xc6, 0x00, 0xc3, 0x00, 
+0xc3, 0x00, 0xe3, 0x00, 0xdf, 0x00, 0x8e, 0x01};
+static unsigned char times24_228_bits[] = {
+0x66, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x00, 0xe6, 0x00, 
+0xc6, 0x00, 0xc0, 0x00, 0xf0, 0x00, 0xdc, 0x00, 0xc6, 0x00, 0xc3, 0x00, 
+0xc3, 0x00, 0xe3, 0x00, 0xdf, 0x00, 0x8e, 0x01};
+static unsigned char times24_229_bits[] = {
+0x38, 0x00, 0x44, 0x00, 0x44, 0x00, 0x38, 0x00, 0x00, 0x00, 0x7c, 0x00, 
+0xe6, 0x00, 0xc6, 0x00, 0xc0, 0x00, 0xf0, 0x00, 0xdc, 0x00, 0xc6, 0x00, 
+0xc3, 0x00, 0xc3, 0x00, 0xe3, 0x00, 0xdf, 0x00, 0x8e, 0x01};
+static unsigned char times24_230_bits[] = {
+0x3c, 0x0f, 0xe6, 0x19, 0xc6, 0x30, 0xc0, 0x30, 0xf0, 0x3f, 0xdc, 0x00, 
+0xc6, 0x00, 0xc3, 0x00, 0xc3, 0x00, 0xe3, 0x21, 0xdf, 0x1f, 0x0e, 0x0f};
+static unsigned char times24_231_bits[] = {
+0xf8, 0x00, 0xc6, 0x01, 0x82, 0x01, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0e, 0x01, 0xfe, 0x00, 0x78, 0x00, 
+0x10, 0x00, 0x18, 0x00, 0x78, 0x00, 0x60, 0x00, 0x66, 0x00, 0x3c, 0x00};
+static unsigned char times24_232_bits[] = {
+0x06, 0x00, 0x0e, 0x00, 0x18, 0x00, 0x20, 0x00, 0x00, 0x00, 0x78, 0x00, 
+0xc6, 0x00, 0x82, 0x01, 0x83, 0x01, 0xff, 0x01, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x07, 0x00, 0x0e, 0x01, 0xfe, 0x00, 0x78, 0x00};
+static unsigned char times24_233_bits[] = {
+0xc0, 0x00, 0xe0, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x00, 0x78, 0x00, 
+0xc6, 0x00, 0x82, 0x01, 0x83, 0x01, 0xff, 0x01, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x07, 0x00, 0x0e, 0x01, 0xfe, 0x00, 0x78, 0x00};
+static unsigned char times24_234_bits[] = {
+0x30, 0x00, 0x78, 0x00, 0x48, 0x00, 0x84, 0x00, 0x00, 0x00, 0x78, 0x00, 
+0xc6, 0x00, 0x82, 0x01, 0x83, 0x01, 0xff, 0x01, 0x03, 0x00, 0x03, 0x00, 
+0x03, 0x00, 0x07, 0x00, 0x0e, 0x01, 0xfe, 0x00, 0x78, 0x00};
+static unsigned char times24_235_bits[] = {
+0xcc, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0xc6, 0x00, 
+0x82, 0x01, 0x83, 0x01, 0xff, 0x01, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 
+0x07, 0x00, 0x0e, 0x01, 0xfe, 0x00, 0x78, 0x00};
+static unsigned char times24_236_bits[] = {
+0x03, 0x07, 0x0c, 0x10, 0x00, 0x0e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x1e};
+static unsigned char times24_237_bits[] = {
+0x18, 0x1c, 0x06, 0x01, 0x00, 0x07, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 
+0x06, 0x06, 0x06, 0x06, 0x0f};
+static unsigned char times24_238_bits[] = {
+0x0c, 0x1e, 0x12, 0x21, 0x00, 0x0e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x0c, 0x1e};
+static unsigned char times24_239_bits[] = {
+0x33, 0x33, 0x00, 0x00, 0x0e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 
+0x0c, 0x0c, 0x0c, 0x1e};
+static unsigned char times24_240_bits[] = {
+0x03, 0x00, 0x8e, 0x01, 0x78, 0x00, 0x3c, 0x00, 0x63, 0x00, 0xf8, 0x00, 
+0xce, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x86, 0x01, 0xce, 0x01, 0x78, 0x00};
+static unsigned char times24_241_bits[] = {
+0x38, 0x01, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0x00, 0xf6, 0x01, 
+0x8e, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x8f, 0x07};
+static unsigned char times24_242_bits[] = {
+0x0c, 0x00, 0x1c, 0x00, 0x30, 0x00, 0x40, 0x00, 0x00, 0x00, 0x78, 0x00, 
+0xce, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x86, 0x01, 0xce, 0x01, 0x78, 0x00};
+static unsigned char times24_243_bits[] = {
+0x80, 0x01, 0xc0, 0x01, 0x60, 0x00, 0x10, 0x00, 0x00, 0x00, 0x78, 0x00, 
+0xce, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x86, 0x01, 0xce, 0x01, 0x78, 0x00};
+static unsigned char times24_244_bits[] = {
+0x30, 0x00, 0x78, 0x00, 0x48, 0x00, 0x84, 0x00, 0x00, 0x00, 0x78, 0x00, 
+0xce, 0x01, 0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x03, 0x03, 0x86, 0x01, 0xce, 0x01, 0x78, 0x00};
+static unsigned char times24_245_bits[] = {
+0x38, 0x01, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0xce, 0x01, 
+0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x86, 0x01, 0xce, 0x01, 0x78, 0x00};
+static unsigned char times24_246_bits[] = {
+0xcc, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0xce, 0x01, 
+0x86, 0x01, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 
+0x03, 0x03, 0x86, 0x01, 0xce, 0x01, 0x78, 0x00};
+static unsigned char times24_247_bits[] = {
+0x60, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x0f, 0xff, 0x0f, 
+0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x60, 0x00};
+static unsigned char times24_248_bits[] = {
+0x00, 0x03, 0x78, 0x03, 0xce, 0x01, 0xc6, 0x01, 0x63, 0x03, 0x23, 0x03, 
+0x33, 0x03, 0x13, 0x03, 0x1b, 0x03, 0x0b, 0x03, 0x8e, 0x01, 0xce, 0x01, 
+0x7b, 0x00, 0x03, 0x00};
+static unsigned char times24_249_bits[] = {
+0x0c, 0x00, 0x1c, 0x00, 0x30, 0x00, 0x40, 0x00, 0x00, 0x00, 0x87, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x8e, 0x03, 0x7c, 0x03, 0x38, 0x07};
+static unsigned char times24_250_bits[] = {
+0x80, 0x01, 0xc0, 0x01, 0x60, 0x00, 0x10, 0x00, 0x00, 0x00, 0x87, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x8e, 0x03, 0x7c, 0x03, 0x38, 0x07};
+static unsigned char times24_251_bits[] = {
+0x30, 0x00, 0x78, 0x00, 0x48, 0x00, 0x84, 0x00, 0x00, 0x00, 0x87, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x8e, 0x03, 0x7c, 0x03, 0x38, 0x07};
+static unsigned char times24_252_bits[] = {
+0xcc, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x8e, 0x03, 0x7c, 0x03, 0x38, 0x07};
+static unsigned char times24_253_bits[] = {
+0x80, 0x01, 0xc0, 0x01, 0x60, 0x00, 0x10, 0x00, 0x00, 0x00, 0x8f, 0x07, 
+0x06, 0x03, 0x06, 0x01, 0x0c, 0x01, 0x0c, 0x01, 0x8c, 0x00, 0x98, 0x00, 
+0x98, 0x00, 0x58, 0x00, 0x70, 0x00, 0x70, 0x00, 0x20, 0x00, 0x30, 0x00, 
+0x10, 0x00, 0x18, 0x00, 0x0f, 0x00, 0x07, 0x00};
+static unsigned char times24_254_bits[] = {
+0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x76, 0x00, 
+0xce, 0x01, 0x86, 0x01, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 0x06, 0x03, 
+0x06, 0x03, 0x06, 0x03, 0x86, 0x01, 0xce, 0x01, 0x76, 0x00, 0x06, 0x00, 
+0x06, 0x00, 0x06, 0x00, 0x06, 0x00, 0x0f, 0x00};
+static unsigned char times24_255_bits[] = {
+0xcc, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x07, 0x06, 0x03, 
+0x06, 0x01, 0x0c, 0x01, 0x0c, 0x01, 0x8c, 0x00, 0x98, 0x00, 0x98, 0x00, 
+0x58, 0x00, 0x70, 0x00, 0x70, 0x00, 0x20, 0x00, 0x30, 0x00, 0x10, 0x00, 
+0x18, 0x00, 0x0f, 0x00, 0x07, 0x00};
+static RotFont times24font[] = {
+{5, 1, 1, times24_0_bits},
+{5, 1, 1, times24_1_bits},
+{5, 1, 1, times24_2_bits},
+{5, 1, 1, times24_3_bits},
+{5, 1, 1, times24_4_bits},
+{5, 1, 1, times24_5_bits},
+{5, 1, 1, times24_6_bits},
+{5, 1, 1, times24_7_bits},
+{5, 1, 1, times24_8_bits},
+{5, 1, 1, times24_9_bits},
+{5, 1, 1, times24_10_bits},
+{5, 1, 1, times24_11_bits},
+{5, 1, 1, times24_12_bits},
+{5, 1, 1, times24_13_bits},
+{5, 1, 1, times24_14_bits},
+{5, 1, 1, times24_15_bits},
+{5, 1, 1, times24_16_bits},
+{5, 1, 1, times24_17_bits},
+{5, 1, 1, times24_18_bits},
+{5, 1, 1, times24_19_bits},
+{5, 1, 1, times24_20_bits},
+{5, 1, 1, times24_21_bits},
+{5, 1, 1, times24_22_bits},
+{5, 1, 1, times24_23_bits},
+{5, 1, 1, times24_24_bits},
+{5, 1, 1, times24_25_bits},
+{5, 1, 1, times24_26_bits},
+{5, 1, 1, times24_27_bits},
+{5, 1, 1, times24_28_bits},
+{5, 1, 1, times24_29_bits},
+{5, 1, 1, times24_30_bits},
+{5, 1, 1, times24_31_bits},
+{10, 1, 1, times24_32_bits},
+{2, 17, 17, times24_33_bits},
+{6, 5, 17, times24_34_bits},
+{11, 17, 17, times24_35_bits},
+{11, 21, 19, times24_36_bits},
+{17, 16, 16, times24_37_bits},
+{16, 17, 17, times24_38_bits},
+{3, 5, 17, times24_39_bits},
+{6, 22, 17, times24_40_bits},
+{6, 22, 17, times24_41_bits},
+{9, 9, 17, times24_42_bits},
+{12, 12, 13, times24_43_bits},
+{3, 5, 2, times24_44_bits},
+{12, 2, 8, times24_45_bits},
+{2, 2, 2, times24_46_bits},
+{8, 20, 17, times24_47_bits},
+{10, 17, 17, times24_48_bits},
+{8, 17, 17, times24_49_bits},
+{10, 17, 17, times24_50_bits},
+{9, 17, 17, times24_51_bits},
+{10, 17, 17, times24_52_bits},
+{10, 17, 17, times24_53_bits},
+{10, 17, 17, times24_54_bits},
+{10, 17, 17, times24_55_bits},
+{10, 17, 17, times24_56_bits},
+{10, 17, 17, times24_57_bits},
+{2, 11, 11, times24_58_bits},
+{3, 14, 11, times24_59_bits},
+{11, 11, 12, times24_60_bits},
+{12, 6, 10, times24_61_bits},
+{11, 11, 12, times24_62_bits},
+{8, 17, 17, times24_63_bits},
+{18, 20, 17, times24_64_bits},
+{17, 17, 17, times24_65_bits},
+{14, 17, 17, times24_66_bits},
+{14, 17, 17, times24_67_bits},
+{15, 17, 17, times24_68_bits},
+{13, 17, 17, times24_69_bits},
+{12, 17, 17, times24_70_bits},
+{16, 17, 17, times24_71_bits},
+{17, 17, 17, times24_72_bits},
+{6, 17, 17, times24_73_bits},
+{9, 17, 17, times24_74_bits},
+{16, 17, 17, times24_75_bits},
+{13, 17, 17, times24_76_bits},
+{21, 17, 17, times24_77_bits},
+{16, 17, 17, times24_78_bits},
+{16, 17, 17, times24_79_bits},
+{13, 17, 17, times24_80_bits},
+{16, 22, 17, times24_81_bits},
+{15, 17, 17, times24_82_bits},
+{11, 17, 17, times24_83_bits},
+{14, 17, 17, times24_84_bits},
+{16, 17, 17, times24_85_bits},
+{17, 17, 17, times24_86_bits},
+{23, 17, 17, times24_87_bits},
+{18, 17, 17, times24_88_bits},
+{16, 17, 17, times24_89_bits},
+{13, 17, 17, times24_90_bits},
+{5, 21, 17, times24_91_bits},
+{7, 17, 17, times24_92_bits},
+{5, 21, 17, times24_93_bits},
+{9, 9, 17, times24_94_bits},
+{13, 2, -3, times24_95_bits},
+{3, 5, 17, times24_96_bits},
+{9, 12, 12, times24_97_bits},
+{10, 17, 17, times24_98_bits},
+{9, 12, 12, times24_99_bits},
+{10, 17, 17, times24_100_bits},
+{9, 12, 12, times24_101_bits},
+{7, 17, 17, times24_102_bits},
+{11, 17, 12, times24_103_bits},
+{11, 17, 17, times24_104_bits},
+{4, 17, 17, times24_105_bits},
+{4, 22, 17, times24_106_bits},
+{11, 17, 17, times24_107_bits},
+{4, 17, 17, times24_108_bits},
+{18, 12, 12, times24_109_bits},
+{11, 12, 12, times24_110_bits},
+{10, 12, 12, times24_111_bits},
+{10, 17, 12, times24_112_bits},
+{10, 17, 12, times24_113_bits},
+{7, 12, 12, times24_114_bits},
+{8, 12, 12, times24_115_bits},
+{7, 15, 15, times24_116_bits},
+{11, 12, 12, times24_117_bits},
+{11, 12, 12, times24_118_bits},
+{17, 12, 12, times24_119_bits},
+{11, 12, 12, times24_120_bits},
+{11, 17, 12, times24_121_bits},
+{8, 12, 12, times24_122_bits},
+{8, 22, 17, times24_123_bits},
+{2, 17, 17, times24_124_bits},
+{8, 22, 17, times24_125_bits},
+{11, 4, 9, times24_126_bits},
+{5, 1, 1, times24_127_bits},
+{5, 1, 1, times24_128_bits},
+{5, 1, 1, times24_129_bits},
+{5, 1, 1, times24_130_bits},
+{5, 1, 1, times24_131_bits},
+{5, 1, 1, times24_132_bits},
+{5, 1, 1, times24_133_bits},
+{5, 1, 1, times24_134_bits},
+{5, 1, 1, times24_135_bits},
+{5, 1, 1, times24_136_bits},
+{5, 1, 1, times24_137_bits},
+{5, 1, 1, times24_138_bits},
+{5, 1, 1, times24_139_bits},
+{5, 1, 1, times24_140_bits},
+{5, 1, 1, times24_141_bits},
+{5, 1, 1, times24_142_bits},
+{5, 1, 1, times24_143_bits},
+{5, 1, 1, times24_144_bits},
+{5, 1, 1, times24_145_bits},
+{5, 1, 1, times24_146_bits},
+{5, 1, 1, times24_147_bits},
+{5, 1, 1, times24_148_bits},
+{5, 1, 1, times24_149_bits},
+{5, 1, 1, times24_150_bits},
+{5, 1, 1, times24_151_bits},
+{5, 1, 1, times24_152_bits},
+{5, 1, 1, times24_153_bits},
+{5, 1, 1, times24_154_bits},
+{5, 1, 1, times24_155_bits},
+{5, 1, 1, times24_156_bits},
+{5, 1, 1, times24_157_bits},
+{5, 1, 1, times24_158_bits},
+{5, 1, 1, times24_159_bits},
+{1, 1, 1, times24_160_bits},
+{2, 17, 12, times24_161_bits},
+{9, 16, 14, times24_162_bits},
+{10, 17, 17, times24_163_bits},
+{11, 12, 15, times24_164_bits},
+{14, 17, 17, times24_165_bits},
+{2, 17, 17, times24_166_bits},
+{8, 20, 18, times24_167_bits},
+{6, 2, 16, times24_168_bits},
+{17, 17, 17, times24_169_bits},
+{7, 9, 17, times24_170_bits},
+{9, 10, 11, times24_171_bits},
+{12, 7, 10, times24_172_bits},
+{7, 2, 7, times24_173_bits},
+{17, 17, 17, times24_174_bits},
+{6, 2, 16, times24_175_bits},
+{7, 7, 17, times24_176_bits},
+{12, 15, 15, times24_177_bits},
+{6, 10, 17, times24_178_bits},
+{6, 10, 17, times24_179_bits},
+{5, 4, 17, times24_180_bits},
+{11, 17, 12, times24_181_bits},
+{9, 22, 17, times24_182_bits},
+{2, 2, 8, times24_183_bits},
+{6, 6, 0, times24_184_bits},
+{5, 10, 17, times24_185_bits},
+{6, 9, 17, times24_186_bits},
+{9, 10, 11, times24_187_bits},
+{16, 17, 17, times24_188_bits},
+{15, 17, 17, times24_189_bits},
+{17, 17, 17, times24_190_bits},
+{8, 17, 12, times24_191_bits},
+{17, 22, 22, times24_192_bits},
+{17, 22, 22, times24_193_bits},
+{17, 22, 22, times24_194_bits},
+{17, 21, 21, times24_195_bits},
+{17, 21, 21, times24_196_bits},
+{17, 21, 21, times24_197_bits},
+{20, 17, 17, times24_198_bits},
+{14, 23, 17, times24_199_bits},
+{13, 22, 22, times24_200_bits},
+{13, 22, 22, times24_201_bits},
+{13, 22, 22, times24_202_bits},
+{13, 21, 21, times24_203_bits},
+{6, 22, 22, times24_204_bits},
+{6, 22, 22, times24_205_bits},
+{8, 22, 22, times24_206_bits},
+{6, 21, 21, times24_207_bits},
+{16, 17, 17, times24_208_bits},
+{16, 21, 21, times24_209_bits},
+{16, 22, 22, times24_210_bits},
+{16, 22, 22, times24_211_bits},
+{16, 22, 22, times24_212_bits},
+{16, 21, 21, times24_213_bits},
+{16, 21, 21, times24_214_bits},
+{10, 11, 12, times24_215_bits},
+{16, 19, 18, times24_216_bits},
+{16, 22, 22, times24_217_bits},
+{16, 22, 22, times24_218_bits},
+{16, 22, 22, times24_219_bits},
+{16, 21, 21, times24_220_bits},
+{16, 22, 22, times24_221_bits},
+{13, 17, 17, times24_222_bits},
+{10, 17, 17, times24_223_bits},
+{9, 17, 17, times24_224_bits},
+{9, 17, 17, times24_225_bits},
+{9, 17, 17, times24_226_bits},
+{9, 16, 16, times24_227_bits},
+{9, 16, 16, times24_228_bits},
+{9, 17, 17, times24_229_bits},
+{14, 12, 12, times24_230_bits},
+{9, 18, 12, times24_231_bits},
+{9, 17, 17, times24_232_bits},
+{9, 17, 17, times24_233_bits},
+{9, 17, 17, times24_234_bits},
+{9, 16, 16, times24_235_bits},
+{5, 17, 17, times24_236_bits},
+{5, 17, 17, times24_237_bits},
+{6, 17, 17, times24_238_bits},
+{6, 16, 16, times24_239_bits},
+{10, 17, 17, times24_240_bits},
+{11, 16, 16, times24_241_bits},
+{10, 17, 17, times24_242_bits},
+{10, 17, 17, times24_243_bits},
+{10, 17, 17, times24_244_bits},
+{10, 16, 16, times24_245_bits},
+{10, 16, 16, times24_246_bits},
+{12, 10, 12, times24_247_bits},
+{10, 14, 13, times24_248_bits},
+{11, 17, 17, times24_249_bits},
+{11, 17, 17, times24_250_bits},
+{11, 17, 17, times24_251_bits},
+{11, 16, 16, times24_252_bits},
+{11, 22, 17, times24_253_bits},
+{10, 22, 17, times24_254_bits},
+{11, 21, 16, times24_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times8.bdf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times8.bdf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times8.bdf	(revision 15879)
@@ -0,0 +1,2435 @@
+STARTFONT 2.1
+COMMENT  
+COMMENT  Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved.
+COMMENT  
+COMMENT  WARNING:  This bdf file was generated from a font server using
+COMMENT  fstobdf.  The resulting font is subject to the same copyright,
+COMMENT  license, and trademark restrictions as the original font.  The
+COMMENT  authors and distributors of fstobdf disclaim all liability for
+COMMENT  misuse of the program or its output.
+COMMENT  
+FONT -Adobe-Times-Medium-R-Normal--8-80-75-75-P-44-ISO8859-1
+SIZE 8 75 75
+FONTBOUNDINGBOX 9 10 -1 -2
+STARTPROPERTIES 32
+FOUNDRY "Adobe"
+FAMILY_NAME "Times"
+WEIGHT_NAME "Medium"
+SLANT "R"
+SETWIDTH_NAME "Normal"
+ADD_STYLE_NAME ""
+PIXEL_SIZE 8
+POINT_SIZE 80
+RESOLUTION_X 75
+RESOLUTION_Y 75
+SPACING "P"
+AVERAGE_WIDTH 44
+CHARSET_REGISTRY "ISO8859"
+CHARSET_ENCODING "1"
+CAP_HEIGHT 5
+X_HEIGHT 4
+FACE_NAME "Times Roman"
+COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems Incorporated. All Rights Reserved. Copyright (c) 1988, 1991 Digital Equipment Corporation. All Rights Reserved."
+NOTICE "Times is a trademark of Linotype-Hell AG and/or its subsidiaries."
+_DEC_DEVICE_FONTNAMES "PS=Times-Roman"
+_DEC_PRODUCTINFO "DECwindows Fonts V2.2, 07-Nov-1991"
+RELATIVE_SETWIDTH 50
+RELATIVE_WEIGHT 50
+CHARSET_COLLECTIONS "ASCII ISO8859-1 ADOBE-STANDARD"
+FULL_NAME "Times Roman"
+FONT "-Adobe-Times-Medium-R-Normal--8-80-75-75-P-44-ISO8859-1"
+WEIGHT 10
+RESOLUTION 103
+QUAD_WIDTH 5
+DEFAULT_CHAR 32
+FONT_ASCENT 7
+FONT_DESCENT 2
+ENDPROPERTIES
+CHARS 191
+STARTCHAR space
+ENCODING 32
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclam
+ENCODING 33
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 6 1 0
+BITMAP
+80
+80
+80
+80
+00
+80
+ENDCHAR
+STARTCHAR quotedbl
+ENCODING 34
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 2 0 3
+BITMAP
+a0
+a0
+ENDCHAR
+STARTCHAR numbersign
+ENCODING 35
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 5 0 0
+BITMAP
+50
+f0
+50
+f0
+50
+ENDCHAR
+STARTCHAR dollar
+ENCODING 36
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 -1
+BITMAP
+40
+60
+80
+60
+a0
+c0
+40
+ENDCHAR
+STARTCHAR percent
+ENCODING 37
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+c8
+d0
+20
+58
+98
+ENDCHAR
+STARTCHAR ampersand
+ENCODING 38
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 6 0 0
+BITMAP
+20
+50
+60
+a8
+90
+78
+ENDCHAR
+STARTCHAR apostrophe
+ENCODING 39
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 2 1 4
+BITMAP
+80
+80
+ENDCHAR
+STARTCHAR parenleft
+ENCODING 40
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 7 1 -1
+BITMAP
+40
+80
+80
+80
+80
+80
+40
+ENDCHAR
+STARTCHAR parenright
+ENCODING 41
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 7 0 -1
+BITMAP
+80
+40
+40
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR asterisk
+ENCODING 42
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 3 1 2
+BITMAP
+a0
+40
+a0
+ENDCHAR
+STARTCHAR plus
+ENCODING 43
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+BITMAP
+20
+20
+f0
+20
+20
+ENDCHAR
+STARTCHAR comma
+ENCODING 44
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 2 1 -1
+BITMAP
+40
+80
+ENDCHAR
+STARTCHAR minus
+ENCODING 45
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 1 1 2
+BITMAP
+f0
+ENDCHAR
+STARTCHAR period
+ENCODING 46
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 1 1 0
+BITMAP
+80
+ENDCHAR
+STARTCHAR slash
+ENCODING 47
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 7 0 -1
+BITMAP
+20
+20
+40
+40
+40
+80
+80
+ENDCHAR
+STARTCHAR 0
+ENCODING 48
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+40
+a0
+a0
+a0
+40
+ENDCHAR
+STARTCHAR 1
+ENCODING 49
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+40
+c0
+40
+40
+e0
+ENDCHAR
+STARTCHAR 2
+ENCODING 50
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+c0
+20
+40
+80
+e0
+ENDCHAR
+STARTCHAR 3
+ENCODING 51
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+c0
+20
+40
+20
+c0
+ENDCHAR
+STARTCHAR 4
+ENCODING 52
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 5 0 0
+BITMAP
+20
+60
+a0
+f0
+20
+ENDCHAR
+STARTCHAR 5
+ENCODING 53
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+e0
+80
+60
+20
+c0
+ENDCHAR
+STARTCHAR 6
+ENCODING 54
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+60
+80
+c0
+a0
+40
+ENDCHAR
+STARTCHAR 7
+ENCODING 55
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+e0
+20
+40
+80
+80
+ENDCHAR
+STARTCHAR 8
+ENCODING 56
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+40
+a0
+40
+a0
+40
+ENDCHAR
+STARTCHAR 9
+ENCODING 57
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+40
+a0
+60
+20
+c0
+ENDCHAR
+STARTCHAR colon
+ENCODING 58
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 3 1 0
+BITMAP
+80
+00
+80
+ENDCHAR
+STARTCHAR semicolon
+ENCODING 59
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 4 1 -1
+BITMAP
+40
+00
+40
+80
+ENDCHAR
+STARTCHAR less
+ENCODING 60
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+20
+40
+80
+40
+20
+ENDCHAR
+STARTCHAR equal
+ENCODING 61
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 3 0 1
+BITMAP
+f0
+00
+f0
+ENDCHAR
+STARTCHAR greater
+ENCODING 62
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 1 0
+BITMAP
+80
+40
+20
+40
+80
+ENDCHAR
+STARTCHAR question
+ENCODING 63
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 5 0 0
+BITMAP
+c0
+20
+40
+00
+40
+ENDCHAR
+STARTCHAR at
+ENCODING 64
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 6 7 0 -1
+BITMAP
+78
+84
+9c
+a4
+bc
+80
+78
+ENDCHAR
+STARTCHAR A
+ENCODING 65
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+20
+50
+70
+50
+d8
+ENDCHAR
+STARTCHAR B
+ENCODING 66
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+BITMAP
+e0
+50
+60
+50
+e0
+ENDCHAR
+STARTCHAR C
+ENCODING 67
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+70
+88
+80
+88
+70
+ENDCHAR
+STARTCHAR D
+ENCODING 68
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+f0
+48
+48
+48
+f0
+ENDCHAR
+STARTCHAR E
+ENCODING 69
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+BITMAP
+f0
+40
+60
+40
+f0
+ENDCHAR
+STARTCHAR F
+ENCODING 70
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+BITMAP
+f0
+40
+70
+40
+c0
+ENDCHAR
+STARTCHAR G
+ENCODING 71
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+70
+80
+b8
+88
+70
+ENDCHAR
+STARTCHAR H
+ENCODING 72
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 5 0 0
+BITMAP
+cc
+48
+78
+48
+cc
+ENDCHAR
+STARTCHAR I
+ENCODING 73
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 5 0 0
+BITMAP
+e0
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR J
+ENCODING 74
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 5 0 0
+BITMAP
+c0
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR K
+ENCODING 75
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+c8
+50
+60
+50
+d8
+ENDCHAR
+STARTCHAR L
+ENCODING 76
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+BITMAP
+e0
+40
+40
+50
+f0
+ENDCHAR
+STARTCHAR M
+ENCODING 77
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 7 5 0 0
+BITMAP
+ee
+6c
+54
+54
+c6
+ENDCHAR
+STARTCHAR N
+ENCODING 78
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 5 0 0
+BITMAP
+cc
+68
+68
+58
+c8
+ENDCHAR
+STARTCHAR O
+ENCODING 79
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+70
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR P
+ENCODING 80
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+BITMAP
+f0
+48
+70
+40
+c0
+ENDCHAR
+STARTCHAR Q
+ENCODING 81
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 7 0 -2
+BITMAP
+70
+88
+88
+88
+70
+20
+10
+ENDCHAR
+STARTCHAR R
+ENCODING 82
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+e0
+50
+60
+50
+d8
+ENDCHAR
+STARTCHAR S
+ENCODING 83
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+BITMAP
+70
+80
+60
+10
+e0
+ENDCHAR
+STARTCHAR T
+ENCODING 84
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 5 0 0
+BITMAP
+f8
+a8
+20
+20
+70
+ENDCHAR
+STARTCHAR U
+ENCODING 85
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 5 0 0
+BITMAP
+cc
+48
+48
+48
+30
+ENDCHAR
+STARTCHAR V
+ENCODING 86
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+d8
+50
+50
+20
+20
+ENDCHAR
+STARTCHAR W
+ENCODING 87
+SWIDTH 960 0
+DWIDTH 8 0
+BBX 8 5 0 0
+BITMAP
+d3
+52
+4a
+5a
+2c
+ENDCHAR
+STARTCHAR X
+ENCODING 88
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 5 0 0
+BITMAP
+cc
+30
+30
+48
+cc
+ENDCHAR
+STARTCHAR Y
+ENCODING 89
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+d8
+50
+20
+20
+70
+ENDCHAR
+STARTCHAR Z
+ENCODING 90
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 1 0
+BITMAP
+f0
+a0
+40
+90
+f0
+ENDCHAR
+STARTCHAR bracketleft
+ENCODING 91
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 7 0 -1
+BITMAP
+c0
+80
+80
+80
+80
+80
+c0
+ENDCHAR
+STARTCHAR backslash
+ENCODING 92
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 7 0 -1
+BITMAP
+80
+80
+40
+40
+40
+20
+20
+ENDCHAR
+STARTCHAR bracketright
+ENCODING 93
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 7 0 -1
+BITMAP
+c0
+40
+40
+40
+40
+40
+c0
+ENDCHAR
+STARTCHAR asciicircum
+ENCODING 94
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 2 1 4
+BITMAP
+40
+a0
+ENDCHAR
+STARTCHAR underscore
+ENCODING 95
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 1 0 -1
+BITMAP
+f0
+ENDCHAR
+STARTCHAR grave
+ENCODING 96
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 2 1 4
+BITMAP
+80
+80
+ENDCHAR
+STARTCHAR a
+ENCODING 97
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 4 0 0
+BITMAP
+80
+40
+c0
+c0
+ENDCHAR
+STARTCHAR b
+ENCODING 98
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+80
+c0
+a0
+a0
+c0
+ENDCHAR
+STARTCHAR c
+ENCODING 99
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 2 4 0 0
+BITMAP
+40
+80
+80
+40
+ENDCHAR
+STARTCHAR d
+ENCODING 100
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+20
+60
+a0
+a0
+60
+ENDCHAR
+STARTCHAR e
+ENCODING 101
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 4 0 0
+BITMAP
+40
+e0
+80
+40
+ENDCHAR
+STARTCHAR f
+ENCODING 102
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 5 0 0
+BITMAP
+20
+40
+e0
+40
+40
+ENDCHAR
+STARTCHAR g
+ENCODING 103
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 5 0 -1
+BITMAP
+70
+a0
+40
+a0
+40
+ENDCHAR
+STARTCHAR h
+ENCODING 104
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+80
+c0
+a0
+a0
+a0
+ENDCHAR
+STARTCHAR i
+ENCODING 105
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 6 0 0
+BITMAP
+80
+00
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR j
+ENCODING 106
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 8 -1 -2
+BITMAP
+40
+00
+40
+40
+40
+40
+40
+80
+ENDCHAR
+STARTCHAR k
+ENCODING 107
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+80
+a0
+c0
+c0
+a0
+ENDCHAR
+STARTCHAR l
+ENCODING 108
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 1 5 0 0
+BITMAP
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR m
+ENCODING 109
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 4 0 0
+BITMAP
+d0
+a8
+a8
+a8
+ENDCHAR
+STARTCHAR n
+ENCODING 110
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 4 0 0
+BITMAP
+c0
+a0
+a0
+a0
+ENDCHAR
+STARTCHAR o
+ENCODING 111
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 4 0 0
+BITMAP
+40
+a0
+a0
+40
+ENDCHAR
+STARTCHAR p
+ENCODING 112
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 -2
+BITMAP
+c0
+a0
+a0
+c0
+80
+80
+ENDCHAR
+STARTCHAR q
+ENCODING 113
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 -2
+BITMAP
+60
+a0
+a0
+60
+20
+20
+ENDCHAR
+STARTCHAR r
+ENCODING 114
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 4 0 0
+BITMAP
+a0
+c0
+80
+80
+ENDCHAR
+STARTCHAR s
+ENCODING 115
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 4 0 0
+BITMAP
+c0
+80
+40
+c0
+ENDCHAR
+STARTCHAR t
+ENCODING 116
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 5 0 0
+BITMAP
+80
+c0
+80
+80
+40
+ENDCHAR
+STARTCHAR u
+ENCODING 117
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 4 0 0
+BITMAP
+a0
+a0
+a0
+60
+ENDCHAR
+STARTCHAR v
+ENCODING 118
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 4 0 0
+BITMAP
+a0
+a0
+a0
+40
+ENDCHAR
+STARTCHAR w
+ENCODING 119
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 4 0 0
+BITMAP
+a8
+a8
+a8
+50
+ENDCHAR
+STARTCHAR x
+ENCODING 120
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+BITMAP
+90
+60
+60
+90
+ENDCHAR
+STARTCHAR y
+ENCODING 121
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 -2
+BITMAP
+a0
+a0
+a0
+40
+40
+80
+ENDCHAR
+STARTCHAR z
+ENCODING 122
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 4 0 0
+BITMAP
+e0
+40
+80
+e0
+ENDCHAR
+STARTCHAR braceleft
+ENCODING 123
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 7 0 -1
+BITMAP
+20
+40
+40
+c0
+40
+40
+20
+ENDCHAR
+STARTCHAR bar
+ENCODING 124
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 7 0 -1
+BITMAP
+80
+80
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR braceright
+ENCODING 125
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 7 0 -1
+BITMAP
+80
+40
+40
+60
+40
+40
+80
+ENDCHAR
+STARTCHAR asciitilde
+ENCODING 126
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 2 0 2
+BITMAP
+68
+b0
+ENDCHAR
+STARTCHAR nobreakspace
+ENCODING 160
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 1 0 0
+BITMAP
+00
+ENDCHAR
+STARTCHAR exclamdown
+ENCODING 161
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 7 0 -2
+BITMAP
+80
+00
+80
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR cent
+ENCODING 162
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 -1
+BITMAP
+40
+60
+80
+80
+60
+40
+ENDCHAR
+STARTCHAR sterling
+ENCODING 163
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 5 0 0
+BITMAP
+20
+40
+e0
+40
+f0
+ENDCHAR
+STARTCHAR currency
+ENCODING 164
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 4 0 0
+BITMAP
+90
+60
+60
+90
+ENDCHAR
+STARTCHAR yen
+ENCODING 165
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+88
+50
+f8
+20
+20
+ENDCHAR
+STARTCHAR brokenbar
+ENCODING 166
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 7 0 -1
+BITMAP
+80
+80
+80
+00
+80
+80
+80
+ENDCHAR
+STARTCHAR section
+ENCODING 167
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 -1
+BITMAP
+60
+80
+c0
+a0
+60
+20
+c0
+ENDCHAR
+STARTCHAR diaeresis
+ENCODING 168
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 1 1 6
+BITMAP
+90
+ENDCHAR
+STARTCHAR copyright
+ENCODING 169
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 6 7 1 -1
+BITMAP
+78
+84
+94
+a4
+94
+84
+78
+ENDCHAR
+STARTCHAR ordfeminine
+ENCODING 170
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 5 0 1
+BITMAP
+80
+40
+c0
+00
+c0
+ENDCHAR
+STARTCHAR guillemotleft
+ENCODING 171
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 4 0 0
+BITMAP
+50
+a0
+a0
+50
+ENDCHAR
+STARTCHAR notsign
+ENCODING 172
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 4 3 1 1
+BITMAP
+f0
+10
+10
+ENDCHAR
+STARTCHAR hyphen
+ENCODING 173
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 1 0 2
+BITMAP
+c0
+ENDCHAR
+STARTCHAR registered
+ENCODING 174
+SWIDTH 840 0
+DWIDTH 7 0
+BBX 6 7 1 -1
+BITMAP
+78
+b4
+ac
+b4
+ac
+84
+78
+ENDCHAR
+STARTCHAR macron
+ENCODING 175
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 1 0 6
+BITMAP
+e0
+ENDCHAR
+STARTCHAR degree
+ENCODING 176
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 3 0 2
+BITMAP
+40
+a0
+40
+ENDCHAR
+STARTCHAR plusminus
+ENCODING 177
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 3 5 1 0
+BITMAP
+40
+e0
+40
+00
+e0
+ENDCHAR
+STARTCHAR twosuperior
+ENCODING 178
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 4 0 2
+BITMAP
+80
+40
+80
+c0
+ENDCHAR
+STARTCHAR threesuperior
+ENCODING 179
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 5 0 1
+BITMAP
+80
+40
+80
+40
+80
+ENDCHAR
+STARTCHAR acute
+ENCODING 180
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 2 0 5
+BITMAP
+40
+80
+ENDCHAR
+STARTCHAR mu
+ENCODING 181
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 5 0 -1
+BITMAP
+a0
+a0
+a0
+d0
+80
+ENDCHAR
+STARTCHAR paragraph
+ENCODING 182
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 5 7 0 -1
+BITMAP
+f8
+d0
+d0
+50
+50
+50
+50
+ENDCHAR
+STARTCHAR periodcentered
+ENCODING 183
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 1 1 0 2
+BITMAP
+80
+ENDCHAR
+STARTCHAR cedilla
+ENCODING 184
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 2 0 -2
+BITMAP
+40
+80
+ENDCHAR
+STARTCHAR onesuperior
+ENCODING 185
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 4 0 2
+BITMAP
+c0
+40
+40
+e0
+ENDCHAR
+STARTCHAR masculine
+ENCODING 186
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 5 0 1
+BITMAP
+40
+a0
+40
+00
+e0
+ENDCHAR
+STARTCHAR guillemotright
+ENCODING 187
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 4 0 0
+BITMAP
+a0
+50
+50
+a0
+ENDCHAR
+STARTCHAR onequarter
+ENCODING 188
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 7 0 -1
+BITMAP
+44
+48
+50
+24
+4c
+9c
+04
+ENDCHAR
+STARTCHAR onehalf
+ENCODING 189
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 7 0 -1
+BITMAP
+44
+48
+50
+28
+44
+88
+0c
+ENDCHAR
+STARTCHAR threequarters
+ENCODING 190
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 7 0 -1
+BITMAP
+80
+44
+88
+54
+ac
+5c
+04
+ENDCHAR
+STARTCHAR questiondown
+ENCODING 191
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 6 0 -1
+BITMAP
+40
+00
+40
+80
+80
+40
+ENDCHAR
+STARTCHAR Agrave
+ENCODING 192
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+40
+20
+00
+20
+20
+50
+70
+d8
+ENDCHAR
+STARTCHAR Aacute
+ENCODING 193
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+10
+20
+00
+20
+20
+50
+70
+d8
+ENDCHAR
+STARTCHAR Acircumflex
+ENCODING 194
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+20
+50
+00
+20
+20
+50
+70
+d8
+ENDCHAR
+STARTCHAR Atilde
+ENCODING 195
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+28
+50
+00
+20
+20
+50
+70
+d8
+ENDCHAR
+STARTCHAR Adiaeresis
+ENCODING 196
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 7 0 0
+BITMAP
+50
+00
+20
+20
+50
+70
+d8
+ENDCHAR
+STARTCHAR Aring
+ENCODING 197
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+20
+50
+20
+20
+20
+50
+70
+d8
+ENDCHAR
+STARTCHAR AE
+ENCODING 198
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 5 0 0
+BITMAP
+3c
+50
+7c
+50
+dc
+ENDCHAR
+STARTCHAR Ccedilla
+ENCODING 199
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 7 0 -2
+BITMAP
+70
+88
+80
+88
+70
+20
+40
+ENDCHAR
+STARTCHAR Egrave
+ENCODING 200
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 0 0
+BITMAP
+40
+20
+00
+f0
+40
+60
+40
+f0
+ENDCHAR
+STARTCHAR Eacute
+ENCODING 201
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 0 0
+BITMAP
+10
+20
+00
+f0
+40
+60
+40
+f0
+ENDCHAR
+STARTCHAR Ecircumflex
+ENCODING 202
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 8 0 0
+BITMAP
+20
+50
+00
+f0
+40
+60
+40
+f0
+ENDCHAR
+STARTCHAR Ediaeresis
+ENCODING 203
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 7 0 0
+BITMAP
+50
+00
+f0
+40
+60
+40
+f0
+ENDCHAR
+STARTCHAR Igrave
+ENCODING 204
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 8 0 0
+BITMAP
+80
+40
+00
+e0
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR Iacute
+ENCODING 205
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 8 0 0
+BITMAP
+20
+40
+00
+e0
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR Icircumflex
+ENCODING 206
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 8 0 0
+BITMAP
+40
+a0
+00
+e0
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR Idiaeresis
+ENCODING 207
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 7 0 0
+BITMAP
+a0
+00
+e0
+40
+40
+40
+e0
+ENDCHAR
+STARTCHAR ETH
+ENCODING 208
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 5 0 0
+BITMAP
+f0
+48
+e8
+48
+f0
+ENDCHAR
+STARTCHAR Ntilde
+ENCODING 209
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 8 0 0
+BITMAP
+28
+50
+00
+cc
+68
+58
+48
+c8
+ENDCHAR
+STARTCHAR Ograve
+ENCODING 210
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+40
+20
+00
+70
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Oacute
+ENCODING 211
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+10
+20
+00
+70
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Ocircumflex
+ENCODING 212
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+20
+50
+00
+70
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Otilde
+ENCODING 213
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+28
+50
+00
+70
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR Odiaeresis
+ENCODING 214
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 7 0 0
+BITMAP
+50
+00
+70
+88
+88
+88
+70
+ENDCHAR
+STARTCHAR multiply
+ENCODING 215
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 4 0 0
+BITMAP
+90
+60
+60
+90
+ENDCHAR
+STARTCHAR Ooblique
+ENCODING 216
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 7 0 -1
+BITMAP
+08
+70
+98
+a8
+c8
+70
+80
+ENDCHAR
+STARTCHAR Ugrave
+ENCODING 217
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 8 0 0
+BITMAP
+20
+10
+00
+cc
+48
+48
+48
+30
+ENDCHAR
+STARTCHAR Uacute
+ENCODING 218
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 8 0 0
+BITMAP
+08
+10
+00
+cc
+48
+48
+48
+30
+ENDCHAR
+STARTCHAR Ucircumflex
+ENCODING 219
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 8 0 0
+BITMAP
+10
+28
+00
+cc
+48
+48
+48
+30
+ENDCHAR
+STARTCHAR Udiaeresis
+ENCODING 220
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 6 7 0 0
+BITMAP
+28
+00
+cc
+48
+48
+48
+30
+ENDCHAR
+STARTCHAR Yacute
+ENCODING 221
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 8 0 0
+BITMAP
+10
+20
+00
+d8
+50
+50
+20
+20
+ENDCHAR
+STARTCHAR THORN
+ENCODING 222
+SWIDTH 600 0
+DWIDTH 5 0
+BBX 4 5 0 0
+BITMAP
+c0
+60
+50
+60
+c0
+ENDCHAR
+STARTCHAR ssharp
+ENCODING 223
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 6 0 -1
+BITMAP
+60
+90
+a0
+90
+a0
+80
+ENDCHAR
+STARTCHAR agrave
+ENCODING 224
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 7 0 0
+BITMAP
+80
+40
+00
+80
+40
+c0
+c0
+ENDCHAR
+STARTCHAR aacute
+ENCODING 225
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 2 7 0 0
+BITMAP
+40
+80
+00
+80
+40
+c0
+c0
+ENDCHAR
+STARTCHAR acircumflex
+ENCODING 226
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 7 0 0
+BITMAP
+40
+a0
+00
+80
+40
+c0
+c0
+ENDCHAR
+STARTCHAR atilde
+ENCODING 227
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 4 7 0 0
+BITMAP
+50
+a0
+00
+80
+40
+c0
+c0
+ENDCHAR
+STARTCHAR adiaeresis
+ENCODING 228
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 7 0 0
+BITMAP
+a0
+00
+00
+80
+40
+c0
+c0
+ENDCHAR
+STARTCHAR aring
+ENCODING 229
+SWIDTH 360 0
+DWIDTH 3 0
+BBX 3 7 0 0
+BITMAP
+40
+a0
+40
+80
+40
+c0
+c0
+ENDCHAR
+STARTCHAR ae
+ENCODING 230
+SWIDTH 720 0
+DWIDTH 6 0
+BBX 5 4 0 0
+BITMAP
+90
+78
+e0
+d0
+ENDCHAR
+STARTCHAR ccedilla
+ENCODING 231
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 2 5 1 -1
+BITMAP
+40
+80
+80
+40
+80
+ENDCHAR
+STARTCHAR egrave
+ENCODING 232
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+80
+40
+00
+40
+e0
+80
+40
+ENDCHAR
+STARTCHAR eacute
+ENCODING 233
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+20
+40
+00
+40
+e0
+80
+40
+ENDCHAR
+STARTCHAR ecircumflex
+ENCODING 234
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+40
+a0
+00
+40
+e0
+80
+40
+ENDCHAR
+STARTCHAR ediaeresis
+ENCODING 235
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+a0
+00
+00
+40
+e0
+80
+40
+ENDCHAR
+STARTCHAR igrave
+ENCODING 236
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 7 0 0
+BITMAP
+80
+40
+00
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR iacute
+ENCODING 237
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 2 7 0 0
+BITMAP
+40
+80
+00
+80
+80
+80
+80
+ENDCHAR
+STARTCHAR icircumflex
+ENCODING 238
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 7 -1 0
+BITMAP
+40
+a0
+00
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR idiaeresis
+ENCODING 239
+SWIDTH 240 0
+DWIDTH 2 0
+BBX 3 6 -1 0
+BITMAP
+a0
+00
+40
+40
+40
+40
+ENDCHAR
+STARTCHAR eth
+ENCODING 240
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 6 0 0
+BITMAP
+a0
+40
+a0
+50
+50
+20
+ENDCHAR
+STARTCHAR ntilde
+ENCODING 241
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 7 0 0
+BITMAP
+50
+a0
+00
+c0
+a0
+a0
+a0
+ENDCHAR
+STARTCHAR ograve
+ENCODING 242
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+80
+40
+00
+40
+a0
+a0
+40
+ENDCHAR
+STARTCHAR oacute
+ENCODING 243
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+20
+40
+00
+40
+a0
+a0
+40
+ENDCHAR
+STARTCHAR ocircumflex
+ENCODING 244
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+40
+a0
+00
+40
+a0
+a0
+40
+ENDCHAR
+STARTCHAR otilde
+ENCODING 245
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 7 0 0
+BITMAP
+50
+a0
+00
+40
+a0
+a0
+40
+ENDCHAR
+STARTCHAR odiaeresis
+ENCODING 246
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+a0
+00
+00
+40
+a0
+a0
+40
+ENDCHAR
+STARTCHAR division
+ENCODING 247
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 5 0 0
+BITMAP
+40
+00
+e0
+00
+40
+ENDCHAR
+STARTCHAR oslash
+ENCODING 248
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 -1
+BITMAP
+20
+60
+a0
+a0
+c0
+80
+ENDCHAR
+STARTCHAR ugrave
+ENCODING 249
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+80
+40
+00
+a0
+a0
+a0
+60
+ENDCHAR
+STARTCHAR uacute
+ENCODING 250
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+20
+40
+00
+a0
+a0
+a0
+60
+ENDCHAR
+STARTCHAR ucircumflex
+ENCODING 251
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 7 0 0
+BITMAP
+40
+a0
+00
+a0
+a0
+a0
+60
+ENDCHAR
+STARTCHAR udiaeresis
+ENCODING 252
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 6 0 0
+BITMAP
+a0
+00
+a0
+a0
+a0
+60
+ENDCHAR
+STARTCHAR yacute
+ENCODING 253
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 9 0 -2
+BITMAP
+20
+40
+00
+a0
+a0
+a0
+40
+40
+80
+ENDCHAR
+STARTCHAR thorn
+ENCODING 254
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 4 7 -1 -2
+BITMAP
+c0
+60
+50
+50
+60
+40
+c0
+ENDCHAR
+STARTCHAR ydiaeresis
+ENCODING 255
+SWIDTH 480 0
+DWIDTH 4 0
+BBX 3 8 0 -2
+BITMAP
+a0
+00
+a0
+a0
+a0
+40
+40
+80
+ENDCHAR
+ENDFONT
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times8.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times8.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/rotfont/times8.h	(revision 15879)
@@ -0,0 +1,769 @@
+static unsigned char times8_0_bits[] = {
+0x00};
+static unsigned char times8_1_bits[] = {
+0x00};
+static unsigned char times8_2_bits[] = {
+0x00};
+static unsigned char times8_3_bits[] = {
+0x00};
+static unsigned char times8_4_bits[] = {
+0x00};
+static unsigned char times8_5_bits[] = {
+0x00};
+static unsigned char times8_6_bits[] = {
+0x00};
+static unsigned char times8_7_bits[] = {
+0x00};
+static unsigned char times8_8_bits[] = {
+0x00};
+static unsigned char times8_9_bits[] = {
+0x00};
+static unsigned char times8_10_bits[] = {
+0x00};
+static unsigned char times8_11_bits[] = {
+0x00};
+static unsigned char times8_12_bits[] = {
+0x00};
+static unsigned char times8_13_bits[] = {
+0x00};
+static unsigned char times8_14_bits[] = {
+0x00};
+static unsigned char times8_15_bits[] = {
+0x00};
+static unsigned char times8_16_bits[] = {
+0x00};
+static unsigned char times8_17_bits[] = {
+0x00};
+static unsigned char times8_18_bits[] = {
+0x00};
+static unsigned char times8_19_bits[] = {
+0x00};
+static unsigned char times8_20_bits[] = {
+0x00};
+static unsigned char times8_21_bits[] = {
+0x00};
+static unsigned char times8_22_bits[] = {
+0x00};
+static unsigned char times8_23_bits[] = {
+0x00};
+static unsigned char times8_24_bits[] = {
+0x00};
+static unsigned char times8_25_bits[] = {
+0x00};
+static unsigned char times8_26_bits[] = {
+0x00};
+static unsigned char times8_27_bits[] = {
+0x00};
+static unsigned char times8_28_bits[] = {
+0x00};
+static unsigned char times8_29_bits[] = {
+0x00};
+static unsigned char times8_30_bits[] = {
+0x00};
+static unsigned char times8_31_bits[] = {
+0x00};
+static unsigned char times8_32_bits[] = {
+0x00};
+static unsigned char times8_33_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x00, 0x01};
+static unsigned char times8_34_bits[] = {
+0x05, 0x05};
+static unsigned char times8_35_bits[] = {
+0x0a, 0x0f, 0x0a, 0x0f, 0x0a};
+static unsigned char times8_36_bits[] = {
+0x02, 0x06, 0x01, 0x06, 0x05, 0x03, 0x02};
+static unsigned char times8_37_bits[] = {
+0x13, 0x0b, 0x04, 0x1a, 0x19};
+static unsigned char times8_38_bits[] = {
+0x04, 0x0a, 0x06, 0x15, 0x09, 0x1e};
+static unsigned char times8_39_bits[] = {
+0x01, 0x01};
+static unsigned char times8_40_bits[] = {
+0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02};
+static unsigned char times8_41_bits[] = {
+0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01};
+static unsigned char times8_42_bits[] = {
+0x05, 0x02, 0x05};
+static unsigned char times8_43_bits[] = {
+0x04, 0x04, 0x0f, 0x04, 0x04};
+static unsigned char times8_44_bits[] = {
+0x02, 0x01};
+static unsigned char times8_45_bits[] = {
+0x0f};
+static unsigned char times8_46_bits[] = {
+0x01};
+static unsigned char times8_47_bits[] = {
+0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01};
+static unsigned char times8_48_bits[] = {
+0x02, 0x05, 0x05, 0x05, 0x02};
+static unsigned char times8_49_bits[] = {
+0x02, 0x03, 0x02, 0x02, 0x07};
+static unsigned char times8_50_bits[] = {
+0x03, 0x04, 0x02, 0x01, 0x07};
+static unsigned char times8_51_bits[] = {
+0x03, 0x04, 0x02, 0x04, 0x03};
+static unsigned char times8_52_bits[] = {
+0x04, 0x06, 0x05, 0x0f, 0x04};
+static unsigned char times8_53_bits[] = {
+0x07, 0x01, 0x06, 0x04, 0x03};
+static unsigned char times8_54_bits[] = {
+0x06, 0x01, 0x03, 0x05, 0x02};
+static unsigned char times8_55_bits[] = {
+0x07, 0x04, 0x02, 0x01, 0x01};
+static unsigned char times8_56_bits[] = {
+0x02, 0x05, 0x02, 0x05, 0x02};
+static unsigned char times8_57_bits[] = {
+0x02, 0x05, 0x06, 0x04, 0x03};
+static unsigned char times8_58_bits[] = {
+0x01, 0x00, 0x01};
+static unsigned char times8_59_bits[] = {
+0x02, 0x00, 0x02, 0x01};
+static unsigned char times8_60_bits[] = {
+0x04, 0x02, 0x01, 0x02, 0x04};
+static unsigned char times8_61_bits[] = {
+0x0f, 0x00, 0x0f};
+static unsigned char times8_62_bits[] = {
+0x01, 0x02, 0x04, 0x02, 0x01};
+static unsigned char times8_63_bits[] = {
+0x03, 0x04, 0x02, 0x00, 0x02};
+static unsigned char times8_64_bits[] = {
+0x1e, 0x21, 0x39, 0x25, 0x3d, 0x01, 0x1e};
+static unsigned char times8_65_bits[] = {
+0x04, 0x0a, 0x0e, 0x0a, 0x1b};
+static unsigned char times8_66_bits[] = {
+0x07, 0x0a, 0x06, 0x0a, 0x07};
+static unsigned char times8_67_bits[] = {
+0x0e, 0x11, 0x01, 0x11, 0x0e};
+static unsigned char times8_68_bits[] = {
+0x0f, 0x12, 0x12, 0x12, 0x0f};
+static unsigned char times8_69_bits[] = {
+0x0f, 0x02, 0x06, 0x02, 0x0f};
+static unsigned char times8_70_bits[] = {
+0x0f, 0x02, 0x0e, 0x02, 0x03};
+static unsigned char times8_71_bits[] = {
+0x0e, 0x01, 0x1d, 0x11, 0x0e};
+static unsigned char times8_72_bits[] = {
+0x33, 0x12, 0x1e, 0x12, 0x33};
+static unsigned char times8_73_bits[] = {
+0x07, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times8_74_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x01};
+static unsigned char times8_75_bits[] = {
+0x13, 0x0a, 0x06, 0x0a, 0x1b};
+static unsigned char times8_76_bits[] = {
+0x07, 0x02, 0x02, 0x0a, 0x0f};
+static unsigned char times8_77_bits[] = {
+0x77, 0x36, 0x2a, 0x2a, 0x63};
+static unsigned char times8_78_bits[] = {
+0x33, 0x16, 0x16, 0x1a, 0x13};
+static unsigned char times8_79_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char times8_80_bits[] = {
+0x0f, 0x12, 0x0e, 0x02, 0x03};
+static unsigned char times8_81_bits[] = {
+0x0e, 0x11, 0x11, 0x11, 0x0e, 0x04, 0x08};
+static unsigned char times8_82_bits[] = {
+0x07, 0x0a, 0x06, 0x0a, 0x1b};
+static unsigned char times8_83_bits[] = {
+0x0e, 0x01, 0x06, 0x08, 0x07};
+static unsigned char times8_84_bits[] = {
+0x1f, 0x15, 0x04, 0x04, 0x0e};
+static unsigned char times8_85_bits[] = {
+0x33, 0x12, 0x12, 0x12, 0x0c};
+static unsigned char times8_86_bits[] = {
+0x1b, 0x0a, 0x0a, 0x04, 0x04};
+static unsigned char times8_87_bits[] = {
+0xcb, 0x4a, 0x52, 0x5a, 0x34};
+static unsigned char times8_88_bits[] = {
+0x33, 0x0c, 0x0c, 0x12, 0x33};
+static unsigned char times8_89_bits[] = {
+0x1b, 0x0a, 0x04, 0x04, 0x0e};
+static unsigned char times8_90_bits[] = {
+0x0f, 0x05, 0x02, 0x09, 0x0f};
+static unsigned char times8_91_bits[] = {
+0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03};
+static unsigned char times8_92_bits[] = {
+0x01, 0x01, 0x02, 0x02, 0x02, 0x04, 0x04};
+static unsigned char times8_93_bits[] = {
+0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03};
+static unsigned char times8_94_bits[] = {
+0x02, 0x05};
+static unsigned char times8_95_bits[] = {
+0x0f};
+static unsigned char times8_96_bits[] = {
+0x01, 0x01};
+static unsigned char times8_97_bits[] = {
+0x01, 0x02, 0x03, 0x03};
+static unsigned char times8_98_bits[] = {
+0x01, 0x03, 0x05, 0x05, 0x03};
+static unsigned char times8_99_bits[] = {
+0x02, 0x01, 0x01, 0x02};
+static unsigned char times8_100_bits[] = {
+0x04, 0x06, 0x05, 0x05, 0x06};
+static unsigned char times8_101_bits[] = {
+0x02, 0x07, 0x01, 0x02};
+static unsigned char times8_102_bits[] = {
+0x04, 0x02, 0x07, 0x02, 0x02};
+static unsigned char times8_103_bits[] = {
+0x0e, 0x05, 0x02, 0x05, 0x02};
+static unsigned char times8_104_bits[] = {
+0x01, 0x03, 0x05, 0x05, 0x05};
+static unsigned char times8_105_bits[] = {
+0x01, 0x00, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times8_106_bits[] = {
+0x02, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x01};
+static unsigned char times8_107_bits[] = {
+0x01, 0x05, 0x03, 0x03, 0x05};
+static unsigned char times8_108_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times8_109_bits[] = {
+0x0b, 0x15, 0x15, 0x15};
+static unsigned char times8_110_bits[] = {
+0x03, 0x05, 0x05, 0x05};
+static unsigned char times8_111_bits[] = {
+0x02, 0x05, 0x05, 0x02};
+static unsigned char times8_112_bits[] = {
+0x03, 0x05, 0x05, 0x03, 0x01, 0x01};
+static unsigned char times8_113_bits[] = {
+0x06, 0x05, 0x05, 0x06, 0x04, 0x04};
+static unsigned char times8_114_bits[] = {
+0x05, 0x03, 0x01, 0x01};
+static unsigned char times8_115_bits[] = {
+0x03, 0x01, 0x02, 0x03};
+static unsigned char times8_116_bits[] = {
+0x01, 0x03, 0x01, 0x01, 0x02};
+static unsigned char times8_117_bits[] = {
+0x05, 0x05, 0x05, 0x06};
+static unsigned char times8_118_bits[] = {
+0x05, 0x05, 0x05, 0x02};
+static unsigned char times8_119_bits[] = {
+0x15, 0x15, 0x15, 0x0a};
+static unsigned char times8_120_bits[] = {
+0x09, 0x06, 0x06, 0x09};
+static unsigned char times8_121_bits[] = {
+0x05, 0x05, 0x05, 0x02, 0x02, 0x01};
+static unsigned char times8_122_bits[] = {
+0x07, 0x02, 0x01, 0x07};
+static unsigned char times8_123_bits[] = {
+0x04, 0x02, 0x02, 0x03, 0x02, 0x02, 0x04};
+static unsigned char times8_124_bits[] = {
+0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times8_125_bits[] = {
+0x01, 0x02, 0x02, 0x06, 0x02, 0x02, 0x01};
+static unsigned char times8_126_bits[] = {
+0x16, 0x0d};
+static unsigned char times8_127_bits[] = {
+0x00};
+static unsigned char times8_128_bits[] = {
+0x00};
+static unsigned char times8_129_bits[] = {
+0x00};
+static unsigned char times8_130_bits[] = {
+0x00};
+static unsigned char times8_131_bits[] = {
+0x00};
+static unsigned char times8_132_bits[] = {
+0x00};
+static unsigned char times8_133_bits[] = {
+0x00};
+static unsigned char times8_134_bits[] = {
+0x00};
+static unsigned char times8_135_bits[] = {
+0x00};
+static unsigned char times8_136_bits[] = {
+0x00};
+static unsigned char times8_137_bits[] = {
+0x00};
+static unsigned char times8_138_bits[] = {
+0x00};
+static unsigned char times8_139_bits[] = {
+0x00};
+static unsigned char times8_140_bits[] = {
+0x00};
+static unsigned char times8_141_bits[] = {
+0x00};
+static unsigned char times8_142_bits[] = {
+0x00};
+static unsigned char times8_143_bits[] = {
+0x00};
+static unsigned char times8_144_bits[] = {
+0x00};
+static unsigned char times8_145_bits[] = {
+0x00};
+static unsigned char times8_146_bits[] = {
+0x00};
+static unsigned char times8_147_bits[] = {
+0x00};
+static unsigned char times8_148_bits[] = {
+0x00};
+static unsigned char times8_149_bits[] = {
+0x00};
+static unsigned char times8_150_bits[] = {
+0x00};
+static unsigned char times8_151_bits[] = {
+0x00};
+static unsigned char times8_152_bits[] = {
+0x00};
+static unsigned char times8_153_bits[] = {
+0x00};
+static unsigned char times8_154_bits[] = {
+0x00};
+static unsigned char times8_155_bits[] = {
+0x00};
+static unsigned char times8_156_bits[] = {
+0x00};
+static unsigned char times8_157_bits[] = {
+0x00};
+static unsigned char times8_158_bits[] = {
+0x00};
+static unsigned char times8_159_bits[] = {
+0x00};
+static unsigned char times8_160_bits[] = {
+0x00};
+static unsigned char times8_161_bits[] = {
+0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times8_162_bits[] = {
+0x02, 0x06, 0x01, 0x01, 0x06, 0x02};
+static unsigned char times8_163_bits[] = {
+0x04, 0x02, 0x07, 0x02, 0x0f};
+static unsigned char times8_164_bits[] = {
+0x09, 0x06, 0x06, 0x09};
+static unsigned char times8_165_bits[] = {
+0x11, 0x0a, 0x1f, 0x04, 0x04};
+static unsigned char times8_166_bits[] = {
+0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01};
+static unsigned char times8_167_bits[] = {
+0x06, 0x01, 0x03, 0x05, 0x06, 0x04, 0x03};
+static unsigned char times8_168_bits[] = {
+0x09};
+static unsigned char times8_169_bits[] = {
+0x1e, 0x21, 0x29, 0x25, 0x29, 0x21, 0x1e};
+static unsigned char times8_170_bits[] = {
+0x01, 0x02, 0x03, 0x00, 0x03};
+static unsigned char times8_171_bits[] = {
+0x0a, 0x05, 0x05, 0x0a};
+static unsigned char times8_172_bits[] = {
+0x0f, 0x08, 0x08};
+static unsigned char times8_173_bits[] = {
+0x03};
+static unsigned char times8_174_bits[] = {
+0x1e, 0x2d, 0x35, 0x2d, 0x35, 0x21, 0x1e};
+static unsigned char times8_175_bits[] = {
+0x07};
+static unsigned char times8_176_bits[] = {
+0x02, 0x05, 0x02};
+static unsigned char times8_177_bits[] = {
+0x02, 0x07, 0x02, 0x00, 0x07};
+static unsigned char times8_178_bits[] = {
+0x01, 0x02, 0x01, 0x03};
+static unsigned char times8_179_bits[] = {
+0x01, 0x02, 0x01, 0x02, 0x01};
+static unsigned char times8_180_bits[] = {
+0x02, 0x01};
+static unsigned char times8_181_bits[] = {
+0x05, 0x05, 0x05, 0x0b, 0x01};
+static unsigned char times8_182_bits[] = {
+0x1f, 0x0b, 0x0b, 0x0a, 0x0a, 0x0a, 0x0a};
+static unsigned char times8_183_bits[] = {
+0x01};
+static unsigned char times8_184_bits[] = {
+0x02, 0x01};
+static unsigned char times8_185_bits[] = {
+0x03, 0x02, 0x02, 0x07};
+static unsigned char times8_186_bits[] = {
+0x02, 0x05, 0x02, 0x00, 0x07};
+static unsigned char times8_187_bits[] = {
+0x05, 0x0a, 0x0a, 0x05};
+static unsigned char times8_188_bits[] = {
+0x22, 0x12, 0x0a, 0x24, 0x32, 0x39, 0x20};
+static unsigned char times8_189_bits[] = {
+0x22, 0x12, 0x0a, 0x14, 0x22, 0x11, 0x30};
+static unsigned char times8_190_bits[] = {
+0x01, 0x22, 0x11, 0x2a, 0x35, 0x3a, 0x20};
+static unsigned char times8_191_bits[] = {
+0x02, 0x00, 0x02, 0x01, 0x01, 0x02};
+static unsigned char times8_192_bits[] = {
+0x02, 0x04, 0x00, 0x04, 0x04, 0x0a, 0x0e, 0x1b};
+static unsigned char times8_193_bits[] = {
+0x08, 0x04, 0x00, 0x04, 0x04, 0x0a, 0x0e, 0x1b};
+static unsigned char times8_194_bits[] = {
+0x04, 0x0a, 0x00, 0x04, 0x04, 0x0a, 0x0e, 0x1b};
+static unsigned char times8_195_bits[] = {
+0x14, 0x0a, 0x00, 0x04, 0x04, 0x0a, 0x0e, 0x1b};
+static unsigned char times8_196_bits[] = {
+0x0a, 0x00, 0x04, 0x04, 0x0a, 0x0e, 0x1b};
+static unsigned char times8_197_bits[] = {
+0x04, 0x0a, 0x04, 0x04, 0x04, 0x0a, 0x0e, 0x1b};
+static unsigned char times8_198_bits[] = {
+0x3c, 0x0a, 0x3e, 0x0a, 0x3b};
+static unsigned char times8_199_bits[] = {
+0x0e, 0x11, 0x01, 0x11, 0x0e, 0x04, 0x02};
+static unsigned char times8_200_bits[] = {
+0x02, 0x04, 0x00, 0x0f, 0x02, 0x06, 0x02, 0x0f};
+static unsigned char times8_201_bits[] = {
+0x08, 0x04, 0x00, 0x0f, 0x02, 0x06, 0x02, 0x0f};
+static unsigned char times8_202_bits[] = {
+0x04, 0x0a, 0x00, 0x0f, 0x02, 0x06, 0x02, 0x0f};
+static unsigned char times8_203_bits[] = {
+0x0a, 0x00, 0x0f, 0x02, 0x06, 0x02, 0x0f};
+static unsigned char times8_204_bits[] = {
+0x01, 0x02, 0x00, 0x07, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times8_205_bits[] = {
+0x04, 0x02, 0x00, 0x07, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times8_206_bits[] = {
+0x02, 0x05, 0x00, 0x07, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times8_207_bits[] = {
+0x05, 0x00, 0x07, 0x02, 0x02, 0x02, 0x07};
+static unsigned char times8_208_bits[] = {
+0x0f, 0x12, 0x17, 0x12, 0x0f};
+static unsigned char times8_209_bits[] = {
+0x14, 0x0a, 0x00, 0x33, 0x16, 0x1a, 0x12, 0x13};
+static unsigned char times8_210_bits[] = {
+0x02, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char times8_211_bits[] = {
+0x08, 0x04, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char times8_212_bits[] = {
+0x04, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char times8_213_bits[] = {
+0x14, 0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char times8_214_bits[] = {
+0x0a, 0x00, 0x0e, 0x11, 0x11, 0x11, 0x0e};
+static unsigned char times8_215_bits[] = {
+0x09, 0x06, 0x06, 0x09};
+static unsigned char times8_216_bits[] = {
+0x10, 0x0e, 0x19, 0x15, 0x13, 0x0e, 0x01};
+static unsigned char times8_217_bits[] = {
+0x04, 0x08, 0x00, 0x33, 0x12, 0x12, 0x12, 0x0c};
+static unsigned char times8_218_bits[] = {
+0x10, 0x08, 0x00, 0x33, 0x12, 0x12, 0x12, 0x0c};
+static unsigned char times8_219_bits[] = {
+0x08, 0x14, 0x00, 0x33, 0x12, 0x12, 0x12, 0x0c};
+static unsigned char times8_220_bits[] = {
+0x14, 0x00, 0x33, 0x12, 0x12, 0x12, 0x0c};
+static unsigned char times8_221_bits[] = {
+0x08, 0x04, 0x00, 0x1b, 0x0a, 0x0a, 0x04, 0x04};
+static unsigned char times8_222_bits[] = {
+0x03, 0x06, 0x0a, 0x06, 0x03};
+static unsigned char times8_223_bits[] = {
+0x06, 0x09, 0x05, 0x09, 0x05, 0x01};
+static unsigned char times8_224_bits[] = {
+0x01, 0x02, 0x00, 0x01, 0x02, 0x03, 0x03};
+static unsigned char times8_225_bits[] = {
+0x02, 0x01, 0x00, 0x01, 0x02, 0x03, 0x03};
+static unsigned char times8_226_bits[] = {
+0x02, 0x05, 0x00, 0x01, 0x02, 0x03, 0x03};
+static unsigned char times8_227_bits[] = {
+0x0a, 0x05, 0x00, 0x01, 0x02, 0x03, 0x03};
+static unsigned char times8_228_bits[] = {
+0x05, 0x00, 0x00, 0x01, 0x02, 0x03, 0x03};
+static unsigned char times8_229_bits[] = {
+0x02, 0x05, 0x02, 0x01, 0x02, 0x03, 0x03};
+static unsigned char times8_230_bits[] = {
+0x09, 0x1e, 0x07, 0x0b};
+static unsigned char times8_231_bits[] = {
+0x02, 0x01, 0x01, 0x02, 0x01};
+static unsigned char times8_232_bits[] = {
+0x01, 0x02, 0x00, 0x02, 0x07, 0x01, 0x02};
+static unsigned char times8_233_bits[] = {
+0x04, 0x02, 0x00, 0x02, 0x07, 0x01, 0x02};
+static unsigned char times8_234_bits[] = {
+0x02, 0x05, 0x00, 0x02, 0x07, 0x01, 0x02};
+static unsigned char times8_235_bits[] = {
+0x05, 0x00, 0x00, 0x02, 0x07, 0x01, 0x02};
+static unsigned char times8_236_bits[] = {
+0x01, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times8_237_bits[] = {
+0x02, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01};
+static unsigned char times8_238_bits[] = {
+0x02, 0x05, 0x00, 0x02, 0x02, 0x02, 0x02};
+static unsigned char times8_239_bits[] = {
+0x05, 0x00, 0x02, 0x02, 0x02, 0x02};
+static unsigned char times8_240_bits[] = {
+0x05, 0x02, 0x05, 0x0a, 0x0a, 0x04};
+static unsigned char times8_241_bits[] = {
+0x0a, 0x05, 0x00, 0x03, 0x05, 0x05, 0x05};
+static unsigned char times8_242_bits[] = {
+0x01, 0x02, 0x00, 0x02, 0x05, 0x05, 0x02};
+static unsigned char times8_243_bits[] = {
+0x04, 0x02, 0x00, 0x02, 0x05, 0x05, 0x02};
+static unsigned char times8_244_bits[] = {
+0x02, 0x05, 0x00, 0x02, 0x05, 0x05, 0x02};
+static unsigned char times8_245_bits[] = {
+0x0a, 0x05, 0x00, 0x02, 0x05, 0x05, 0x02};
+static unsigned char times8_246_bits[] = {
+0x05, 0x00, 0x00, 0x02, 0x05, 0x05, 0x02};
+static unsigned char times8_247_bits[] = {
+0x02, 0x00, 0x07, 0x00, 0x02};
+static unsigned char times8_248_bits[] = {
+0x04, 0x06, 0x05, 0x05, 0x03, 0x01};
+static unsigned char times8_249_bits[] = {
+0x01, 0x02, 0x00, 0x05, 0x05, 0x05, 0x06};
+static unsigned char times8_250_bits[] = {
+0x04, 0x02, 0x00, 0x05, 0x05, 0x05, 0x06};
+static unsigned char times8_251_bits[] = {
+0x02, 0x05, 0x00, 0x05, 0x05, 0x05, 0x06};
+static unsigned char times8_252_bits[] = {
+0x05, 0x00, 0x05, 0x05, 0x05, 0x06};
+static unsigned char times8_253_bits[] = {
+0x04, 0x02, 0x00, 0x05, 0x05, 0x05, 0x02, 0x02, 0x01};
+static unsigned char times8_254_bits[] = {
+0x03, 0x06, 0x0a, 0x0a, 0x06, 0x02, 0x03};
+static unsigned char times8_255_bits[] = {
+0x05, 0x00, 0x05, 0x05, 0x05, 0x02, 0x02, 0x01};
+static RotFont times8font[] = {
+{5, 1, 1, times8_0_bits},
+{5, 1, 1, times8_1_bits},
+{5, 1, 1, times8_2_bits},
+{5, 1, 1, times8_3_bits},
+{5, 1, 1, times8_4_bits},
+{5, 1, 1, times8_5_bits},
+{5, 1, 1, times8_6_bits},
+{5, 1, 1, times8_7_bits},
+{5, 1, 1, times8_8_bits},
+{5, 1, 1, times8_9_bits},
+{5, 1, 1, times8_10_bits},
+{5, 1, 1, times8_11_bits},
+{5, 1, 1, times8_12_bits},
+{5, 1, 1, times8_13_bits},
+{5, 1, 1, times8_14_bits},
+{5, 1, 1, times8_15_bits},
+{5, 1, 1, times8_16_bits},
+{5, 1, 1, times8_17_bits},
+{5, 1, 1, times8_18_bits},
+{5, 1, 1, times8_19_bits},
+{5, 1, 1, times8_20_bits},
+{5, 1, 1, times8_21_bits},
+{5, 1, 1, times8_22_bits},
+{5, 1, 1, times8_23_bits},
+{5, 1, 1, times8_24_bits},
+{5, 1, 1, times8_25_bits},
+{5, 1, 1, times8_26_bits},
+{5, 1, 1, times8_27_bits},
+{5, 1, 1, times8_28_bits},
+{5, 1, 1, times8_29_bits},
+{5, 1, 1, times8_30_bits},
+{5, 1, 1, times8_31_bits},
+{4, 1, 1, times8_32_bits},
+{1, 6, 6, times8_33_bits},
+{3, 2, 5, times8_34_bits},
+{4, 5, 5, times8_35_bits},
+{3, 7, 6, times8_36_bits},
+{5, 5, 5, times8_37_bits},
+{5, 6, 6, times8_38_bits},
+{1, 2, 6, times8_39_bits},
+{2, 7, 6, times8_40_bits},
+{2, 7, 6, times8_41_bits},
+{3, 3, 5, times8_42_bits},
+{4, 5, 5, times8_43_bits},
+{2, 2, 1, times8_44_bits},
+{4, 1, 3, times8_45_bits},
+{1, 1, 1, times8_46_bits},
+{3, 7, 6, times8_47_bits},
+{3, 5, 5, times8_48_bits},
+{3, 5, 5, times8_49_bits},
+{3, 5, 5, times8_50_bits},
+{3, 5, 5, times8_51_bits},
+{4, 5, 5, times8_52_bits},
+{3, 5, 5, times8_53_bits},
+{3, 5, 5, times8_54_bits},
+{3, 5, 5, times8_55_bits},
+{3, 5, 5, times8_56_bits},
+{3, 5, 5, times8_57_bits},
+{1, 3, 3, times8_58_bits},
+{2, 4, 3, times8_59_bits},
+{3, 5, 5, times8_60_bits},
+{4, 3, 4, times8_61_bits},
+{3, 5, 5, times8_62_bits},
+{3, 5, 5, times8_63_bits},
+{6, 7, 6, times8_64_bits},
+{5, 5, 5, times8_65_bits},
+{4, 5, 5, times8_66_bits},
+{5, 5, 5, times8_67_bits},
+{5, 5, 5, times8_68_bits},
+{4, 5, 5, times8_69_bits},
+{4, 5, 5, times8_70_bits},
+{5, 5, 5, times8_71_bits},
+{6, 5, 5, times8_72_bits},
+{3, 5, 5, times8_73_bits},
+{2, 5, 5, times8_74_bits},
+{5, 5, 5, times8_75_bits},
+{4, 5, 5, times8_76_bits},
+{7, 5, 5, times8_77_bits},
+{6, 5, 5, times8_78_bits},
+{5, 5, 5, times8_79_bits},
+{5, 5, 5, times8_80_bits},
+{5, 7, 5, times8_81_bits},
+{5, 5, 5, times8_82_bits},
+{4, 5, 5, times8_83_bits},
+{5, 5, 5, times8_84_bits},
+{6, 5, 5, times8_85_bits},
+{5, 5, 5, times8_86_bits},
+{8, 5, 5, times8_87_bits},
+{6, 5, 5, times8_88_bits},
+{5, 5, 5, times8_89_bits},
+{4, 5, 5, times8_90_bits},
+{2, 7, 6, times8_91_bits},
+{3, 7, 6, times8_92_bits},
+{2, 7, 6, times8_93_bits},
+{3, 2, 6, times8_94_bits},
+{4, 1, 0, times8_95_bits},
+{1, 2, 6, times8_96_bits},
+{2, 4, 4, times8_97_bits},
+{3, 5, 5, times8_98_bits},
+{2, 4, 4, times8_99_bits},
+{3, 5, 5, times8_100_bits},
+{3, 4, 4, times8_101_bits},
+{3, 5, 5, times8_102_bits},
+{4, 5, 4, times8_103_bits},
+{3, 5, 5, times8_104_bits},
+{1, 6, 6, times8_105_bits},
+{2, 8, 6, times8_106_bits},
+{3, 5, 5, times8_107_bits},
+{1, 5, 5, times8_108_bits},
+{5, 4, 4, times8_109_bits},
+{3, 4, 4, times8_110_bits},
+{3, 4, 4, times8_111_bits},
+{3, 6, 4, times8_112_bits},
+{3, 6, 4, times8_113_bits},
+{3, 4, 4, times8_114_bits},
+{2, 4, 4, times8_115_bits},
+{2, 5, 5, times8_116_bits},
+{3, 4, 4, times8_117_bits},
+{3, 4, 4, times8_118_bits},
+{5, 4, 4, times8_119_bits},
+{4, 4, 4, times8_120_bits},
+{3, 6, 4, times8_121_bits},
+{3, 4, 4, times8_122_bits},
+{3, 7, 6, times8_123_bits},
+{1, 7, 6, times8_124_bits},
+{3, 7, 6, times8_125_bits},
+{5, 2, 4, times8_126_bits},
+{5, 1, 1, times8_127_bits},
+{5, 1, 1, times8_128_bits},
+{5, 1, 1, times8_129_bits},
+{5, 1, 1, times8_130_bits},
+{5, 1, 1, times8_131_bits},
+{5, 1, 1, times8_132_bits},
+{5, 1, 1, times8_133_bits},
+{5, 1, 1, times8_134_bits},
+{5, 1, 1, times8_135_bits},
+{5, 1, 1, times8_136_bits},
+{5, 1, 1, times8_137_bits},
+{5, 1, 1, times8_138_bits},
+{5, 1, 1, times8_139_bits},
+{5, 1, 1, times8_140_bits},
+{5, 1, 1, times8_141_bits},
+{5, 1, 1, times8_142_bits},
+{5, 1, 1, times8_143_bits},
+{5, 1, 1, times8_144_bits},
+{5, 1, 1, times8_145_bits},
+{5, 1, 1, times8_146_bits},
+{5, 1, 1, times8_147_bits},
+{5, 1, 1, times8_148_bits},
+{5, 1, 1, times8_149_bits},
+{5, 1, 1, times8_150_bits},
+{5, 1, 1, times8_151_bits},
+{5, 1, 1, times8_152_bits},
+{5, 1, 1, times8_153_bits},
+{5, 1, 1, times8_154_bits},
+{5, 1, 1, times8_155_bits},
+{5, 1, 1, times8_156_bits},
+{5, 1, 1, times8_157_bits},
+{5, 1, 1, times8_158_bits},
+{5, 1, 1, times8_159_bits},
+{1, 1, 1, times8_160_bits},
+{1, 7, 5, times8_161_bits},
+{3, 6, 5, times8_162_bits},
+{4, 5, 5, times8_163_bits},
+{4, 4, 4, times8_164_bits},
+{5, 5, 5, times8_165_bits},
+{1, 7, 6, times8_166_bits},
+{3, 7, 6, times8_167_bits},
+{4, 1, 7, times8_168_bits},
+{6, 7, 6, times8_169_bits},
+{2, 5, 6, times8_170_bits},
+{4, 4, 4, times8_171_bits},
+{4, 3, 4, times8_172_bits},
+{2, 1, 3, times8_173_bits},
+{6, 7, 6, times8_174_bits},
+{3, 1, 7, times8_175_bits},
+{3, 3, 5, times8_176_bits},
+{3, 5, 5, times8_177_bits},
+{2, 4, 6, times8_178_bits},
+{2, 5, 6, times8_179_bits},
+{2, 2, 7, times8_180_bits},
+{4, 5, 4, times8_181_bits},
+{5, 7, 6, times8_182_bits},
+{1, 1, 3, times8_183_bits},
+{2, 2, 0, times8_184_bits},
+{3, 4, 6, times8_185_bits},
+{3, 5, 6, times8_186_bits},
+{4, 4, 4, times8_187_bits},
+{6, 7, 6, times8_188_bits},
+{6, 7, 6, times8_189_bits},
+{6, 7, 6, times8_190_bits},
+{2, 6, 5, times8_191_bits},
+{5, 8, 8, times8_192_bits},
+{5, 8, 8, times8_193_bits},
+{5, 8, 8, times8_194_bits},
+{5, 8, 8, times8_195_bits},
+{5, 7, 7, times8_196_bits},
+{5, 8, 8, times8_197_bits},
+{6, 5, 5, times8_198_bits},
+{5, 7, 5, times8_199_bits},
+{4, 8, 8, times8_200_bits},
+{4, 8, 8, times8_201_bits},
+{4, 8, 8, times8_202_bits},
+{4, 7, 7, times8_203_bits},
+{3, 8, 8, times8_204_bits},
+{3, 8, 8, times8_205_bits},
+{3, 8, 8, times8_206_bits},
+{3, 7, 7, times8_207_bits},
+{5, 5, 5, times8_208_bits},
+{6, 8, 8, times8_209_bits},
+{5, 8, 8, times8_210_bits},
+{5, 8, 8, times8_211_bits},
+{5, 8, 8, times8_212_bits},
+{5, 8, 8, times8_213_bits},
+{5, 7, 7, times8_214_bits},
+{4, 4, 4, times8_215_bits},
+{5, 7, 6, times8_216_bits},
+{6, 8, 8, times8_217_bits},
+{6, 8, 8, times8_218_bits},
+{6, 8, 8, times8_219_bits},
+{6, 7, 7, times8_220_bits},
+{5, 8, 8, times8_221_bits},
+{4, 5, 5, times8_222_bits},
+{4, 6, 5, times8_223_bits},
+{2, 7, 7, times8_224_bits},
+{2, 7, 7, times8_225_bits},
+{3, 7, 7, times8_226_bits},
+{4, 7, 7, times8_227_bits},
+{3, 7, 7, times8_228_bits},
+{3, 7, 7, times8_229_bits},
+{5, 4, 4, times8_230_bits},
+{2, 5, 4, times8_231_bits},
+{3, 7, 7, times8_232_bits},
+{3, 7, 7, times8_233_bits},
+{3, 7, 7, times8_234_bits},
+{3, 7, 7, times8_235_bits},
+{2, 7, 7, times8_236_bits},
+{2, 7, 7, times8_237_bits},
+{3, 7, 7, times8_238_bits},
+{3, 6, 6, times8_239_bits},
+{4, 6, 6, times8_240_bits},
+{4, 7, 7, times8_241_bits},
+{3, 7, 7, times8_242_bits},
+{3, 7, 7, times8_243_bits},
+{3, 7, 7, times8_244_bits},
+{4, 7, 7, times8_245_bits},
+{3, 7, 7, times8_246_bits},
+{3, 5, 5, times8_247_bits},
+{3, 6, 5, times8_248_bits},
+{3, 7, 7, times8_249_bits},
+{3, 7, 7, times8_250_bits},
+{3, 7, 7, times8_251_bits},
+{3, 6, 6, times8_252_bits},
+{3, 9, 7, times8_253_bits},
+{4, 7, 5, times8_254_bits},
+{3, 8, 6, times8_255_bits}};
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/DrawRotString.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/DrawRotString.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/DrawRotString.c	(revision 15879)
@@ -0,0 +1,242 @@
+# include <kapa_internal.h>
+
+# define NROTCHARS 256
+# define XPROC(x,y) (scale*(cs*((x) - x0) - sn*((y) - y0)) + X0)
+# define YPROC(x,y) (scale*(cs*((y) - y0) + sn*((x) - x0)) + Y0)
+# define NEARINT(x) ((x < 0) ? ((int)(x - 0.5)) : ((int)(x + 0.5)))
+  
+static Display *RotDisplay;
+static Window   RotWindow;
+static GC       RotGC;
+static unsigned long RotForeground;
+static unsigned long RotBackground;
+
+int DrawRotTextInit (Display *display, Window window, GC gc, unsigned long fore, unsigned long back) {
+
+    RotDisplay = display;
+    RotWindow  = window;
+    RotGC      = gc;
+    RotForeground = fore;
+    RotBackground = back;
+
+    return (TRUE);
+}
+
+int DrawRotText (int x, int y, char *string, int pos, double angle) {
+
+  unsigned char *bitmap;
+  char *currentname, basename[64]; 
+  int i, dy, dx, N, X, Y, code;
+  int dX, Xoff, dY, Yoff, YoffBase;
+  int currentsize, basesize;
+  double cs, sn, currentscale;
+  RotFont *currentfont;
+
+  currentname = GetRotFont (&currentsize);
+  currentfont = GetRotFontData (&currentscale);
+  strcpy (basename, currentname);
+  basesize = currentsize;
+
+  /* strip leading WHITESPACE */
+  stripwhite (string);
+  if (*string == 0) return (FALSE);
+  
+  /* compute string length */
+  cs = cos(angle*RAD_DEG);
+  sn = sin(angle*RAD_DEG);
+  dX = RotStrlen (string);
+  dY = currentfont[65].ascent;
+
+  /* apply appropriate offset */
+  Xoff = Yoff = 0;
+  switch (pos) {
+  case 0: Xoff =     -dX; Yoff = dY; break;
+  case 1: Xoff = -0.5*dX; Yoff = dY; break;
+  case 2: Xoff =       0; Yoff = dY; break;
+  case 3: Xoff =     -dX; Yoff = 0.5*dY; break;
+  case 4: Xoff = -0.5*dX; Yoff = 0.5*dY; break;
+  case 5: Xoff =       0; Yoff = 0.5*dY; break;
+  case 6: Xoff =     -dX; Yoff = 0; break;
+  case 7: Xoff = -0.5*dX; Yoff = 0; break;
+  case 8: Xoff =       0; Yoff = 0; break;
+  }
+
+  code = FALSE;
+
+  YoffBase = Yoff;
+  /* draw characters one-by-one */
+  for (i = 0; i < strlen(string); i++) {
+    N = (int)(string[i]);
+    if ((N < 0) || (N >= NROTCHARS)) continue;
+
+    /* check for special characters */
+    if (!code) {
+      if (N == 94) {
+	SetRotFont (currentname, (int)(0.8*currentsize));
+	currentfont = GetRotFontData (&currentscale);
+	Yoff -= 0.5*currentscale*dY;
+	continue;
+      }
+      if (N == 95) { 
+	SetRotFont (currentname, (int)(0.8*currentsize));
+	currentfont = GetRotFontData (&currentscale);
+	Yoff += 0.5*currentscale*dY;
+	continue;
+      }
+      if (N == 124) {
+	SetRotFont (currentname, basesize);
+	currentfont = GetRotFontData (&currentscale);
+	Yoff = YoffBase;
+	continue;
+      }
+      if (N == 92) {
+	code = TRUE;
+	continue;
+      } 
+      if (N == 38) {
+	if (string[i+1] == 'h') {
+	  SetRotFont ("helvetica", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	}
+	if (string[i+1] == 't') {
+	  SetRotFont ("times", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	}
+	if (string[i+1] == 'c') {
+	  SetRotFont ("courier", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	}
+	if (string[i+1] == 's') {
+	  SetRotFont ("symbol", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	}
+	i++;
+	continue;
+      }
+    }
+    code = FALSE;
+
+    bitmap = currentfont[N].bits;
+    dx = currentfont[N].dx;
+    dy = currentfont[N].dy;
+    X = x + (int)(Xoff*cs - Yoff*sn) + (int)(currentscale*currentfont[N].ascent*sn);
+    Y = y + (int)(Xoff*sn + Yoff*cs) - (int)(currentscale*currentfont[N].ascent*cs);
+    DrawRotBitmap (X, Y, dx, dy, bitmap, TRUE, angle, currentscale);
+    Xoff += 1 + (int)(currentscale*dx + 0.5);
+  }
+  SetRotFont (basename, basesize);
+  return (TRUE);
+}
+
+int DrawRotBitmap (int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale) {
+
+  int ii, jj, byte_line, byte, bit, flag;
+  unsigned long int fore, back;
+  double i, j, cs, sn, rscale, tmp;
+  int X, Y, X0, X1, X2, Y0, Y1, Y2, x0, y0;
+
+  if (mode) {
+    fore = RotForeground;
+    back = RotBackground;
+  } else {
+    fore = RotBackground;
+    back = RotForeground;
+  } 
+    
+  byte_line = (int) ((dx + 7) / 8);
+
+  cs = cos(angle*RAD_DEG);  sn = sin(angle*RAD_DEG);
+  rscale = 1.0 / scale;
+
+  X0 = 0;
+  Y0 = 0;
+  x0 = 0;
+  y0 = 0;
+
+  X2 = X1 = XPROC (0,0);
+  Y2 = Y1 = YPROC (0,0);
+
+  X = XPROC (dx,0);
+  Y = YPROC (dx,0);
+# ifdef DRAWBOXES
+  XDrawLine (RotDisplay, RotWindow, RotGC, x+X, y+Y, x+X1, y+Y1);
+  Xt = X;
+  Yt = Y;
+# endif
+  X1 = MIN (X, X1);
+  X2 = MAX (X, X2);
+  Y1 = MIN (Y, Y1);
+  Y2 = MAX (Y, Y2);
+
+  X = XPROC (dx,dy);
+  Y = YPROC (dx,dy);
+# ifdef DRAWBOXES
+  XDrawLine (RotDisplay, RotWindow, RotGC, x+X, y+Y, x+Xt, y+Yt);
+  Xt = X;
+  Yt = Y;
+# endif
+  Y1 = MIN (Y, Y1);
+  Y2 = MAX (Y, Y2);
+  X1 = MIN (X, X1);
+  X2 = MAX (X, X2);
+
+  X = XPROC (0,dy);
+  Y = YPROC (0,dy);
+# ifdef DRAWBOXES
+  XDrawLine (RotDisplay, RotWindow, RotGC, x+X, y+Y, x+Xt, y+Yt);
+  Xt = X;
+  Yt = Y;
+# endif
+  Y1 = MIN (Y, Y1);
+  Y2 = MAX (Y, Y2);
+  X1 = MIN (X, X1);
+  X2 = MAX (X, X2);
+
+  XSetForeground (RotDisplay, RotGC, fore);
+  if (scale > 1) {
+    for (i = X1; i <= X2; i+=1) {
+      for (j = Y1; j <= Y2; j+=1) {
+	tmp = rscale*(cs*(i - X0) + sn*(j - Y0)) + x0;  ii = NEARINT (tmp);
+	tmp = rscale*(cs*(j - Y0) - sn*(i - X0)) + y0;  jj = NEARINT (tmp);
+	/* fprintf (stderr, "%d %d  %d %d\n", i, j, ii, jj);  */
+	if ((ii < 0) || (ii >= dx) || (jj < 0) || (jj >= dy)) continue;
+	byte = byte_line * jj + (ii / 8);
+	bit = ii % 8;
+	flag = 0x01 & (bitmap[byte] >> bit);
+	if (flag) XDrawPoint (RotDisplay, RotWindow, RotGC, x + i, y + j);
+      }
+    }
+  } else {
+    for (i = X1; i <= X2; i+=scale) {
+      for (j = Y1; j <= Y2; j+=scale) {
+	tmp = rscale*(cs*(i - X0) + sn*(j - Y0)) + x0;  ii = NEARINT (tmp);
+	tmp = rscale*(cs*(j - Y0) - sn*(i - X0)) + y0;  jj = NEARINT (tmp);
+	/* fprintf (stderr, "%d %d  %d %d\n", i, j, ii, jj);  */
+	if ((ii < 0) || (ii >= dx) || (jj < 0) || (jj >= dy)) continue;
+	byte = byte_line * jj + (ii / 8);
+	bit = ii % 8;
+	flag = 0x01 & (bitmap[byte] >> bit);
+	/* fprintf (stderr, "%2d %2d  %3d %3d  %1d  %f  %f\n", i, j, ii, jj, flag,
+	   rscale*(cs*(i - X0) + sn*(j - Y0)) + x0, rscale*(cs*(j - Y0) - sn*(i - X0)) + y0);  */
+	if (flag) XDrawPoint (RotDisplay, RotWindow, RotGC, x + i, y + j);
+      }
+    }
+# if (0)
+    for (i = 0; i < dx; i++) {
+      for (j = 0; j < dy; j++) {
+	tmp = scale*(cs*(i - x0) - sn*(j - y0)) + X0; ii = NEARINT (tmp);
+	tmp = scale*(cs*(j - y0) + sn*(i - x0)) + Y0; jj = NEARINT (tmp);
+	/* if ((ii < 0) || (ii >= dx) || (jj < 0) || (jj >= dy)) continue; */
+	byte = byte_line * j + (i / 8);
+	bit = i % 8;
+	flag = 0x01 & (bitmap[byte] >> bit);
+	fprintf (stderr, "%2d %2d  %3d %3d  %1d  %f  %f\n", i, j, ii, jj, flag, 
+		 scale*(cs*(i - x0) - sn*(j - y0)) + X0, scale*(cs*(j - y0) + sn*(i - x0)) + Y0); 
+	if (flag) XDrawPoint (RotDisplay, RotWindow, RotGC, x + ii, y + jj);
+      }
+    }
+# endif
+  }
+  XSetForeground (RotDisplay, RotGC, RotForeground);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/IOfuncs.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/IOfuncs.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/IOfuncs.c	(revision 15879)
@@ -0,0 +1,163 @@
+# include <kapa_internal.h>
+
+/** these function expect to operate with a BLOCKing socket **/
+
+/* why is this not defined in stdarg.h for linux/x64? */
+int vsscanf(const char *str, const char *format, va_list ap);
+
+int KiiSendData (int device, char *data, int Nbytes) {
+
+  KiiSendCommand (device, 16, "LEN: %11d", Nbytes);
+  write (device, data, Nbytes);
+  return (TRUE);
+} 
+
+char *KiiRecvData (int device) {
+
+  int status, Nbytes;
+  char *data, buffer[20];
+
+  /* read 16 bytes: LEN (length) */
+  status = read (device, buffer, 16);
+  buffer[16] = 0;
+
+  /* find the message length, allocate space */
+  sscanf (buffer, "%*s %d", &Nbytes);
+  ALLOCATE (data, char, Nbytes + 1);
+  read (device, data, Nbytes);
+  data[Nbytes] = 0;
+
+  return (data);
+} 
+
+/* send a message of arbitrary size, sending the size first */
+int KiiSendMessage (int device, char *format, ...) {
+
+  int Nbyte, status;
+  char tmp;
+  va_list argp;  
+
+  va_start (argp, format);
+  Nbyte = vsnprintf (&tmp, 0, format, argp);
+  va_end (argp);
+
+  if (!Nbyte) return (FALSE);
+
+  /* the message may contain up to 99,999,999,999 bytes (100MB) */
+  va_start (argp, format);
+  KiiSendCommand (device, 16, "LEN: %11d", Nbyte);
+  status = KiiSendCommandV (device, Nbyte, format, argp);
+  va_end (argp);
+
+  return (status);
+}
+
+/* scan a message of arbitrary size, accepting the size first */
+int KiiScanMessage (int device, char *format, ...) {
+
+  int Nbytes, status;
+  char buffer[20], *message;
+  va_list argp;  
+
+  /* read 16 bytes: LEN (length) */
+  status = read (device, buffer, 16);
+  buffer[16] = 0;
+  if (status != 16) fprintf (stderr, "dropped message length\n");
+
+  /* find the message length, allocate space */
+  sscanf (buffer, "%*s %d", &Nbytes);
+  ALLOCATE (message, char, Nbytes + 1);
+
+  /* read Nbytes from the device */
+  status = read (device, message, Nbytes);
+  if (status != Nbytes) fprintf (stderr, "Kii/Kapa comm error\n");
+  message[status] = 0;
+  /* make the string easy to parse */
+
+  // fprintf (stderr, "recv: %s\n", message);
+
+  /* scan the incoming message */
+  va_start (argp, format);
+  Nbytes = vsscanf (message, format, argp);
+  va_end (argp);
+
+  return (status);
+}
+
+/* send a command of fixed size */
+int KiiSendCommand (int device, int length, char *format, ...) {
+
+  int status;
+  va_list argp;  
+
+  va_start (argp, format);
+  status = KiiSendCommandV (device, length, format, argp);
+  va_end (argp);
+
+  return (status);
+}
+  
+int KiiSendCommandV (int device, int length, char *format, va_list argp) {
+
+  char *string;
+
+  /* string is sent WITHOUT ending NULL char */
+  /* allocate and zero length + 1 extra byte */
+  ALLOCATE (string, char, length + 1);
+  memset (string, 0, length + 1);
+  vsnprintf (string, length + 1, format, argp);
+
+  write (device, string, length);
+
+  // fprintf (stderr, "send: %s\n", string);
+
+  free (string);
+  return (TRUE);
+}
+
+/* scan a command of fixed size */
+int KiiScanCommand (int device, int length, char *format, ...) {
+
+  int status;
+  char *message;
+  va_list argp;  
+
+  ALLOCATE (message, char, length + 1);
+
+  /* read Nbytes from the device */
+  status = read (device, message, length);
+
+  if (status != length) {
+      fprintf (stderr, "Kii/Kapa comm error\n");
+      return (0);
+  }
+  message[status] = 0; // make the string easy to parse
+
+  /* scan the incoming message */
+  va_start (argp, format);
+  vsscanf (message, format, argp);
+  va_end (argp);
+
+  return (1);
+}
+
+int KiiWaitAnswer (int device, char *expect) {
+
+  int Nbytes;
+  char *answer;
+
+  Nbytes = strlen (expect);
+  ALLOCATE (answer, char, Nbytes + 1);
+
+  KiiScanCommand (device, Nbytes, "%s", answer);
+  if (strcmp (answer, expect)) {
+      fprintf (stderr, "unexpected response %s, expected %s\n", answer, expect); 
+      REALLOCATE (answer, char, 128);
+      Nbytes = read (device, answer, 127);
+      answer[Nbytes] = 0;
+      fprintf (stderr, "extra data in buffer: %d bytes\n", Nbytes);
+      fprintf (stderr, "garbage: %s\n", answer);
+      return (FALSE);
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/KapaColors.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/KapaColors.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/KapaColors.c	(revision 15879)
@@ -0,0 +1,103 @@
+# include <kapa_internal.h>
+
+# define N_KAPA_COLORS 23
+
+static char KAPA_COLORS[N_KAPA_COLORS][3][16] = {
+{"black",    	 "black",    	 "0.00 0.00 0.00"}, 
+{"white",    	 "white",    	 "1.00 1.00 1.00"}, 
+{"red",      	 "red",      	 "1.00 0.00 0.00"}, 
+{"pink",     	 "pink",     	 "1.00 0.75 0.80"}, 
+{"orange",   	 "orange",   	 "1.00 0.65 0.00"}, 
+{"yellow",   	 "yellow",   	 "1.00 1.00 0.00"}, 
+{"wheat",    	 "wheat",    	 "0.96 0.87 0.70"}, 
+{"gold",     	 "gold",     	 "1.00 0.84 0.00"}, 
+{"green",    	 "green",    	 "0.00 1.00 0.00"}, 
+{"darkgreen",	 "darkgreen",	 "0.00 0.40 0.00"}, 
+{"blue",     	 "blue",     	 "0.00 0.00 1.00"}, 
+{"skyblue",  	 "skyblue",  	 "0.53 0.81 0.92"}, 
+{"indigo",   	 "mediumpurple", "0.57 0.44 0.86"}, 
+{"violet",   	 "darkviolet", 	 "0.58 0.00 0.88"},
+{"grey10",   	 "grey10",   	 "0.10 0.10 0.10"},
+{"grey20",   	 "grey20",   	 "0.20 0.20 0.20"},
+{"grey30",   	 "grey30",   	 "0.30 0.30 0.30"},
+{"grey40",   	 "grey40",   	 "0.40 0.40 0.40"},
+{"grey50",   	 "grey50",   	 "0.50 0.50 0.50"},
+{"grey60",   	 "grey60",   	 "0.60 0.60 0.60"},
+{"grey70",   	 "grey70",   	 "0.70 0.70 0.70"},
+{"grey80",   	 "grey80",   	 "0.80 0.80 0.80"},
+{"grey90",   	 "grey90",   	 "0.90 0.90 0.90"}};
+
+int KapaColorByName (char *name) {
+
+  int i;
+  
+  for (i = 0; i < N_KAPA_COLORS; i++) {
+    if (!strcmp (name, KAPA_COLORS[i][0])) {
+      return (i);
+    }	
+  }
+  fprintf (stderr, "color may be one of:\n");
+  for (i = 0; i < N_KAPA_COLORS; i++) {
+    fprintf (stderr, "  %s\n", KAPA_COLORS[i][0]);
+  }
+  return (-1);
+}	
+
+int KapaColormapSize () {
+  return (N_KAPA_COLORS);
+}
+
+char *KapaColorRGBString (int N) {
+  return (KAPA_COLORS[N][2]);
+}
+
+char *KapaColorName (int N) {
+  return (KAPA_COLORS[N][0]);
+}
+
+png_color *KapaPNGPalette (int *Npalette) {
+
+  int i;
+  float red, green, blue;
+  png_color *palette;
+
+  ALLOCATE (palette, png_color, N_KAPA_COLORS);
+
+  /* define the palette */
+  for (i = 0; i < N_KAPA_COLORS; i++) {
+    sscanf (KAPA_COLORS[i][2], "%f %f %f", &red, &green, &blue);
+    palette[i].red = (0xff * red);
+    palette[i].green = (0xff * green);
+    palette[i].blue = (0xff * blue);
+  }
+  *Npalette = N_KAPA_COLORS;
+  return (palette);
+}
+
+unsigned long *KapaX11colors (Display *display, Colormap colormap, unsigned long default_color, int *Ncolors) {
+
+  int i;
+  int status;
+  unsigned long *colors;
+  XColor rgbcolor, hardwarecolor;
+
+  *Ncolors = N_KAPA_COLORS;
+  ALLOCATE (colors, unsigned long, N_KAPA_COLORS);
+
+  for (i = 0; i < N_KAPA_COLORS; i++) {
+    colors[i] = default_color;
+    status = XLookupColor (display, colormap, KAPA_COLORS[i][1], &rgbcolor, &hardwarecolor);
+    if (!status) continue;
+    status = XAllocColor (display, colormap, &hardwarecolor);
+    if (!status) continue;
+    colors[i] = hardwarecolor.pixel;
+  }
+  return (colors);
+}
+
+/*
+
+kapa objects, bDraw, and png all use the same pallete sequence, defined by
+KAPA_COLORS above.  the color correspond to a color sequence.  
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/KapaOpen.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/KapaOpen.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/KapaOpen.c	(revision 15879)
@@ -0,0 +1,315 @@
+# include "kapa_internal.h"
+
+# define MY_PORT 2500
+# define MY_WAIT 100000
+# define DEBUG 0
+
+static int Nvalid = 0;
+static int *VALID = NULL;
+
+int KapaServerInit (KapaSockAddress *Address) {
+
+  int status, InitSocket, length;
+
+  Address[0].sin_family = AF_INET;
+  Address[0].sin_port   = MY_PORT;
+  Address[0].sin_addr.s_addr = INADDR_ANY; // use this line to bind any address / port?
+
+retry_server:
+
+  length = sizeof(Address[0]);
+
+  InitSocket = socket (PF_INET, SOCK_STREAM, 0);
+  if (InitSocket == -1) {
+    perror ("socket: ");
+    exit (2);
+  }
+
+  if (DEBUG) fprintf (stderr, "init sock: %d, len: %d\n", InitSocket, length);
+  status = bind (InitSocket, (struct sockaddr *) Address, length);
+  if (status == -1) {
+    if (errno == EADDRINUSE) {
+	close (InitSocket);
+	Address[0].sin_port ++;
+	if (Address[0].sin_port > MY_PORT + 10) exit (2);
+	goto retry_server;
+    }
+    perror ("bind: ");
+    exit (2);
+  }
+
+  /* repeated starts of the server are limited by xinetd or something:
+     requires 60sec timeout of the selected socket */
+
+  if (DEBUG) fprintf (stderr, "bound to port: %d\n", Address[0].sin_port);
+  status = listen (InitSocket, 10);
+  if (status == -1) {
+    perror ("listen: ");
+    exit (2);
+  }
+  return (InitSocket);
+}
+
+int KapaServerWait (int InitSocket, KapaSockAddress *Address) {
+
+  int i, status, BindSocket;
+  KapaSockAddress Address_in;
+  socklen_t length;
+  u_int32_t addr;
+  fd_set rfds;
+  struct timeval wait;
+
+  Address_in = Address[0];
+
+  length = sizeof(Address_in);
+
+  wait.tv_sec = 0;
+  wait.tv_usec = MY_WAIT;
+
+  /* do I need to clear rfds on each pass? */
+  FD_SET (InitSocket, &rfds);
+  status = select (InitSocket + 1, &rfds, NULL, NULL, &wait);
+  if (status == -1) {
+    perror ("select");
+    abort ();
+  }
+  if (!status) return (-1);
+
+  if (DEBUG) fprintf (stderr, "init sock: %d, len: %d\n", InitSocket, length);
+  BindSocket = accept (InitSocket, (struct sockaddr *) &Address_in, &length);
+  if (DEBUG) fprintf (stderr, "bind sock: %d\n", BindSocket);
+  if (BindSocket == -1) {
+    perror ("accept: ");
+    exit (2);
+  }
+
+  addr = Address_in.sin_addr.s_addr;
+  if (DEBUG) {
+    fprintf (stderr, "incoming connection from: ");
+    fprintf (stderr, " %u", (0xff & (addr >>  0)));
+    fprintf (stderr, ".%u", (0xff & (addr >>  8)));
+    fprintf (stderr, ".%u", (0xff & (addr >> 16)));
+    fprintf (stderr, ".%u", (0xff & (addr >> 24)));
+    fprintf (stderr, "\n");
+  }
+
+  if (Nvalid == 0) goto accepted;
+
+  for (i = 0; i < Nvalid; i++) {
+    /* valid IP addresses may be machines (120.90.121.142) or 
+       class C networks (120.90.121.0) */
+       
+    /* for machine, address must match */
+    if ((0xff & (VALID[i] >> 24)) != 0) {
+      if (addr == VALID[i]) goto accepted;
+    }
+
+    /* for network, lower three bytes of address must match */
+    if ((0xff & (VALID[i] >> 24)) == 0) {
+      if ((0x00ffffff & addr) == VALID[i]) goto accepted;
+    }
+  }
+
+  if (DEBUG) fprintf (stderr, "connection rejected\n");
+  close (BindSocket);
+  return (-1);
+
+accepted:
+  if (DEBUG) fprintf (stderr, "connection accepted\n");
+  return (BindSocket);
+}
+
+/* load valid ip list */
+int KapaDefineValidIP (char *ipstring) {
+
+  int ip1, ip2, ip3, ip4, test, status;
+  char string[80];
+
+  if (Nvalid == 0) {
+    Nvalid = 1;
+    ALLOCATE (VALID, int, Nvalid);
+  } else {
+    Nvalid ++;
+    REALLOCATE (VALID, int, Nvalid);
+  }
+
+  status = sscanf (ipstring, "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4);
+  test = TRUE;
+  test &= (status == 4);
+  test &= ((ip1 > 0) && (ip1 < 256)); 
+  test &= ((ip2 > 0) && (ip2 < 256)); 
+  test &= ((ip3 > 0) && (ip3 < 256)); 
+  test &= ((ip4 >=0) && (ip4 < 256)); 
+  if (!test) {
+    fprintf (stderr, "invalid IP address %s\n", string);
+    exit (2);
+  }
+  VALID[Nvalid-1] = ip1 | (ip2 << 8) | (ip3 << 16) | (ip4 << 24);
+  return (TRUE);
+}
+
+/* connect to a running server on the specified host */
+int KapaClientSocket (char *hostname) {
+
+  int i, status, InitSocket, length;
+  KapaSockAddress Address;
+  struct hostent  *host;
+  char tmpline[80], hostip[80];
+
+  host = gethostbyname (hostname);
+  bzero (hostip, 80);
+  for (i = 0; i < host[0].h_length; i++) {
+    sprintf (tmpline, "%u", (0xff & host[0].h_addr[i]));
+    strcat (hostip, tmpline);
+    if (i < host[0].h_length - 1) strcat (hostip, ".");
+  }
+
+  if (DEBUG) {
+    fprintf (stderr, "trying %s (%s:%d)...", host[0].h_name, hostip, MY_PORT);
+  }
+
+  Address.sin_family = AF_INET;
+  Address.sin_port   = MY_PORT;
+
+retry_client:
+  status = inet_aton (hostip, &Address.sin_addr);
+  if (!status) {
+    fprintf (stderr, "invalid address\n");
+    exit (2);
+  }
+
+  length = sizeof(Address);
+
+  InitSocket = socket (PF_INET, SOCK_STREAM, 0);
+  if (InitSocket == -1) {
+    perror ("socket: ");
+    exit (2);
+  }
+
+  status = connect (InitSocket, (struct sockaddr *) &Address, length);
+  if (status == -1) {
+    if (DEBUG) fprintf (stderr, "error connecting: %d\n", errno);
+    if (errno == ECONNREFUSED) {
+      close (InitSocket);
+      Address.sin_port ++;
+      if (Address.sin_port > MY_PORT + 10) return (-1);
+      goto retry_client;
+    }
+    perror ("connect: ");
+    exit (2);
+  }
+
+  if (DEBUG) fprintf (stderr, "connected on port: %d\n", Address.sin_port);
+  if (DEBUG) fprintf (stderr, "connected\n");
+
+  // the client uses a BLOCKing socket by default
+  fcntl (InitSocket, F_SETFL, !O_NONBLOCK); 
+  return (InitSocket);
+}
+
+int KapaOpen (char *kapa_exec, char *kapa_name) {
+
+  // kapa_exec may be kapa://host, in which case we attempt to connect to an 
+  // already running kapa, or the program path, in which case we are supposed
+  // to launch it locally, then connect to it.
+
+  int sock, Ntry;
+  char line[128];
+
+  if (!strncmp (kapa_exec, "kapa://", 7)) {
+    sock = KapaClientSocket (&kapa_exec[7]);
+    return (sock);
+  }
+
+  if (kapa_name == NULL) {
+    sprintf (line, "%s &", kapa_exec);
+  } else {
+    sprintf (line, "%s -name '%s' &", kapa_exec, kapa_name);
+  }
+  system (line);
+
+# define NTRY 500
+  Ntry = 0;
+  while (Ntry < NTRY) {
+    sock = KapaClientSocket ("localhost");
+    if (sock != -1) break;
+    // if (errno != EAGAIN) break;
+    if (errno != ECONNREFUSED) break;
+    usleep (10000);
+    Ntry ++;
+  }
+
+  if (sock < 0) return (-1);
+  return (sock);
+}
+
+/* start socketed connection (UNIX Socket) */
+int KapaOpenNamedSocket (char *kapa_exec, char *name) {
+
+  int InitSocket, status;
+  struct sockaddr_un Address;
+  socklen_t AddressLength;
+  char temp[128], socket_name[64];
+  int Ntry, fd;
+
+  sprintf (socket_name, "/tmp/Kapa.XXXXXX");
+  if ((fd = mkstemp (socket_name)) == -1) {
+    fprintf (stderr, "error starting kapa\n");
+    return (-1);
+  }
+  close (fd);
+  unlink (socket_name);
+
+  strcpy (Address.sun_path, socket_name); 
+  Address.sun_family = AF_UNIX; 
+  InitSocket = socket (AF_UNIX, SOCK_STREAM, 0); 
+  status = bind (InitSocket, (struct sockaddr *) &Address, sizeof (Address));
+  status = listen (InitSocket, 1);
+  
+  if (name == NULL) {
+    sprintf (temp, "%s -socket %s &", kapa_exec, socket_name);
+  } else {
+    sprintf (temp, "%s -socket %s -name %s &", kapa_exec, socket_name, name);
+  }
+  system (temp);
+
+  AddressLength =  sizeof (Address);
+  fcntl (InitSocket, F_SETFL, O_NONBLOCK); 
+
+# define NTRY 500
+  Ntry = 0;
+  while (Ntry < NTRY) {
+    fd = accept (InitSocket, (struct sockaddr *)&Address, &AddressLength);
+    if (fd != -1) break;
+    if (errno != EAGAIN) break;
+    usleep (10000);
+    Ntry ++;
+  }
+
+  if (fd < 0) return (-1);
+
+  // the client uses a BLOCKing socket by default
+  fcntl (fd, F_SETFL, !O_NONBLOCK); 
+  return (fd);
+}
+
+// wait for the initiating process to connect to the socket
+int KapaWaitNamedSocket (char *sockpath) {
+
+  int sock, status;
+  struct sockaddr_un Address;
+
+  strcpy (Address.sun_path, sockpath);
+  Address.sun_family = AF_UNIX;
+  sock = socket (AF_UNIX, SOCK_STREAM, 0);
+  status = connect (sock, (struct sockaddr *) &Address, sizeof (Address));
+  if (status < 0) {
+    fprintf (stderr, "unsuccessful connection: %d\n", status);
+    exit (0);
+  }
+
+  // the server uses an unblocked socket
+  fcntl (sock, F_SETFL, O_NONBLOCK);  
+  unlink (sockpath);
+  return (sock);
+}
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/KapaWindow.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/KapaWindow.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/KapaWindow.c	(revision 15879)
@@ -0,0 +1,332 @@
+# include <kapa_internal.h>
+
+int KiiCenter (int fd, double x, double y, int zoom) {
+
+  KiiSendCommand (fd, 4, "CENT");
+  KiiSendMessage (fd, "%8.3f %8.3f %8d ", x, y, zoom);
+  KiiWaitAnswer (fd, "DONE");
+  
+  return (TRUE);
+}
+
+int KiiResize (int fd, int Nx, int Ny) {
+
+  KiiSendCommand (fd, 4, "RSIZ");
+  KiiSendMessage (fd, "%d %d", Nx, Ny); 
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaBox (int fd, Graphdata *graphdata) {
+
+  KiiSendCommand (fd, 4, "DBOX");
+  KiiSendMessage (fd, "%12.6g %12.6g %12.6g %12.6g", 
+		    graphdata[0].xmin, graphdata[0].xmax, graphdata[0].ymin, graphdata[0].ymax);
+
+  KiiSendMessage (fd, "%s %s %s", graphdata[0].axis, graphdata[0].labels, graphdata[0].ticks);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaClearCurrentPlot (int fd) {
+  
+  KiiSendCommand (fd, 4, "ERSC");
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaClearPlots (int fd) {
+  
+  KiiSendCommand (fd, 4, "ERSP");
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaClearSections (int fd) {
+  
+  KiiSendCommand (fd, 4, "ERSS");
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaClearImage (int fd) {
+  
+  KiiSendCommand (fd, 4, "ERSI");
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaSetToolbox (int fd, int location) {
+  
+  KiiSendCommand (fd, 4, "TOOL");
+  KiiSendMessage (fd, "%d", location); 
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaInitGraph (Graphdata *graphdata) {
+
+  graphdata[0].xmin = graphdata[0].ymin = 0.0;
+  graphdata[0].xmax = graphdata[0].ymax = 1.0;
+  graphdata[0].style = graphdata[0].ptype = 0;
+  graphdata[0].ltype = graphdata[0].color = 0;
+  graphdata[0].etype = graphdata[0].ebar = 0;
+  graphdata[0].lweight = graphdata[0].size = 1.0;
+    
+  graphdata[0].coords.pc1_1 = graphdata[0].coords.pc2_2 = 1.0;
+  graphdata[0].coords.pc1_2 = graphdata[0].coords.pc2_1 = 0.0;
+  strcpy (graphdata[0].coords.ctype, "RA---LIN");
+  graphdata[0].coords.crval1 = 0.0;
+  graphdata[0].coords.crval2 = 0.0;
+  graphdata[0].coords.crpix1 = 0.0;
+  graphdata[0].coords.crpix2 = 0.0;
+  graphdata[0].coords.cdelt1 = graphdata[0].coords.cdelt2 = 1.0;
+  graphdata[0].flipeast = TRUE;
+  graphdata[0].flipnorth = FALSE;
+  strcpy (graphdata[0].axis, "2222");
+  strcpy (graphdata[0].ticks, "2222");
+  strcpy (graphdata[0].labels, "2222");
+
+  return (TRUE);
+}
+
+int KapaPrepPlot (int fd, int Npts, Graphdata *data) {
+
+  /* tell kapa to look for the incoming image */
+  KiiSendCommand (fd, 4, "PLOT"); 
+  
+  /* send kapa the plot details */
+  KiiSendMessage (fd, "%8d %8d %d %d %d %d %d %f %f", 
+		  Npts, data[0].style, 
+		  data[0].ptype, data[0].ltype, 
+		  data[0].etype, data[0].ebar, data[0].color, 
+		  data[0].lweight, data[0].size);
+  KiiSendMessage (fd, "%g %g %g %g", 
+		  data[0].xmin, data[0].xmax, 
+		  data[0].ymin, data[0].ymax);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaSetGraphData (int fd, Graphdata *data) {
+
+  /* tell kapa to look for the incoming image */
+  KiiSendCommand (fd, 4, "SSTY"); 
+  
+  /* send kapa the plot details */
+  KiiSendMessage (fd, "%8d %d %d %d %d %d %f %f", 
+		  data[0].style, 
+		  data[0].ptype, data[0].ltype, 
+		  data[0].etype, data[0].ebar, data[0].color, 
+		  data[0].lweight, data[0].size);
+
+  KiiSendMessage (fd, "%g %g %g %g", 
+		  data[0].xmin, data[0].xmax, 
+		  data[0].ymin, data[0].ymax);
+
+  KiiSendMessage (fd, "%g %g %g %g", 
+		  data[0].coords.pc1_1, data[0].coords.pc2_2,
+		  data[0].coords.pc1_2, data[0].coords.pc2_1);
+
+  KiiSendMessage (fd, "%d %d %s", 
+		  data[0].flipeast, data[0].flipnorth,
+		  data[0].coords.ctype);
+
+  KiiSendMessage (fd, "%g %g %g %g %g %g", 
+		  data[0].coords.crval1,
+		  data[0].coords.crval2,
+		  data[0].coords.crpix1,
+		  data[0].coords.crpix2,
+		  data[0].coords.cdelt1,
+		  data[0].coords.cdelt2);
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaGetGraphData (int fd, Graphdata *data) {
+
+  /* tell kapa to look for the incoming image */
+  KiiSendCommand (fd, 4, "GSTY"); 
+  
+  /* send kapa the plot details */
+  KiiScanMessage (fd, "%d %d %d %d %d %d %lf %lf", 
+		  &data[0].style, 
+		  &data[0].ptype, &data[0].ltype, 
+		  &data[0].etype, &data[0].ebar, &data[0].color, 
+		  &data[0].lweight, &data[0].size);
+
+  KiiScanMessage (fd, "%lf %lf %lf %lf", 
+		  &data[0].xmin, &data[0].xmax, 
+		  &data[0].ymin, &data[0].ymax);
+
+  KiiScanMessage (fd, "%f %f %f %f", 
+		  &data[0].coords.pc1_1, &data[0].coords.pc2_2,
+		  &data[0].coords.pc1_2, &data[0].coords.pc2_1);
+
+  KiiScanMessage (fd, "%d %d %s", 
+		  &data[0].flipeast, &data[0].flipnorth,
+		  data[0].coords.ctype);
+
+  KiiScanMessage (fd, "%lf %lf %f %f %f %f", 
+		  &data[0].coords.crval1,
+		  &data[0].coords.crval2,
+		  &data[0].coords.crpix1,
+		  &data[0].coords.crpix2,
+		  &data[0].coords.cdelt1,
+		  &data[0].coords.cdelt2);
+
+  // XXX at some point, we need to add polynomials and 2-level mosaic
+  // astrometry here.
+
+  data[0].coords.Npolyterms = 0;
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaSetImageData (int fd, KapaImageData *data) {
+
+  /* tell kapa to look for the incoming image */
+  KiiSendCommand (fd, 4, "SIMD"); 
+  
+  /* send kapa the plot details */
+  KiiSendMessage (fd, "%g %g %s %s", 
+		  data[0].zero, data[0].range, data[0].name, data[0].file);
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaGetImageData (int fd, KapaImageData *data) {
+
+  /* tell kapa to look for the incoming image */
+  KiiSendCommand (fd, 4, "GIMD"); 
+  
+  KiiScanMessage (fd, "%lf %lf %s %s", 
+		  &data[0].zero, &data[0].range, data[0].name, data[0].file);
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaPlotVector (int fd, int Npts, float *values, char *type) {
+
+  int Nbytes;
+  int swap;
+
+# ifdef BYTE_SWAP
+  swap = 1;
+# else
+  swap = 0;
+# endif
+
+  Nbytes = Npts * sizeof (float);
+
+  if (!strcmp(type, "x")) goto valid;
+  if (!strcmp(type, "y")) goto valid;
+  if (!strcmp(type, "z")) goto valid;
+  if (!strcmp(type, "dym")) goto valid;
+  if (!strcmp(type, "dyp")) goto valid;
+  if (!strcmp(type, "dxm")) goto valid;
+  if (!strcmp(type, "dxp")) goto valid;
+  return (FALSE);
+
+valid:
+  KiiSendCommand (fd, 4, "PLOB"); 
+  KiiSendMessage (fd, "%s %d %d %d", type, Npts, Nbytes, swap); 
+
+  write (fd, values, Nbytes);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaSetFont (int fd, char *name, int size) {
+
+  KiiSendCommand (fd, 4, "FONT");
+  KiiSendCommand (fd, 16, "%s", name);
+  KiiSendCommand (fd, 16, "%d", size);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaSendLabel (int fd, char *string, int mode) {
+
+  KiiSendCommand (fd, 4, "LABL");
+  KiiSendMessage (fd, "%6d", mode);
+  KiiSendData (fd, string, strlen(string));
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaSendTextline (int fd, char *string, float x, float y, float angle) {
+  
+  KiiSendCommand (fd, 4, "PTXT");
+  KiiSendMessage (fd, "%f %f %f", x, y, angle);
+  KiiSendData (fd, string, strlen(string));
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaSetLimits (int fd, Graphdata *data) {
+
+  KiiSendCommand (fd, 4, "SLIM");
+  KiiSendMessage (fd, "%g %g %g %g ", data[0].xmin, data[0].xmax, data[0].ymin, data[0].ymax);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+// for now, this just gets the dimensions
+int KapaGetLimits (int fd, float *dx, float *dy) {
+
+  KiiSendCommand (fd, 4, "GLIM"); 
+  KiiScanMessage (fd, "%f %f", dx, dy); 
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaSetSection (int fd, KapaSection *section) {
+
+  KiiSendCommand (fd, 4, "DSEC");
+  KiiSendMessage (fd, "%s %6.3f %6.3f %6.3f %6.3f", 
+		  section[0].name, 
+		  section[0].x,
+		  section[0].y,
+		  section[0].dx,
+		  section[0].dy);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaMoveSection (int fd, char *name, char *direction) {
+
+  if (!strcasecmp(direction, "up")) goto valid;
+  if (!strcasecmp(direction, "down")) goto valid;
+  if (!strcasecmp(direction, "top")) goto valid;
+  if (!strcasecmp(direction, "bottom")) goto valid;
+  
+  fprintf (stderr, "unexpected direction %s\n", direction); 
+  return (FALSE);
+
+valid:
+  KiiSendCommand (fd, 4, "MSEC");
+  KiiSendMessage (fd, "%s %s", name, direction);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaSelectSection (int fd, char *name) {
+
+  KiiSendCommand (fd, 4, "SSEC");
+  KiiSendMessage (fd, "%s", name);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaGetSection (int fd, char *name) {
+
+  KiiSendCommand (fd, 4, "LSEC");
+  KiiSendMessage (fd, "%s", name);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiConvert.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiConvert.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiConvert.c	(revision 15879)
@@ -0,0 +1,33 @@
+# include <kapa_internal.h>
+
+int KiiJPEG (int fd, const char *filename) {
+
+  KiiSendCommand (fd, 4, "JPEG");
+  KiiSendMessage (fd, "%s", filename);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaPNG (int fd, const char *filename) {
+
+  KiiSendCommand (fd, 4, "PNGF");
+  KiiSendMessage (fd, "%s", filename);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaPPM (int fd, const char *filename) {
+
+  KiiSendCommand (fd, 4, "PPMF");
+  KiiSendMessage (fd, "%s", filename);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KiiPS (int fd, const char *filename, int scaleMode, int pageMode, char *pagename) {
+
+  KiiSendCommand (fd, 4, "PSIT");
+  KiiSendMessage (fd, "%s %s %d %d", filename, pagename, scaleMode, pageMode);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiCursor.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiCursor.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiCursor.c	(revision 15879)
@@ -0,0 +1,22 @@
+# include <kapa_internal.h>
+
+int KiiCursorOn (int fd) {
+
+  KiiSendCommand (fd, 4, "CURS");
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KiiCursorOff (int fd) {
+
+  KiiSendCommand (fd, 4, "NCUR");
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KiiCursorRead (int fd, double *x, double *y, double *z, double *r, double *d, char *key) {
+
+  KiiScanMessage (fd, "%s %lf %lf %lf %lf %lf", key, x, y, z, r, d);
+  if (ispunct(key[0])) strcpy (key, "_");
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiOpen.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiOpen.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiOpen.c	(revision 15879)
@@ -0,0 +1,76 @@
+# include <kapa_internal.h>
+
+/** start socketed connection */
+int KiiOpen (char *kii_exec, char *name) {
+
+  int InitSocket, status;
+  struct sockaddr_un Address;
+  socklen_t AddressLength;
+  char temp[128], socket_name[64];
+  int Ntry, fd;
+
+  sprintf (socket_name, "/tmp/Kii.XXXXXX");
+  if ((fd = mkstemp (socket_name)) == -1) {
+    fprintf (stderr, "error starting kii\n");
+    return (-1);
+  }
+  close (fd);
+  unlink (socket_name);
+
+  strcpy (Address.sun_path, socket_name); 
+  Address.sun_family = AF_UNIX; 
+  InitSocket = socket (AF_UNIX, SOCK_STREAM, 0); 
+  status = bind (InitSocket, (struct sockaddr *) &Address, sizeof (Address));
+  status = listen (InitSocket, 1);
+  
+  if (name == NULL) {
+    sprintf (temp, "%s %s &", kii_exec, socket_name);
+  } else {
+    sprintf (temp, "%s %s -name %s &", kii_exec, socket_name, name);
+  }
+  system (temp);
+
+  AddressLength =  sizeof (Address);
+  fcntl (InitSocket, F_SETFL, O_NONBLOCK); 
+
+# define NTRY 500
+  Ntry = 0;
+  while (Ntry < NTRY) {
+    fd = accept (InitSocket, (struct sockaddr *)&Address, &AddressLength);
+    if (fd != -1) break;
+    if (errno != EAGAIN) break;
+    usleep (10000);
+    Ntry ++;
+  }
+
+  if (fd < 0) return (-1);
+
+  fcntl (fd, F_SETFL, !O_NONBLOCK); 
+  return (fd);
+}
+
+int KiiWait (char *sockpath) {
+
+  int sock, status;
+  struct sockaddr_un Address;
+
+  strcpy (Address.sun_path, sockpath);
+  Address.sun_family = AF_UNIX;
+  sock = socket (AF_UNIX, SOCK_STREAM, 0);
+  status = connect (sock, (struct sockaddr *) &Address, sizeof (Address));
+  if (status < 0) {
+    fprintf (stderr, "unsuccessful connection: %d\n", status);
+    exit (0);
+  }
+  fcntl (sock, F_SETFL, O_NONBLOCK);  
+  unlink (sockpath);
+  return (sock);
+}
+
+int KiiClose (int fd) {
+
+  if (fd < 1) return (FALSE);
+  KiiSendCommand (fd, 4, "QUIT");
+  close (fd);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiOverlay.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiOverlay.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiOverlay.c	(revision 15879)
@@ -0,0 +1,130 @@
+# include <kapa_internal.h>
+
+# define NOVERLAY_TYPE 5
+static char KiiOverlayTypeName[NOVERLAY_TYPE][16] = {
+  "NONE",
+  "TEXT", 
+  "BOX", 
+  "LINE",
+  "CIRCLE", 
+};
+
+int KiiOverlayTypeByName (char *overname) {
+
+  int i;
+
+  for (i = 1; i < NOVERLAY_TYPE; i++) {
+    if (!strcasecmp (overname, KiiOverlayTypeName[i])) return (i);
+  }
+  return (0);
+}
+
+char *KiiOverlayTypeByNumber (int n) {
+
+  if ((n < 0) || (n >= NOVERLAY_TYPE)) return NULL;
+  return (KiiOverlayTypeName[n]);
+}
+
+int KiiSelectOverlay (char *overname, int *number) {
+
+  *number = -1;
+  if (!strcmp (overname, "red") || !strcmp (overname, "0")) {
+    *number = 0;
+    return (TRUE);
+  }
+  if (!strcmp (overname, "green") || !strcmp (overname, "1")) {
+    *number = 1;
+    return (TRUE);
+  }
+  if (!strcmp (overname, "blue") || !strcmp (overname, "2")) {
+    *number = 2;
+    return (TRUE);
+  }
+  if (!strcmp (overname, "yellow") || !strcmp (overname, "3")) {
+    *number = 3;
+    return (TRUE);
+  }
+
+  fprintf (stderr, "valid overlays may be: red (0), green (1), blue (2), yellow (3)\n");
+  return (FALSE);
+}
+
+int KiiLoadOverlay (int fd, KiiOverlay *overlay, int Noverlay, char *overname) {
+
+  int i, overnum, Ntextdata, NTEXTDATA, Ntext, Nchar;
+  char *textdata;
+  KiiOverlayBase *buffer;
+
+  Ntext = 0;
+  KiiSelectOverlay (overname, &overnum);
+
+  Ntextdata = 0;
+  NTEXTDATA = 1024;
+  ALLOCATE (textdata, char, 1024);
+
+  // we send the position information as a binary block
+  ALLOCATE (buffer, KiiOverlayBase, Noverlay);
+  for (i = 0; i < Noverlay; i++) {
+    buffer[i].x     = overlay[i].x;
+    buffer[i].y     = overlay[i].y;
+    buffer[i].dx    = overlay[i].dx;
+    buffer[i].dy    = overlay[i].dy;
+    buffer[i].angle = overlay[i].angle;
+    buffer[i].type  = overlay[i].type;
+    if (buffer[i].type == KII_OVERLAY_TEXT) {
+      Ntext ++;
+      Nchar = strlen(overlay[i].text) + 1;
+      if (Ntextdata + Nchar >= NTEXTDATA) {
+	NTEXTDATA += 1024;
+	REALLOCATE (textdata, char, NTEXTDATA);
+      }
+      sprintf (&textdata[Ntextdata], "%s\n", overlay[i].text);
+      Ntextdata += Nchar;
+    }
+  }
+
+  KiiSendCommand (fd,  4, "LOAD");
+  KiiSendMessage (fd, "%d %d %d %d", overnum, Noverlay, Ntext, Ntextdata);
+
+  // we could break this into segments if we want to trap an interrupt, but why bother?
+  Nchar = write (fd, buffer, Noverlay*sizeof(KiiOverlayBase));
+  KiiWaitAnswer (fd, "DONE");
+
+  write (fd, textdata, Ntextdata);
+  KiiWaitAnswer (fd, "DONE");
+
+  free (buffer);
+  free (textdata);
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KiiEraseOverlay (int fd, char *overname) {
+
+  int n;
+
+  KiiSelectOverlay (overname, &n);
+    
+  KiiSendCommand (fd, 4, "ERSO");
+  KiiSendCommand (fd, 16, "OVERLAY %7d ", n);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KiiSaveOverlay (int fd, int celestial, char *overname, char *file) {
+
+  int n;
+
+  KiiSelectOverlay (overname, &n);
+    
+  if (celestial) {
+    KiiSendCommand (fd, 4, "CSVE");
+  } else {
+    KiiSendCommand (fd, 4, "SAVE");
+  }
+
+  KiiSendMessage (fd, "FILE: %d %s", n, file);
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiPicture.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiPicture.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/KiiPicture.c	(revision 15879)
@@ -0,0 +1,221 @@
+# include <kapa_internal.h>
+
+int KiiNewPicture1D (int fd, KiiImage *image, KapaImageData *data, Coords *coords) {
+
+  int Npix, Ncolors, size;
+  float *in, min, max;
+
+  Npix = image[0].Nx*image[0].Ny;
+
+  KiiSendCommand (fd, 4, "READ"); /* tell kapa to look for the incoming image */
+  KiiScanMessage (fd, "%d", &Ncolors);
+
+  in = image[0].data1d;
+
+  /* these are for a future upgrade */
+  min = max = 0.0;
+  size = Npix*sizeof(float);
+
+  /* done with the conversion, now send kapa the converted picture */
+  KiiSendMessage (fd, "%8d %8d", image[0].Nx, image[0].Ny);
+  KiiSendMessage (fd, "-32 1 0.0 1.0");
+  KiiSendMessage (fd, "%f %f %s %s", data[0].zero, data[0].range, data[0].name, data[0].file);
+  KiiSendMessage (fd, "%f %f %d ", min, max, size);
+  KiiSendMessage (fd, "%f %f %g %g %g ", coords[0].crval1, coords[0].crpix1, coords[0].cdelt1, coords[0].pc1_1, coords[0].pc1_2);
+  KiiSendMessage (fd, "%f %f %g %g %g ", coords[0].crval2, coords[0].crpix2, coords[0].cdelt2, coords[0].pc2_1, coords[0].pc2_2);
+  KiiSendMessage (fd, "%s", coords[0].ctype);
+
+  /* send the image data */
+  write (fd, image[0].data1d, size);
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KiiNewPicture1D_8bit (int fd, KiiImage *image, KapaImageData *data, Coords *coords) {
+
+  int i;
+  int Npix, Ncolors, NNcolors, size;
+  float *in, min, max;
+  char *out, *outbuffer;
+  double a1, a2;
+
+  Npix = image[0].Nx*image[0].Ny;
+
+  KiiSendCommand (fd, 4, "READ"); /* tell kapa to look for the incoming image */
+  KiiScanMessage (fd, "%d", &Ncolors);
+
+  ALLOCATE (outbuffer, char, Npix);
+  out = outbuffer;
+  in = image[0].data1d;
+
+  /* need to invert the logic if range < 0 */
+
+  /* define color table, */
+  NNcolors = Ncolors - 1;
+  if (data[0].logflux) {
+    data[0].range = MAX (2, data[0].range);
+    a1 = Ncolors / log10 (data[0].range);
+    a2 = data[0].zero;
+    for (i = 0; i < Npix; i++, in++, out++) {
+      *out = (char) MIN (a1 * log10 (MAX (*in - a2, 1.0)), NNcolors);
+    }
+  } else {
+    a1 = Ncolors / data[0].range;
+    a2 = Ncolors * data[0].zero / data[0].range;
+    for (i = 0; i < Npix; i++, in++, out++) {
+      *out = (char) MIN (MAX (a1 * *in - a2, 0), NNcolors);
+    }
+  }
+  
+  /* these are for a future upgrade */
+  min = max = 0.0;
+  size = Npix*sizeof(char);
+
+  /* done with the conversion, now send kapa the converted picture */
+  KiiSendMessage (fd, "%8d %8d", image[0].Nx, image[0].Ny);
+  KiiSendMessage (fd, "8 1 0.0 1.0");
+  KiiSendMessage (fd, "%f %f %s %s", data[0].zero, data[0].range, data[0].name, data[0].file);
+  KiiSendMessage (fd, "%f %f %d ", min, max, size);
+  KiiSendMessage (fd, "%f %f %g %g %g ", coords[0].crval1, coords[0].crpix1, coords[0].cdelt1, coords[0].pc1_1, coords[0].pc1_2);
+  KiiSendMessage (fd, "%f %f %g %g %g ", coords[0].crval2, coords[0].crpix2, coords[0].cdelt2, coords[0].pc2_1, coords[0].pc2_2);
+  KiiSendMessage (fd, "%s", coords[0].ctype);
+
+  /* send the image data */
+  write (fd, outbuffer, size);
+  free (outbuffer);
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KiiNewPicture2D (int fd, KiiImage *image, KapaImageData *data, Coords *coords) {
+
+  int i, j;
+  int Npix, Ncolors, NNcolors, size;
+  float *in, min, max;
+  char *out, *outbuffer;
+  double a1, a2;
+
+  Npix = image[0].Nx*image[0].Ny;
+
+  KiiSendCommand (fd, 4, "READ"); /* tell kapa to look for the incoming image */
+  KiiScanMessage (fd, "%d", &Ncolors);
+
+  ALLOCATE (outbuffer, char, Npix);
+  out = outbuffer;
+
+  /* need to invert the logic if range < 0 */
+
+  /* define color table, */
+  NNcolors = Ncolors - 1;
+  if (data[0].logflux) {
+    data[0].range = MAX (2, data[0].range);
+    a1 = Ncolors / log10 (data[0].range);
+    a2 = data[0].zero;
+    for (j = 0; j < image[0].Ny; j++) {
+      in = image[0].data2d[j];
+      for (i = 0; i < image[0].Nx; i++, in++, out++) {
+	*out = (char) MIN (a1 * log10 (MAX (*in - a2, 1.0)), NNcolors);
+      }
+    }
+  } else {
+    a1 = Ncolors / data[0].range;
+    a2 = Ncolors * data[0].zero / data[0].range;
+    for (j = 0; j < image[0].Ny; j++) {
+      in = image[0].data2d[j];
+      for (i = 0; i < image[0].Nx; i++, in++, out++) {
+	*out = (char) MIN (MAX (a1 * *in - a2, 0), NNcolors);
+      }
+    }
+  }
+  
+  /* these are for a future upgrade */
+  min = max = 0.0;
+  size = Npix*sizeof(char);
+
+  /* done with the conversion, now send kapa the converted picture */
+  KiiSendMessage (fd, "%8d %8d", image[0].Nx, image[0].Ny);
+  KiiSendMessage (fd, "8 1 0.0 1.0");
+  KiiSendMessage (fd, "%f %f %s %s", data[0].zero, data[0].range, data[0].name, data[0].file);
+  KiiSendMessage (fd, "%f %f %d ", min, max, size);
+  KiiSendMessage (fd, "%f %f %g %g %g ", coords[0].crval1, coords[0].crpix1, coords[0].cdelt1, coords[0].pc1_1, coords[0].pc1_2);
+  KiiSendMessage (fd, "%f %f %g %g %g ", coords[0].crval2, coords[0].crpix2, coords[0].cdelt2, coords[0].pc2_1, coords[0].pc2_2);
+  KiiSendMessage (fd, "%s", coords[0].ctype);
+
+  /* send the image data */
+  write (fd, outbuffer, size);
+  free (outbuffer);
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaSetImageCoords (int fd, Coords *coords) {
+
+  /* tell kapa to look for the incoming image */
+  KiiSendCommand (fd, 4, "SIMC"); 
+  
+  KiiSendMessage (fd, "%g %g %g %g", 
+		  coords[0].pc1_1, coords[0].pc2_2,
+		  coords[0].pc1_2, coords[0].pc2_1);
+
+  KiiSendMessage (fd, "%s", coords[0].ctype);
+
+  KiiSendMessage (fd, "%g %g %g %g %g %g", 
+		  coords[0].crval1,
+		  coords[0].crval2,
+		  coords[0].crpix1,
+		  coords[0].crpix2,
+		  coords[0].cdelt1,
+		  coords[0].cdelt2);
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaGetImageCoords (int fd, Coords *coords) {
+
+  /* tell kapa to look for the incoming image */
+  KiiSendCommand (fd, 4, "GIMC"); 
+  
+  KiiScanMessage (fd, "%f %f %f %f", 
+		  &coords[0].pc1_1, &coords[0].pc2_2,
+		  &coords[0].pc1_2, &coords[0].pc2_1);
+
+  KiiScanMessage (fd, "%s", coords[0].ctype);
+
+  KiiScanMessage (fd, "%lf %lf %f %f %f %f", 
+		  &coords[0].crval1,
+		  &coords[0].crval2,
+		  &coords[0].crpix1,
+		  &coords[0].crpix2,
+		  &coords[0].cdelt1,
+		  &coords[0].cdelt2);
+
+  // XXX at some point, we need to add polynomials and 2-level mosaic
+  // astrometry here.
+
+  coords[0].Npolyterms = 0;
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+int KapaGetImageRange (int fd, double *Xmin, double *Xmax, double *Ymin, double *Ymax) {
+
+  /* tell kapa to look for the incoming image */
+  KiiSendCommand (fd, 4, "GIMR"); 
+  
+  KiiScanMessage (fd, "%lf %lf %lf %lf", Xmin, Xmax, Ymin, Ymax);
+
+  KiiWaitAnswer (fd, "DONE");
+  return (TRUE);
+}
+
+
+/* this function should be broken into pieces: 
+   KiiSendImage
+   KiiSendCoords (default to 0 otherwise)
+   KiiSendFilename
+*/
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/PSRotFont.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/PSRotFont.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/PSRotFont.c	(revision 15879)
@@ -0,0 +1,182 @@
+# include <kapa_internal.h>
+# define NROTCHARS 256
+
+/* writes commands to print string at location and angle using
+   currently set font and size */
+void PSRotText (FILE *f, int x, int y, char *string, int pos, double angle) {
+
+  char *segment, basename[64], *currentname;
+  int i, N, code;
+  int dX, dY, Xoff, Yoff, X, Y, Nseg, NSEG, YoffBase;
+  double cs, sn, fscale, currentscale;
+  int basesize, currentsize;
+  RotFont *currentfont;
+  
+  currentname = GetRotFont (&currentsize);
+  currentfont = GetRotFontData (&currentscale);
+  strcpy (basename, currentname);
+  basesize = currentsize;
+
+  /* strip off leading WHITESPACE */
+  stripwhite (string);
+  if (*string == 0) return;
+  
+  /* compute string length */
+  /* PS fonts are somewhat different scales from bitmap font equivalents */
+  fscale = 1.0;
+  if (!strcmp (currentname, "times")) fscale = 1.07;
+  if (!strcmp (currentname, "courier")) fscale = 1.5;
+  if (!strcmp (currentname, "helvetica")) fscale = 0.9;
+  if (!strcmp (currentname, "symbol")) fscale = 1.2;
+  dX = fscale*RotStrlen (string);
+  dY = currentfont[65].ascent;
+  
+  /* apply appropriate offset */
+  Xoff = Yoff = 0;
+  switch (pos) {
+  case 0: Xoff =     -dX; Yoff = -dY; break;
+  case 1: Xoff = -0.5*dX; Yoff = -dY; break;
+  case 2: Xoff =       0; Yoff = -dY; break;
+  case 3: Xoff =     -dX; Yoff = -0.5*dY; break;
+  case 4: Xoff = -0.5*dX; Yoff = -0.5*dY; break;
+  case 5: Xoff =       0; Yoff = -0.5*dY; break;
+  case 6: Xoff =     -dX; Yoff = 0; break;
+  case 7: Xoff = -0.5*dX; Yoff = 0; break;
+  case 8: Xoff =       0; Yoff = 0; break;
+  }
+  cs = cos(angle*RAD_DEG);
+  sn = sin(angle*RAD_DEG);
+  X = x + Xoff*cs + Yoff*sn;
+  Y = y - Xoff*sn + Yoff*cs;
+
+  PSSetFont (f, currentname, currentsize);
+  fprintf (f, "gsave\n");
+  fprintf (f, " %d %d moveto %f rotate\n", X, Y, -angle);
+
+  Nseg = 0;
+  NSEG = strlen(string) + 2;
+  ALLOCATE (segment, char, NSEG);
+  bzero (segment, NSEG);
+
+  code = FALSE;
+  YoffBase = 0;
+  /* accumulate string segments with common state */
+  for (i = 0; i < strlen (string); i++) {
+    N = (int)(string[i]);
+    if ((N < 0) || (N >= NROTCHARS)) continue;
+
+    /* check for special characters */
+    if (!code) {
+      /* superscript character (^) */
+      if (N == 94) {
+	PSDumpRotSegment (f, segment, &Nseg);
+	SetRotFont (currentname, (int)(0.8*currentsize));
+	currentfont = GetRotFontData (&currentscale);
+	Yoff = 0.75*currentscale*dY;
+	fprintf (f, "0 %d rmoveto\n", Yoff);
+	YoffBase += Yoff;
+	PSSetFont (f, currentname, currentsize);
+	continue;
+      }
+      /* subscript character (_) */
+      if (N == 95) { 
+	PSDumpRotSegment (f, segment, &Nseg);
+	SetRotFont (currentname, (int)(0.8*currentsize));
+	currentfont = GetRotFontData (&currentscale);
+	Yoff = -0.5*currentscale*dY;
+	fprintf (f, "0 %d rmoveto\n", Yoff);
+	YoffBase += Yoff;
+	PSSetFont (f, currentname, currentsize);
+	continue;
+      }
+      /* end super/sub script (|) */
+      if (N == 124) {
+	PSDumpRotSegment (f, segment, &Nseg);
+	SetRotFont (currentname, basesize);
+	currentfont = GetRotFontData (&currentscale);
+	fprintf (f, "0 %d rmoveto\n", -YoffBase);
+	YoffBase = 0;
+	PSSetFont (f, currentname, currentsize);
+	continue;
+      }
+      /* escape char (\) */
+      if (N == 92) {
+	code = TRUE;
+	continue;
+      } 
+      /* begin paren (insert \) */
+      if (N == 40) {
+	code = FALSE;
+	segment[Nseg] = 92;
+	Nseg ++;
+	CHECK_REALLOCATE (segment, char, NSEG, Nseg, 64);
+      }
+      /* end paren (insert \) */
+      if (N == 41) {
+	code = FALSE;
+	segment[Nseg] = 92;
+	Nseg ++;
+	CHECK_REALLOCATE (segment, char, NSEG, Nseg, 64);
+      }
+      /* font change character (&) */
+      if (N == 38) {
+	PSDumpRotSegment (f, segment, &Nseg);
+	if (string[i+1] == 'h') {
+	  SetRotFont ("helvetica", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	  PSSetFont (f, currentname, currentsize);
+	}
+	if (string[i+1] == 't') {
+	  SetRotFont ("times", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	  PSSetFont (f, currentname, currentsize);
+	}
+	if (string[i+1] == 'c') {
+	  SetRotFont ("courier", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	  PSSetFont (f, currentname, currentsize);
+	}
+	if (string[i+1] == 's') {
+	  SetRotFont ("symbol", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	  PSSetFont (f, currentname, currentsize);
+	}
+	i++;
+	continue;
+      }
+    }
+    code = FALSE;
+    segment[Nseg] = N;
+    Nseg ++;
+    CHECK_REALLOCATE (segment, char, NSEG, Nseg, 64);
+  }
+  PSDumpRotSegment (f, segment, &Nseg);
+  fprintf (f, "stroke grestore\n");
+  free (segment);
+  SetRotFont (basename, basesize);
+}
+
+void PSDumpRotSegment (FILE *f, char *segment, int *Nseg) {
+  segment[*Nseg] = 0;
+  fprintf (f, "(%s) show\n", segment);
+  bzero (segment, *Nseg);
+  *Nseg = 0;
+}
+
+void PSSetFont (FILE *f, char *name, int size) {
+  if (!strcmp (name, "times")) 
+    fprintf (f, "/Times-Roman findfont %d scalefont setfont\n", size);
+  if (!strcmp (name, "helvetica")) 
+    fprintf (f, "/Helvetica findfont %d scalefont setfont\n", size);
+  if (!strcmp (name, "courier")) 
+    fprintf (f, "/Courier findfont %d scalefont setfont\n", size);
+  if (!strcmp (name, "symbol")) 
+    fprintf (f, "/Symbol findfont %d scalefont setfont\n", size);
+}
+
+
+
+  /* test cross hair
+  fprintf (f, "%d %d %d %d L\n", x-10, y, x+10, y);
+  fprintf (f, "%d %d %d %d L\n", x, y-10, x, y+10);
+  */
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/RotFont.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/RotFont.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/RotFont.c	(revision 15879)
@@ -0,0 +1,124 @@
+# include <kapa_internal.h>
+# include "alphabet.h"
+  
+static int Nrotfonts;
+static FontSet *RotFonts;
+
+static char currentname[64];
+static int  currentsize;
+static double currentscale;
+static RotFont *currentfont;
+
+void InitRotFonts () {
+
+  int i, Nhardwired;
+
+  Nhardwired = sizeof (HardwiredFonts) / sizeof (FontSet);
+  
+  Nrotfonts = Nhardwired;
+  ALLOCATE (RotFonts, FontSet, Nrotfonts);
+  
+  for (i = 0; i < Nhardwired; i++) {
+    RotFonts[i] = HardwiredFonts[i];
+  }
+
+  currentfont = RotFonts[DEFFONT].font;
+  currentscale = 1.0;
+  strcpy (currentname, RotFonts[DEFFONT].name);
+  currentsize = RotFonts[DEFFONT].size;
+}
+
+int SetRotFont (char *name, int size) {
+  
+  int i, nsize, msize, bsize, bigger, dsize, match, good;
+
+  bigger = good = match = -1;
+  dsize = 10000;
+  bsize = 10000;
+  for (i = 0; i < Nrotfonts; i++) {
+    if (!strcasecmp (RotFonts[i].name, name)) {
+      good = i;
+      nsize = abs (RotFonts[i].size - size);
+      if (nsize < dsize) {
+	match = i;
+	dsize = nsize;
+      }
+      msize = RotFonts[i].size - size;
+      if ((msize < bsize) && (msize >= 0)) {
+	bigger = i;
+	bsize = msize;
+      }
+    }
+  }
+  
+  if ((match == -1) && (good != -1)) match = good;
+  if (bigger != -1) match = bigger;
+  if (match != -1) {
+    currentfont = RotFonts[match].font;
+    currentscale = (double) size / RotFonts[match].size;
+    currentsize = size;
+    strcpy (currentname, name);
+    return (TRUE);
+  } else {
+    fprintf (stderr, "no matching font\n");
+    return (FALSE);
+  }
+
+}
+  
+char *GetRotFont (int *size) {
+
+  *size = currentsize;
+  return (currentname);
+
+}
+
+RotFont *GetRotFontData (double *scale) {
+  *scale = currentscale;
+  return (currentfont);
+}
+
+int RotStrlen (char *c) {
+
+  int i, N, dX, code;
+  double scale; 
+  
+  scale = currentscale;
+
+  /* find string length */
+  dX = 0;
+
+  code = FALSE;
+  for (i = 0; i < strlen (c); i++) {
+    N = (int)(c[i]);
+    /* skip non-printing characters */
+    if ((N < 0) || (N >= NROT)) continue;
+
+    /* check for special characters */
+    if (!code) {
+      if (N == 94) { /* super-script */
+	scale *= 0.8;
+	continue;
+      }
+      if (N == 95) { /* sub-script */
+	scale *= 0.8;
+	continue;
+      }
+      if (N == 124) { /* normal-script */
+	scale = currentscale;
+	continue;
+      }
+      if (N == 92) { /* backslash */
+	code = TRUE;
+	continue;
+      } 
+      if (N == 38) { /* font-code */
+	i++;
+	continue;
+      }
+    }
+    code = FALSE;
+    dX += scale*currentfont[N].dx + 1;
+  }
+  return (dX);
+}
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/bDrawFuncs.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/bDrawFuncs.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/bDrawFuncs.c	(revision 15879)
@@ -0,0 +1,418 @@
+# include <kapa_internal.h>
+
+static int bWeight;
+static int bType;
+static bDrawColor bColor;
+static bDrawBuffer *bBuffer;
+void bDrawCircleSingle (double xc, double yc, double radius);
+
+bDrawBuffer *bDrawBufferCreate (int Nx, int Ny) {
+
+  int i, j;
+  bDrawColor white;
+  bDrawBuffer *buffer;
+
+  white = KapaColorByName ("white");
+
+  ALLOCATE (buffer, bDrawBuffer, 1);
+  buffer[0].Nx = Nx;
+  buffer[0].Ny = Ny;
+
+  ALLOCATE (buffer[0].pixels, bDrawColor *, Ny);
+  for (i = 0; i < Ny; i++) {
+    ALLOCATE (buffer[0].pixels[i], bDrawColor, Nx);
+    for (j = 0; j < Nx; j++) {
+      buffer[0].pixels[i][j] = white;
+    }
+  }
+  return (buffer);
+}
+
+void bDrawBufferFree (bDrawBuffer *buffer) {
+
+  int i;
+
+  for (i = 0; i < buffer[0].Ny; i++) {
+    free (buffer[0].pixels[i]);
+  }
+  free (buffer[0].pixels);
+  free (buffer);
+  return;
+}
+
+void bDrawSetBuffer (bDrawBuffer *buffer) {
+  bBuffer = buffer;
+  return;
+}
+
+void bDrawSetStyle (bDrawColor color, int lw, int lt) {
+  bColor = color;
+  bWeight = lw;
+  bType = lt;
+  return;
+}
+
+// draw a point in the current color 
+void bDrawPoint (int x, int y) {
+
+  if (x < 0) return;
+  if (y < 0) return;
+  if (x >= bBuffer[0].Nx) return;
+  if (y >= bBuffer[0].Ny) return;
+  bBuffer[0].pixels[y][x] = bColor;
+  return;
+}
+
+// draw a point in the current color 
+void bDrawPointf (float x, float y) {
+
+  bDrawPoint (ROUND(x), ROUND(y));
+  return;
+}
+
+void bDrawTriOpen (double x1, double y1, double x2, double y2, double x3, double y3) {
+
+  bDrawLine (x1, y1, x2, y2);
+  bDrawLine (x2, y2, x3, y3);
+  bDrawLine (x3, y3, x1, y1);
+
+  return;
+}
+
+void bDrawRectOpen (double x1, double y1, double x2, double y2) {
+
+  int X1, Y1, X2, Y2;
+
+  if (x1 > x2) SWAP (x1, x2);
+  if (y1 > y2) SWAP (y1, y2);
+
+  X1 = MIN (MAX (ROUND (x1), 0), bBuffer[0].Nx - 1);
+  X2 = MIN (MAX (ROUND (x2), 1), bBuffer[0].Nx);
+
+  Y1 = MIN (MAX (ROUND (y1), 0), bBuffer[0].Ny - 1);
+  Y2 = MIN (MAX (ROUND (y2), 1), bBuffer[0].Ny);
+
+  bDrawLineHorizontal (X1, X2, Y1);
+  bDrawLineHorizontal (X1, X2, Y2);
+  bDrawLineVertical (X1, Y1, Y2);
+  bDrawLineVertical (X2, Y1, Y2);
+  return;
+}
+
+void bDrawRectFill (double x1, double y1, double x2, double y2) {
+
+  int i;
+  int X1, Y1, X2, Y2;
+
+  if (x1 > x2) SWAP (x1, x2);
+  if (y1 > y2) SWAP (y1, y2);
+
+  X1 = MIN (MAX (ROUND (x1), 0), bBuffer[0].Nx - 1);
+  X2 = MIN (MAX (ROUND (x2), 1), bBuffer[0].Nx);
+
+  Y1 = MIN (MAX (ROUND (y1), 0), bBuffer[0].Ny - 1);
+  Y2 = MIN (MAX (ROUND (y2), 0), bBuffer[0].Ny);
+
+  for (i = Y1; i < Y2; i++) {
+    bDrawLineHorizontal (X1, X2, i);
+  } 
+  return;
+}
+
+// identify the quadrant and draw the correct line
+void bDrawLine (double x1, double y1, double x2, double y2) {
+
+  int FlipDirect, FlipCoords;
+  int X1, Y1, X2, Y2, dX, dY;
+
+  /* rather than draw the line from float positions, we find the closest
+     integer end-points and draw the line between those pixels */ 
+
+  X1 = ROUND(x1);
+  Y1 = ROUND(y1);
+  X2 = ROUND(x2);
+  Y2 = ROUND(y2);
+
+  dX = X2 - X1;
+  dY = Y2 - Y1;
+
+  FlipCoords = (abs(dX) < abs(dY));
+  FlipDirect = FlipCoords ? (y1 > y2) : (x1 > x2);
+
+  if (!FlipDirect && !FlipCoords) bDrawLineWeight (X1, Y1, X2, Y2, FALSE);
+  if ( FlipDirect && !FlipCoords) bDrawLineWeight (X2, Y2, X1, Y1, FALSE);
+  if (!FlipDirect &&  FlipCoords) bDrawLineWeight (Y1, X1, Y2, X2, TRUE);
+  if ( FlipDirect &&  FlipCoords) bDrawLineWeight (Y2, X2, Y1, X1, TRUE);
+
+  return;
+}
+
+// draw a series of lines to give the line weight
+void bDrawLineWeight (int X1, int Y1, int X2, int Y2, int swapcoords) {
+
+  int dN, dNs, dNe;
+
+  dNs = -0.5*(bWeight - 1); 
+  /* 0, 0, 0, -1, -1, -2, -2 */
+
+  dNe = +0.5*bWeight + 1; 
+  /* 1, 1, 2, 2, 2, 3, 3 */
+
+  for (dN = dNs; dN < dNe; dN++) {
+    bDrawLineBresen (X1, Y1 + dN, X2, Y2 + dN, swapcoords);
+  }
+  return;
+}
+
+// use the Bresenham line drawing technique
+// integer-only Bresenham line-draw version which is fast
+void bDrawLineBresen (int X1, int Y1, int X2, int Y2, int swapcoords) {
+
+  int X, Y, dX, dY;
+  int e, e2;
+  int N, DashOn;
+
+  dX = X2 - X1;
+  dY = Y2 - Y1;
+
+  DashOn = TRUE;
+
+  Y = Y1;
+  e = 0;
+  for (X = X1, N = 0; X <= X2; X++, N++) {
+    if (bType == 1) { DashOn = (N % 10) < 5; }
+    if (bType == 2) { DashOn = (N % 6) < 3; }
+    if (swapcoords) {
+      if (DashOn) bDrawPoint (Y,X);
+    } else {
+      if (DashOn) bDrawPoint (X,Y);
+    }
+    e += dY;
+    e2 = 2 * e;
+    if (e2 > dX) {
+      Y++;
+      e -= dX;
+    } 
+    if (e2 < -dX) {
+      Y--;
+      e += dX;
+    }
+  }
+  return;
+}
+
+void bDrawLineHorizontal (int X1, int X2, int Y) {
+  
+  int i;
+
+  for (i = X1; i < X2; i++) {
+    bBuffer[0].pixels[Y][i] = bColor;
+  }
+  return;
+}
+
+void bDrawLineVertical (int X, int Y1, int Y2) {
+  
+  int i;
+
+  for (i = Y1; i < Y2; i++) {
+    bBuffer[0].pixels[i][X] = bColor;
+  }
+  return;
+}
+
+void bDrawTriFill (double x1, double y1, double x2, double y2, double x3, double y3) {
+
+  bDrawTriOpen (x1, y1, x2, y2, x3, y3);
+  return;
+}
+
+void bDrawArc (double Xc, double Yc, double Xr, double Yr, double Ts, double Te) {
+
+  float t, dt;
+  int x, y;
+
+  /* drawing a complete circle */
+//  if ((fabs(Te - Ts) > 360.0) && (Xr == Yr)) {
+//    bDrawCircle (Xc, Yc, Xr);
+//    return;
+//  }
+
+  /* only draw a single loop */
+  if (fabs(Te - Ts) > 360.0) {
+    Te = 360.0;
+    Ts = 0.0;
+  }
+
+  /* smallest angle is 1/Rmax */
+  dt = MAX (fabs(Xr * sin(Ts*RAD_DEG)), fabs(Yr * cos(Ts*RAD_DEG)));
+  dt = 1.0 / dt;
+
+  for (t = Ts*RAD_DEG; t <= Te*RAD_DEG; t += dt) {
+    x = Xr*cos(t) + Xc;
+    y = Yr*sin(t) + Yc;
+
+    /* we could use the value of MAX(dy/dt,dx/dt) to set dt */
+    bDrawPoint (x,y);
+
+    dt = MAX (fabs(Xr * sin(t)), fabs(Yr * cos(t)));
+    dt = 1.0 / dt;
+  }
+  return;
+}
+
+// draw a series of circles to give line weight
+void bDrawCircle (double xc, double yc, double radius) {
+
+  int dN, dNs, dNe;
+
+  dNs = -0.5*(bWeight - 1); 
+  /* 0, 0, 0, -1, -1, -2, -2 */
+
+  dNe = +0.5*bWeight + 1; 
+  /* 1, 1, 2, 2, 2, 3, 3 */
+
+  for (dN = dNs; dN < dNe; dN++) {
+    bDrawCircleSingle (xc, yc, radius + dN);
+  }
+  return;
+}
+
+// draw a pure circle  
+void bDrawCircleSingle (double xc, double yc, double radius) {
+
+  int Xc, Yc, Radius;
+  int x, y, d;
+
+  Xc = ROUND(xc);
+  Yc = ROUND(yc);
+  Radius = ROUND(radius);
+
+  x = 0;
+  y = Radius;
+
+  // d = 3 - 2*Radius;
+  d = 5 - 4*radius;
+
+  while (x <= y) {
+    bDrawPoint (Xc+x, Yc+y);
+    bDrawPoint (Xc+x, Yc-y);
+    bDrawPoint (Xc-x, Yc+y);
+    bDrawPoint (Xc-x, Yc-y);
+    bDrawPoint (Xc+y, Yc+x);
+    bDrawPoint (Xc+y, Yc-x);
+    bDrawPoint (Xc-y, Yc+x);
+    bDrawPoint (Xc-y, Yc-x);
+
+    if (d < 0) {
+      // d = d + 4*x + 6;
+      d = d + 8*x + 4;
+    } else {
+      // d = d + 4*(x-y) + 10;
+      d = d + 8*(x-y) + 8;
+      y--;
+    }
+    x++;
+  }
+}
+
+// draw a pure circle  
+void bDrawCircleFill (double xc, double yc, double radius) {
+
+  int Xc, Yc, Radius;
+  int x, y, d;
+
+  Xc = ROUND(xc);
+  Yc = ROUND(yc);
+  Radius = ROUND(radius);
+
+  x = 0;
+  y = Radius;
+
+  // d = 3 - 2*Radius;
+  d = 5 - 4*radius;
+
+  while (x <= y) {
+    bDrawLineHorizontal (Xc-x, Xc+x, Yc+y);
+    bDrawLineHorizontal (Xc-x, Xc+x, Yc-y);
+    bDrawLineHorizontal (Xc-y, Xc+y, Yc+x);
+    bDrawLineHorizontal (Xc-y, Xc+y, Yc-x);
+
+    if (d < 0) {
+      // d = d + 4*x + 6;
+      d = d + 8*x + 4;
+    } else {
+      // d = d + 4*(x-y) + 10;
+      d = d + 8*(x-y) + 8;
+      y--;
+    }
+    x++;
+  }
+}
+
+/* 
+the discriminant of inside or outside the circle is:
+
+f(x,y) = x^2 + y^2 - r^2
+
+- negative: (x,y) inside circle
+- positive: (x,y) outside circle
+
+given d(0) = f(x,y); find d(1) = f(x+1,y):
+d(1) = (x+1)^2 + y^2 - r^2
+d(1) = d(0) + 2x + 1
+(use d(1) if d(0) < 0, ie inside circle)
+
+given d(0) = f(x,y); find d(1) = f(x+1,y-1):
+d(1) = (x+1)^2 + (y-1)^2 - r^2
+d(1) = d(0) + 2x + 1 - 2y + 1
+d(1) = d(0) + 2(x-y) + 2
+
+* init d to f(1,r-1/2) instead of r, keeping the effective boundary 
+  between two pixels (also, an inside point)
+
+f(1,r-1/2) = 1 + (r-1/2)^2 - r^2 = 5/4 - r
+f(1,r-1/4) = 1 + (r-1/4)^2 - r^2 = 1 + r/2 + 1/16 = 17/16 + r/2
+
+f(1,r-x)   = 1 + (r-x)^2 - r^2 = 1 - 2xr + x^2 = A (3 - 2r)
+
+1+x^2 = 3A
+-2x = -2A
+
+A = x
+
+1 - 3x + x^2 = 0
+
+(3 +/- sqrt(9 - 4))/2 = (3 - sqrt(5))/2
+
+multiply all d values by 4 to get integer tests:
+
+d'(0) = 5 - 4r
+d'(in) = d' + 8x + 4
+d'(out) = d' + 8(x-y) + 8
+
+*/
+
+/* This is the Bresenham line-drawing algorithm for 1st and 4th quandrant
+   vectors with positive and negative slopes < 1. this is the sequence if we use
+   float errors and tests it is easy to understand, but slower than it could be
+
+  { 
+    float e, m;
+    m = dY / dX;
+    Y = Y1;
+    e = 0;
+    for (X = X1; X <= X2; X++) {
+      plot (X,Y);
+      e += m;
+      if (e > 0.5) {
+	Y++;
+	e -= 1.0;
+      }
+      if (e < -0.5) {
+	Y--;
+	e += 1.0;
+      }
+    }
+  }
+*/
Index: /branches/eam_branch_20071222/Ohana/src/libkapa/src/bDrawRotFont.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/libkapa/src/bDrawRotFont.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/libkapa/src/bDrawRotFont.c	(revision 15879)
@@ -0,0 +1,211 @@
+# include <kapa_internal.h>
+
+# define NROTCHARS 256
+# define XPROC(x,y) (scale*(cs*((x) - x0) - sn*((y) - y0)) + X0)
+# define YPROC(x,y) (scale*(cs*((y) - y0) + sn*((x) - x0)) + Y0)
+# define NEARINT(x) ((x < 0) ? ((int)(x - 0.5)) : ((int)(x + 0.5)))
+  
+static bDrawColor black;
+static bDrawColor white;
+
+int bDrawRotText (int x, int y, char *string, int pos, double angle) {
+
+  unsigned char *bitmap;
+  char *currentname, basename[64]; 
+  int i, dy, dx, N, X, Y, code;
+  int dX, Xoff, dY, Yoff, YoffBase;
+  int currentsize, basesize;
+  double cs, sn, currentscale;
+  RotFont *currentfont;
+
+  white = KapaColorByName ("white");
+  black = KapaColorByName ("black");
+
+  currentname = GetRotFont (&currentsize);
+  currentfont = GetRotFontData (&currentscale);
+  strcpy (basename, currentname);
+  basesize = currentsize;
+
+  /* strip leading WHITESPACE */
+  stripwhite (string);
+  if (*string == 0) return (FALSE);
+  
+  /* compute string length */
+  cs = cos(angle*RAD_DEG);
+  sn = sin(angle*RAD_DEG);
+  dX = RotStrlen (string);
+  dY = currentfont[65].ascent;
+
+  /* apply appropriate offset */
+  Xoff = Yoff = 0;
+  switch (pos) {
+  case 0: Xoff =     -dX; Yoff = dY; break;
+  case 1: Xoff = -0.5*dX; Yoff = dY; break;
+  case 2: Xoff =       0; Yoff = dY; break;
+  case 3: Xoff =     -dX; Yoff = 0.5*dY; break;
+  case 4: Xoff = -0.5*dX; Yoff = 0.5*dY; break;
+  case 5: Xoff =       0; Yoff = 0.5*dY; break;
+  case 6: Xoff =     -dX; Yoff = 0; break;
+  case 7: Xoff = -0.5*dX; Yoff = 0; break;
+  case 8: Xoff =       0; Yoff = 0; break;
+  }
+
+  code = FALSE;
+
+  YoffBase = Yoff;
+  /* draw characters one-by-one */
+  for (i = 0; i < strlen(string); i++) {
+    N = (int)(string[i]);
+    if ((N < 0) || (N >= NROTCHARS)) continue;
+
+    /* check for special characters */
+    if (!code) {
+      if (N == 94) {
+	SetRotFont (currentname, (int)(0.8*currentsize));
+	currentfont = GetRotFontData (&currentscale);
+	Yoff -= 0.5*currentscale*dY;
+	continue;
+      }
+      if (N == 95) { 
+	SetRotFont (currentname, (int)(0.8*currentsize));
+	currentfont = GetRotFontData (&currentscale);
+	Yoff += 0.5*currentscale*dY;
+	continue;
+      }
+      if (N == 124) {
+	SetRotFont (currentname, basesize);
+	currentfont = GetRotFontData (&currentscale);
+	Yoff = YoffBase;
+	continue;
+      }
+      if (N == 92) {
+	code = TRUE;
+	continue;
+      } 
+      if (N == 38) {
+	if (string[i+1] == 'h') {
+	  SetRotFont ("helvetica", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	}
+	if (string[i+1] == 't') {
+	  SetRotFont ("times", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	}
+	if (string[i+1] == 'c') {
+	  SetRotFont ("courier", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	}
+	if (string[i+1] == 's') {
+	  SetRotFont ("symbol", currentsize);
+	  currentfont = GetRotFontData (&currentscale);
+	}
+	i++;
+	continue;
+      }
+    }
+    code = FALSE;
+
+    bitmap = currentfont[N].bits;
+    dx = currentfont[N].dx;
+    dy = currentfont[N].dy;
+    X = x + (int)(Xoff*cs - Yoff*sn) + (int)(currentscale*currentfont[N].ascent*sn);
+    Y = y + (int)(Xoff*sn + Yoff*cs) - (int)(currentscale*currentfont[N].ascent*cs);
+    bDrawRotBitmap (X, Y, dx, dy, bitmap, TRUE, angle, currentscale);
+    Xoff += 1 + (int)(currentscale*dx + 0.5);
+  }
+  SetRotFont (basename, basesize);
+  return (TRUE);
+}
+
+int bDrawRotBitmap (int x, int y, int dx, int dy, unsigned char *bitmap, int mode, double angle, double scale) {
+
+  int ii, jj, byte_line, byte, bit, flag;
+  bDrawColor color;
+  double i, j, cs, sn, rscale, tmp;
+  int X, Y, X0, X1, X2, Y0, Y1, Y2, x0, y0;
+
+  /* this mode option is nort actually used... */
+  if (mode) {
+    color = black;
+  } else {
+    color = white;
+  } 
+    
+  byte_line = (int) ((dx + 7) / 8);
+
+  cs = cos(angle*RAD_DEG);  sn = sin(angle*RAD_DEG);
+  rscale = 1.0 / scale;
+
+  X0 = 0;
+  Y0 = 0;
+  x0 = 0;
+  y0 = 0;
+
+  X2 = X1 = XPROC (0,0);
+  Y2 = Y1 = YPROC (0,0);
+
+  X = XPROC (dx,0);
+  Y = YPROC (dx,0);
+# ifdef DRAWBOXES
+  bDrawLine (x+X, y+Y, x+X1, y+Y1);
+  Xt = X;
+  Yt = Y;
+# endif
+  X1 = MIN (X, X1);
+  X2 = MAX (X, X2);
+  Y1 = MIN (Y, Y1);
+  Y2 = MAX (Y, Y2);
+
+  X = XPROC (dx,dy);
+  Y = YPROC (dx,dy);
+# ifdef DRAWBOXES
+  bDrawLine (x+X, y+Y, x+Xt, y+Yt);
+  Xt = X;
+  Yt = Y;
+# endif
+  Y1 = MIN (Y, Y1);
+  Y2 = MAX (Y, Y2);
+  X1 = MIN (X, X1);
+  X2 = MAX (X, X2);
+
+  X = XPROC (0,dy);
+  Y = YPROC (0,dy);
+# ifdef DRAWBOXES
+  bDrawLine (x+X, y+Y, x+Xt, y+Yt);
+  Xt = X;
+  Yt = Y;
+# endif
+  Y1 = MIN (Y, Y1);
+  Y2 = MAX (Y, Y2);
+  X1 = MIN (X, X1);
+  X2 = MAX (X, X2);
+
+  bDrawSetStyle (color, 0, 0);
+  if (scale > 1) {
+    for (i = X1; i <= X2; i+=1) {
+      for (j = Y1; j <= Y2; j+=1) {
+	tmp = rscale*(cs*(i - X0) + sn*(j - Y0)) + x0;  ii = NEARINT (tmp);
+	tmp = rscale*(cs*(j - Y0) - sn*(i - X0)) + y0;  jj = NEARINT (tmp);
+	if ((ii < 0) || (ii >= dx) || (jj < 0) || (jj >= dy)) continue;
+	byte = byte_line * jj + (ii / 8);
+	bit = ii % 8;
+	flag = 0x01 & (bitmap[byte] >> bit);
+	if (flag) bDrawPointf (x + i, y + j);
+      }
+    }
+  } else {
+    for (i = X1; i <= X2; i+=scale) {
+      for (j = Y1; j <= Y2; j+=scale) {
+	tmp = rscale*(cs*(i - X0) + sn*(j - Y0)) + x0;  ii = NEARINT (tmp);
+	tmp = rscale*(cs*(j - Y0) - sn*(i - X0)) + y0;  jj = NEARINT (tmp);
+	if ((ii < 0) || (ii >= dx) || (jj < 0) || (jj >= dy)) continue;
+	byte = byte_line * jj + (ii / 8);
+	bit = ii % 8;
+	flag = 0x01 & (bitmap[byte] >> bit);
+	if (flag) bDrawPointf (x + i, y + j);
+      }
+    }
+  }
+  bDrawSetStyle (black, 0, 0);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/.cvsignore
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/.cvsignore	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/.cvsignore	(revision 15879)
@@ -0,0 +1,2 @@
+lib
+bin
Index: /branches/eam_branch_20071222/Ohana/src/opihi/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/Makefile	(revision 15879)
@@ -0,0 +1,81 @@
+
+### this is the top-level makefile for the opihi collection of programs
+
+default: all
+
+### the include file dependencies need to be cleaned up still
+
+mana:     	 lib.data lib.shell cmd.basic cmd.data cmd.astro
+dimm:     	 lib.data lib.shell cmd.basic cmd.data cmd.astro
+dvo:      	 lib.data lib.shell cmd.basic cmd.data cmd.astro
+pantasks: 	 lib.data lib.shell cmd.basic cmd.data cmd.astro
+pantasks_server: lib.data lib.shell cmd.basic cmd.data cmd.astro
+pantasks_client: lib.data lib.shell cmd.basic cmd.data cmd.astro
+pclient:  	 lib.data lib.shell cmd.basic
+pcontrol: 	 lib.data lib.shell cmd.basic
+
+LIBS = lib.data lib.shell cmd.basic cmd.data cmd.astro
+
+PROGRAM = mana dvo pantasks pclient pcontrol
+SPECIAL = pantasks_client pantasks_server
+
+EXTRAS = dimm
+
+all:
+	for i in $(PROGRAM) $(SPECIAL); do make $$i || exit; done
+	make pantasks_client
+	make pantasks_server
+
+libs:
+	for i in $(LIBS); do make $$i || exit; done
+
+extras:
+	for i in $(EXTRAS); do make $$i || exit; done
+
+install:
+	for i in $(PROGRAM) $(SPECIAL); do make $$i.install || exit; done
+	make pantasks_client.install
+	make pantasks_server.install
+
+extras-install:
+	for i in $(EXTRAS); do make $$i.install || exit; done
+
+clean:
+	for i in $(PROGRAM) $(SPECIAL) $(EXTRAS) $(LIBS); do make $$i.clean || exit; done
+
+libs-uninstall:
+	for i in $(LIBS); do make $$i.uninstall || exit; done
+
+dist: clean
+	for i in $(PROGRAM) $(SPECIAL) $(EXTRAS) $(LIBS); do make $$i.dist || exit; done
+	rm -rf bin
+	rm -rf lib
+
+#############################################################
+
+pantasks_client pantasks_server:
+	if [ -d pantasks ]; then (cd pantasks && make $@); fi
+
+pantasks_client.install: pantasks_client
+	if [ -d pantasks ]; then (cd pantasks && make $@); fi
+
+pantasks_server.install: pantasks_server
+	if [ -d pantasks ]; then (cd pantasks && make $@); fi
+
+$(PROGRAM) $(LIBS) $(EXTRAS):
+	if [ -d "$@" ]; then (cd $@ && make); fi
+
+%.install:
+	if [ -d "$*" ]; then make $*; fi
+	if [ -d "$*" ]; then (cd $* && make install); fi
+
+%.clean:
+	if [ -d "$*" ]; then (cd $* && make clean); fi
+
+%.dist:
+	if [ -d "$*" ]; then (cd $* && make dist); fi
+
+%.uninstall:
+	if [ -d "$*" ]; then (cd $* && make uninstall); fi
+
+.PHONY: $(PROGRAM) $(LIBS) pantasks_server pantasks_client
Index: /branches/eam_branch_20071222/Ohana/src/opihi/Makefile.Common
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/Makefile.Common	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/Makefile.Common	(revision 15879)
@@ -0,0 +1,88 @@
+
+# utilities #################################################
+# .SUFFIXES: .$(ARCH).o
+
+BASE_CFLAGS   =	$(CFLAGS)
+BASE_CPPFLAGS =	$(CPPFLAGS) -I$(INC) -I$(DESTINC) $(INCDIRS) -D$(ARCH)
+BASE_LDFLAGS  = $(LDFLAGS) -L$(LIB) -L$(DESTLIB) $(LIBDIRS) $(LIBFLAGS)
+
+%.c : %.c.in
+	sed "s|@DATADIR@|$(DATA)|" $< > $@
+
+%.$(ARCH).o : %.c
+	$(CC) $(FULL_CFLAGS) $(FULL_CPPFLAGS) -c $< -o $@
+
+$(BIN)/%.$(ARCH):
+	@if [ ! -d $(BIN) ]; then mkdir -p $(BIN); fi
+	$(CC) $(FULL_CFLAGS) -o $@ $^ $(FULL_LDFLAGS)
+	@echo "compiled $*"
+	@echo ""
+
+$(DESTBIN)/%: $(BIN)/%.$(ARCH) 
+	@if [ ! -d $(DESTBIN) ]; then mkdir -p $(DESTBIN); fi
+	rm -f $(DESTBIN)/$*
+	cp $(BIN)/$*.$(ARCH) $(DESTBIN)/$*
+	@echo "installed $*"
+	@echo ""
+
+$(LIB)/%.$(ARCH).a:
+	@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
+	rm -f $@
+	ar rcv $@ $^ 
+	$(RANLIB) $@
+	@echo "compiled library $*"
+	@echo ""
+
+$(DESTLIB)/%.a: $(LIB)/%.$(ARCH).a
+	@if [ ! -d $(DESTLIB) ]; then mkdir -p $(DESTLIB); fi
+	rm -f $@
+	cp $< $@
+
+$(LIB)/%.$(ARCH).so:
+	@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
+	rm -f $@
+	gcc -shared -Wl,-soname,$*.so -o $@ $^ -lc
+
+$(DESTLIB)/%.so: $(LIB)/%.$(ARCH).so
+	@if [ ! -d $(DESTLIB) ]; then mkdir -p $(DESTLIB); fi
+	rm -f $@
+	cp $< $@
+
+lib%.clean:
+	rm -f $(LIB)/lib$*.$(ARCH).a
+	rm -f $($*)
+	@echo ""
+
+%.help:
+	@echo "installing help files for $*"
+	@if [ ! -d $(DATA)/help ]; then mkdir -p $(DATA)/help; fi
+	@rm -f $(HOME)/$*/help/*~
+	@rm -f $(HOME)/$*/help/#*
+	@for i in `find $(HOME)/$*/help -maxdepth 1 -type f`; do cp -f $$i $(DATA)/help; done
+
+%.modules:
+	@echo "installing modules for $*"
+	@if [ ! -d $(DATA)/modules ]; then mkdir -p $(DATA)/modules; fi
+	@if [ ! -d $(HOME)/modules/$* ]; then echo "no modules for $*"; fi
+	@if [   -d $(HOME)/modules/$* ]; then rm -f $(HOME)/modules/$*/*~; fi
+	@if [   -d $(HOME)/modules/$* ]; then rm -f $(HOME)/modules/$*/#*; fi
+	@if [   -d $(HOME)/modules/$* ]; then for i in `find $(HOME)/modules/$* -name CVS -prune -o -type f -print`; do cp -f $$i $(DATA)/modules; done; fi
+
+%.clean:
+	rm -f $(BIN)/$*.$(ARCH)
+	@echo ""
+
+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 -rf $(BIN)/*
+	rm -rf $(LIB)/*
+
+clean-help:
+	@if [ ! -d $(DATA)/help ]; then mkdir -p $(DATA)/help; fi
+	rm -f $(DATA)/help/*
Index: /branches/eam_branch_20071222/Ohana/src/opihi/bin/.cvsignore
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/bin/.cvsignore	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/bin/.cvsignore	(revision 15879)
@@ -0,0 +1,2 @@
+*.linux *.lin64 *.sol *.sun *.sid *.hp *.irix
+*.linrh
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/Makefile	(revision 15879)
@@ -0,0 +1,82 @@
+default: libastrocmd
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+SRC     =       $(HOME)/cmd.astro
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+FULL_CFLAGS   = $(BASE_CFLAGS) -fPIC
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(BASE_LDFLAGS)
+
+# astro user commands ########################
+srcs = \
+$(SRC)/init.$(ARCH).o             \
+$(SRC)/biassub.$(ARCH).o	   \
+$(SRC)/cgrid.$(ARCH).o		   \
+$(SRC)/coords.$(ARCH).o	   \
+$(SRC)/cplot.$(ARCH).o		   \
+$(SRC)/csystem.$(ARCH).o	   \
+$(SRC)/ctimes.$(ARCH).o	   \
+$(SRC)/cval.$(ARCH).o		   \
+$(SRC)/czplot.$(ARCH).o	   \
+$(SRC)/drizzle.$(ARCH).o	   \
+$(SRC)/flux.$(ARCH).o		   \
+$(SRC)/fixwrap.$(ARCH).o	   \
+$(SRC)/gauss.$(ARCH).o		   \
+$(SRC)/getvel.$(ARCH).o	   \
+$(SRC)/getlst.$(ARCH).o	   \
+$(SRC)/medianmap.$(ARCH).o	   \
+$(SRC)/mkgauss.$(ARCH).o	   \
+$(SRC)/multifit.$(ARCH).o	   \
+$(SRC)/objload.$(ARCH).o	   \
+$(SRC)/outline.$(ARCH).o	   \
+$(SRC)/polar.$(ARCH).o		   \
+$(SRC)/precess.$(ARCH).o	   \
+$(SRC)/profile.$(ARCH).o	   \
+$(SRC)/region.$(ARCH).o	   \
+$(SRC)/rotcurve.$(ARCH).o	   \
+$(SRC)/scale.$(ARCH).o		   \
+$(SRC)/sexigesimal.$(ARCH).o	   \
+$(SRC)/spec.$(ARCH).o		   \
+$(SRC)/star.$(ARCH).o		   \
+$(SRC)/transform.$(ARCH).o        \
+$(SRC)/imsub.$(ARCH).o		   \
+$(SRC)/imfit.$(ARCH).o		   \
+$(SRC)/imfit-fgauss.$(ARCH).o	   \
+$(SRC)/imfit-pgauss.$(ARCH).o	   \
+$(SRC)/imfit-pgauss-psf.$(ARCH).o	   \
+$(SRC)/imfit-qgauss.$(ARCH).o	   \
+$(SRC)/imfit-qgauss-psf.$(ARCH).o	   \
+$(SRC)/imfit-sgauss.$(ARCH).o	   \
+$(SRC)/imfit-sgauss-psf.$(ARCH).o	   \
+$(SRC)/imfit-qfgauss.$(ARCH).o	   \
+$(SRC)/imfit-qrgauss.$(ARCH).o	   
+
+# dependancy rules for include files ########################
+incs = \
+$(INC)/opihi.h \
+$(INC)/external.h \
+$(INC)/shell.h \
+$(INC)/dvomath.h \
+$(INC)/convert.h \
+$(INC)/display.h 
+
+$(srcs): $(incs)
+
+$(LIB)/libastrocmd.$(ARCH).a: $(srcs)
+$(LIB)/libastrocmd.$(ARCH).$(DLLTYPE): $(srcs)
+
+$(DESTLIB)/libastrocmd.a: $(LIB)/libastrocmd.$(ARCH).a
+$(DESTLIB)/libastrocmd.$(DLLTYPE): $(LIB)/libastrocmd.$(ARCH).$(DLLTYPE)
+
+libastrocmd: $(DESTLIB)/libastrocmd.a $(DESTLIB)/libastrocmd.$(DLLTYPE)
+
+uninstall:
+	rm -f $(DESTLIB)/libastrocmd.a
+	rm -f $(DESTLIB)/libastrocmd.$(DLLTYPE)
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/biassub.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/biassub.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/biassub.c	(revision 15879)
@@ -0,0 +1,126 @@
+# include "astro.h"
+
+int biassub (int argc, char **argv) {
+  
+  int i, j, k, N, dir, nlong, nwide, start;
+  int sx, sy, nx, ny, NX, NY, NoVector, Nval;
+  float *V, *DV, dV, *vect, *segment, val;
+  Vector *xvec, *yvec;
+  Buffer *buf;
+
+  xvec = yvec = NULL;
+  NoVector = TRUE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    NoVector = FALSE;
+    remove_argument (N, &argc, argv);
+    if ((xvec = SelectVector (argv[N], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    remove_argument (N, &argc, argv);
+    if ((yvec = SelectVector (argv[N], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 7) {
+    gprint (GP_ERR, "USAGE: biassub <buffer> sx sy nx ny dir [-v N V]\n");
+    gprint (GP_ERR, "  optional storage of vector and sequence in N and V\n");
+    return (FALSE);
+  }
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  sx = atof (argv[2]);
+  sy = atof (argv[3]);
+  nx = atof (argv[4]);
+  ny = atof (argv[5]);
+  dir = atof (argv[6]);
+  if ((dir != 0) && (dir != 1)) {
+    gprint (GP_ERR, " dir must be either 0 (x) or 1 (y)\n");
+    return (FALSE);
+  }
+  if (dir) {
+    start = sy;
+    nwide = nx;
+    nlong = ny;
+  } else {
+    start = sx;
+    nwide = ny;
+    nlong = nx;
+  }    
+  gprint (GP_LOG, "start: %d %d  size: %d %d\n", sx, sy, nx, ny);
+
+    if ((sx < 0) || (sy < 0) || 
+      (sx+nx > buf[0].matrix.Naxis[0]) || 
+      (sy+ny > buf[0].matrix.Naxis[1])) {
+    gprint (GP_ERR, "region out of range\n");
+    return (FALSE);
+  }
+
+  ALLOCATE (vect, float, nlong);
+  ALLOCATE (segment, float, nwide);
+
+  NX = buf[0].matrix.Naxis[0];
+  NY = buf[0].matrix.Naxis[1];
+  if (dir) {
+    for (j = sy; j < sy + ny; j++) {
+      V = (float *)(buf[0].matrix.buffer) + j*NX + sx; 
+      for (i = 0; i < nx; i++, V++) {
+	segment[i] = *V;
+      }
+      fsort (segment, nwide);
+      val = Nval = 0;
+      for (k = 0.25*nwide; k <=0.75*nwide; k++) {
+	val += segment[k];
+	Nval ++;
+      }
+      vect[j-sy] = val / Nval;
+    }
+  } else {
+    for (i = 0; i < nx; i++) {
+      V = (float *)(buf[0].matrix.buffer) + sy*NX + sx + i; 
+      for (j = 0; j < ny; j++, V+=NX) {
+	segment[j] = *V;
+      }
+      fsort (segment, nwide);
+      val = Nval = 0;
+      for (k = 0.25*nwide; k <=0.75*nwide; k++) {
+	val += segment[k];
+	Nval ++;
+      }
+      vect[i] = val / Nval;
+    }
+  }
+
+  if (!NoVector) {
+    xvec[0].Nelements = yvec[0].Nelements = nlong;
+    REALLOCATE (xvec[0].elements, float, nlong);
+    REALLOCATE (yvec[0].elements, float, nlong);
+    for (i = 0; i < nlong; i++) {
+      xvec[0].elements[i] = i + start;
+      yvec[0].elements[i] = vect[i];
+    }
+  }
+
+  if (dir) {
+    /* here we run all the way across in X for the defined Y range */
+    for (j = sy; j < sy + ny; j++) {
+      V = (float *)(buf[0].matrix.buffer) + j*NX; 
+      dV = vect[j];
+      for (i = 0; i < NX; i++, V++) {
+	*V -= dV;
+      }
+    }
+  } else {
+    /* here we run all the way across in Y for the defined X range */
+    for (j = 0; j < NY; j++) {
+      V = (float *)(buf[0].matrix.buffer) + j*NX + sx; 
+      DV = vect;
+      for (i = 0; i < nx; i++, V++, DV++) {
+	*V -= *DV;
+      }
+    }
+  }
+
+  free (segment);
+  free (vect);
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/cgrid.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/cgrid.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/cgrid.c	(revision 15879)
@@ -0,0 +1,399 @@
+# include "astro.h"
+# define CHECKELEMENTS \
+  if (N == NELEMENTS) { \
+    NELEMENTS +=200; \
+    REALLOCATE (Xvec.elements, float, NELEMENTS); \
+    REALLOCATE (Yvec.elements, float, NELEMENTS); \
+  }
+
+int cgrid (int argc, char **argv) {
+  
+  double range, lrange, factor, mantis, power, fmantis;
+  double firstRA, firstDEC, minorRA, minorDEC;
+  double r, d, dR, dD, D;
+  double x, y;
+  Vector Xvec, Yvec;
+  int kapa, NorthPole, SouthPole, N, OnPic, LOnPic, status, NELEMENTS, First;
+  Graphdata graphmode;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: cgrid [style]\n");
+    return (FALSE);
+  }
+
+  /* are we plotting one of the poles? */
+  NorthPole = SouthPole = FALSE;
+  status = RD_to_XY (&x, &y, 0.0, 90.0, &graphmode.coords);
+  if ((x >= graphmode.xmin) && (x <= graphmode.xmax) && 
+      (y >= graphmode.ymin) && (y <= graphmode.ymax) && status)
+    NorthPole = TRUE;
+  status = RD_to_XY (&x, &y, 0.0, -90.0, &graphmode.coords);
+  if ((x >= graphmode.xmin) && (x <= graphmode.xmax) && 
+      (y >= graphmode.ymin) && (y <= graphmode.ymax) && status)
+    SouthPole = TRUE;
+
+  /* set spacings for RA */
+  minorRA = minorDEC = 0.1;
+  range = MIN (fabs(graphmode.xmax-graphmode.xmin), fabs(graphmode.ymax-graphmode.ymin));
+  if (NorthPole || SouthPole) range = 360;
+  lrange = log10(MAX(fabs(range), 1e-30));
+  factor = (int) (lrange);
+  if (lrange < 0) { factor -= 1; }
+  mantis = lrange - factor;
+  power = pow(10.0, factor);
+  fmantis = pow(10.0, mantis);
+  if ((fmantis >= 1.0) && (fmantis <=  2.0)) {
+    minorRA = 0.1 * power;
+  }
+  if ((fmantis > 2.0) && (fmantis <=  4.0)) {
+    minorRA = 0.2 * power;
+  }
+  if ((fmantis > 4.0) && (fmantis <=  6.0)) {
+    minorRA = 0.5 * power;
+  }
+  if ((fmantis > 6.0) && (fmantis <=  10.0)) {
+    minorRA = 0.5 * power;
+  }
+  dR = range / 100.0;
+  /* set spacings for DEC */
+  range = MIN (fabs(graphmode.xmax-graphmode.xmin), fabs(graphmode.ymax-graphmode.ymin));
+  lrange = log10(MAX(fabs(range), 1e-30));
+  factor = (int) (lrange);
+  if (lrange < 0) { factor -= 1; }
+  mantis = lrange - factor;
+  power = pow(10.0, factor);
+  fmantis = pow(10.0, mantis);
+  if ((fmantis >= 1.0) && (fmantis <=  2.0)) {
+    minorDEC = 0.1 * power;
+  }
+  if ((fmantis > 2.0) && (fmantis <=  4.0)) {
+    minorDEC = 0.2 * power;
+  }
+  if ((fmantis > 4.0) && (fmantis <=  6.0)) {
+    minorDEC = 0.5 * power;
+  }
+  if ((fmantis > 6.0) && (fmantis <=  10.0)) {
+    minorDEC = 0.5 * power;
+  }
+  dD = range / 100.0;
+
+  /* choose a starting point */
+  if ((int)(graphmode.coords.crval1/minorRA) == (graphmode.coords.crval1/minorRA)) {
+    firstRA = graphmode.coords.crval1;
+  } else {
+    firstRA = minorRA + minorRA*((int)(graphmode.coords.crval1/minorRA));
+  }
+  if ((int)(graphmode.coords.crval2/minorDEC) == (graphmode.coords.crval2/minorDEC)) {
+    firstDEC = graphmode.coords.crval2;
+  } else {
+    firstDEC = minorDEC + minorDEC*((int)(graphmode.coords.crval2/minorDEC));
+  }
+  if (SouthPole) firstDEC = -90;
+  if (NorthPole) firstDEC = 90;
+  
+  /* prepare vectors to hold data */
+  NELEMENTS = 200;
+  ALLOCATE (Xvec.elements, float, NELEMENTS);
+  ALLOCATE (Yvec.elements, float, NELEMENTS);
+  N = 0;
+  
+  /***  do consecutive RA lines, first increasing **/
+  OnPic = TRUE;
+  for (r = firstRA; (r <= firstRA + 180) && (OnPic); r += minorRA) {
+    /* first, DEC increasing */
+    LOnPic = TRUE;
+    OnPic = FALSE;
+    First = TRUE;
+    for (d = firstDEC; (d < 90 + dD) && (LOnPic || NorthPole || SouthPole); d += dD) {
+      D = MAX (-90, MIN(90, d));
+      status = fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, D, &graphmode.coords);
+      /*
+      if ((fabs(Xvec.elements[N] - Xvec.elements[N-1]) > 10) && (fabs(Yvec.elements[N] - Yvec.elements[N-1]) > 10))
+	First = TRUE;
+	*/
+      if ((Xvec.elements[N] >= graphmode.xmin) && (Xvec.elements[N] <= graphmode.xmax) && 
+	  (Yvec.elements[N] >= graphmode.ymin) && (Yvec.elements[N] <= graphmode.ymax) && status) {
+	N++;
+	CHECKELEMENTS;
+	OnPic = TRUE;
+	if (!First) {
+	  Xvec.elements[N] = Xvec.elements[N-1];
+	  Yvec.elements[N] = Yvec.elements[N-1];
+	  N++;
+	  CHECKELEMENTS;
+	} else {
+	  if (N > 1) {
+	    Xvec.elements[N-2] = Xvec.elements[N-1];
+	    Yvec.elements[N-2] = Yvec.elements[N-1];
+	    N--;
+	  }
+	  First = FALSE;
+	}
+      } else {
+	LOnPic = FALSE;
+	First = TRUE;
+      }
+    }
+    /* next, DEC decreasing */
+    First = TRUE;
+    LOnPic = TRUE;
+    for (d = firstDEC; (d > -90 - dD) && (LOnPic || NorthPole || SouthPole); d -= dD) {
+      D = MAX (-90, MIN(90, d));
+      status = fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, D, &graphmode.coords);
+      /*
+      if ((fabs(Xvec.elements[N] - Xvec.elements[N-1]) > 10) && (fabs(Yvec.elements[N] - Yvec.elements[N-1]) > 10))
+	First = TRUE;
+	*/
+      if ((Xvec.elements[N] >= graphmode.xmin) && (Xvec.elements[N] <= graphmode.xmax) && 
+	  (Yvec.elements[N] >= graphmode.ymin) && (Yvec.elements[N] <= graphmode.ymax) && status) {
+	N++;
+	CHECKELEMENTS;
+	OnPic = TRUE;
+	if (!First) {
+	  Xvec.elements[N] = Xvec.elements[N-1];
+	  Yvec.elements[N] = Yvec.elements[N-1];
+	  N++;
+	  CHECKELEMENTS;
+	} else {
+	  if (N > 1) {
+	    Xvec.elements[N-2] = Xvec.elements[N-1];
+	    Yvec.elements[N-2] = Yvec.elements[N-1];
+	    N--;
+	  }
+	  First = FALSE;
+	}
+      } else {
+	LOnPic = FALSE;
+	First = TRUE;
+      } 
+    }
+  }
+
+  /***  do consecutive RA lines, decreasing **/
+  OnPic = TRUE;
+  for (r = firstRA; (r >=  firstRA - 180) && (OnPic); r -= minorRA) {
+    /* first, DEC increasing */
+    First = TRUE;
+    LOnPic = TRUE;
+    OnPic = FALSE;
+    for (d = firstDEC; (d < 90 + dD) && (LOnPic || NorthPole || SouthPole); d += dD) {
+      D = MAX (-90, MIN(90, d));
+      status = fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, D, &graphmode.coords);
+      /*
+      if ((fabs(Xvec.elements[N] - Xvec.elements[N-1]) > 10) && (fabs(Yvec.elements[N] - Yvec.elements[N-1]) > 10))
+	First = TRUE;
+	*/
+      if ((Xvec.elements[N] >= graphmode.xmin) && (Xvec.elements[N] <= graphmode.xmax) && 
+	  (Yvec.elements[N] >= graphmode.ymin) && (Yvec.elements[N] <= graphmode.ymax) && status) {
+	N++;
+	CHECKELEMENTS;
+	OnPic = TRUE;
+	if (!First) {
+	  Xvec.elements[N] = Xvec.elements[N-1];
+	  Yvec.elements[N] = Yvec.elements[N-1];
+	  N++;
+	  CHECKELEMENTS;
+	} else {
+	  if (N > 1) {
+	    Xvec.elements[N-2] = Xvec.elements[N-1];
+	    Yvec.elements[N-2] = Yvec.elements[N-1];
+	    N--;
+	  }
+	  First = FALSE;
+	}
+      } else {
+	LOnPic = FALSE;
+	First = TRUE;
+      }
+    }
+    /* next, DEC decreasing */
+    First = TRUE;
+    LOnPic = TRUE;
+    for (d = firstDEC; (d > -90 - dD) && (LOnPic || NorthPole || SouthPole); d -= dD) {
+      D = MAX (-90, MIN(90, d));
+      status = fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, D, &graphmode.coords);
+      /*
+      if ((fabs(Xvec.elements[N] - Xvec.elements[N-1]) > 10) && (fabs(Yvec.elements[N] - Yvec.elements[N-1]) > 10))
+	First = TRUE;
+	*/
+      if ((Xvec.elements[N] >= graphmode.xmin) && (Xvec.elements[N] <= graphmode.xmax) && 
+	  (Yvec.elements[N] >= graphmode.ymin) && (Yvec.elements[N] <= graphmode.ymax) && status) {
+	N++;
+	CHECKELEMENTS;
+	OnPic = TRUE;
+	if (!First) {
+	  Xvec.elements[N] = Xvec.elements[N-1];
+	  Yvec.elements[N] = Yvec.elements[N-1];
+	  N++;
+	  CHECKELEMENTS;
+	} else {
+	  if (N > 1) {
+	    Xvec.elements[N-2] = Xvec.elements[N-1];
+	    Yvec.elements[N-2] = Yvec.elements[N-1];
+	    N--;
+	  }
+	  First = FALSE;
+	}
+      } else {
+	LOnPic = FALSE;
+	First = TRUE;
+      }
+    }
+  }
+
+  /***  do consecutive DEC lines, first increasing **/
+  OnPic = TRUE;
+  for (d = firstDEC; (d < 90 + dD) && (OnPic); d += minorDEC) {
+    D = MAX (-90, MIN(90, d));
+    /* first, RA increasing */
+    LOnPic = TRUE;
+    OnPic = FALSE;
+    First = TRUE;
+    for (r = firstRA; (r < firstRA + 180) && (LOnPic || NorthPole || SouthPole); r += dR) {
+      status = fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, D, &graphmode.coords);
+      /*
+      if ((fabs(Xvec.elements[N] - Xvec.elements[N-1]) > 10) && (fabs(Yvec.elements[N] - Yvec.elements[N-1]) > 10))
+	First = TRUE;
+	*/
+      if ((Xvec.elements[N] >= graphmode.xmin) && (Xvec.elements[N] <= graphmode.xmax) && 
+	  (Yvec.elements[N] >= graphmode.ymin) && (Yvec.elements[N] <= graphmode.ymax) && status) {
+	N++;
+	CHECKELEMENTS;
+	OnPic = TRUE;
+	if (!First) {
+	  Xvec.elements[N] = Xvec.elements[N-1];
+	  Yvec.elements[N] = Yvec.elements[N-1];
+	  N++;
+	  CHECKELEMENTS;
+	} else {
+	  if (N > 1) {
+	    Xvec.elements[N-2] = Xvec.elements[N-1];
+	    Yvec.elements[N-2] = Yvec.elements[N-1];
+	    N--;
+	  }
+	  First = FALSE;
+	}
+      } else {
+	LOnPic = FALSE;
+	First = TRUE;
+      }
+    }
+    /* next, RA decreasing */
+    First = TRUE;
+    LOnPic = TRUE;
+    for (r = firstRA; (r > firstRA - 180) && (LOnPic || NorthPole || SouthPole); r -= dR) {
+      status = fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, D, &graphmode.coords);
+      /*
+      if ((fabs(Xvec.elements[N] - Xvec.elements[N-1]) > 10) && (fabs(Yvec.elements[N] - Yvec.elements[N-1]) > 10))
+	First = TRUE;
+	*/
+      if ((Xvec.elements[N] >= graphmode.xmin) && (Xvec.elements[N] <= graphmode.xmax) && 
+	  (Yvec.elements[N] >= graphmode.ymin) && (Yvec.elements[N] <= graphmode.ymax) && status) {
+	N++;
+	CHECKELEMENTS;
+	OnPic = TRUE;
+	if (!First) {
+	  Xvec.elements[N] = Xvec.elements[N-1];
+	  Yvec.elements[N] = Yvec.elements[N-1];
+	  N++;
+	  CHECKELEMENTS;
+	} else {
+	  if (N > 1) {
+	    Xvec.elements[N-2] = Xvec.elements[N-1];
+	    Yvec.elements[N-2] = Yvec.elements[N-1];
+	    N--;
+	  }
+	  First = FALSE;
+	}
+      } else {
+	LOnPic = FALSE;
+	First = TRUE;
+      }
+    }
+  }
+
+  /***  do consecutive DEC lines, decreasing **/
+  OnPic = TRUE;
+  for (d = firstDEC; (d > -90 - dD) && (OnPic); d -= minorDEC) {
+    D = MAX (-90, MIN(90, d));
+    /* first, RA increasing */
+    LOnPic = TRUE;
+    OnPic = FALSE;
+    First = TRUE;
+    for (r = firstRA; (r < firstRA + 180) && (LOnPic || NorthPole || SouthPole); r += dR) {
+      status = fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, D, &graphmode.coords);
+      /*
+      if ((fabs(Xvec.elements[N] - Xvec.elements[N-1]) > 10) && (fabs(Yvec.elements[N] - Yvec.elements[N-1]) > 10))
+	First = TRUE;
+	*/
+      if ((Xvec.elements[N] >= graphmode.xmin) && (Xvec.elements[N] <= graphmode.xmax) && 
+	  (Yvec.elements[N] >= graphmode.ymin) && (Yvec.elements[N] <= graphmode.ymax) && status) {
+	N++;
+	CHECKELEMENTS;
+	OnPic = TRUE;
+	if (!First) {
+	  Xvec.elements[N] = Xvec.elements[N-1];
+	  Yvec.elements[N] = Yvec.elements[N-1];
+	  N++;
+	  CHECKELEMENTS;
+	} else {
+	  if (N > 1) {
+	    Xvec.elements[N-2] = Xvec.elements[N-1];
+	    Yvec.elements[N-2] = Yvec.elements[N-1];
+	    N--;
+	  }
+	  First = FALSE;
+	}
+      } else {
+	LOnPic = FALSE;
+	First = TRUE;
+      }
+    }
+    /* next, RA decreasing */
+    First = TRUE;
+    LOnPic = TRUE;
+    for (r = firstRA; (r > firstRA - 180) && (LOnPic || NorthPole || SouthPole); r -= dR) {
+      status = fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, D, &graphmode.coords);
+      /*
+      if ((fabs(Xvec.elements[N] - Xvec.elements[N-1]) > 10) && (fabs(Yvec.elements[N] - Yvec.elements[N-1]) > 10))
+	First = TRUE;
+	*/
+      if ((Xvec.elements[N] >= graphmode.xmin) && (Xvec.elements[N] <= graphmode.xmax) && 
+	  (Yvec.elements[N] >= graphmode.ymin) && (Yvec.elements[N] <= graphmode.ymax) && status) {
+	N++;
+	CHECKELEMENTS;
+	OnPic = TRUE;
+	if (!First) {
+	  Xvec.elements[N] = Xvec.elements[N-1];
+	  Yvec.elements[N] = Yvec.elements[N-1];
+	  N++;
+	  CHECKELEMENTS;
+	} else {
+	  if (N > 1) {
+	    Xvec.elements[N-2] = Xvec.elements[N-1];
+	    Yvec.elements[N-2] = Yvec.elements[N-1];
+	    N--;
+	  }
+	  First = FALSE;
+	}
+      } else {
+	LOnPic = FALSE;
+	First = TRUE;
+      }
+    }
+  }
+  
+  /* send the line segments as connect-points */
+  Xvec.Nelements = Yvec.Nelements = N;
+  graphmode.style = 2; /* points */
+  graphmode.ptype = 100; /* connect a pair */
+  graphmode.etype = 0;
+  PlotVectorPair (kapa, N, Xvec.elements, Yvec.elements, &graphmode);
+
+  free (Xvec.elements);
+  free (Yvec.elements);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/coords.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/coords.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/coords.c	(revision 15879)
@@ -0,0 +1,109 @@
+# include "astro.h"
+
+enum {NONE, SKY, PIXEL, VECTOR, SCALAR};
+
+int coords (int argc, char **argv) {
+
+  int i, mode, form, N, Quiet;
+  double Xin, Yin, Xout, Yout;
+  char *MOSAIC;
+  Coords coords, moscoords;
+  Buffer *buf, *mosbuffer;
+  Vector *xvec, *yvec;
+
+  MOSAIC = NULL;
+  if ((N = get_argument (argc, argv, "-mosaic"))) {
+    remove_argument (N, &argc, argv);
+    MOSAIC = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  Quiet = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  form = NONE;
+  mode = NONE;
+  if ((N = get_argument (argc, argv, "-p"))) {
+    remove_argument (N, &argc, argv);
+    mode = SKY;
+  }
+  if ((N = get_argument (argc, argv, "-c"))) {
+    if (mode == SKY) goto syntax;
+    remove_argument (N, &argc, argv);
+    mode = PIXEL;
+  }
+  if (mode == NONE) goto syntax;
+  if (argc != 4) goto syntax;
+
+  if (SelectScalar (argv[2], &Xin)) {
+    if (!SelectScalar (argv[3], &Yin)) {
+      gprint (GP_ERR, "syntax error: mixed vector and scalar?\n");
+      return (FALSE);
+    }
+    form = SCALAR;
+  } else {
+    if ((xvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+    if ((yvec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+    if (xvec[0].Nelements != yvec[0].Nelements) {
+      fprintf (stderr, "mis-matched vector lengths\n");
+      return (FALSE);
+    }
+    form = VECTOR;
+  }      
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) goto escape;
+  GetCoords (&coords, &buf[0].header);
+  if (!strcmp(&coords.ctype[4], "-WRP")) {
+    if (MOSAIC == NULL) {
+      gprint (GP_ERR, "must supply mosaic for WRP coords\n");
+      return (FALSE);
+    }
+    if ((mosbuffer = SelectBuffer (MOSAIC, OLDBUFFER, TRUE)) == NULL) goto escape;
+    GetCoords (&moscoords, &mosbuffer[0].header);
+    RegisterMosaic (&moscoords);
+  }
+  
+  if (form == SCALAR) {
+    if (mode == SKY) {
+      XY_to_RD (&Xout, &Yout, Xin, Yin, &coords);
+      if (!Quiet) gprint (GP_LOG, "%10.6f %10.6f\n", Xout, Yout);
+      set_variable ("RA", Xout);
+      set_variable ("DEC", Yout);
+      return (TRUE);
+    }
+    if (mode == PIXEL) {
+      RD_to_XY (&Xout, &Yout, Xin, Yin, &coords);
+      if (!Quiet) gprint (GP_LOG, "%7.2f %7.2f\n", Xout, Yout);
+      set_variable ("Xc", Xout);
+      set_variable ("Yc", Yout);
+      return (TRUE);
+    }
+  }
+  if (mode == SKY) {
+    for (i = 0; i < xvec[0].Nelements; i++) {
+      fXY_to_RD (&xvec[0].elements[i], &yvec[0].elements[i], xvec[0].elements[i], yvec[0].elements[i], &coords);
+    }
+    return (TRUE);
+  }
+  if (mode == PIXEL) {
+    for (i = 0; i < xvec[0].Nelements; i++) {
+      fRD_to_XY (&xvec[0].elements[i], &yvec[0].elements[i], xvec[0].elements[i], yvec[0].elements[i], &coords);
+    }
+    return (TRUE);
+  }
+  return (FALSE);
+
+ syntax:
+  gprint (GP_ERR, "USAGE: coords [buffer] (-c R D) | (-p X Y)\n");
+  gprint (GP_ERR, "only one of -p or -c can be used\n");
+ escape:
+  if (MOSAIC != NULL) free (MOSAIC);
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/cplot.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/cplot.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/cplot.c	(revision 15879)
@@ -0,0 +1,85 @@
+# include "astro.h"
+
+int cplot (int argc, char **argv) {
+  
+  int i, kapa, Npts, status, leftside;
+  float *x, *y, *r, *d, Rmin, Rmax, Rmid;
+  Vector Xvec, Yvec, *xvec, *yvec;
+  Graphdata graphmode;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: cplot <ra> <dec> [style]\n");
+    return (FALSE);
+  }
+
+  Rmin = graphmode.coords.crval1 - 182.0;
+  Rmax = graphmode.coords.crval1 + 182.0;
+  Rmid = 0.5*(Rmin + Rmax);
+
+  /* find vectors */
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (xvec[0].Nelements != yvec[0].Nelements) {
+    gprint (GP_ERR, "vectors are not the same length\n");
+    return (FALSE);
+  }
+
+  ALLOCATE (Xvec.elements, float, xvec[0].Nelements);
+  ALLOCATE (Yvec.elements, float, xvec[0].Nelements);
+    
+  Xvec.Nelements = xvec[0].Nelements;
+  Yvec.Nelements = xvec[0].Nelements;
+  
+  r = xvec[0].elements;
+  d = yvec[0].elements;
+  x = Xvec.elements;
+  y = Yvec.elements;
+  
+  Npts = 0;
+  for (i = 0; i < Xvec.Nelements; i++, r++, d++) {
+    while (*r < Rmin) *r += 360.0;
+    while (*r > Rmax) *r -= 360.0;
+
+    // for pair-by-pair connections, check on second point if we straddle the back midline
+    if ((graphmode.ptype == 100) && (i % 2)) {
+      leftside = (r[-1] < Rmid); // if first of the pair is left, second must be as well
+      if ( leftside && (r[0] > Rmid + 90)) { r[0] -= 360.0; }
+      if (!leftside && (r[0] < Rmid - 90)) { r[0] += 360.0; }
+    }
+    status = fRD_to_XY (x, y, *r, *d, &graphmode.coords);
+
+    // if we fail on one of the points, drop the corresponding pair
+    if (!status) {
+      if (graphmode.ptype == 100) {
+	if (i % 2) {
+	  // for odd points, skip previous also
+	  x--;
+	  y--;
+	  Npts--;
+	} else {
+	  // for even points, skip previous also
+	  i++;
+	  r++;
+	  d++;
+	}
+      }
+      continue;
+    }
+    x++;
+    y++;
+    Npts++;
+  }
+  Xvec.Nelements = Npts;
+
+  graphmode.etype = 0;
+  PlotVectorPair (kapa, Npts, Xvec.elements, Yvec.elements, &graphmode);
+  
+  free (Xvec.elements);
+  free (Yvec.elements);
+    
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/csystem.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/csystem.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/csystem.c	(revision 15879)
@@ -0,0 +1,141 @@
+# include "astro.h"
+
+int csystem (int argc, char **argv) {
+
+  /* USAGE: csystem [C/G/E/H] [C/G/E/H] [epoch] */
+  int i;
+  double X, Y, Xo, xo, phi, T;
+  double sin_x, sin_y, cos_x, cos_y;
+  float *x, *y;
+  struct timeval now;
+  struct tm *local;
+  Vector *xvec, *yvec;
+   
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: csystems [C/G/E/H] [C/G/E/H] X Y\n");
+    return (FALSE);
+  }
+
+  Xo = xo = phi = 0;
+  switch (argv[1][0]) {
+  case 'C':
+    switch (argv[2][0]) {
+    case 'C': 
+      gprint (GP_ERR, "same coordinate system\n");
+      return (TRUE);
+      break;
+    case 'G':
+      phi = -62.6*RAD_DEG;
+      Xo = 282.25;
+      xo = 33;
+      break;
+    case 'E':
+      gettimeofday (&now, (struct timezone *) NULL);
+      local = localtime (&now.tv_sec);
+      T = local[0].tm_year / 100.0;
+      phi = -1*(23.452294 - 0.013013*T - 0.000001639*T*T + 0.000000503*T*T*T);
+      phi *= RAD_DEG;
+      Xo = xo = 0.0;
+      break;
+    }
+    break;
+  case 'E':
+    switch (argv[2][0]) {
+    case 'C': 
+      gettimeofday (&now, (struct timezone *) NULL);
+      local = localtime (&now.tv_sec);
+      T = local[0].tm_year / 100.0;
+      phi = 23.452294 - 0.013013*T - 0.000001639*T*T + 0.000000503*T*T*T;
+      phi *= RAD_DEG;
+      Xo = xo = 0.0;
+      break;
+    case 'G':
+      gprint (GP_ERR, "error: conversions between galactic and ecliptic not implemented\n");
+      return (FALSE);
+      phi = -62.6*RAD_DEG;
+      Xo = 282.25;
+      xo = 33;
+      break;
+    case 'E':
+      phi = Xo = xo = 0.0;
+      break;
+    }
+    break;
+  case 'G':
+    switch (argv[2][0]) {
+    case 'C': 
+      phi = 62.6*RAD_DEG;
+      Xo = 33;
+      xo = 282.25;
+      break;
+    case 'G':
+      phi = Xo = xo = 0.0;
+      break;
+    case 'E':
+      gprint (GP_ERR, "error: conversions between galactic and ecliptic not implemented\n");
+      return (FALSE);
+      gettimeofday (&now, (struct timezone *) NULL);
+      local = localtime (&now.tv_sec);
+      T = local[0].tm_year / 100.0;
+      phi = -1*(23.452294 - 0.013013*T - 0.000001639*T*T + 0.000000503*T*T*T);
+      Xo = xo = 0.0;
+      break;
+    }
+  }
+ 
+  Xo *= RAD_DEG;
+
+  if (SelectScalar (argv[3], &X)) {
+      if (!SelectScalar (argv[4], &Y)) return (FALSE);
+      
+      X *= RAD_DEG;
+      Y *= RAD_DEG;
+
+      sin_y = cos(Y)*sin(X - Xo)*sin(phi) + sin(Y)*cos(phi);
+      cos_y = sqrt (1 - sin_y*sin_y);
+      sin_x = (cos(Y)*sin(X - Xo)*cos(phi) - sin(Y)*sin(phi)) /  cos_y;
+      cos_x = cos(Y)*cos(X - Xo) / cos_y;
+      
+      X = (DEG_RAD * atan2 (sin_x, cos_x) + xo + 360);
+      
+      while (X >= 360.0)
+	  X -= 360;
+      Y = DEG_RAD * atan2 (sin_y, cos_y);
+
+      gprint (GP_LOG, "%10.6f %10.6f\n", X, Y);
+      return (TRUE);
+  }
+
+  /* find vectors */
+  if ((xvec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[4], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (xvec[0].Nelements != yvec[0].Nelements) {
+    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[3], argv[4]);
+    return (FALSE);
+  }
+  
+  x = xvec[0].elements;
+  y = yvec[0].elements;
+
+  for (i = 0; i < xvec[0].Nelements; i++, x++, y++) {
+    X = *x*RAD_DEG;
+    Y = *y*RAD_DEG;
+
+    sin_y = cos(Y)*sin(X - Xo)*sin(phi) + sin(Y)*cos(phi);
+    cos_y = sqrt (1 - sin_y*sin_y);
+    sin_x = (cos(Y)*sin(X - Xo)*cos(phi) - sin(Y)*sin(phi)) /  cos_y;
+    cos_x = cos(Y)*cos(X - Xo) / cos_y;
+    
+    X = (DEG_RAD * atan2 (sin_x, cos_x) + xo + 360);
+    
+    while (X >= 360.0)
+      X -= 360;
+    Y = DEG_RAD * atan2 (sin_y, cos_y);
+    *x = X;
+    *y = Y;
+  }
+
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/ctimes.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/ctimes.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/ctimes.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "astro.h"
+
+int ctimes (int argc, char **argv) {
+
+  int Reference, TimeFormat, N;
+  double value;
+  time_t time, TimeReference;
+  char *date, *Variable;
+
+  Variable = (char *) NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    Variable = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: ctimes [-ref (value) / -abs (date)] [-var name]\n");
+    return (FALSE);
+  }
+
+  GetTimeFormat (&TimeReference, &TimeFormat);
+
+  Reference = FALSE;
+  if (!strcmp (argv[1], "-ref")) Reference = TRUE;
+
+  if (Reference) {
+
+    value = atof (argv[2]);
+    time = TimeRef (value, TimeReference, TimeFormat);
+    date = ohana_sec_to_date (time);
+    
+    if (Variable != (char *) NULL) {
+      set_str_variable (Variable, date);
+      free (Variable);
+    } else {
+      gprint (GP_ERR, "time: %s\n", date);
+    }
+
+    free (date);
+    return (TRUE);
+
+  } else {
+
+    if (strcmp (argv[1], "-abs")) {
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+
+    if (!ohana_str_to_time (argv[2], &time)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    
+    value = TimeValue (time, TimeReference, TimeFormat);
+    
+    if (Variable != (char *) NULL) {
+      set_variable (Variable, value);
+      free (Variable);
+      return (TRUE);
+    }
+    gprint (GP_ERR, "time: %f\n", value);
+    return (TRUE);
+  }
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/cval.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/cval.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/cval.c	(revision 15879)
@@ -0,0 +1,51 @@
+# include "astro.h"
+
+int cval (int argc, char **argv) {
+  
+  int i, j, Nx;
+  int sx, sy, nx, ny, xo, yo, dx, dy;
+  float *V, cval, val, sn, sky;
+  Buffer *buf;
+
+  if (argc != 7) {
+    gprint (GP_ERR, "USAGE: cval <buffer> x y dx dy sky\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  xo = atof (argv[2]);
+  yo = atof (argv[3]);
+  dx = atof (argv[4]);
+  dy = atof (argv[5]);
+  sky = atof (argv[6]);
+
+  sx = xo - dx;
+  sy = yo - dy;
+  nx = 2*dx + 1;
+  ny = 2*dy + 1;
+  if ((sx < 0) || (sy < 0) || 
+      (sx+nx > buf[0].matrix.Naxis[0]) || 
+      (sy+ny > buf[0].matrix.Naxis[1])) {
+    gprint (GP_ERR, "region out of range\n");
+    return (FALSE);
+  }
+
+  V = (float *)buf[0].matrix.buffer;
+  Nx = buf[0].matrix.Naxis[0];
+  val = V[xo + yo*Nx];
+
+  sn = 0;
+  cval = 0;
+  for (j = sy; j < sy + ny; j++) {
+    for (i = sx; i < sx + nx; i++) {
+      cval += (val - V[i + j*Nx]) / sqrt(V[i + j*Nx]);
+      sn += SQ (V[i + j*Nx] - sky) / V[i + j*Nx];
+    }
+  }
+
+  gprint (GP_ERR, "cval: %f  sn: %f\n", cval, sqrt(sn));
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/czplot.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/czplot.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/czplot.c	(revision 15879)
@@ -0,0 +1,68 @@
+# include "astro.h"
+
+int czplot (int argc, char **argv) {
+  
+  int i, kapa, Npts;
+  double min, range, Rmin, Rmax;
+  float *in, *out, *r, *d, *x, *y;
+  Vector Xvec, Yvec, Zvec, *xvec, *yvec, *zvec;
+  Graphdata graphmode;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: czplot <x> <y> <z> min max\n");
+    return (FALSE);
+  }
+
+  min = atof(argv[4]);
+  range = atof(argv[5]) - min;
+  Rmin = graphmode.coords.crval1 - 180.0;
+  Rmax = graphmode.coords.crval1 + 180.0;
+
+  /* find vectors */
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((zvec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (xvec[0].Nelements != yvec[0].Nelements) {
+    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[1], argv[2]);
+    return (FALSE);
+  }
+  if (xvec[0].Nelements != zvec[0].Nelements) {
+    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[1], argv[3]);
+    return (FALSE);
+  }
+  Xvec.Nelements = xvec[0].Nelements;
+  Yvec.Nelements = xvec[0].Nelements;
+  Zvec.Nelements = zvec[0].Nelements;
+  ALLOCATE (Xvec.elements, float, Xvec.Nelements);
+  ALLOCATE (Yvec.elements, float, Yvec.Nelements);
+  ALLOCATE (Zvec.elements, float, Zvec.Nelements);
+  
+  r   = xvec[0].elements;
+  d   = yvec[0].elements;
+  in  = zvec[0].elements;
+  x   = Xvec.elements;
+  y   = Yvec.elements;
+  out = Zvec.elements;
+  for (i = 0; i < Zvec.Nelements; i++, in++, out++, r++, d++, x++, y++) {
+    *out = MIN (1.0, MAX (0.01, (*in - min) / range));
+    while (*r < Rmin) *r += 360.0;
+    while (*r > Rmax) *r -= 360.0;
+    fRD_to_XY (x, y, *r, *d, &graphmode.coords);
+  }
+
+  graphmode.style = 2;
+  graphmode.size = -1; /* point size determined by Zvec */
+  graphmode.etype = 0;
+  Npts = Xvec.Nelements;
+  PlotVectorTriplet (kapa, Npts, Xvec.elements, Yvec.elements, Zvec.elements, &graphmode);
+
+  free (Xvec.elements);
+  free (Yvec.elements);
+  free (Zvec.elements);
+
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/drizzle.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/drizzle.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/drizzle.c	(revision 15879)
@@ -0,0 +1,302 @@
+# include "astro.h"
+
+/*** needs mosaic astrometry ***/
+
+static double XO, XX, XY;
+static double YO, YX, YY;
+static int ZERO;
+
+static int ROTATE;
+static double rot_phi, rot_alpha, rot_delta;
+static double rot_cdp, rot_sdp;
+
+int map_output_to_input (int Npix, double df);
+int map_input_to_output (int Npix, double df);
+int set_linear_terms (Coords *in, Coords *out, int i, int j, int Npix);
+void apply_terms (double *Xout, double *Yout, double Xin, double Yin);
+
+Coords coords_in, coords_out;
+Buffer *in, *out, *wt, *mask;
+
+int drizzle (int argc, char **argv) {
+
+  int Nlinear, Np, N;
+  double scale_in, scale_out, df;
+
+  ZERO = FALSE;
+  if ((N = get_argument (argc, argv, "-zero"))) {
+    ZERO = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  ROTATE = FALSE;
+  if ((N = get_argument (argc, argv, "-roll"))) {
+    /* -roll phi alpha_pole delta_pole */
+    /* XXX need to clarify the meaning of phi, alpha, delta */
+    ROTATE = TRUE;
+    remove_argument (N, &argc, argv);
+    rot_phi   = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    rot_alpha = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    rot_delta = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+
+    rot_cdp = cos(RAD_DEG*rot_delta);
+    rot_sdp = sin(RAD_DEG*rot_delta);
+  }
+
+  mask = NULL;
+  if ((N = get_argument (argc, argv, "-mask"))) {
+    remove_argument (N, &argc, argv);
+    if ((mask = SelectBuffer (argv[N], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: transform <from> <to> <weight> (Nlinear)\n");
+    gprint (GP_ERR, "  output buffer must exist with target astrometry header\n");
+    gprint (GP_ERR, "  Nlinear is the pixel scale for linear astrometric transformation\n");
+    return (FALSE);
+  }
+
+  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((wt  = SelectBuffer (argv[3], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  Nlinear = atoi (argv[4]);
+
+  GetCoords (&coords_in, &in[0].header);
+  GetCoords (&coords_out, &out[0].header);
+
+  /* for the moment, disable WRP / DIS */
+  if (!strcmp(&coords_in.ctype[4], "-WRP") || !strcmp(&coords_out.ctype[4], "-WRP")) {
+    gprint (GP_ERR, "WRP mode not implemented for astrom\n");
+    return (FALSE);
+  }
+  
+  scale_in = sqrt(fabs(coords_in.cdelt1*coords_in.cdelt2*(coords_in.pc1_1*coords_in.pc2_2 - coords_in.pc1_2*coords_in.pc2_1)));
+  scale_out = sqrt(fabs(coords_out.cdelt1*coords_out.cdelt2*(coords_out.pc1_1*coords_out.pc2_2 - coords_out.pc1_2*coords_out.pc2_1)));
+  
+  gprint (GP_ERR, "%f - %f\n", scale_in, scale_out);
+
+  if (scale_in > scale_out) {
+    Np = MAX (1, 3*scale_out / scale_in);
+    df = 1.0 / Np;
+    map_output_to_input (Nlinear, df);
+  } else {
+    Np = MAX (1, 3*scale_in / scale_out);
+    df = 1.0 / Np;
+    map_input_to_output (Nlinear, df);
+  }
+  return (TRUE);
+}
+
+/* mode 1: input pixels >> output pixels: loop over output pixels */
+/* mode 2: input pixels << output pixels: loop over input pixels */
+/* mode 3: input pixels ~= output pixels: drizzle input to output */
+
+/* loop over the input pixels, map input output image */
+int map_output_to_input (int Npix, double df) {
+
+  int i, j, Ni, No, Nx, Ny, nx, ny;
+  float *Vin, *Vout, *Vwt, *Vmk;
+  double x, y, X, Y;
+
+  /* loop over output pixels */
+  /* set up pointers for buffers */
+  Vin  = (float *) in[0].matrix.buffer;
+  Vout = (float *) out[0].matrix.buffer;
+  Vwt  = (float *) wt[0].matrix.buffer;
+  Vmk  = NULL;
+  Vmk = (mask == NULL) ? NULL : (float *) mask[0].matrix.buffer;
+
+  nx = in[0].header.Naxis[0];
+  ny = in[0].header.Naxis[1];
+  Nx = out[0].header.Naxis[0];
+  Ny = out[0].header.Naxis[1];
+
+  if (ZERO) {
+    bzero (Vout, Nx*Ny*sizeof(float));
+    bzero (Vwt,  Nx*Ny*sizeof(float));
+  }
+
+  gprint (GP_ERR, "mapping output to input\n");
+
+  for (j = 0; j < Ny; j+=Npix) {
+    for (i = 0; i < Nx; i+=Npix) {
+      
+      /* define linear transformation in region */
+      if (!set_linear_terms (&coords_out, &coords_in, i, j, Npix)) continue;
+
+      for (X = i; (X < i + Npix) && (X < Nx); X += df) {
+	for (Y = j; (Y < j + Npix) && (Y < Ny); Y += df) {
+	  
+	  No = (int)X + ((int)Y)*Nx;
+	  apply_terms (&x, &y, X, Y);
+	  if (x < 0) continue;
+	  if (x >= nx) continue;
+	  if (y < 0) continue;
+	  if (y >= ny) continue;
+	  Ni = (int)x + ((int)y)*nx;
+
+	  if (Vmk && Vmk[Ni]) continue;
+	  Vout[No] += Vin[Ni];
+	  Vwt[No] ++;
+	}
+      }
+    }
+  }
+  return (TRUE);
+}
+
+/* loop over the input pixels, map input output image */
+int map_input_to_output (int Npix, double df) {
+
+  int i, j, Ni, No, Nx, Ny, nx, ny;
+  float *Vin, *Vout, *Vwt, *Vmk;
+  double x, y, X, Y;
+
+  /* loop over output pixels */
+  /* set up pointers for buffers */
+  Vin  = (float *) in[0].matrix.buffer;
+  Vout = (float *) out[0].matrix.buffer;
+  Vwt  = (float *) wt[0].matrix.buffer;
+  Vmk  = NULL;
+  Vmk = (mask == NULL) ? NULL : (float *) mask[0].matrix.buffer;
+
+  Nx = in[0].header.Naxis[0];
+  Ny = in[0].header.Naxis[1];
+  nx = out[0].header.Naxis[0];
+  ny = out[0].header.Naxis[1];
+
+  if (ZERO) {
+    bzero (Vout, nx*ny*sizeof(float));
+    bzero (Vwt,  nx*ny*sizeof(float));
+  }
+
+  gprint (GP_ERR, "mapping input to output\n");
+
+  for (j = 0; j < Ny; j+=Npix) {
+    for (i = 0; i < Nx; i+=Npix) {
+      
+      /* define linear transformation in region */
+      if (!set_linear_terms (&coords_in, &coords_out, i, j, Npix)) continue;
+
+      for (X = i; (X < i + Npix) && (X < Nx); X += df) {
+	for (Y = j; (Y < j + Npix) && (Y < Ny); Y += df) {
+	  
+	  Ni = (int)X + ((int)Y)*Nx;
+	  apply_terms (&x, &y, X, Y);
+	  if (x < 0) continue;
+	  if (x >= nx) continue;
+	  if (y < 0) continue;
+	  if (y >= ny) continue;
+	  No = (int)x + ((int)y)*nx;
+
+	  if (Vmk && Vmk[Ni]) continue;
+	  Vout[No] += Vin[Ni];
+	  Vwt[No] ++;
+	}
+      }
+    }
+  }
+  return (TRUE);
+}
+
+int rotate_coords (double *phi, double *theta, double alpha, double delta) {
+
+  double sda, cda, cd, sd, sth;
+  double x, y;
+  
+  sda = sin(RAD_DEG*(alpha - rot_alpha));
+  cda = cos(RAD_DEG*(alpha - rot_alpha));
+  sd = sin(RAD_DEG*delta);
+  cd = cos(RAD_DEG*delta);
+  
+  sth = -cd*sda*rot_cdp + sd*rot_sdp;
+  y   = +cd*sda*rot_sdp + sd*rot_cdp;
+  x   = +cd*cda;
+
+  *theta = DEG_RAD*asin(sth);
+  *phi   = DEG_RAD*atan2(y,x) + rot_phi;
+  
+  while (*phi <   0.0) *phi += 360.0;
+  while (*phi > 360.0) *phi -= 360.0;
+  return (TRUE);
+}
+
+/* find the linear astrometric fix between images at this location */
+int set_linear_terms (Coords *in, Coords *out, int i, int j, int Npix) {
+
+  int n;
+  double x, y, x2, y2, xy, X, Y, Xx, Xy, Yx, Yy;
+  double Xin, Yin, Xout, Yout;
+  double Sx2, Sy2, Sxy, SXx, SXy, SYx, SYy;
+  double N, r, d, phi, theta;
+
+  Xin = Yin = 0;
+  N = x = y = x2 = y2 = xy = X = Y = Xx = Xy = Yx = Yy = 0;
+
+  /* define several test points, fit a line to the input,output pairs */
+  for (n = 0; n < 3; n++) {
+
+    switch (n) {
+    case 0:
+      Xin = i;
+      Yin = j;
+      break;
+    case 1:
+      Xin = i + Npix;
+      Yin = j;
+      break;
+    case 2:
+      Xin = i;
+      Yin = j + Npix;
+      break;
+    }
+
+    if (!XY_to_RD (&r, &d, Xin, Yin, in)) return (FALSE);
+    if (ROTATE) { 
+      rotate_coords (&phi, &theta, r, d);
+      r = phi;
+      d = theta;
+    }
+    if (!RD_to_XY (&Xout, &Yout, r, d, out)) return (FALSE);
+
+    x  += Xin;
+    y  += Yin;
+    x2 += Xin*Xin;
+    y2 += Yin*Yin;
+    xy += Xin*Yin;
+    X  += Xout;
+    Y  += Yout;
+    Xx += Xout*Xin;
+    Xy += Xout*Yin;
+    Yx += Yout*Xin;
+    Yy += Yout*Yin;
+    N  += 1.0;
+  }
+
+  Sx2 = x2 - x*x/N;
+  Sy2 = y2 - y*y/N;
+  Sxy = xy - x*y/N;
+  SXx = Xx - X*x/N;
+  SXy = Xy - X*y/N;
+  SYx = Yx - Y*x/N;
+  SYy = Yy - Y*y/N;
+  
+  XX = (SXx*Sy2 - SXy*Sxy) / (Sx2*Sy2 - Sxy*Sxy);
+  XY = (SXy*Sx2 - SXx*Sxy) / (Sx2*Sy2 - Sxy*Sxy);
+  XO = X/N - XX*x/N - XY*y/N;
+
+  YX = (SYx*Sy2 - SYy*Sxy) / (Sx2*Sy2 - Sxy*Sxy);
+  YY = (SYy*Sx2 - SYx*Sxy) / (Sx2*Sy2 - Sxy*Sxy);
+  YO = Y/N - YX*x/N - YY*y/N;
+  return (TRUE);
+}
+
+
+void apply_terms (double *Xout, double *Yout, double Xin, double Yin) {
+  *Xout = XO + XX*Xin + XY*Yin;
+  *Yout = YO + YX*Xin + YY*Yin;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/fixwrap.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/fixwrap.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/fixwrap.c	(revision 15879)
@@ -0,0 +1,110 @@
+# include "astro.h"
+
+int fixwrap (int argc, char **argv) {
+  
+  int i, j, Nflip, n, Ny, Nx, flip, sat, rowfix;
+  float *Vin, *outf, *outb, dO;
+  Buffer *in;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: fixwrap <in> (rowfix)\n");
+    return (FALSE);
+  }
+
+  if ((in = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  rowfix = atoi (argv[2]);
+
+  Nx = in[0].matrix.Naxis[0];
+  Ny = in[0].matrix.Naxis[1];
+
+  ALLOCATE (outf, float, MAX(Nx, Ny));
+  ALLOCATE (outb, float, MAX(Nx, Ny));
+
+  for (j = 0; j < Ny; j++) {
+    Vin  = (float *)(in[0].matrix.buffer)  + j*Nx;
+
+    /* measure forward flips */ 
+    sat = FALSE;
+    for (i = 0; i < Nx; i++) {
+      if ((i < 1056) || (i > 2079)) {
+	outf[i] = Vin[i];
+	continue;
+      }
+
+      dO = 2*outf[i-1] - outf[i-2] - Vin[i];
+      flip = (fabs(dO - 0x8000) < fabs(dO));
+
+      /* going onto saturation */
+      if (!sat && (Vin[i] > 32766.5) && (Vin[i+1]  > 32766.5)) sat  = TRUE;
+      if (!sat && (Vin[i] > 32766.5) && (Vin[i-Nx] > 65534.5)) sat  = TRUE;
+
+      /* exiting saturation region */
+      if ( sat && (Vin[i] < 32766.5) && (Vin[i-1] < 32766.5)) sat = FALSE;
+
+      if (sat) flip = TRUE;
+
+      outf[i] = flip ? (Vin[i] + 0x8000) : Vin[i];
+    }
+
+    /* measure backward flips */ 
+    sat = FALSE;
+    for (i = Nx - 1; i >= 0; i--) {
+      if ((i < 1056) || (i > 2077)) {
+	outb[i] = Vin[i];
+	continue;
+      }
+
+      dO = 2*outb[i+1] - outb[i+2] - Vin[i];
+      flip = (fabs(dO - 0x8000) < fabs(dO));
+
+      /* going onto saturation */
+      if (!sat && (Vin[i] > 32766.5) && (Vin[i-1] > 32766.5)) sat  = TRUE;
+
+      /* exiting saturation region */
+      if ( sat && (Vin[i] < 32766.5) && (Vin[i+1] < 32766.5)) sat = FALSE;
+
+      if (sat) flip = TRUE;
+
+      outb[i] = flip ? (Vin[i] + 0x8000) : Vin[i];
+    }
+
+    /* compare forward and backward flips: where they disagree, use column to predict */
+    for (i = 0; (j > 1) && (i < Nx); i++) {
+      if ((i < 1056) || (i > 2077)) continue;
+      if (outf[i] != outb[i]) {
+	/* use this column to predict, not the row */
+	dO = 2*Vin[i - Nx] - Vin[i-2*Nx] - Vin[i];
+	flip = (fabs(dO - 0x8000) < fabs(dO));
+	outf[i] = flip ? Vin[i] + 0x8000 : Vin[i];
+	outb[i] = outf[i];  /* save this for the row segments below */
+      }
+    }
+
+    /* compare this row and previous (now fixed) row. if large segments are flipped, fix them */
+    for (i = 0; rowfix && (j > 1) && (i < Nx); i++) {
+      if ((i < 1056) || (i > 2077)) continue;
+
+      if (fabs(outf[i] - Vin[i-Nx]) > 15000) {
+	Nflip = 0;
+	for (n = i - 8; n < i + 9; n++) {
+	  if (fabs(outb[n] - Vin[n-Nx]) > 15000) {
+	    Nflip ++;
+	  }
+	}
+	if (Nflip > 5) {
+	  if (outf[i] - Vin[i-Nx] > 15000) {
+	    outf[i] -= 0x8000;
+	  } else {
+	    outf[i] += 0x8000;
+	  }	    
+	}
+      }
+    }
+    for (i = 0; i < Nx; i++) {
+      Vin[i] = outf[i];
+    }
+  }
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/flux.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/flux.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/flux.c	(revision 15879)
@@ -0,0 +1,76 @@
+# include "astro.h"
+
+int flux (int argc, char **argv) {
+  
+  int i, j, k, xmin, ymin, xmax, ymax;
+  void *oldsignal;
+  double ax, ay, s, S, flux;
+  double bx[5], by[5], x[5], y[5], bb[5];
+  float *V;
+  FILE *f;
+  Buffer *buf;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: flux <buffer> (region)\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  f = fopen (argv[2], "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "file %s not found\n", argv[2]);
+    return (FALSE);
+  }
+
+  xmin = buf[0].matrix.Naxis[0];
+  xmax = 0;
+  ymin = buf[0].matrix.Naxis[1];
+  ymax = 0;
+  for (i = 0; i < 4; i++) {
+    fscanf (f, "%lf %lf", &x[i], &y[i]);
+    xmin = MAX (0, MIN (xmin, x[i] - 1));
+    ymin = MAX (0, MIN (ymin, y[i] - 1));
+    xmax = MIN (MAX (xmax, x[i] + 1), buf[0].matrix.Naxis[0]);
+    ymax = MIN (MAX (ymax, y[i] + 1), buf[0].matrix.Naxis[1]);
+  }
+  fclose (f);
+
+  x[4] = x[0]; y[4] = y[0];
+  for (i = 0; i < 4; i++) {
+    bx[i] = x[i+1] - x[i];
+    by[i] = y[i+1] - y[i];
+  }
+  bx[4] = bx[0]; by[4] = by[0];
+  for (i = 0; i < 4; i++) {
+    bb[i] = hypot (bx[i], by[i]) * SIGN (bx[i]*by[i+1] - bx[i+1]*by[i]);
+  }
+  gprint (GP_ERR, "%f %f %f %f\n", bb[0], bb[1], bb[2], bb[3]);
+
+  /* this only works for convex contours --
+   we have to add up the angles for concave contours */
+  flux = 0;
+  oldsignal = signal (SIGINT, handle_interrupt);
+  interrupt = FALSE;
+  for (j = ymin; (j < ymax) && !interrupt; j++) {
+    V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + xmin; 
+    for (i = xmin; (i < xmax) && !interrupt; i++, V++) {
+      S = 1.0;
+      for (k = 0; k < 4; k++) {
+	ax = i - x[k];
+	ay = j - y[k];
+	s = (ay*bx[k] - ax*by[k]) / bb[k] + 0.5;
+	/* s = b x a / |b|, with the correct sign (above) so inside is positive */
+	s = MAX (0.0, MIN (1.0, s));  /* s is between 0.0 and 1.0 */
+	S *= s;
+      }
+      flux += S * (*V);
+    }
+  }
+  signal (SIGINT, oldsignal);
+
+  gprint (GP_LOG, "flux: %f\n", flux);
+  set_variable ("FLUX", flux);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/gauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/gauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/gauss.c	(revision 15879)
@@ -0,0 +1,65 @@
+# include "astro.h"
+
+int gauss (int argc, char **argv) {
+
+  char key[20];
+  int i, N, Npix, Nborder, Nspot;
+  double X, Y, Z, ZP, RA, DEC, max;
+  int kapa;
+  char *name;
+  Buffer *buf;
+  KapaImageData data;
+
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImageData (&data, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  Nborder = 3;
+  if ((N = get_argument (argc, argv, "-border"))) {
+    remove_argument (N, &argc, argv);
+    Nborder  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  Nborder = MAX (Nborder, 1);
+  
+  max = 60000;
+  if ((N = get_argument (argc, argv, "-sat"))) {
+    remove_argument (N, &argc, argv);
+    max  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  
+  if ((argc != 2) && (argc != 3)) {
+    gprint (GP_ERR, "USAGE: gauss Npix [Nspots] [-border N] [-sat cnts]\n");
+    return (FALSE);
+  }
+  
+  if (kapa < 1) {
+    gprint (GP_ERR, "no active TV\n");
+    return (FALSE);
+  }
+
+  Nspot = 0;
+  Npix = atof (argv[1]);
+  if (argc == 3) {
+    Nspot = atof (argv[2]);
+  }
+
+  if ((buf = SelectBuffer (data.name, OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  KiiCursorOn (kapa);
+
+  for (i = 0; (i < Nspot) || (Nspot == 0); i++) {
+    KiiCursorRead (kapa, &X, &Y, &ZP, &RA, &DEC, key);
+    if (!strcasecmp (key, "Q")) break;
+    Z = get_aperture_stats (&buf[0].matrix, (int)(X+0.5), (int)(Y+0.5), Npix, Nborder, max);
+  }
+  KiiCursorOff (kapa);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/getlst.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/getlst.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/getlst.c	(revision 15879)
@@ -0,0 +1,41 @@
+# include "astro.h"
+
+int getlst (int argc, char **argv) {
+
+  int N;
+  time_t time;
+  double jd, lst, longitude;
+  char *Variable;
+
+  Variable = NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    Variable = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (argc != 3) goto syntax;
+
+  if (!ohana_str_to_time (argv[1], &time)) {
+      if (Variable != NULL) free (Variable);
+      return (FALSE);
+  }
+
+  longitude = atof (argv[2]);
+
+  jd = ohana_sec_to_jd (time);
+  fprintf (stderr, "jd: %f\n", jd);
+
+  lst = ohana_lst (jd, longitude);
+
+  if (Variable != NULL) {
+      set_variable (Variable, lst);
+      free (Variable);
+      return (TRUE);
+  }
+  gprint (GP_ERR, "lst: %f\n", lst);
+  return (TRUE);
+
+ syntax:
+  gprint (GP_ERR, "USAGE: getlst (time) (longitude) [-var name]\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/getvel.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/getvel.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/getvel.c	(revision 15879)
@@ -0,0 +1,81 @@
+# include "astro.h"
+
+int getvel (int argc, char **argv) {
+  
+  int i, n, Ncurve;
+  int nx, ny;
+  double L, V, Vo, dV, Bo, dB;
+  double xo, yo;
+  double sl, cl, wo, Ro, Rs, wr, r, fr, d, x;
+  double R[100], T[100], W[100];
+  FILE *f;
+  Buffer *buf;
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: rotcurve buf X Y curve.txt\n");
+    return (FALSE);
+  }
+
+  f = fopen (argv[4], "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "can't find rotation curve data file %s\n", argv[4]);
+    return (FALSE);
+  }
+  for (i = 0; fscanf (f, "%lf %lf", &R[i], &T[i]) != EOF; i++) {
+    W[i] = T[i] / R[i];
+  }  
+  fclose (f);
+  Ncurve = i;
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  nx = buf[0].matrix.Naxis[0];
+  ny = buf[0].matrix.Naxis[1];
+
+  /* we expect the input image to have units of velocity, lattitude, and longitude */
+  gfits_scan (&buf[0].header, "CRVAL1", "%lf", 1, &Vo);
+  gfits_scan (&buf[0].header, "CDELT1", "%lf", 1, &dV);
+  gfits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &xo);
+  gfits_scan (&buf[0].header, "CRVAL2", "%lf", 1, &Bo);
+  gfits_scan (&buf[0].header, "CDELT2", "%lf", 1, &dB);
+  gfits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &yo);
+  gfits_scan (&buf[0].header, "CRVAL3", "%lf", 1, &L);
+  Vo *= 0.001;
+  dV *= 0.001;
+
+  while (L >= 360) {L -= 360.0;}
+  while (L < 0.0)  {L += 360.0;}
+  gprint (GP_ERR, "L: %f\n", L);
+
+  cl = cos (L*RAD_DEG);
+  sl = sin (L*RAD_DEG);
+  wo = 25.0;
+  Ro = 10.0;
+  Rs = Ro*sl;
+  x = atof (argv[2]);
+  /* this method depends on wr monotonically decreasing */
+
+  V = (x - xo) * dV + Vo;
+  wr = V/Rs + wo;
+  for (n = 0; (n < Ncurve) && (wr < W[n]); n++);
+  if ((n == 0) || (n == Ncurve)) {
+    gprint (GP_ERR, "velocity out of reasonable range\n");
+    gprint (GP_ERR, "%f %f %f %f\n", V, wr, W[0], W[Ncurve-1]);
+    return (TRUE);
+  }
+  r = (wr - W[n]) *  (R[n-1] - R[n]) / (W[n-1] - W[n]) + R[n];
+  fr = (Ro/r);
+  if (r < fabs(Rs)) { /* can't be on rotation curve */
+    gprint (GP_ERR, "velocity out of reasonable range\n");
+    gprint (GP_ERR, "%f %f %f %f %f %f %f\n", V, wr, W[0], W[Ncurve-1], r, fr, Rs);
+    return (TRUE);
+  }
+  if (r < Ro)
+    d = Ro*cl - sqrt(r*r - Rs*Rs);
+  else 
+    d = Ro*cl + sqrt(r*r - Rs*Rs);
+  
+  gprint (GP_ERR, "dist: %f, vel: %f\n", d, V);
+
+  return (TRUE);
+
+} 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/biassub
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/biassub	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/biassub	(revision 15879)
@@ -0,0 +1,9 @@
+
+  biassub buffer sx sy nx ny dir [-v N V]
+
+  Apply a bias correction.  The region defines a vector 
+  (median is taken perpendicular to the dir direction) which 
+  is subtracted from the image.
+
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/cgrid
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/cgrid	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/cgrid	(revision 15879)
@@ -0,0 +1,6 @@
+
+  cgrid
+
+  draws a grid in RA and DEC on window 0 approriate for the current
+  region.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/coords
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/coords	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/coords	(revision 15879)
@@ -0,0 +1,19 @@
+
+  coords <buffer> (filename)
+
+  "coords" loads astrometric parameters for the given buffer from the
+header of the named file.  The parameters are applied to the buffer,
+and will register in the Ki'i window if the buffer it tv'ed again.
+This is particularly convenient for intercomparing coordinate system
+or in the event the astrometry is stored in a different file (eg, a
+stripped off header).  Currently, the only format of coordinate
+information that is looked for are gene's linear transformation: RA_O,
+RA_X, RA_Y, DEC_O, DEC_X, DEC_Y such that the RA,DEC of an object is
+given by:
+
+RA  = RA_O  + x*RA_X  + y*RA_Y
+DEC = DEC_O + x*DEC_X + y*DEC_Y.
+
+
+  See also: rd, tv
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/flux
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/flux	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/flux	(revision 15879)
@@ -0,0 +1,7 @@
+
+   flux buffer (file)
+
+   calculate the flux enclosed by the contour given in the file.  The
+   file contains the coordinates of the polygon corners.
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/gauss
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/gauss	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/gauss	(revision 15879)
@@ -0,0 +1,15 @@
+
+   gauss Npix [Nspots] [-border N] [-sat cnts]
+
+   calculate statistics on stars, assuming a Gaussian profile.  The
+   user types a key on a star in the Kii window, and the resulting
+   information is printed on the screen.  This is really aperture
+   photometry.  Npix defines the aperture width (square aperture), the
+   optional -border defines the number of pixels in an annulus used to
+   find the background, -sat defines the value of a saturated pixel.
+   If the Nspots option is given, exactly Nspots stars are chosen.
+   Otherwise, the user may type on stars until the 'q' is typed.  The
+   results of the last star are stored the a set of Mana variables.
+
+   See also: star, cursor
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/profile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/profile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/profile	(revision 15879)
@@ -0,0 +1,6 @@
+
+   profile <buffer> <X vector> <Y vector> x y N
+
+   Find the radial profile of an image at the location x, y.  the
+   radius is placed in the X vector and the pixel value is placed in
+   the Y vector.   
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/region
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/region	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/help/region	(revision 15879)
@@ -0,0 +1,18 @@
+
+  region RA DEC Radius [projection]
+
+  define the current sky region and optionally the projection.  
+  RA, DEC and Radius are all values in decimal degrees.  The possible 
+  values for "projection" are:
+
+  TAN - a tangent plane projection (default, and typical for optical images)
+  SIN - a sine plane projection (more appropriate for polar regions)
+  AIT - aitoff projection (good for the full sky)
+  GLS - ?? (also good for the full sky)
+
+  optional orientation flags:
+
+  -ew : display with East Left (default)
+  +ew : display with East Right 
+  -ns : display with North Down
+  +ns : display with North Up (default)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-fgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-fgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-fgauss.c	(revision 15879)
@@ -0,0 +1,68 @@
+# include "imfit.h"
+
+float fgaussTD (float, float, float *, int, float *);
+void  fgaussCL ();
+
+void fgauss_setup (char *name) {
+
+  if (strcmp(name, "fgauss")) return;
+
+  fitfunc = fgaussTD;
+  imfit_cleanup = fgaussCL;
+  Npar = 7;
+  Nfpar = 0;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0] = get_variable_default ("Xg", 0);
+  par[1] = get_variable_default ("Yg", 0);
+  par[2] = 2.35 / get_variable_default ("SXg", 2.0);
+  par[3] = 2.35 / get_variable_default ("SYg", 2.0);
+  par[4] = get_variable_default ("SXYg", 0);
+  par[5] = get_variable_default ("Zpk", 10000);
+  par[6] = get_variable_default ("Sg", 0.0);
+  sky = &par[6];
+}
+
+void fgaussCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 / par[2]);
+  set_variable ("SYg",  2.35 / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zpk",  par[5]);
+  set_variable ("Sg",   par[6]);
+}
+
+/* real 2D gaussian -- x, y, sx, sy, sxy, I, sky */
+float fgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, q, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = par[2]*X;
+  py = par[3]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + par[4]*X*Y;
+  r = exp (-z);
+  q = par[5]*r;
+  f = q + par[6];
+
+  if (dpar != NULL) {
+    dpar[0] = q*(2*px*par[2] + par[4]*Y);
+    dpar[1] = q*(2*py*par[3] + par[4]*X);
+    dpar[2] = -2*q*px*X;
+    dpar[3] = -2*q*py*Y;
+    dpar[4] = -q*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+  }
+  return (f);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-pgauss-psf.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-pgauss-psf.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-pgauss-psf.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "imfit.h"
+
+float pgauss_psfTD (float, float, float *, int, float *);
+void  pgauss_psfCL ();
+
+void  pgauss_psf_setup (char *name) {
+
+  if (strcmp(name, "pgauss_psf")) return;
+
+  fitfunc = pgauss_psfTD;
+  imfit_cleanup = pgauss_psfCL;
+  Npar = 4;
+  Nfpar = 3;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0] = get_variable_default ("Xg", 0);
+  par[1] = get_variable_default ("Yg", 0);
+  par[2] = get_variable_default ("Zpk", 10000);
+  par[3] = get_variable_default ("Sg", 0.0);
+  sky = &par[3];
+
+  fpar[0] = 2.35 / get_variable_default ("SXg", 2.0);
+  fpar[1] = 2.35 / get_variable_default ("SYg", 2.0);
+  fpar[2] = get_variable_default ("SXYg", 0);
+}
+
+void pgauss_psfCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("Zpk",  par[2]);
+  set_variable ("Sg",   par[3]);
+}
+
+/* pseudo 2D gaussian -- x, y, (sx), (sy), (sxy), I, sky */
+float pgauss_psfTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, q, f;
+
+  /* par -> fpar: (2,0), (3,1), (4,2) */
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = fpar[0]*X;
+  py = fpar[1]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + fpar[2]*X*Y;
+  r = 1.0 / (1 + z + 0.5*z*z*(1 + z/3)); /* ~ exp (-Z) */
+  f = par[2]*r + par[3];
+  q = par[2]*r*r*(1 + z + 0.5*z*z);
+  /* note difference from gaussian: q = par[5]*r */
+
+  if (dpar != NULL) {
+    dpar[0] = q*(2*px*fpar[0] + fpar[2]*Y);
+    dpar[1] = q*(2*py*fpar[1] + fpar[2]*X);
+    dpar[2] = +r;
+    dpar[3] = +1;
+  }
+  return (f);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-pgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-pgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-pgauss.c	(revision 15879)
@@ -0,0 +1,69 @@
+# include "imfit.h"
+
+float pgaussTD (float, float, float *, int, float *);
+void  pgaussCL ();
+
+void  pgauss_setup (char *name) {
+
+  if (strcmp(name, "pgauss")) return;
+
+  fitfunc = pgaussTD;
+  imfit_cleanup = pgaussCL;
+  Npar = 7;
+  Nfpar = 0;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0] = get_variable_default ("Xg", 0.0);
+  par[1] = get_variable_default ("Yg", 0.0);
+  par[2] = 2.35 / get_variable_default ("SXg", 2.0);
+  par[3] = 2.35 / get_variable_default ("SYg", 2.0);
+  par[4] = get_variable_default ("SXYg", 0.0);
+  par[5] = get_variable_default ("Zpk", 10000);
+  par[6] = get_variable_default ("Sg", 0.0);
+  sky = &par[6];
+}
+
+void pgaussCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 / par[2]);
+  set_variable ("SYg",  2.35 / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zpk",  par[5]);
+  set_variable ("Sg",   par[6]);
+}
+
+/* pseudo 2D gaussian -- x, y, sx, sy, sxy, I, sky */
+float pgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, q, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = par[2]*X;
+  py = par[3]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + par[4]*X*Y;
+  r = 1.0 / (1 + z + 0.5*z*z*(1 + z/3)); /* ~ exp (-Z) */
+  f = par[5]*r + par[6];
+  q = par[5]*r*r*(1 + z + 0.5*z*z);
+  /* note difference from gaussian: q = par[5]*r */
+
+  if (dpar != NULL) {
+    dpar[0] = q*(2*px*par[2] + par[4]*Y);
+    dpar[1] = q*(2*py*par[3] + par[4]*X);
+    dpar[2] = -2*q*px*X;
+    dpar[3] = -2*q*py*Y;
+    dpar[4] = -q*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+  }
+  return (f);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qfgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qfgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qfgauss.c	(revision 15879)
@@ -0,0 +1,74 @@
+# include "imfit.h"
+
+float qfgaussTD (float, float, float *, int, float *);
+void  qfgaussCL ();
+
+void qfgauss_setup (char *name) {
+
+  if (strcmp(name, "qfgauss")) return;
+
+  fitfunc = qfgaussTD;
+  imfit_cleanup = qfgaussCL;
+  Npar = 7;
+  Nfpar = 2;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0]  = get_variable_default ("Xg", 0);
+  par[1]  = get_variable_default ("Yg", 0);
+  par[2]  = 2.35 / get_variable_default ("SXg", 2.0);
+  par[3]  = 2.35 / get_variable_default ("SYg", 2.0);
+  par[4]  = get_variable_default ("SXYg", 0);
+  par[5]  = get_variable_default ("Zpk", 10000);
+  par[6]  = get_variable_default ("Sg", 0.0);
+
+  fpar[0] = get_variable_default ("Npow", 2.25);
+  fpar[1]  = get_variable_default ("Sr", 1.0);
+
+  sky = &par[6];
+}
+
+void qfgaussCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 / par[2]);
+  set_variable ("SYg",  2.35 / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zpk",  par[5]);
+  set_variable ("Sg",   par[6]);
+}
+
+/* one component, two slopes: (1 + z^M + z^N)^(-1) -- x, y, sx, sy, sxy, I, sky */
+float qfgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, q, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = par[2]*X;
+  py = par[3]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + par[4]*X*Y;
+
+  r = 1.0 / (1 + fpar[1]*z + pow(z,fpar[0]));
+  f = par[5]*r + par[6];
+  q = par[5]*SQ(r)*(fpar[1] + fpar[0]*pow(z,(fpar[0]-1)));
+
+  if (dpar != NULL) {
+    dpar[0] = q*(2*px*par[2] + par[4]*Y);
+    dpar[1] = q*(2*py*par[3] + par[4]*X);
+    dpar[2] = -2*q*px*X*2;
+    dpar[3] = -2*q*py*Y*2;
+    dpar[4] = -q*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+  }
+  return (f);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qgauss-psf.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qgauss-psf.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qgauss-psf.c	(revision 15879)
@@ -0,0 +1,68 @@
+# include "imfit.h"
+
+float qgauss_psfTD (float, float, float *, int, float *);
+void  qgauss_psfCL ();
+
+void qgauss_psf_setup (char *name) {
+
+  if (strcmp(name, "qgauss_psf")) return;
+
+  fitfunc = qgauss_psfTD;
+  imfit_cleanup = qgauss_psfCL;
+  Npar = 4;
+  Nfpar = 5;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0]  = get_variable_default ("Xg", 0);
+  par[1]  = get_variable_default ("Yg", 0);
+  par[2]  = get_variable_default ("Zpk", 10000);
+  par[3]  = get_variable_default ("Sg", 0.0);
+
+  fpar[0] = 2.35 / get_variable_default ("SXg", 15.0);
+  fpar[1] = 2.35 / get_variable_default ("SYg", 15.0);
+  fpar[2] = get_variable_default ("SXYg", 0.0);
+  fpar[3] = get_variable_default ("Sr", 1.0);
+  fpar[4] = get_variable_default ("Npow", 2.25);
+
+  sky = &par[3];
+}
+
+void qgauss_psfCL () {
+  set_variable ("Xg",  par[0]);
+  set_variable ("Yg",  par[1]);
+  set_variable ("Zpk", par[2]);
+  set_variable ("Sg",  par[3]);
+}
+
+/* one component, two slopes: (1 + z^M + z^N)^(-1) -- x, y, sx, sy, sxy, I, sky, sr */
+float qgauss_psfTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, q, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = fpar[0]*X;
+  py = fpar[1]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + fpar[2]*X*Y;
+
+  r = 1.0 / (1 + fpar[3]*z + pow(z,fpar[4]));
+  f = par[2]*r + par[3];
+  q = par[2]*SQ(r)*(fpar[3] + fpar[4]*pow(z,(fpar[4]-1)));
+
+  if (dpar != NULL) {
+    dpar[0] = q*(2*px*fpar[0] + fpar[2]*Y);
+    dpar[1] = q*(2*py*fpar[1] + fpar[2]*X);
+    dpar[2] = +r;
+    dpar[3] = +1;
+  }
+  return (f);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qgauss.c	(revision 15879)
@@ -0,0 +1,75 @@
+# include "imfit.h"
+
+float qgaussTD (float, float, float *, int, float *);
+void  qgaussCL ();
+
+void qgauss_setup (char *name) {
+
+  if (strcmp(name, "qgauss")) return;
+
+  fitfunc = qgaussTD;
+  imfit_cleanup = qgaussCL;
+  Npar = 8;
+  Nfpar = 1;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0]  = get_variable_default ("Xg", 0);
+  par[1]  = get_variable_default ("Yg", 0);
+  par[2]  = 2.35 / get_variable_default ("SXg", 2.0);
+  par[3]  = 2.35 / get_variable_default ("SYg", 2.0);
+  par[4]  = get_variable_default ("SXYg", 0);
+  par[5]  = get_variable_default ("Zpk", 10000);
+  par[6]  = get_variable_default ("Sg", 0.0);
+  par[7]  = get_variable_default ("Sr", 1.0);
+  fpar[0] = get_variable_default ("Npow", 2.25);
+
+  sky = &par[6];
+}
+
+void qgaussCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 / par[2]);
+  set_variable ("SYg",  2.35 / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zpk",  par[5]);
+  set_variable ("Sg",   par[6]);
+  set_variable ("Sr", par[7]);
+}
+
+/* one component, two slopes: (1 + z^M + z^N)^(-1) -- x, y, sx, sy, sxy, I, sky, sr */
+float qgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, q, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = par[2]*X;
+  py = par[3]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + par[4]*X*Y;
+
+  r = 1.0 / (1 + par[7]*z + pow(z,fpar[0]));
+  f = par[5]*r + par[6];
+  q = par[5]*SQ(r)*(par[7] + fpar[0]*pow(z,(fpar[0]-1)));
+
+  if (dpar != NULL) {
+    dpar[0] = q*(2*px*par[2] + par[4]*Y);
+    dpar[1] = q*(2*py*par[3] + par[4]*X);
+    dpar[2] = -2*q*px*X*2;
+    dpar[3] = -2*q*py*Y*2;
+    dpar[4] = -q*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+    dpar[7] = -par[5]*SQ(r)*z;
+  }
+  return (f);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qrgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qrgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-qrgauss.c	(revision 15879)
@@ -0,0 +1,110 @@
+# include "imfit.h"
+
+float qrgaussTD (float, float, float *, int, float *);
+void  qrgaussCL ();
+
+void qrgauss_setup (char *name) {
+
+  if (strcmp(name, "qrgauss")) return;
+
+  fitfunc = qrgaussTD;
+  imfit_cleanup = qrgaussCL;
+  Npar = 8;
+  Nfpar = 1;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0]  = get_variable_default ("Xg", 0);
+  par[1]  = get_variable_default ("Yg", 0);
+  par[2]  = 2.35 / get_variable_default ("SXg", 2.0);
+  par[3]  = 2.35 / get_variable_default ("SYg", 2.0);
+  par[4]  = get_variable_default ("SXYg", 0);
+  par[5]  = get_variable_default ("Zpk", 10000);
+  par[6]  = get_variable_default ("Sg", 0.0);
+  par[7]  = get_variable_default ("Npow", 2.25);
+
+  fpar[0] = get_variable_default ("Sr", 1.0);
+
+  sky = &par[6];
+}
+
+void qrgaussCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 / par[2]);
+  set_variable ("SYg",  2.35 / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zpk",  par[5]);
+  set_variable ("Sg",   par[6]);
+  set_variable ("Npow", par[7]);
+}
+
+float qrgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, q, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = par[2]*X;
+  py = par[3]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + par[4]*X*Y;
+
+  r = 1.0 / (1 + fpar[0]*z + pow(z,par[7]));
+  f = par[5]*r + par[6];
+  q = par[5]*SQ(r)*(fpar[0] + par[7]*pow(z,(par[7]-1)));
+
+  if (dpar != NULL) {
+    dpar[0] = q*(2*px*par[2] + par[4]*Y);
+    dpar[1] = q*(2*py*par[3] + par[4]*X);
+    dpar[2] = -2*q*px*X*2;
+    dpar[3] = -2*q*py*Y*2;
+    dpar[4] = -q*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+    dpar[7] = -5*par[5]*SQ(r)*log(z)*pow(z,par[7]);
+  }
+  return (f);
+}
+
+
+# if (0)
+/* one component, two slopes: (1 + z^M + z^N)^(-1) -- x, y, sx, sy, sxy, I, sky, sr */
+float qrgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, q, f;
+
+  /* if (par[7] < 1.0) par[7] = 1.0; */
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = par[2]*X;
+  py = par[3]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + par[4]*X*Y;
+
+  r = 1.0 / (1 + fpar[0]*z + pow(z,par[7]) + 0.05*z*z*z);
+  f = par[5]*r + par[6];
+  q = par[5]*SQ(r)*(fpar[0] + par[7]*pow(z,(par[7]-1)) + 0.15*z*z);
+
+  if (dpar != NULL) {
+    dpar[0] = q*(2*px*par[2] + par[4]*Y);
+    dpar[1] = q*(2*py*par[3] + par[4]*X);
+    dpar[2] = -2*q*px*X*2;
+    dpar[3] = -2*q*py*Y*2;
+    dpar[4] = -q*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+    dpar[7] = -5*par[5]*SQ(r)*log(z)*pow(z,par[7]);
+  }
+  return (f);
+}
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-rgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-rgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-rgauss.c	(revision 15879)
@@ -0,0 +1,86 @@
+# include "imfit.h"
+
+float rgaussTD (float, float, float *, int, float *);
+void  rgaussCL ();
+
+void rgauss_setup (char *name) {
+
+  if (strcmp(name, "rgauss")) return;
+
+  fitfunc = rgaussTD;
+  cleanup = rgaussCL;
+  Npar = 10;
+  Nfpar = 1;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0] = get_variable_default ("Xg", 0);
+  par[1] = get_variable_default ("Yg", 0);
+  par[2] = 2.35 * sqrt(2.0) / get_variable_default ("SXg", 2.0);
+  par[3] = 2.35 * sqrt(2.0) / get_variable_default ("SYg", 2.0);
+  par[4] = 0.0;
+  par[5] = get_variable_default ("Zpk", 10000);
+  par[6] = get_variable_default ("Sg", 0.0);
+  par[7] = 2.35 * sqrt(2.0) / get_variable_default ("SXf", 15.0);
+  par[8] = 2.35 * sqrt(2.0) / get_variable_default ("SYf", 15.0);
+  par[9] = get_variable_default ("SXYf", 0.0);
+
+  fpar[0] = get_variable_default ("Npow", 2.25);
+
+  sky = &par[6];
+}
+
+/* two components: (1 + z_1 + 0.5*z_1^2 + z_2^N)^(-1) -- x, y, sx1, sy1, sxy1, I, sky, sx2, sy2, sxy2 */
+float rgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px1, py1, px2, py2;
+  float z1, z2, r, q1, q2, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px1 = par[2]*X;
+  py1 = par[3]*Y;
+  px2 = par[7]*X;
+  py2 = par[8]*Y;
+
+  z1 = 0.5*SQ(px1) + 0.5*SQ(py1) + par[4]*X*Y;
+  z2 = 0.5*SQ(px2) + 0.5*SQ(py2) + par[9]*X*Y;
+
+  r = 1.0 / (1 + z1 + 0.5*SQ(z1)+ pow(z2,fpar[0]));
+  f = par[5]*r + par[6];
+
+  q1 = par[5]*SQ(r)*(1 + z1);
+  q2 = par[5]*SQ(r)*fpar[0]*pow(z2,(fpar[0]-1));
+
+  if (dpar != NULL) {
+    dpar[0] = q1*(2*px1*par[2] + par[4]*Y) + q2*(2*px2*par[7] + par[9]*Y);
+    dpar[1] = q1*(2*py1*par[3] + par[4]*X) + q2*(2*py2*par[8] + par[9]*X);
+    dpar[2] = -2*q1*px1*X;
+    dpar[3] = -2*q1*py1*Y;
+    dpar[4] = -q1*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+    dpar[7] = -2*q2*px2*X;
+    dpar[8] = -2*q2*py2*Y;
+    dpar[9] = -q2*X*Y;
+  }
+  return (f);
+}
+
+int rgaussCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 * sqrt(2.0) / par[2]);
+  set_variable ("SYg",  2.35 * sqrt(2.0) / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zpk",  par[5]);
+  set_variable ("Sg",   par[6]);
+  set_variable ("SXf", 2.35 * sqrt(2.0) / par[7]);
+  set_variable ("SYf", 2.35 * sqrt(2.0) / par[8]);
+  set_variable ("SXYf", par[9]);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-serbulge.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-serbulge.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-serbulge.c	(revision 15879)
@@ -0,0 +1,102 @@
+# include "imfit.h"
+
+float serbulgeTD (float, float, float *, int, float *);
+void  serbulgeCL ();
+
+void serbulge_setup (char *name) {
+
+  if (strcmp(name, "serbulge")) return;
+
+  fitfunc = serbulgeTD;
+  cleanup = serbulgeCL;
+  Npar = 12;
+  Nfpar = 0;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0] = get_variable_default ("Xg", 0);
+  par[1] = get_variable_default ("Yg", 0);
+  par[2] = 2.35 * sqrt(2.0) / get_variable_default ("SXg", 2.0);
+  par[3] = 2.35 * sqrt(2.0) / get_variable_default ("SYg", 2.0);
+  par[4] = 0.0;
+  par[5] = get_variable_default ("Zpk", 10000) / 2.0;
+
+  par[6] = get_variable_default ("Sg", 0.0);
+
+  par[7] = 2.35 * sqrt(2.0) / get_variable_default ("SXf", 15.0);
+  par[8] = 2.35 * sqrt(2.0) / get_variable_default ("SYf", 15.0);
+  par[9] = get_variable_default ("SXYf", 0.0);
+  par[10] = get_variable_default ("Zpk", 10000) / 2.0;
+
+  par[11] = get_variable_default ("Sr", 1.0);
+
+  sky = &par[6];
+}
+
+/*                                  0  1    2   3   4      5    6     7   8   9       10  11 */
+/* sersic galaxy model w/ bulge: -- x, y, (sx, sy, sxy)_1, I_1, sky, (sx, sy, sxy)_2, I_2, n */
+/* exp (-b (r/r_e)^(1/n)) + pgauss (r) */
+float serbulgeTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px1, px2, py1, py2;
+  float z1, z2, r1, r2, t, q1, q2, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px1 = par[2]*X;
+  py1 = par[3]*Y;
+  px2 = par[7]*X;
+  py2 = par[8]*Y;
+
+  z1 = 0.5*SQ(px1) + 0.5*SQ(py1) + par[4]*X*Y;
+  z2 = 0.5*SQ(px2) + 0.5*SQ(py2) + par[9]*X*Y;
+
+  /* bulge component */
+  r1 = 1.0 / (1 + z1 + 0.5*z1*z1*(1 + z1/3)); /* ~ exp (-Z) */
+
+  /* disk component */
+  t = pow (z2, par[11]);
+  r2 = exp (-t);
+
+  f = par[5]*r1 + par[10]*r2 + par[6];
+
+  q1 = par[5]*r1*r1*(1 + z1 + 0.5*z1*z1);
+  q2 = par[10]*r2*par[11]*pow(z2, par[11]-1);
+
+  if (dpar != NULL) {
+    dpar[0] = q1*(2*px1*par[2] + par[4]*Y) + q2*(2*px2*par[7] + par[9]*Y);
+    dpar[1] = q1*(2*py1*par[3] + par[4]*X) + q2*(2*py2*par[8] + par[9]*X);
+    dpar[2] = -2*q1*px1*X;
+    dpar[3] = -2*q1*py1*Y;
+    dpar[4] = -q1*X*Y;
+    dpar[5] = +r1;
+    dpar[6] = +1;
+    dpar[7] = -2*q2*px2*X*50;
+    dpar[8] = -2*q2*py2*Y*50;
+    dpar[9] = -q2*X*Y*50;
+    dpar[10] = +r2*50;
+    dpar[11] = -q2*log(z2)*t*50;
+  }
+  return (f);
+}
+
+int serbulgeCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 * sqrt(2.0) / par[2]);
+  set_variable ("SYg",  2.35 * sqrt(2.0) / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zb",   par[5]);
+  set_variable ("Sg",   par[6]);
+
+  set_variable ("SXf",  2.35 * sqrt(2.0) / par[7]);
+  set_variable ("SYf",  2.35 * sqrt(2.0) / par[8]);
+  set_variable ("SXYf", par[9]);
+  set_variable ("Zd",   par[10]);
+  set_variable ("Sr",   par[11]);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-sersic.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-sersic.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-sersic.c	(revision 15879)
@@ -0,0 +1,74 @@
+# include "imfit.h"
+
+float sersicTD (float, float, float *, int, float *);
+void  sersicCL ();
+
+void sersic_setup (char *name) {
+
+  if (strcmp(name, "sersic")) return;
+
+  fitfunc = sersicTD;
+  cleanup = sersicCL;
+  Npar = 8;
+  Nfpar = 0;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0] = get_variable_default ("Xg", 0);
+  par[1] = get_variable_default ("Yg", 0);
+  par[2] = 2.35 * sqrt(2.0) / get_variable_default ("SXg", 2.0);
+  par[3] = 2.35 * sqrt(2.0) / get_variable_default ("SYg", 2.0);
+  par[4] = 0.0;
+  par[5] = get_variable_default ("Zpk", 10000);
+  par[6] = get_variable_default ("Sg", 0.0);
+  par[7] = get_variable_default ("Sr", 1.0);
+
+  sky = &par[6];
+}
+
+/* sersic galaxy model -- x, y, sx, sy, sxy, I, sky, n */
+/* exp (-b (r/r_e)^(1/n)) */
+float sersicTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, t, q, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = par[2]*X;
+  py = par[3]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + par[4]*X*Y;
+  t = pow (z, par[7]);
+  r = exp (-t);
+  f = par[5]*r + par[6];
+  q = par[5]*r*par[7]*pow(z, par[7]-1);
+
+  if (dpar != NULL) {
+    dpar[0] = q*(2*px*par[2] + par[4]*Y);
+    dpar[1] = q*(2*py*par[3] + par[4]*X);
+    dpar[2] = -2*q*px*X;
+    dpar[3] = -2*q*py*Y;
+    dpar[4] = -q*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+    dpar[7] = -q*log(z)*t;
+  }
+  return (f);
+}
+
+int sersicCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 * sqrt(2.0) / par[2]);
+  set_variable ("SYg",  2.35 * sqrt(2.0) / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zpk",  par[5]);
+  set_variable ("Sg",   par[6]);
+  set_variable ("Sr", par[7]);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-sgauss-psf.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-sgauss-psf.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-sgauss-psf.c	(revision 15879)
@@ -0,0 +1,74 @@
+# include "imfit.h"
+
+float sgauss_psfTD (float, float, float *, int, float *);
+void  sgauss_psfCL ();
+
+void sgauss_psf_setup (char *name) {
+
+  if (strcmp(name, "sgauss_psf")) return;
+
+  fitfunc = sgauss_psfTD;
+  imfit_cleanup = sgauss_psfCL;
+  Npar = 4;
+  Nfpar = 7;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0] = get_variable_default ("Xg", 0);
+  par[1] = get_variable_default ("Yg", 0);
+  par[2] = get_variable_default ("Zpk", 10000);
+  par[3] = get_variable_default ("Sg", 0.0);
+
+  fpar[0] = 2.35 / get_variable_default ("SXg", 15.0);
+  fpar[1] = 2.35 / get_variable_default ("SYg", 15.0);
+  fpar[2] = get_variable_default ("SXYg", 0.0);
+  fpar[3] = 2.35 / get_variable_default ("SXf", 15.0);
+  fpar[4] = 2.35 / get_variable_default ("SYf", 15.0);
+  fpar[5] = get_variable_default ("SXYf", 0.0);
+  fpar[6] = get_variable_default ("Npow", 2.25);
+
+  sky = &par[3];
+}
+
+void sgauss_psfCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("Zpk",  par[2]);
+  set_variable ("Sg",   par[3]);
+}
+
+/* two components: (1 + z_1 + z_2^N)^(-1) -- x, y, sx1, sy1, sxy1, I, sky, sx2, sy2, sxy2 */
+float sgauss_psfTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px1, py1, px2, py2;
+  float z1, z2, r, q1, q2, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px1 = fpar[0]*X;
+  py1 = fpar[1]*Y;
+  px2 = fpar[3]*X;
+  py2 = fpar[4]*Y;
+
+  z1 = 0.5*SQ(px1) + 0.5*SQ(py1) + fpar[2]*X*Y;
+  z2 = 0.5*SQ(px2) + 0.5*SQ(py2) + fpar[5]*X*Y;
+
+  r = 1.0 / (1 + z1 + pow(z2,fpar[6]));
+  f = par[2]*r + par[3];
+
+  q1 = par[2]*SQ(r);
+  q2 = par[2]*SQ(r)*fpar[6]*pow(z2,(fpar[6]-1));
+
+  if (dpar != NULL) {
+    dpar[0] = q1*(2*px1*fpar[0] + fpar[2]*Y) + q2*(2*px2*fpar[3] + fpar[5]*Y);
+    dpar[1] = q1*(2*py1*fpar[1] + fpar[2]*X) + q2*(2*py2*fpar[4] + fpar[5]*X);
+    dpar[2] = +r;
+    dpar[3] = +1;
+  }
+  return (f);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-sgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-sgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-sgauss.c	(revision 15879)
@@ -0,0 +1,98 @@
+# include "imfit.h"
+# define FFACTOR 200
+# define FSCALE 1.2
+
+float sgaussTD (float, float, float *, int, float *);
+void  sgaussCL ();
+
+void sgauss_setup (char *name) {
+
+  if (strcmp(name, "sgauss")) return;
+
+  fitfunc = sgaussTD;
+  imfit_cleanup = sgaussCL;
+  Npar = 10;
+  Nfpar = 2;
+
+  /* allocate free and fixed parameters */
+  ALLOCATE (par, float, MAX (Npar, 1));
+  bzero (par, Npar*sizeof(float));
+  ALLOCATE (fpar, float, MAX (Nfpar, 1));
+  bzero (fpar, Nfpar*sizeof(float));
+
+  par[0] = get_variable_default ("Xg", 0);
+  par[1] = get_variable_default ("Yg", 0);
+  par[2] = 2.35 / get_variable_default ("SXg", 2.0);
+  par[3] = 2.35 / get_variable_default ("SYg", 2.0);
+  par[4] = get_variable_default ("SXYg", 0);
+  par[5] = get_variable_default ("Zpk", 10000);
+  par[6] = get_variable_default ("Sg", 0.0);
+  par[7] = 2.35 / get_variable_default ("SXf", 15.0);
+  par[8] = 2.35 / get_variable_default ("SYf", 15.0);
+  par[9] = get_variable_default ("SXYf", 0.0);
+
+  fpar[0] = get_variable_default ("Npow", 2.25);
+  fpar[1] = get_variable_default ("Npin", 1.00); // drop this?
+
+  sky = &par[6];
+}
+
+void sgaussCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 / par[2]);
+  set_variable ("SYg",  2.35 / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zpk",  par[5]);
+  set_variable ("Sg",   par[6]);
+  set_variable ("SXf", 2.35 / par[7]);
+  set_variable ("SYf", 2.35 / par[8]);
+  set_variable ("SXYf", par[9]);
+}
+
+/* two components: (1 + z_1 + z_2^N)^(-1) -- x, y, sx1, sy1, sxy1, I, sky, sx2, sy2, sxy2 */
+float sgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px1, py1, px2, py2;
+  float z1, z2, r, q1, q2, f, f1, f2;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px1 = par[2]*X;
+  py1 = par[3]*Y;
+  px2 = par[7]*X;
+  py2 = par[8]*Y;
+
+  z1 = 0.5*SQ(px1) + 0.5*SQ(py1) + par[4]*X*Y;
+  z2 = 0.5*SQ(px2) + 0.5*SQ(py2) + par[9]*X*Y;
+
+  r = 1.0 / (1 + z1 + pow(z2,fpar[0]));
+  f = par[5]*r + par[6];
+
+  q1 = par[5]*SQ(r);
+  q2 = par[5]*SQ(r)*fpar[0]*pow(z2,(fpar[0]-1));
+
+  if (dpar != NULL) {
+    dpar[0] = q1*(2*px1*par[2] + par[4]*Y) + q2*(2*px2*par[7] + par[9]*Y);
+    dpar[1] = q1*(2*py1*par[3] + par[4]*X) + q2*(2*py2*par[8] + par[9]*X);
+
+    /* these fudge factors impede the growth of par[2] beyond par[7] */
+    f1 = fabs(par[7]) / fabs(par[2]);
+    f2 = (f1 < FSCALE) ? 1 : FFACTOR*(f1 - FSCALE) + 1;
+    dpar[2] = -2*q1*px1*X*f2;
+
+    f1 = fabs(par[8]) / fabs(par[3]);
+    f2 = (f1 < FSCALE) ? 1 : FFACTOR*(f1 - FSCALE) + 1;
+    dpar[3] = -2*q1*py1*Y*f2;
+
+    dpar[4] = -q1*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+    dpar[7] = -2*q2*px2*X;
+    dpar[8] = -2*q2*py2*Y;
+    dpar[9] = -q2*X*Y;
+  }
+  return (f);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-test.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-test.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-test.c	(revision 15879)
@@ -0,0 +1,314 @@
+  if (ShapeVariation) {
+    /* find dChi/dSx and dChi/dSy given by increasing shape terms by 5% */
+    float tp1, tp2, chix, chiy;
+    chix = chiy = 0;
+    if (fitfunc == sgaussTD) {
+      tp1 = par[2];
+      tp2 = par[7];
+      par[2] = par[2]*1.05;
+      par[7] = par[7]*1.05;
+      chix = mrq2dchi (x, y, z, dz, Npts, par, Npar, fitfunc) - chisq;
+      par[2] = tp1;
+      par[7] = tp2;
+
+      tp1 = par[3];
+      tp2 = par[8];
+      par[3] = par[3]*1.05;
+      par[8] = par[8]*1.05;
+      chiy = mrq2dchi (x, y, z, dz, Npts, par, Npar, fitfunc) - chisq;
+      par[3] = tp1;
+      par[8] = tp2;
+    }
+    if (fitfunc == pgaussTD) {
+      tp1 = par[2];
+      par[2] = par[2]*1.05;
+      chix = mrq2dchi (x, y, z, dz, Npts, par, Npar, fitfunc) - chisq;
+      par[2] = tp1;
+
+      tp1 = par[3];
+      par[3] = par[3]*1.05;
+      chiy = mrq2dchi (x, y, z, dz, Npts, par, Npar, fitfunc) - chisq;
+      par[3] = tp1;
+    }
+    if (fitfunc == sgauss_psfTD) {
+      tp1 = par[0];
+      tp2 = par[3];
+      par[0] = par[0]*1.05;
+      par[3] = par[3]*1.05;
+      chix = mrq2dchi (x, y, z, dz, Npts, par, Npar, fitfunc) - chisq;
+      par[0] = tp1;
+      par[3] = tp2;
+
+      tp1 = par[1];
+      tp2 = par[4];
+      par[1] = par[1]*1.05;
+      par[4] = par[4]*1.05;
+      chiy = mrq2dchi (x, y, z, dz, Npts, par, Npar, fitfunc) - chisq;
+      par[1] = tp1;
+      par[4] = tp2;
+    }
+    if (fitfunc == pgauss_psfTD) {
+      tp1 = par[0];
+      par[0] = par[0]*1.05;
+      chix = mrq2dchi (x, y, z, dz, Npts, par, Npar, fitfunc) - chisq;
+      par[0] = tp1;
+
+      tp1 = par[1];
+      par[1] = par[1]*1.05;
+      chiy = mrq2dchi (x, y, z, dz, Npts, par, Npar, fitfunc) - chisq;
+      par[1] = tp1;
+    }
+    set_variable ("dChiX", chix/chisq);
+    set_variable ("dChiY", chiy/chisq);
+  }
+
+# if (0)
+/* pars: x, y, sx, sy, sxy, I, sky */
+float fgalaxyTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, Z, E, F, q, R, f, p2, p3;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  p2 = X / par[2];
+  p3 = Y / par[3];
+
+  Z = sqrt (0.5*p2*X + X*Y*par[4] + 0.5*p3*Y);                 /* R */
+  E = 1.0 / (1 + Z);   
+
+  q = par[5] * E;
+  R = q*E;
+  F = 0.5 / Z;
+  
+  f = q + par[6];
+
+  dpar[0] = F*R*(p2 + par[4]*Y);
+  dpar[1] = F*R*(p3 + par[4]*X);
+  dpar[2] = F*0.5*R*p2*p2;
+  dpar[3] = F*0.5*R*p3*p3;
+  dpar[4] = -R*X*Y*F;
+    
+  dpar[5] = E;
+  dpar[6] = 1;
+  return (f);
+}
+
+/* pars: x, y, sx, sy, sxy, I, sky */
+float fbarTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, Z, E, F, q, R, f, p2, p3;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  p2 = X / par[2];
+  p3 = Y / par[3];
+
+  Z = 0.5*p2*X + X*Y*par[4] + 0.5*p3*Y;                 /* R */
+  E = 1.0 / (1 + Z*Z*Z);   
+
+  q = par[5] * E;
+  F = 3*Z*Z;
+  R = q*E*F;
+  
+  f = q + par[6];
+
+  dpar[0] = R*(p2 + par[4]*Y);
+  dpar[1] = R*(p3 + par[4]*X);
+  dpar[2] = 0.5*R*p2*p2;
+  dpar[3] = 0.5*R*p3*p3;
+  dpar[4] = -R*X*Y;
+    
+  dpar[5] = E;
+  dpar[6] = 1;
+  return (f);
+}
+
+/* convert from x,y to major,minor */
+void fix_ellipsegauss_pars (float *par, int Npar) {
+
+  float p2, p4, angle, t1, t2, tmp, area;
+
+  /* par[0], par[1] = Xo, Yo - stay the same */
+
+  p2 = 1/par[2];
+  p4 = 1/par[3];
+
+  angle = 0.5 * atan2 (-2*par[4], p4 - p2); 
+
+  tmp = sqrt (SQ(p2 - p4) + 4*SQ(par[4]));
+  t1 = (p2 + p4 + tmp) / 2;
+  t2 = t1 - tmp;
+
+  par[2] = 2.35482*sqrt(1/t2);
+  par[3] = 2.35482*sqrt(1/t1);
+  par[4] = DEG_RAD * angle;
+
+  area = 2*M_PI/sqrt(t1*t2);
+
+  par[5] *= area;
+
+}
+# endif
+
+/***  options for later
+
+  Subtract = FALSE;
+  if ((N = get_argument (argc, argv, "-sub"))) {
+    remove_argument (N, &argc, argv);
+    Subtract  = TRUE;
+  }
+
+  DFact = 1;
+  if ((N = get_argument (argc, argv, "-D"))) {
+    remove_argument (N, &argc, argv);
+    DFact  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  fitfunc = fgaussTD;
+  if ((N = get_argument (argc, argv, "-gal"))) {
+    remove_argument (N, &argc, argv);
+    fitfunc = fgalaxyTD; 
+  }
+  if ((N = get_argument (argc, argv, "-bar"))) {
+    remove_argument (N, &argc, argv);
+    fitfunc = fbarTD; 
+  }
+
+
+  f1 = 1;
+  if ((c = get_variable ("BETA1")) != (char *) NULL) f1 = atof (c);
+
+  f2 = 1;
+  if ((c = get_variable ("BETA2")) != (char *) NULL) f2 = atof (c);
+
+  if (Subtract) {
+    tmpsky = par[6];
+    par[6] = 0;
+    for (N = j = 0; j < ny; j++) {
+      V = (float *)(buf[0].matrix.buffer) + (j+sy)*buf[0].matrix.Naxis[0] + sx; 
+      for (i = 0; i < nx; i++, V++, N++) {
+	dx = i + sx;
+	dy = j + sy;
+	*V -= fitfunc (dx, dy, par, Npar, (float *) NULL);
+      }
+    }
+    par[6] = tmpsky;
+  }
+
+***/
+
+# if (0)
+
+/* these two tests were not very succcessful.  the first did not model the shape well because 
+   it could not match the change in roundness with radius.  the second did not work because the 
+   parameters were degenerate (amplitude and slope of second component) */
+
+/* test: fixed, non-integer higher-order term -- x, y, sx, sy, sxy, I, sky, f1, f2 */
+float qgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, q, f, k;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = par[2]*X;
+  py = par[3]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + par[4]*X*Y;
+  k = pow(z,1.75*par[8]);
+  r = 1.0 / (1 + z + par[7]*k); /* ~ exp (-Z) */
+  q = par[5]*r*r*(1 + 1.75*par[7]*par[8]*pow(z,1.75*par[8]-1));
+  /* note difference from gaussian: q = par[5]*r */
+  f = par[5]*r + par[6];
+
+  dpar[0] = q*(2*px*par[2] + par[4]*Y);
+  dpar[1] = q*(2*py*par[3] + par[4]*X);
+  dpar[2] = -2*q*px*X;
+  dpar[3] = -2*q*py*Y;
+  dpar[4] = -q*X*Y;
+  dpar[5] = +r;
+  dpar[6] = +1;
+  dpar[7] = -10*par[5]*r*r*k;
+  dpar[8] = -10*par[5]*r*r*par[7]*k*1.75*log(z);
+
+  return (f);
+}
+
+/* test: two component model: inner pseudo gaussian with outer z^1.75 x, y, sx, sy, sxy, I, sky */
+float rgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px1, py1, px2, py2;
+  float z1, z2, r1, r2, q1, q2, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px1 = par[2]*X;
+  py1 = par[3]*Y;
+  px2 = par[8]*X;
+  py2 = par[9]*Y;
+
+  z1 = 0.5*SQ(px1) + 0.5*SQ(py1) + par[4]*X*Y;
+  z2 = 0.5*SQ(px2) + 0.5*SQ(py2) + par[10]*X*Y;
+
+  r1 = 1.0 / (1 + z1 + 0.5*SQ(z1)*(1 + z1/3)); /* ~ exp (-Z) */
+  r2 = 1.0 / (1 + pow(z2,1.75));
+
+  f = par[5]*r1 + par[6] + par[7]*r2;
+
+  q1 = par[5]*SQ(r1)*(1 + z1 + 0.5*SQ(z1));
+  q2 = par[7]*SQ(r2)*(1.75*pow(z2,0.75));
+
+  dpar[	0] = q1*(2*px1*par[2] + par[4]*Y) + q2*(2*px2*par[8] + par[10]*Y);
+  dpar[	1] = q1*(2*py1*par[3] + par[4]*X) + q2*(2*py2*par[9] + par[10]*X);
+  dpar[	2] = -2*q1*px1*X;
+  dpar[	3] = -2*q1*py1*Y;
+  dpar[	4] = -q1*X*Y;
+  dpar[	5] = +r1;
+  dpar[	6] = +1;
+  dpar[	7] = +r2*2;
+  dpar[	8] = -2*q2*px2*X*2;
+  dpar[	9] = -2*q2*py2*Y*2;
+  dpar[10] = -q2*X*Y;
+
+  return (f);
+}
+
+# endif
+
+  /* forcing values to have a rational range
+  ALLOCATE (parmin, float, Npar);
+  ALLOCATE (parmax, float, Npar);
+  bzero (parmin, Npar*sizeof(float));
+  bzero (parmax, Npar*sizeof(float));
+  parmin[0] = parmin[1] = 0;
+  parmax[0] = buf[0].matrix.Naxis[0];
+  parmax[1] = buf[0].matrix.Naxis[1];
+
+  parmin[2] = parmin[3] = 0.01;
+  parmax[2] = parmax[3] = 100.0;
+  parmin[4] = -1000;
+  parmax[4] = -1000;
+  
+  parmin[5] = 1;
+  parmax[5] = 1e5;
+
+  parmin[6] = 0.0;
+  parmax[6] = 1e5;
+
+  if (Npar == 9) {
+    parmin[7] = parmin[8] = 0.01;
+    parmax[7] = parmax[8] = 10.0;
+  }
+  if (Npar == 10) {
+    parmin[7] = parmin[8] = 0.01;
+    parmax[7] = parmax[8] = 10.0;
+    parmin[9] = -1000;
+    parmax[9] = -1000;
+  }
+  */
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-tgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-tgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-tgauss.c	(revision 15879)
@@ -0,0 +1,81 @@
+# include "imfit.h"
+
+float tgaussTD (float, float, float *, int, float *);
+void  tgaussCL ();
+
+void tgauss_setup (char *name) {
+
+  if (strcmp(name, "tgauss")) return;
+
+  fitfunc = tgaussTD;
+  cleanup = tgaussCL;
+  Npar = 10;
+  Nfpar = 2;
+
+  par[0] = get_variable_default ("Xg", 0);
+  par[1] = get_variable_default ("Yg", 0);
+  par[2] = 2.35 * sqrt(2.0) / get_variable_default ("SXg", 2.0);
+  par[3] = 2.35 * sqrt(2.0) / get_variable_default ("SYg", 2.0);
+  par[4] = 0.0;
+  par[5] = get_variable_default ("Zpk", 10000);
+  par[6] = get_variable_default ("Sg", 0.0);
+  par[7] = 2.35 * sqrt(2.0) / get_variable_default ("SXf", 15.0);
+  par[8] = 2.35 * sqrt(2.0) / get_variable_default ("SYf", 15.0);
+  par[9] = get_variable_default ("SXYf", 0.0);
+
+  fpar[0] = get_variable_default ("Npow", 2.25);
+  fpar[1] = get_variable_default ("Npin", 1.00); // drop this?
+
+  sky = &par[6];
+}
+
+/* two components: (1 + z_1^M + z_2^N)^(-1) -- x, y, sx1, sy1, sxy1, I, sky, sx2, sy2, sxy2 */
+float tgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px1, py1, px2, py2;
+  float z1, z2, r, q1, q2, f;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px1 = par[2]*X;
+  py1 = par[3]*Y;
+  px2 = par[7]*X;
+  py2 = par[8]*Y;
+
+  z1 = 0.5*SQ(px1) + 0.5*SQ(py1) + par[4]*X*Y;
+  z2 = 0.5*SQ(px2) + 0.5*SQ(py2) + par[9]*X*Y;
+
+  r = 1.0 / (1 + pow(z1,fpar[1]) + pow(z2,fpar[0]));
+  f = par[5]*r + par[6];
+
+  q1 = par[5]*SQ(r)*fpar[1]*pow(z1,(fpar[1]-1));
+  q2 = par[5]*SQ(r)*fpar[0]*pow(z2,(fpar[0]-1));
+
+  if (dpar != NULL) {
+    dpar[0] = q1*(2*px1*par[2] + par[4]*Y) + q2*(2*px2*par[7] + par[9]*Y);
+    dpar[1] = q1*(2*py1*par[3] + par[4]*X) + q2*(2*py2*par[8] + par[9]*X);
+    dpar[2] = -2*q1*px1*X*2;
+    dpar[3] = -2*q1*py1*Y*2;
+    dpar[4] = -q1*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+    dpar[7] = -2*q2*px2*X;
+    dpar[8] = -2*q2*py2*Y;
+    dpar[9] = -q2*X*Y;
+  }
+  return (f);
+}
+
+int tgaussCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 * sqrt(2.0) / par[2]);
+  set_variable ("SYg",  2.35 * sqrt(2.0) / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zpk",  par[5]);
+  set_variable ("Sg",   par[6]);
+  set_variable ("SXf",  2.35 * sqrt(2.0) / par[7]);
+  set_variable ("SYf",  2.35 * sqrt(2.0) / par[8]);
+  set_variable ("SXYf", par[9]);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-vgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-vgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit-vgauss.c	(revision 15879)
@@ -0,0 +1,70 @@
+# include "imfit.h"
+
+float vgaussTD (float, float, float *, int, float *);
+void  vgaussCL ();
+
+void  vgauss_setup (char *name) {
+
+  if (strcmp(name, "vgauss")) return;
+
+  fitfunc = vgaussTD;
+  cleanup = vgaussCL;
+  Npar = 9;
+  Nfpar = 0;
+
+  par[0] = get_variable_default ("Xg", 0);
+  par[1] = get_variable_default ("Yg", 0);
+  par[2] = 2.35 * sqrt(2.0) / get_variable_default ("SXg", 2.0);
+  par[3] = 2.35 * sqrt(2.0) / get_variable_default ("SYg", 2.0);
+  par[4] = 0.0;
+  par[5] = get_variable_default ("Zpk", 10000);
+  par[6] = get_variable_default ("Sg", 0.0);
+  par[7] = 1;
+  par[8] = 1;
+  sky = &par[6];
+}
+
+/* pseudo 2D gaussian with floating 2nd and 3rd order terms -- x, y, sx, sy, sxy, I, sky, f1, f2 */
+float vgaussTD (float x, float y, float *par, int Npar, float *dpar) {
+
+  float X, Y, px, py;
+  float z, r, q, f, k;
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  px = par[2]*X;
+  py = par[3]*Y;
+
+  z = 0.5*SQ(px) + 0.5*SQ(py) + par[4]*X*Y;
+  k = 0.5*z*z*(1 + par[8]*z/3);
+  r = 1.0 / (1 + z + par[7]*k); /* ~ exp (-Z) */
+  f = par[5]*r + par[6];
+  q = par[5]*r*r*(1 + par[7]*z*(1 + par[8]*z/2));
+  /* note difference from gaussian: q = par[5]*r */
+
+  if (dpar != NULL) {
+    dpar[0] = q*(2*px*par[2] + par[4]*Y);
+    dpar[1] = q*(2*py*par[3] + par[4]*X);
+    dpar[2] = -2*q*px*X;
+    dpar[3] = -2*q*py*Y;
+    dpar[4] = -q*X*Y;
+    dpar[5] = +r;
+    dpar[6] = +1;
+    dpar[7] = -100*par[5]*r*r*k;
+    dpar[8] = -100*par[5]*r*r*par[7]*(z*z*z)/6;
+  }
+  return (f);
+}
+
+int vgaussCL () {
+  set_variable ("Xg",   par[0]);
+  set_variable ("Yg",   par[1]);
+  set_variable ("SXg",  2.35 * sqrt(2.0) / par[2]);
+  set_variable ("SYg",  2.35 * sqrt(2.0) / par[3]);
+  set_variable ("SXYg", par[4]);
+  set_variable ("Zpk",  par[5]);
+  set_variable ("Sg",   par[6]);
+  set_variable ("SXf", par[7]);
+  set_variable ("SYf", par[8]);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imfit.c	(revision 15879)
@@ -0,0 +1,185 @@
+# include "imfit.h"
+
+int imfit (int argc, char **argv) {
+
+  int i, j, N, Npts, Save, VERBOSE, ShapeVariation;
+  int sx, sy, nx, ny, Nx, Ny;
+  float chisq, ochisq, dchisq, Gain, RDnoise, SatThreshold;
+  float *x, *y, *z, *dz, *V;
+  Buffer *buf;
+
+  Save = FALSE;
+  if ((N = get_argument (argc, argv, "-save"))) {
+    remove_argument (N, &argc, argv);
+    Save = TRUE;
+  }
+
+  ShapeVariation = FALSE;
+  if ((N = get_argument (argc, argv, "-shapes"))) {
+    remove_argument (N, &argc, argv);
+    ShapeVariation = TRUE;
+  }
+
+  SatThreshold = 0xffff;
+  if ((N = get_argument (argc, argv, "-sat"))) {
+    remove_argument (N, &argc, argv);
+    SatThreshold = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  /* Gain in e/DN */
+  Gain = 1.0;
+  if ((N = get_argument (argc, argv, "-gain"))) {
+    remove_argument (N, &argc, argv);
+    Gain = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  /* RD noise in DN */
+  RDnoise = 0.0;
+  if ((N = get_argument (argc, argv, "-rdnoise"))) {
+    remove_argument (N, &argc, argv);
+    RDnoise = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    remove_argument (N, &argc, argv);
+    VERBOSE = TRUE;
+  }
+
+  /* set fitting function */
+  fgauss_setup ("fgauss");
+  if ((N = get_argument (argc, argv, "-func"))) {
+    fitfunc = NULL;
+    remove_argument (N, &argc, argv);
+    fgauss_setup (argv[N]);
+    pgauss_setup (argv[N]);
+    pgauss_psf_setup (argv[N]);
+    sgauss_setup (argv[N]);
+    sgauss_psf_setup (argv[N]);
+    qgauss_setup (argv[N]);
+    qgauss_psf_setup (argv[N]);
+    qfgauss_setup (argv[N]);
+    qrgauss_setup (argv[N]);
+    if (fitfunc == NULL) {
+      gprint (GP_ERR, "unknown function %s\n", argv[N]);
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: imfit <buffer> sx sy nx ny\n");
+    return (FALSE);
+  }
+
+  /* non-optional arguments */
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  sx = atof (argv[2]);
+  sy = atof (argv[3]);
+  nx = atof (argv[4]);
+  ny = atof (argv[5]);
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+
+  /* check if region is valid */
+  if (sx + 0.5*nx < 0) goto range;
+  if (sy + 0.5*ny < 0) goto range;
+  if (sx + 0.5*nx >= Nx) goto range;
+  if (sy + 0.5*ny >= Ny) goto range;
+
+  /* convert array z[x,y] to x[i], y[i], z[i] */
+  N = 0;
+  Npts = nx*ny;
+  ALLOCATE (x,  float, 2*Npts);
+  ALLOCATE (y,  float, 2*Npts);
+  ALLOCATE (z,  float, 2*Npts);
+  ALLOCATE (dz, float, 2*Npts);
+  for (j = 0; j < ny; j++) {
+    if (j + sy < 0) continue;
+    if (j + sy >= Ny) continue;
+    V = (float *)(buf[0].matrix.buffer) + (j+sy)*buf[0].matrix.Naxis[0] + sx; 
+    for (i = 0; i < nx; i++) {
+      if (i + sx < 0) continue;
+      if (i + sx >= Nx) continue;
+      if (*V > SatThreshold) goto next;
+      dz[N] = (SQ(RDnoise) + *V/Gain);
+      if (dz[N] <= 0) goto next;
+      dz[N] = 1.0 / dz[N];
+      x[N] = i + sx;
+      y[N] = j + sy;
+      z[N] = *V;
+      N++;
+    next:
+      V++;
+    }
+  }
+  Npts = N;
+
+  /* run fit routine */
+  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);
+    dchisq = ochisq - chisq;
+    ochisq = chisq;
+  }  
+  set_int_variable ("Niter",  i);
+
+  /** create output image (keep in sky) **/
+  if (Save) {
+    Buffer *out;
+    float *Vi, *Vo, vr, vf;
+
+    if ((out = SelectBuffer ("out",   ANYBUFFER, TRUE)) == NULL) return (FALSE);
+    free (out[0].header.buffer);
+    free (out[0].matrix.buffer);
+
+    strcpy (out[0].file, "(empty)");
+    CreateBuffer (out, 2*nx, 2*ny, -32, 0.0, 1.0);
+
+    /* four panels: 1) raw image. 2) fit  3) raw - fit   4) ?? */
+    Vi = (float *)buf[0].matrix.buffer;
+    Vo = (float *)out[0].matrix.buffer;
+    for (j = 0; j < ny; j++) {
+      for (i = 0; i < nx; i++) {
+	vf = fitfunc ((float)(i+sx), (float)(j+sy), par, Npar, NULL);
+	vr = Vi[(i+sx)+(j+sy)*Nx];
+	Vo[(i   )+(j   )*2*nx] = vr;
+	Vo[(i+nx)+(j   )*2*nx] = vf;
+	Vo[(i   )+(j+ny)*2*nx] = vr - vf + *sky;
+	Vo[(i+nx)+(j+ny)*2*nx] = fabs(vr-vf) + *sky;
+      }
+    }
+  }
+
+  /* save parameters to opihi variables */
+  imfit_cleanup ();
+
+  set_variable ("ChiSq", chisq/(Npts - Npar));
+
+  if (VERBOSE) {
+    for (i = 0; i < Npar; i++) {
+      gprint (GP_ERR, "%g ", par[i]);
+    }
+    gprint (GP_ERR, "\n");
+  }
+
+  free (x);
+  free (y);
+  free (z);
+  free (dz);
+  free (par);
+  free (fpar);
+
+  mrq2dfree (Npar);
+  return (TRUE);
+
+range:
+  gprint (GP_ERR, "region out of range\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imsub.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imsub.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/imsub.c	(revision 15879)
@@ -0,0 +1,79 @@
+# include "imfit.h"
+
+int imsub (int argc, char **argv) {
+
+  int i, j, N, VERBOSE;
+  int sx, sy, nx, ny, Nx, Ny;
+  float value;
+  float *V;
+  Buffer *buf;
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    remove_argument (N, &argc, argv);
+    VERBOSE = TRUE;
+  }
+
+  /* set fitting function */
+  fgauss_setup ("fgauss");
+  if ((N = get_argument (argc, argv, "-func"))) {
+    fitfunc = NULL;
+    remove_argument (N, &argc, argv);
+    fgauss_setup (argv[N]);
+    pgauss_setup (argv[N]);
+    pgauss_psf_setup (argv[N]);
+    sgauss_setup (argv[N]);
+    sgauss_psf_setup (argv[N]);
+    qgauss_setup (argv[N]);
+    qgauss_psf_setup (argv[N]);
+    qfgauss_setup (argv[N]);
+    qrgauss_setup (argv[N]);
+    if (fitfunc == NULL) {
+      gprint (GP_ERR, "unknown function %s\n", argv[N]);
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: imfit <buffer> sx sy nx ny\n");
+    return (FALSE);
+  }
+
+  /* non-optional arguments */
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  sx = atof (argv[2]);
+  sy = atof (argv[3]);
+  nx = atof (argv[4]);
+  ny = atof (argv[5]);
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+
+  /* check if region is valid */
+  if (sx >= Nx) goto range;
+  if (sy >= Ny) goto range;
+  if (sx + nx < 0) goto range;
+  if (sy + ny < 0) goto range;
+
+  /* subtract model fit, but not local sky */
+  for (j = 0; j < ny; j++) {
+    if (j + sy < 0) continue;
+    if (j + sy >= Ny) continue;
+    V = (float *)(buf[0].matrix.buffer) + (j+sy)*buf[0].matrix.Naxis[0] + sx; 
+    for (i = 0; i < nx; i++, V++) {
+      if (i + sx < 0) continue;
+      if (i + sx >= Nx) continue;
+      value = fitfunc ((float)(i+sx), (float)(j+sy), par, Npar, NULL);
+      *V -= value;
+    }
+  }
+
+  free (par);
+  free (fpar);
+  return (TRUE);
+
+range:
+  gprint (GP_ERR, "region out of range\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/init.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/init.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/init.c	(revision 15879)
@@ -0,0 +1,85 @@
+# include "astro.h"
+
+int biassub		    PROTO((int, char **));
+int cgrid		    PROTO((int, char **));
+int coords		    PROTO((int, char **));
+int cplot		    PROTO((int, char **));
+int csystem		    PROTO((int, char **));
+int ctimes		    PROTO((int, char **));
+int cval		    PROTO((int, char **));
+int czplot		    PROTO((int, char **));
+int drizzle		    PROTO((int, char **));
+int flux		    PROTO((int, char **));
+int fixwrap		    PROTO((int, char **));
+int gauss		    PROTO((int, char **));
+int gaussfit		    PROTO((int, char **));
+int getvel		    PROTO((int, char **));
+int getlst		    PROTO((int, char **));
+int imfit		    PROTO((int, char **));
+int imsub		    PROTO((int, char **));
+int medianmap		    PROTO((int, char **));
+int mkgauss		    PROTO((int, char **));
+int multifit		    PROTO((int, char **));
+int objload		    PROTO((int, char **));
+int outline		    PROTO((int, char **));
+int polar		    PROTO((int, char **));
+int precess		    PROTO((int, char **));
+int profile		    PROTO((int, char **));
+int region		    PROTO((int, char **));
+int rotcurve		    PROTO((int, char **));
+int scale		    PROTO((int, char **));
+int sexigesimal		    PROTO((int, char **));
+int spec		    PROTO((int, char **));
+int star		    PROTO((int, char **));
+int times		    PROTO((int, char **));
+int transform		    PROTO((int, char **));
+
+static Command cmds[] = {  
+  {"biassub", 	  biassub,      "subtract medianed overscan row or column"},
+  {"cgrid",       cgrid,        "plot sky coordinate grid"},
+  {"coords",  	  coords,       "load coordinates for buffer from file"},
+  {"cplot",       cplot,        "plot vectors in sky coordinates"},
+  {"csystem", 	  csystem,      "convert between coordinate systems"},
+  {"ctimes",  	  ctimes,       "convert between time formats"},
+  {"cval",        cval,         "cosmic ray flux?"},
+  {"czplot",  	  czplot,       "plot scaled vectors in sky coordinates"},
+  {"drizzle", 	  drizzle,      "transform image to image"},
+  {"flux",    	  flux,         "flux in a convex contour"},
+  {"fixwrap",  	  fixwrap,      "fix megacam over-wrapped pixels"},
+  {"gauss",   	  gauss,        "get statistics on a star, assuming gaussian profile"},
+  {"getvel",      getvel,       "rotcurve to velocities"},
+  {"getlst",      getlst,       "return LST given time and longitude"},
+  {"imfit",   	  imfit,        "fit function"},
+  {"imsub",   	  imsub,        "subtract function"},
+  {"medianmap",   medianmap,    "small median image"},
+  {"mkgauss",     mkgauss,      "generate a 2-D gaussian centered in image"},
+  {"multifit",    multifit,     "fit multi-order spectrum"},
+  {"objload",     objload,      "plot obj data on Ximage "},
+  {"outline",     outline,      "fit outline region"},
+  {"polar",       polar,        "convert polar image to cartesian"},
+  {"precess",     precess,      "precess coordinates"},
+  {"profile",     profile,      "radial profile at X, Y"},
+  {"region",      region,       "define sky region for plot"},
+  {"rotcurve",    rotcurve,     "convert CO images to polar coords"},
+  {"scale",       scale,        "get / set real bzero / bscale values"},
+  {"sexigesimal", sexigesimal,  "convert to/from sexigesimal/decimal"},
+  {"spec",    	  spec,         "extract a spectrum"},
+  {"star",    	  star,         "star stats at rough coords"},
+  {"transform",   transform,    "geometric transformation of image"},
+}; 
+
+/* not currently implemented 
+  {"gaussfit",    gaussfit,     "fit a gaussian to pixels in a region"},
+  {"testfit",     testfit, ""},
+  {"times", , ""},
+*/
+
+void InitAstro () {
+  
+  int i;
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/medianmap.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/medianmap.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/medianmap.c	(revision 15879)
@@ -0,0 +1,112 @@
+# include "astro.h"
+
+int medianmap (int argc, char **argv) {
+  
+  float *temp, *tp;
+  int i, j, k, I0, I1, J0, J1, I, J, n, N;
+  int nx, ny, Nx, Ny, NX, NY, Ignore;
+  float Mv, Nv, Mv2, value, min, max, IgnoreValue;
+  float *In, *Out, *ip;
+  float fx, fy;
+  Buffer *in, *out;
+
+  IgnoreValue = 0;
+  Ignore = FALSE;
+  if ((N = get_argument (argc, argv, "-ignore"))) {
+    Ignore = TRUE;
+    remove_argument (N, &argc, argv);
+    IgnoreValue = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  min = 0.45;
+  max = 0.55;
+  if ((N = get_argument (argc, argv, "-range"))) {
+    remove_argument (N, &argc, argv);
+    min  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    max  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: medianmap (in) (out) Nx Ny [-range min max]\n");
+    gprint (GP_ERR, "       Nx, Ny specify dimensions of output image\n");
+    gprint (GP_ERR, "       min, max specify fractional range for sorted average\n");
+    return (FALSE);
+  }
+
+  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectBuffer (argv[2], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  Nx = atof (argv[3]);
+  Ny = atof (argv[4]);
+  NX = in[0].header.Naxis[0];
+  NY = in[0].header.Naxis[1];
+
+  /* duplicate the (in) buffer to the (out), with different size */
+  /* this should probably be a function in misc */
+  gfits_free_matrix (&out[0].matrix);
+  gfits_free_header (&out[0].header);
+  out[0].bitpix = in[0].bitpix;
+  out[0].unsign = in[0].unsign;
+  out[0].bscale = in[0].bscale;
+  out[0].bzero  = in[0].bzero;
+  gfits_copy_header (&in[0].header, &out[0].header);
+  gfits_modify (&out[0].header, "NAXIS1", "%d", 1, Nx);
+  gfits_modify (&out[0].header, "NAXIS2", "%d", 1, Ny);
+  out[0].header.Naxis[0] = Nx;
+  out[0].header.Naxis[1] = Ny;
+  gfits_create_matrix (&out[0].header, &out[0].matrix);
+
+  In = (float *) in[0].matrix.buffer;
+  Out = (float *) out[0].matrix.buffer;
+
+  fx = (float) Nx / NX;
+  fy = (float) Ny / NY;
+
+  nx = 1 + 1/fx;
+  ny = 1 + 1/fy;
+
+  ALLOCATE (temp, float, 2*nx*ny);
+
+  Nv = Mv = Mv2 = 0.0;
+
+  for (j = 0; j < Ny; j++) {
+    J0 = j / fy;
+    J1 = (j + 1) / fy;
+    for (i = 0; i < Nx; i++) {
+      
+      I0 = i / fx;
+      I1 = (i + 1) / fx;
+
+      n = 0;
+      tp = temp;
+      for (J = J0; J < J1; J++) {
+	ip = &In[J*NX + I0];
+	for (I = I0; I < I1; I++, tp++, ip++) {
+	  if (Ignore && (fabs (*ip - IgnoreValue) < 0.01)) continue;
+	  *tp = *ip;
+	  n++;
+	}
+      }
+
+      fsort (temp, n);
+
+      value = 0;
+      N = 0;
+      for (k = min*n; k < max*n; k++) {
+	value += temp[k];
+	N ++;
+      }
+      if (N == 0)
+	Out[j*Nx + i] = 0;
+      else 
+	Out[j*Nx + i] = value / N;
+    }
+  }
+
+  return (TRUE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/mkgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/mkgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/mkgauss.c	(revision 15879)
@@ -0,0 +1,71 @@
+# include "astro.h"
+
+int mkgauss (int argc, char **argv) {
+  
+  int i, j, Nx, Ny, N;
+  float *in;
+  double Sig_x, Sig_y, Theta;
+  double root1, root2, R, A1, A2, A3;
+  double Sx, Sy, Sxy;
+  double x, y, r, f, Xo, Yo;
+  Buffer *buf;
+
+  Xo = Yo = 0;
+  if ((N = get_argument (argc, argv, "-c"))) {
+    remove_argument (N, &argc, argv);
+    Xo = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    Yo = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((argc < 3) || (argc > 5)) {
+    gprint (GP_ERR, "USAGE: mkgauss (buffer) (sigma) [[sy/sx] angle]\n");
+    return (FALSE);
+  }
+
+  /* select input / output buffers */
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  Nx = buf[0].header.Naxis[0];
+  Ny = buf[0].header.Naxis[1];
+  
+  /* gaussian parameters */
+  Sig_x = atof (argv[2]);
+  Sig_y = Sig_x;
+  Theta = 0.0;
+  if (argc > 3) {
+    Sig_y = Sig_x*atof (argv[3]);
+    if (argc == 5) {
+      Theta = atof (argv[4]);
+    }
+  }
+
+  /* given Sig_x, Sig_y, Theta, find Sx, Sy, Sxy */
+  root1 = SQ(1.0 / Sig_y);
+  root2 = SQ(1.0 / Sig_x);
+
+  R = 0.5 * (root1 - root2);
+  A1 = 0.25*(root1 + root2) - 0.5*R*cos(2*RAD_DEG*Theta);
+  A2 = 0.25*(root1 + root2) + 0.5*R*cos(2*RAD_DEG*Theta);
+  A3 = -R*sin(2*RAD_DEG*Theta);
+
+  Sx = 0.5/A1;
+  Sy = 0.5/A2;
+  Sxy = A3;
+
+  /* f = exp (-r), r = (x^2 / 2Sx) + (y^2 / 2Sy) + Sxy*x*y */
+
+  in = (float *) buf[0].matrix.buffer;
+  for (j = 0; j < Ny; j++) {
+    for (i = 0; i < Nx; i++, in++) {
+
+      x = i - Xo;
+      y = j - Yo;
+      r = 0.5*x*x/Sx + 0.5*y*y/Sy + x*y*Sxy;
+      f = exp (-r);
+      *in += f;
+    }
+  }
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/multifit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/multifit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/multifit.c	(revision 15879)
@@ -0,0 +1,179 @@
+# include "astro.h"
+
+int multifit (int argc, char **argv) {
+  
+  char *p, name[64];
+  double **a, **b, v;
+  int i, j, I, J, n, valid;
+  Vector **Nc, **Nmb, **NMb, **Nwb, **Nmh, **Nml, **Nwo;
+  int *nterm;
+  int Ndim, Norder, Nx, Ny;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: multifit (Norder)\n");
+    return (FALSE);
+  }
+
+  Ndim = 0;
+  Norder = atoi (argv[1]);
+  ALLOCATE (nterm, int, Norder);
+  for (i = 0; i < Norder; i++) {
+    sprintf (name, "nterm:%d", i);
+    p = get_variable (name);
+    nterm[i] = atoi (p); 
+    Ndim += nterm[i];
+    free (p);
+  }
+
+  ALLOCATE (a, double *, Ndim);
+  ALLOCATE (b, double *, Ndim);
+  for (i = 0; i < Ndim; i++) {
+    ALLOCATE (a[i], double, Ndim);
+    ALLOCATE (b[i], double, 1);
+    bzero (a[i], Ndim*sizeof(double));
+    bzero (b[i], sizeof(double));
+  }
+ 
+  ALLOCATE (Nc,  Vector *, Norder);
+  ALLOCATE (NMb, Vector *, Norder);
+  ALLOCATE (Nmb, Vector *, Norder);
+  ALLOCATE (Nwb, Vector *, Norder);
+  ALLOCATE (Nmh, Vector *, Norder - 1);
+  ALLOCATE (Nml, Vector *, Norder - 1);
+  ALLOCATE (Nwo, Vector *, Norder - 1);
+  
+  for (i = 0; i < Norder; i++) {
+    sprintf (name, "c%d", i);
+    if ((Nc[i]  = SelectVector (name, ANYVECTOR, TRUE)) == NULL) goto escape;
+    sprintf (name, "Mb%d", i);
+    if ((NMb[i] = SelectVector (name, OLDVECTOR, TRUE)) == NULL) goto escape;
+    sprintf (name, "mb%d", i);
+    if ((Nmb[i] = SelectVector (name, OLDVECTOR, TRUE)) == NULL) goto escape;
+    sprintf (name, "wb%d", i);
+    if ((Nwb[i] = SelectVector (name, OLDVECTOR, TRUE)) == NULL) goto escape;
+  }
+  for (i = 0; i < Norder - 1; i++) {
+    sprintf (name, "ml%d", i);
+    if ((Nml[i] = SelectVector (name, OLDVECTOR, TRUE)) == NULL) goto escape;
+    sprintf (name, "mh%d", i);
+    if ((Nmh[i] = SelectVector (name, OLDVECTOR, TRUE)) == NULL) goto escape;
+    sprintf (name, "wo%d", i);
+    if ((Nwo[i] = SelectVector (name, OLDVECTOR, TRUE)) == NULL) goto escape;
+  }
+
+  Ny = 0;
+  for (i = 0; i < Norder; i++) {
+    for (j = 0; j < nterm[i]; j++, Ny++) {
+      Nx = 0;
+      valid = FALSE;
+      for (I = 0; I < Norder; I++) {
+	if (I == i - 1) { 
+	  for (J = 0; J < nterm[I]; J++) {
+	    v = 0;
+	    for (n = 0; n < Nwo[i-1][0].Nelements; n++) {
+	      v += -pow (Nwo[i-1][0].elements[n], (double)(j+J));
+	    }
+	    a[Ny][Nx] = v;
+	    Nx ++;
+	  }
+	  valid = TRUE;
+	}
+	if (I == i + 1) { 
+	  for (J = 0; J < nterm[I]; J++) {
+	    v = 0;
+	    for (n = 0; n < Nwo[i][0].Nelements; n++) {
+	      v += -pow (Nwo[i][0].elements[n], (double)(j+J));
+	    }
+	    a[Ny][Nx] = v;
+	    Nx ++;
+	  }
+	  valid = TRUE;
+	}
+	if (I == i) { 
+	  for (J = 0; J < nterm[I]; J++) {
+	    v = 0;
+	    for (n = 0; n < Nwb[i][0].Nelements; n++) {
+	      v += pow (Nwb[i][0].elements[n], (double)(j+J));
+	    }
+	    if (i > 0) {
+	      for (n = 0; n < Nwo[i-1][0].Nelements; n++) {
+		v += pow (Nwo[i-1][0].elements[n], (double)(j+J));
+	      }
+	    }
+	    if (i < Norder - 1) {
+	      for (n = 0; n < Nwo[i][0].Nelements; n++) {
+		v += pow (Nwo[i][0].elements[n], (double)(j+J));
+	      }
+	    }
+	    a[Ny][Nx] = v;
+	    Nx ++;
+	  }
+	  valid = TRUE;
+	}
+	if (!valid) {
+	  Nx += nterm[I];
+	}
+      }
+    }
+  }
+
+  Ny = 0;
+  for (i = 0; i < Norder; i++) {
+    for (j = 0; j < nterm[i]; j++, Ny++) {
+      v = 0;
+      for (n = 0; n < Nwb[i][0].Nelements; n++) {
+	v += NMb[i][0].elements[n]*pow (Nwb[i][0].elements[n], (double)j);
+	v -= Nmb[i][0].elements[n]*pow (Nwb[i][0].elements[n], (double)j);
+      }
+      if (i > 0) {
+	for (n = 0; n < Nwo[i-1][0].Nelements; n++) {
+	  v += Nmh[i-1][0].elements[n] * pow (Nwo[i-1][0].elements[n], (double)j);
+	  v -= Nml[i-1][0].elements[n] * pow (Nwo[i-1][0].elements[n], (double)j);
+	}
+      }
+      if (i < Norder - 1) {
+	for (n = 0; n < Nwo[i][0].Nelements; n++) {
+	  v += Nml[i][0].elements[n] * pow (Nwo[i][0].elements[n], (double)j);
+	  v -= Nmh[i][0].elements[n] * pow (Nwo[i][0].elements[n], (double)j);
+	}
+      }
+      b[Ny][0] = v;
+    }
+  }
+  dgaussj (a, Ndim, b, 1);
+
+  Ny = 0;
+  for (i = 0; i < Norder; i++) {
+    Nc[i][0].Nelements = nterm[i];
+    REALLOCATE (Nc[i][0].elements, float, nterm[i]);
+    for (j = 0; j < nterm[i]; j++, Ny++) {
+      Nc[i][0].elements[j] = b[Ny][0];
+    }
+  }
+
+  for (i = 0; i < Ndim; i++) {
+    free (a[i]);
+    free (b[i]);
+  }
+  free (a);
+  free (b);
+  free (nterm);
+  free (Nc);
+  free (NMb);
+  free (Nmb);
+  free (Nwb);
+  free (Nmh);
+  free (Nml);
+  free (Nwo);
+  
+  return (TRUE);
+  
+ escape: 
+  gprint (GP_ERR, "syntax error\n");
+  return (FALSE);
+  
+}
+
+
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/objload.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/objload.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/objload.c	(revision 15879)
@@ -0,0 +1,75 @@
+# include "dvoshell.h"
+# define CHAR_LINE 104
+# define NBLOCK 100
+
+int objload (int argc, char **argv) {
+  
+  int i, N, Objtype, type, Nline, status;
+  FILE *f;
+  char *buffer, *line, *name;
+  int kapa, Noverlay, NOVERLAY;
+  KiiOverlay *overlay;
+  
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImage (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  Objtype = 0;
+  if ((N = get_argument (argc, argv, "-t"))) {
+    remove_argument (N, &argc, argv);
+    Objtype = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: objload (overlay) <filename>\n");
+    return (FALSE);
+  }
+
+  f = fopen (argv[2], "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "ERROR: can't find object file %s\n", argv[2]);
+    return (FALSE);
+  }
+
+  /* read average values from first line */
+  ALLOCATE (line, char, 129);
+  scan_line (f, line);
+
+  ALLOCATE (buffer, char, CHAR_LINE*NBLOCK);
+
+  Noverlay = 0;
+  NOVERLAY = 1000;
+  ALLOCATE (overlay, KiiOverlay, Noverlay);
+  
+  /* read in data from obj file */
+  while ((Nline = fread (buffer, CHAR_LINE, NBLOCK, f)) > 0) {
+    for (i = 0; i < Nline; i++) {
+      /* we are now using all entries on the *.obj line */
+      status = sscanf (&buffer[i*CHAR_LINE], "%d %f %f",  &type, &overlay[Noverlay].x, &overlay[Noverlay].y);
+      if (Objtype && (Objtype != type)) continue;
+      overlay[Noverlay].type = KII_OVERLAY_BOX;
+      overlay[Noverlay].dx = 5.0;
+      overlay[Noverlay].dy = 5.0;
+      Noverlay ++;
+      CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000);
+    }
+  }
+  fclose (f);
+  free (buffer);
+
+  KiiLoadOverlay (kapa, overlay, Noverlay, argv[1]);
+
+  free (overlay);
+  free (buffer);
+  free (line);
+
+  gprint (GP_ERR, "loaded %d objects\n", Noverlay);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/outline.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/outline.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/outline.c	(revision 15879)
@@ -0,0 +1,289 @@
+# include "astro.h"
+
+float par[5];
+float dpar[5];
+float Dpar[5];
+float outline_chi (float, float *, int, int, float *);
+
+int outline (int argc, char **argv) {
+  
+  int i, j, k, Npar, BigChange, ABigChange;
+  float Io, *in, ochisq, dchi, chisq, chisq_p, chisq_m, dp, tmp_par;
+  float curve, frac;
+  Buffer *buf;
+
+  if (argc != 9) {
+    gprint (GP_ERR, "USAGE: outline x y dx dy dxy Io (buffer) Npar\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[7], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  par[0] = atof(argv[1]);
+  par[1] = atof(argv[2]);
+  par[2] = atof(argv[3]);
+  par[3] = atof(argv[4]);
+  par[4] = atof(argv[5]);
+  Io = atof(argv[6]);
+  Npar = atof (argv[8]);
+
+  dpar[0] = 10;
+  dpar[1] = 10;
+  dpar[2] = 10;
+  dpar[3] = 10;
+  dpar[4] = 10;
+
+  Dpar[0] = 10;
+  Dpar[1] = 10;
+  Dpar[2] = 10;
+  Dpar[3] = 10;
+  Dpar[4] = 10;
+
+  in = (float *) buf[0].matrix.buffer;
+
+  chisq = outline_chi (Io, in, buf[0].matrix.Naxis[0], buf[0].matrix.Naxis[1], &frac);
+  gprint (GP_ERR, "chisq (1): %f\n", chisq);
+  
+  for (j = 0; j < 15; j++) {
+
+    /*
+    if (!(j % 3)) {
+      chisq = outline_chi (Io, in, buf[0].matrix.Naxis[0], buf[0].matrix.Naxis[1], &frac);
+      for (k = 0; (k < 3) && (fabs (frac) > 0.3); k++) {
+	tmp1 = par[2];
+	tmp2 = par[3];
+	par[2] *= 1 + 0.1*frac;
+	par[3] *= 1 + 0.1*frac;
+	nchisq = outline_chi (Io, in, buf[0].matrix.Naxis[0], buf[0].matrix.Naxis[1], &frac);
+	if (nchisq > chisq) {
+	  par[2] = tmp1;
+	  par[3] = tmp2;
+	  k = 3;
+	} else {
+	  chisq = nchisq;
+	}
+	gprint (GP_ERR, "frac: %f  %f %f   %f\n", frac, par[2], par[3], chisq);
+      }
+    }
+    */
+    
+    ABigChange = FALSE;
+    ochisq = chisq;
+    for (i = 4; i >= 0; i--) {
+      /* find +chisq, -chisq for this par & adjust par as needed */
+
+      for (k = 0, BigChange = TRUE; (k < 3) && BigChange; k++) {
+	tmp_par = par[i];
+	par[i] = tmp_par + dpar[i];
+	chisq_p = outline_chi (Io, in, buf[0].matrix.Naxis[0], buf[0].matrix.Naxis[1], &frac);
+	par[i] = tmp_par - dpar[i];
+	chisq_m = outline_chi (Io, in, buf[0].matrix.Naxis[0], buf[0].matrix.Naxis[1], &frac);
+	
+	/* have we braketted a minimum? (curve < 0) */
+	curve = (chisq_p - chisq) * (chisq - chisq_m);
+	if (curve > 0) {
+	  dp = 2*dpar[i];
+	} else {
+	  dp = 0.5 * dpar[i] * (chisq_m - chisq_p) / (chisq_m + chisq_p - 2*chisq);
+	}      
+	if (chisq_m + chisq_p - 2*chisq == 0) dp = 0;
+	/* don't let extrapolation go too far */
+	if (fabs (dp) > 2*fabs(dpar[i])) { dp = SIGN(dp) * fabs (2*dpar[i]); }
+	
+	par[i] = tmp_par + dp;
+	chisq = outline_chi (Io, in, buf[0].matrix.Naxis[0], buf[0].matrix.Naxis[1], &frac);
+	
+	BigChange = FALSE;
+	if (chisq <= 1.001*ochisq) {
+	  /* got better */
+	  dchi = (ochisq - chisq) / ochisq; 
+	  if ((dchi > 0.03) || (curve > 0)) BigChange = TRUE;
+	} else {
+	  par[i] = tmp_par;
+	  chisq = ochisq;
+	  if (chisq_m < chisq) {
+	    chisq = chisq_m;
+	    par[i] = tmp_par - dpar[i];
+	  }	
+	  if (chisq_p < chisq) {
+	    chisq = chisq_p;
+	    par[i] = tmp_par + dpar[i];
+	  }	
+	}	
+	/*
+	gprint (GP_ERR, "try: %d  %f   ", i, chisq);
+	for (k = 0; k < 5; k++) {
+	  gprint (GP_ERR, "%f ", par[k]);
+	}
+	gprint (GP_ERR, "\n");
+	*/
+	ochisq = chisq;
+	ABigChange |= BigChange;
+      }
+      if (!BigChange) dpar[i] *= 0.8;
+    }
+
+    if (ABigChange) {
+      for (i = 0; i < 5; i++) {
+	dpar[i] = Dpar[i];
+      }
+    }
+
+    gprint (GP_ERR, "try: %d  %f   ", j, chisq);
+    for (i = 0; i < 5; i++) {
+      gprint (GP_ERR, "%f ", par[i]);
+    }
+    gprint (GP_ERR, "\n          ");
+    for (i = 0; i < 5; i++) {
+      gprint (GP_ERR, "%f ", dpar[i]);
+    }
+    gprint (GP_ERR, "\n");
+    dchi -= chisq;
+
+  }
+
+    /* code to draw dots on Ximage */
+    {
+      int kapa;
+      float xp, yp, x, y;
+      float dx, dy, theta, t, dt;
+      int Noverlay, NOVERLAY;
+      KiiOverlay *overlay;
+      
+      if (!GetImage (NULL, &kapa, NULL)) return (FALSE);
+      
+      Noverlay = 0;
+      NOVERLAY = 1000;
+      ALLOCATE (overlay, KiiOverlay, Noverlay);
+  
+      dx = par[2];
+      dy = par[3];
+      dt = 1 / MAX (dx, dy);
+      theta = par[4];
+      
+      for (t = 0; t < 6.3; t += dt) {
+	xp = dx * cos (t);
+	yp = dy * sin (t);
+	
+	x = xp * cos (theta * RAD_DEG) - yp * sin (theta * RAD_DEG) + par[0];
+	y = xp * sin (theta * RAD_DEG) + yp * cos (theta * RAD_DEG) + par[1];
+	
+	overlay[Noverlay].type = KII_OVERLAY_BOX;
+	overlay[Noverlay].x = x;
+	overlay[Noverlay].y = y;
+	overlay[Noverlay].dx = 1.0;
+	overlay[Noverlay].dy = 1.0;
+
+	Noverlay ++;
+	CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000);
+      }
+      KiiLoadOverlay (kapa, overlay, Noverlay, "red");
+      free (overlay);
+    }
+
+  return (TRUE);
+
+}
+
+/* par[0] = x
+   par[1] = y
+   par[2] = dx
+   par[3] = dy
+   par[4] = dxy
+   
+   ellipse is:  
+
+   ((X-x)/dx)^2 + ((Y-y)/dy)^2 + (X-x)(Y-y)dxy = 1
+  
+   (yp/dy)^2 + xp yp dxy + (xp/dx)^2 - 1 = 0
+
+   yp^2 + yp xp dxy dy^2 + xp^2 (dy/dx)^2 - dy^2 = 0
+
+*/
+
+float outline_chi (float Io, float *in, int Nx, int Ny, float *frac) {
+
+  int npts, xo, yo, x, y;
+  float xp, yp, dx, dy, theta;
+  float t, dt, dv, Dv;
+  float chisq, v, Frac;
+
+  /* 
+  if (!SelectVector (&Nvec, "diffs", ANYVECTOR)) return (FALSE);
+  if (!SelectVector (&Nvec2, "angle", ANYVECTOR)) return (FALSE);
+  if (!SelectVector (&Nvecx, "xdif", ANYVECTOR)) return (FALSE);
+  if (!SelectVector (&Nvecy, "ydif", ANYVECTOR)) return (FALSE);
+  */
+
+  dx = par[2];
+  dy = par[3];
+  theta = par[4];
+  dt = 1 / MAX (dx, dy);
+
+  Frac = 0;
+  chisq = 0;
+  npts = 0;
+  xo = -1; yo = -1;  /* an impossible coordinate */
+
+  /*
+  Npts = 1000;
+  REALLOCATE (vectors[Nvec].elements, float, Npts);
+  REALLOCATE (vectors[Nvec2].elements, float, Npts);
+  REALLOCATE (vectors[Nvecx].elements, float, Npts);
+  REALLOCATE (vectors[Nvecy].elements, float, Npts);
+  */
+
+  for (t = 0; t < 6.3; t += dt) {
+    xp = dx * cos (t);
+    yp = dy * sin (t);
+    
+    x = xp * cos (theta * RAD_DEG) - yp * sin (theta * RAD_DEG) + par[0];
+    y = xp * sin (theta * RAD_DEG) + yp * cos (theta * RAD_DEG) + par[1];
+    
+    if ((x == xo) && (y == yo)) continue;
+    xo = x; yo = y;
+
+    if ((x >= 0) && (x < Nx) && (y >= 0) && (y < Ny)) {
+      v = in[y*Nx + x];
+      if (v > 0) {
+	Dv = v - Io;
+	dv = v + 0.2 * fabs (Dv);
+	chisq += Dv * Dv / dv;
+	if (Dv > sqrt(dv)) Frac += 1.0;
+	if (Dv < sqrt(dv)) Frac -= 1.0;
+	/*
+	vectors[Nvec].elements[npts] = Dv;
+	vectors[Nvec2].elements[npts] = t*DEG_RAD;
+	vectors[Nvecx].elements[npts] = x;
+	vectors[Nvecy].elements[npts] = y;
+	*/
+	npts ++;
+	/* 
+	if (npts == Npts - 1) {
+	  Npts += 1000;
+	  REALLOCATE (vectors[Nvec].elements, float, Npts);
+	  REALLOCATE (vectors[Nvec2].elements, float, Npts);
+	  REALLOCATE (vectors[Nvecx].elements, float, Npts);
+	  REALLOCATE (vectors[Nvecy].elements, float, Npts);
+	}
+	*/
+      }
+    }
+  }
+  /* 
+  vectors[Nvec].Nelements = npts;
+  vectors[Nvec2].Nelements = npts;
+  vectors[Nvecx].Nelements = npts;
+  vectors[Nvecy].Nelements = npts;
+  */
+
+  chisq = chisq / npts;
+  *frac = Frac / npts;
+  if (npts == 0) {
+    chisq = 1e8;
+    *frac = -1.0;
+  }
+
+  return (chisq);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/outline2.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/outline2.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/outline2.c	(revision 15879)
@@ -0,0 +1,341 @@
+# include "astro.h"
+
+int Npts;
+float *xs, *ys, *zs;
+float par[5];
+float dpar[5];
+float Dpar[5];
+float outline_chi (float, float *);
+int plot_outline ();
+
+int outline (int argc, char **argv) {
+  
+  int i, j, k, Nx, Ny, NPTS, BigChange;
+  float dIo, Io, ochisq, dchi, chisq, chisq_p, chisq_m, dp;
+  float tmp_par, curve, value;
+  float *in;
+  Buffer *buf;
+
+  if (argc != 9) {
+    gprint (GP_ERR, "USAGE: outline x y dx dy dxy Io dIo (buffer)\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[8], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  par[0] = atof(argv[1]);
+  par[1] = atof(argv[2]);
+  par[2] = atof(argv[3]);
+  par[3] = atof(argv[4]);
+  par[4] = atof(argv[5]);
+  Io = atof(argv[6]);
+  dIo = atof(argv[7]);
+
+  dpar[0] = 10;
+  dpar[1] = 10;
+  dpar[2] = 10;
+  dpar[3] = 10;
+  dpar[4] = 10;
+
+  Dpar[0] = 10;
+  Dpar[1] = 10;
+  Dpar[2] = 10;
+  Dpar[3] = 10;
+  Dpar[4] = 10;
+
+  in = (float *) buf[0].matrix.buffer;
+
+  /* find all pixels within range Io-dIo : Io+dIo, in region about center guess */
+
+  Nx = buf[0].matrix.Naxis[0];  
+  Ny = buf[0].matrix.Naxis[1];
+  Npts = 0;
+  NPTS = 1000;
+  ALLOCATE (xs, float, NPTS);
+  ALLOCATE (ys, float, NPTS);
+  ALLOCATE (zs, float, NPTS);
+  for (j = par[1]-2*par[3]; j < par[1]+2*par[3]; j++) {
+    if (j < 0) continue;
+    if (j >= buf[0].matrix.Naxis[1]) continue;
+    for (i = par[0]-2*par[2]; i < par[0]+2*par[2]; i++) {
+      if (i < 0) continue;
+      if (i >= buf[0].matrix.Naxis[0]) continue;
+      value = in[i + Nx*j];
+      if (fabs (value - Io) < dIo) {
+	xs[Npts] = i;
+	ys[Npts] = j;
+	zs[Npts] = value;
+	Npts ++;
+	if (Npts == NPTS) {
+	  NPTS += 1000;
+	  REALLOCATE (xs, float, NPTS);
+	  REALLOCATE (ys, float, NPTS);
+	  REALLOCATE (zs, float, NPTS);
+	}
+      }
+    }
+  }
+
+  if (Npts == 0) {
+    gprint (GP_ERR, "no valid points in box, try again\n");
+    free (xs);
+    free (ys);
+    free (zs);
+    return (FALSE);
+  }
+
+  plot_outline ();
+  chisq = outline_chi (Io, in);
+  gprint (GP_ERR, "starting chisq: %f for %d pts\n", chisq, Npts);
+
+# if (1)
+  for (j = 0; j < 15; j++) {
+    
+    ochisq = chisq;
+    for (i = 0; i < 5; i++) {
+      /* find +chisq, -chisq for this par & adjust par as needed */
+
+      for (k = 0, BigChange = TRUE; (k < 3) && BigChange; k++) {
+	tmp_par = par[i];
+	par[i] = tmp_par + dpar[i];
+	chisq_p = outline_chi (Io, in);
+	par[i] = tmp_par - dpar[i];
+	chisq_m = outline_chi (Io, in);
+	
+	/* have we braketted a minimum? (curve < 0) */
+	curve = (chisq_p - chisq) * (chisq - chisq_m);
+	if (curve > 0) {
+	  dp = 2*dpar[i];
+	} else {
+	  dp = 0.5 * dpar[i] * (chisq_m - chisq_p) / (chisq_m + chisq_p - 2*chisq);
+	}      
+	if (chisq_m + chisq_p - 2*chisq == 0) dp = 0;
+	/* don't let extrapolation go too far */
+	if (fabs (dp) > 2*fabs(dpar[i])) { dp = SIGN(dp) * fabs (2*dpar[i]); }
+	
+	par[i] = tmp_par + dp;
+	chisq = outline_chi (Io, in);
+	
+	BigChange = FALSE;
+	if (chisq <= 1.001*ochisq) {
+	  /* got better */
+	  dchi = (ochisq - chisq) / ochisq; 
+	  if ((dchi > 0.03) || (curve > 0)) BigChange = TRUE;
+	} else {
+	  par[i] = tmp_par;
+	  chisq = ochisq;
+	  if (chisq_m < chisq) {
+	    chisq = chisq_m;
+	    par[i] = tmp_par - dpar[i];
+	  }	
+	  if (chisq_p < chisq) {
+	    chisq = chisq_p;
+	    par[i] = tmp_par + dpar[i];
+	  }	
+	}	
+	ochisq = chisq;
+      }
+      if (!BigChange) dpar[i] *= 0.8;
+    }
+
+    gprint (GP_ERR, "try: %d  %f   ", j, chisq);
+    for (i = 0; i < 5; i++) {
+      gprint (GP_ERR, "%f ", par[i]);
+    }
+    gprint (GP_ERR, "\n          ");
+    for (i = 0; i < 5; i++) {
+      gprint (GP_ERR, "%f ", dpar[i]);
+    }
+    gprint (GP_ERR, "\n");
+    dchi -= chisq;
+
+  }
+# endif
+
+  free (xs);
+  free (ys);
+  free (zs);
+  
+  plot_outline ();
+  return (TRUE);
+
+}
+
+/* par[0] = x
+   par[1] = y
+   par[2] = dx
+   par[3] = dy
+   par[4] = dxy
+   
+    xp = par[2] * cos (t);
+    yp = par[3] * sin (t);
+    
+    x = xp * cos (par[4] * RAD_DEG) - yp * sin (par[4] * RAD_DEG) + par[0];
+    y = xp * sin (par[4] * RAD_DEG) + yp * cos (par[4] * RAD_DEG) + par[1];
+
+*/
+
+# if (1)
+
+float outline_chi (float Io, float *in) {
+
+  int i;
+  float theta, phi;
+  float xp, yp, x, y;
+  float chisq, R2;
+
+  chisq = 0;
+
+  for (i = 0; i < Npts; i++) {
+    
+    phi = atan2 (ys[i] - par[1], xs[i] - par[0]) - RAD_DEG * par[4];
+    /* find a point:
+
+       xp, yp such that atan (r2 sin(phi), r1 cos(phi)) == theta 
+
+       tan (theta) = r2 sin(phi) / r1 cos (phi)
+
+       (r1/r2) tan(theta) = sin(phi) / cos (phi);
+       (r1/r2) tan(theta) = tan (phi)
+
+       phi = atan2 (r1 sin(theta), r2 cos(theta))
+    */
+
+    theta = atan2 (par[2]*sin(phi), par[3]*cos(phi));
+
+    /* this is the point on the ellipse at the same angle as ref point */
+    /* this is wrong, but close -- tends to make ellipses too fat */
+    xp = par[2] * cos (theta);
+    yp = par[3] * sin (theta);
+    
+    x = xp * cos (par[4] * RAD_DEG) - yp * sin (par[4] * RAD_DEG) + par[0];
+    y = xp * sin (par[4] * RAD_DEG) + yp * cos (par[4] * RAD_DEG) + par[1];
+
+    R2 = sqrt (SQ (x - xs[i]) + SQ (y - ys[i]));
+
+    /*
+    Dv = zs[i] - Io;
+    dv = fabs(zs[i]);
+    F2 = Dv * Dv / dv;
+    */
+
+    chisq += R2;
+
+  }
+
+  chisq = chisq / Npts;
+  return (chisq);
+
+}
+
+# else 
+
+float outline_chi (float Io, float *in) {
+
+  int i;
+  float theta, theta1, theta2;
+  float xp, yp, x, y;
+  float chisq, dv, Dv, R2, F2, R, dR;
+
+  int Nvec, Nvec2, Nvecx, Nvecy, Nv, nv;
+
+  chisq = 0;
+
+  nv = 0;
+  Nv = 1000;
+  if (!SelectVector (&Nvec, "dR", ANYVECTOR)) return (FALSE);
+  if (!SelectVector (&Nvec2, "dF", ANYVECTOR)) return (FALSE);
+  if (!SelectVector (&Nvecx, "x", ANYVECTOR)) return (FALSE);
+  if (!SelectVector (&Nvecy, "y", ANYVECTOR)) return (FALSE);
+  REALLOCATE (vectors[Nvec].elements, float, Nv);
+  REALLOCATE (vectors[Nvec2].elements, float, Nv);
+  REALLOCATE (vectors[Nvecx].elements, float, Nv);
+  REALLOCATE (vectors[Nvecy].elements, float, Nv);
+
+  for (i = 0; i < Npts; i++) {
+    
+    theta1 = atan2 (ys[i] - par[1], xs[i] - par[0]) - RAD_DEG * par[4];
+    theta = atan2 (par[2]*sin(theta1), par[3]*cos(theta1));
+
+    xp = par[2] * cos (theta);
+    yp = par[3] * sin (theta);
+    
+    x = xp * cos (par[4] * RAD_DEG) - yp * sin (par[4] * RAD_DEG) + par[0];
+    y = xp * sin (par[4] * RAD_DEG) + yp * cos (par[4] * RAD_DEG) + par[1];
+
+    R2 = SQ (x - xs[i]) + SQ (y - ys[i]);
+
+    /* 
+    Dv = fabs (zs[i] - Io) + 1;
+    dv = zs[i] + 0.2 * fabs (Dv);
+    F2 = Dv * Dv / dv;
+    */
+
+    vectors[Nvec].elements[nv] = x;
+    vectors[Nvec2].elements[nv] = y;
+    vectors[Nvecx].elements[nv] = xs[i];
+    vectors[Nvecy].elements[nv] = ys[i];
+    nv ++;
+    if (nv == Nv - 1) {
+      Nv += 1000;
+      REALLOCATE (vectors[Nvec].elements, float, Nv);
+      REALLOCATE (vectors[Nvec2].elements, float, Nv);
+      REALLOCATE (vectors[Nvecx].elements, float, Nv);
+      REALLOCATE (vectors[Nvecy].elements, float, Nv);
+    }
+
+    /* typical distance might be 1 - 10 pix,
+       typical z error might be 100 cts */
+    chisq += R2; 
+
+  }
+  vectors[Nvec].Nelements = nv;
+  vectors[Nvec2].Nelements = nv;
+  vectors[Nvecx].Nelements = nv;
+  vectors[Nvecy].Nelements = nv;
+
+  chisq = chisq / Npts;
+  return (chisq);
+
+}
+# endif
+
+int plot_outline () {
+  
+  int kapa;
+  float xp, yp, x, y;
+  float dx, dy, theta, t, dt;
+  int Noverlay, NOVERLAY;
+  KiiOverlay *overlay;
+  
+  if (!GetImage (NULL, &kapa, NULL)) return (FALSE);
+  
+  Noverlay = 0;
+  NOVERLAY = 1000;
+  ALLOCATE (overlay, KiiOverlay, Noverlay);
+  
+  dx = par[2];
+  dy = par[3];
+  dt = 1 / MAX (dx, dy);
+  theta = par[4];
+  
+  for (t = 0; t < 6.3; t += dt) {
+    xp = dx * cos (t);
+    yp = dy * sin (t);
+    
+    x = xp * cos (theta * RAD_DEG) - yp * sin (theta * RAD_DEG) + par[0];
+    y = xp * sin (theta * RAD_DEG) + yp * cos (theta * RAD_DEG) + par[1];
+    
+    overlay[Noverlay].type = KII_OVERLAY_BOX;
+    overlay[Noverlay].x = x;
+    overlay[Noverlay].y = y;
+    overlay[Noverlay].dx = 1.0;
+    overlay[Noverlay].dy = 1.0;
+
+    Noverlay ++;
+    CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000);
+  }
+  KiiLoadOverlay (kapa, overlay, Noverlay, "red");
+  free (overlay);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/polar.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/polar.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/polar.c	(revision 15879)
@@ -0,0 +1,71 @@
+# include "astro.h"
+
+int polar (int argc, char **argv) {
+  
+  double Lo, dL, Do, dD, Mo, dM, No, dN;
+  double xo, yo, Xo, Yo;
+  double x, y, r, t;
+  float *Vin, *Vout, *Vmask;
+  int i, j, nx, ny, Nx, Ny;
+  int X, Y;
+  Buffer *in, *out, *mask;
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: polar in out\n");
+    return (FALSE);
+  }
+
+  if ((in   = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out  = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((mask = SelectBuffer (argv[3], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  Nx = out[0].matrix.Naxis[0];
+  Ny = out[0].matrix.Naxis[1];
+  nx = mask[0].matrix.Naxis[0];
+  ny = mask[0].matrix.Naxis[1];
+  if ((Nx != nx) && (Ny != ny)) {
+    gprint (GP_ERR, "output and mask must have same dimensions\n");
+    return (FALSE);
+  }
+  nx = in[0].matrix.Naxis[0];
+  ny = in[0].matrix.Naxis[1];
+
+  /* we expect the output image to have units of longitude and distance */
+  gfits_scan (&in[0].header, "CRVAL1", "%lf", 1, &Lo);
+  gfits_scan (&in[0].header, "CDELT1", "%lf", 1, &dL);
+  gfits_scan (&in[0].header, "CRPIX1", "%lf", 1, &xo);
+  gfits_scan (&in[0].header, "CRVAL2", "%lf", 1, &Do);
+  gfits_scan (&in[0].header, "CDELT2", "%lf", 1, &dD);
+  gfits_scan (&in[0].header, "CRPIX2", "%lf", 1, &yo);
+
+  /* we expect the input image to have units of distance X and Y */
+  gfits_scan (&out[0].header, "CRVAL1", "%lf", 1, &Mo);
+  gfits_scan (&out[0].header, "CDELT1", "%lf", 1, &dM);
+  gfits_scan (&out[0].header, "CRPIX1", "%lf", 1, &Xo);
+  gfits_scan (&out[0].header, "CRVAL2", "%lf", 1, &No);
+  gfits_scan (&out[0].header, "CDELT2", "%lf", 1, &dN);
+  gfits_scan (&out[0].header, "CRPIX2", "%lf", 1, &Yo);
+
+  Vin  = (float *)in[0].matrix.buffer;
+  Vout = (float *)out[0].matrix.buffer;
+  Vmask = (float *)mask[0].matrix.buffer;
+  for (j = 0; j < Ny; j++) {
+    for (i = 0; i < Nx; i++, Vout++, Vmask++) {
+      x = (i - Xo) * dM + Mo;
+      y = (j - Yo) * dN + No;
+      r = hypot(x, y);
+      t = DEG_RAD*atan2 (y, x);
+      while (t < 360.0) {t += 360.0;}
+      while (t > 360.0) {t -= 360.0;}
+      X = (t - Lo) / dL + xo;
+      Y = (r - Do) / dD + yo;
+      if ((X >= 0) && (X < nx) && (Y >= 0) && (Y < ny)) {
+	*Vout += Vin[Y*nx + X];
+	*Vmask += 1;
+      }
+    }
+  }
+
+ return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/precess.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/precess.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/precess.c	(revision 15879)
@@ -0,0 +1,112 @@
+# include "astro.h"
+
+int precess (int argc, char **argv) {
+
+  int i, Julian, Besselian;
+  double T, in_epoch, out_epoch;
+  double A, D, RA, DEC, zeta, z, theta;
+  double SA, CA, SD, CD;
+  Vector *xvec, *yvec;
+
+  Besselian = Julian = 0;
+  Besselian = get_argument (argc, argv, "B");
+  Julian    = get_argument (argc, argv, "J");
+
+  in_epoch = out_epoch = 2000.0;
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE:  precess (from) (to) RA DEC \n");
+    gprint (GP_ERR, "   you may use B for B1950.0 or J for J2000.0\n");
+    return (FALSE);
+  }
+
+  if (!Julian && !Besselian) { /* assume Julian! */
+    in_epoch  = get_epoch (argv[1], 'J');
+    out_epoch = get_epoch (argv[2], 'J');
+  }
+
+  if ((Julian == 1) && !Besselian) {
+    in_epoch  = 2000.0;
+    out_epoch = get_epoch(argv[2], 'J');
+  }
+
+  if ((Julian == 2) && !Besselian) {
+    in_epoch  = get_epoch(argv[1], 'J');
+    out_epoch = 2000.0;
+  }
+
+  if ((Besselian == 1) && !Julian) {
+    in_epoch  = BtoJ(1950.0); 
+    out_epoch = get_epoch(argv[2], 'B'); 
+  }
+
+  if ((Besselian == 2) && !Julian) {
+    in_epoch  = get_epoch(argv[1], 'B'); 
+    out_epoch = BtoJ(1950.0); 
+  }
+  
+  if (Julian && Besselian) {
+    if (Julian > Besselian) {
+      in_epoch  = BtoJ(1950.0); 
+      out_epoch = 2000.0;
+    }
+    else {
+      in_epoch  = 2000.0;
+      out_epoch = BtoJ(1950.0); 
+    }
+  }
+
+  gprint (GP_ERR, "converting from J%f to J%f\n", in_epoch, out_epoch);
+
+  T = (out_epoch - in_epoch) / 100.0;
+  
+  zeta  = RAD_DEG*(0.6406161*T + 0.0000839*T*T + 0.0000050*T*T*T);
+  theta = RAD_DEG*(0.5567530*T - 0.0001185*T*T - 0.0000116*T*T*T);
+  z     =          0.6406161*T + 0.0003041*T*T + 0.0000051*T*T*T;
+
+  if (ISNUM(argv[3][0]) && ISNUM(argv[4][0])) {
+    A = atof (argv[3]);
+    D = atof (argv[4]);
+    SD =  cos(RAD_DEG*A + zeta)*sin(theta)*cos(RAD_DEG*D) + cos(theta)*sin(RAD_DEG*D);
+    CD = sqrt (1 - SD*SD);
+    SA =  sin(RAD_DEG*A + zeta)*cos(RAD_DEG*D)/CD;
+    CA = (cos(RAD_DEG*A + zeta)*cos(theta)*cos(RAD_DEG*D) - sin(theta)*sin(RAD_DEG*D))/CD;
+
+    DEC = DEG_RAD*asin(SD);
+    RA  = DEG_RAD*atan2(SA, CA) + z;
+
+    if (RA < 0)
+      RA += 360;
+    gprint (GP_LOG, "%f %f -> %f %f\n", A, D, RA, DEC);
+    return (TRUE);
+  }    
+
+  /* find vectors */
+  if ((xvec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[4], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (xvec[0].Nelements != yvec[0].Nelements) {
+    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[3], argv[4]);
+    return (FALSE);
+  }
+  
+  for (i = 0; i < xvec[0].Nelements; i++) {
+    A = xvec[0].elements[i];
+    D = yvec[0].elements[i];
+    SD =  cos(RAD_DEG*A + zeta)*sin(theta)*cos(RAD_DEG*D) + cos(theta)*sin(RAD_DEG*D);
+    CD = sqrt (1 - SD*SD);
+    SA =  sin(RAD_DEG*A + zeta)*cos(RAD_DEG*D)/CD;
+    CA = (cos(RAD_DEG*A + zeta)*cos(theta)*cos(RAD_DEG*D) - sin(theta)*sin(RAD_DEG*D))/CD;
+
+    DEC = DEG_RAD*asin(SD);
+    RA  = DEG_RAD*atan2(SA, CA) + z;
+
+    if (RA < 0)
+      RA += 360;
+    
+    xvec[0].elements[i] = RA;
+    yvec[0].elements[i] = DEC; 
+  }
+
+  return (TRUE);
+
+}  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/profile.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/profile.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/profile.c	(revision 15879)
@@ -0,0 +1,52 @@
+# include "astro.h"
+
+int profile (int argc, char **argv) {
+  
+  int i, j, N, Nx, Npt;
+  float *V;
+  double sx, sy;
+  Vector *xvec, *yvec;
+  Buffer *buf;
+
+  if (argc != 7) {
+    gprint (GP_ERR, "USAGE: profile <buffer> <X vector> <Y vector> x y N\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  
+  sx = atof (argv[4]);
+  sy = atof (argv[5]);
+  N  = atof (argv[6]);
+
+  if (sx - N < 0) goto range_error;
+  if (sy - N < 0) goto range_error;
+  if (sx + N > buf[0].matrix.Naxis[0]) goto range_error;
+  if (sy + N > buf[0].matrix.Naxis[1]) goto range_error;
+
+  if ((xvec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[3], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  xvec[0].Nelements = yvec[0].Nelements = (int)SQ(2*N+1);
+  REALLOCATE (xvec[0].elements, float, 5*(int)SQ(2*N+1));
+  REALLOCATE (yvec[0].elements, float, 5*(int)SQ(2*N+1));
+  bzero (yvec[0].elements, (int)SQ(2*N+1)*sizeof(float)+1);
+  V = (float *)(buf[0].matrix.buffer); 
+  Npt = 0;
+  Nx = buf[0].matrix.Naxis[0];
+  for (i = sx - N; i < sx + N; i++) {
+    for (j = sy - N; j < sy + N; j++, Npt++) {
+      yvec[0].elements[Npt] = V[i + j*Nx];
+      xvec[0].elements[Npt] = hypot (i - sx, j - sy);
+    }
+  }
+
+  fsortpair (xvec[0].elements, yvec[0].elements, xvec[0].Nelements);
+
+  return (TRUE);
+
+range_error:
+  gprint (GP_ERR, "region out of range\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/region.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/region.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/region.c	(revision 15879)
@@ -0,0 +1,136 @@
+# include "astro.h"
+
+int region (int argc, char **argv) {
+  
+  char string[256];
+  double Ra, Dec, Radius;
+  float dx, dy;
+  int N, kapa;
+  char *name;
+  Graphdata graphmode;
+
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetGraph (&graphmode, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  if ((N = get_argument (argc, argv, "-image"))) {
+    remove_argument (N, &argc, argv);
+    KapaGetImageCoords (kapa, &graphmode.coords);
+    KapaGetImageRange (kapa, &graphmode.xmin, &graphmode.xmax, &graphmode.ymax, &graphmode.ymin);
+    SetGraph (&graphmode);
+    return (TRUE);
+    // Set Region based on image
+  }
+
+  if ((N = get_argument (argc, argv, "-ew"))) {
+    remove_argument (N, &argc, argv);
+    graphmode.flipeast = TRUE;
+  }
+
+  if ((N = get_argument (argc, argv, "+ew"))) {
+    remove_argument (N, &argc, argv);
+    graphmode.flipeast = FALSE;
+  }
+
+  if ((N = get_argument (argc, argv, "-ns"))) {
+    remove_argument (N, &argc, argv);
+    graphmode.flipnorth = TRUE;
+  }
+
+  if ((N = get_argument (argc, argv, "+ns"))) {
+    remove_argument (N, &argc, argv);
+    graphmode.flipnorth = FALSE;
+  }
+
+  if ((argc != 4) && (argc != 5)) {
+    gprint (GP_ERR, "USAGE: region Ra Dec Radius [projection] [orientation]\n");
+    gprint (GP_ERR, " current: %f %f (%f x %f) (%s)\n", 
+	     graphmode.coords.crval1, graphmode.coords.crval2, 
+	     fabs(graphmode.xmax - graphmode.xmin), 
+	     fabs(graphmode.ymax - graphmode.ymin), 
+	     &graphmode.coords.ctype[5]);
+    return (FALSE);
+  }
+  
+  if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
+  Radius = atof (argv[3]);
+  strcpy (graphmode.coords.ctype, "RA---TAN");
+  if (argc == 5) {
+    if (!strcasecmp (argv[4], "TAN")) 
+      strcpy (graphmode.coords.ctype, "RA---TAN");
+    if (!strcasecmp (argv[4], "SIN")) 
+      strcpy (graphmode.coords.ctype, "RA---SIN");
+    if (!strcasecmp (argv[4], "ARC")) 
+      strcpy (graphmode.coords.ctype, "RA---ARC");
+    if (!strcasecmp (argv[4], "STG")) 
+      strcpy (graphmode.coords.ctype, "RA---STG");
+    if (!strcasecmp (argv[4], "ZEA"))
+      strcpy (graphmode.coords.ctype, "RA---ZEA");
+    if (!strcasecmp (argv[4], "AIT")) 
+      strcpy (graphmode.coords.ctype, "RA---AIT");
+    if (!strcasecmp (argv[4], "GLS")) 
+      strcpy (graphmode.coords.ctype, "RA---GLS");
+    if (!strcasecmp (argv[4], "PAR")) 
+      strcpy (graphmode.coords.ctype, "RA---PAR");
+  }
+
+  
+  /* ask kapa for coordinate limits, to get the right aspect ratio */
+  KapaGetLimits (kapa, &dx, &dy);
+  dx = fabs (dx);
+  dy = fabs (dy); 
+
+  /* define limits for Ra, Dec at center, grid in degrees */
+  if (dy < dx) {
+    graphmode.xmin = -(dx/dy)*Radius;
+    graphmode.ymin = -Radius;
+    graphmode.xmax = (dx/dy)*Radius;
+    graphmode.ymax = Radius;
+  } else {
+    graphmode.xmin = -Radius;
+    graphmode.ymin = -(dy/dx)*Radius;
+    graphmode.xmax = Radius;
+    graphmode.ymax = (dy/dx)*Radius;
+  } 
+
+  set_variable ("XMIN", graphmode.xmin);
+  set_variable ("XMAX", graphmode.xmax);
+  set_variable ("YMIN", graphmode.ymin);
+  set_variable ("YMAX", graphmode.ymax);
+
+  set_variable ("RMIN", Ra  + graphmode.xmin);
+  set_variable ("RMAX", Ra  + graphmode.xmax);
+  set_variable ("DMIN", Dec + graphmode.ymin);
+  set_variable ("DMAX", Dec + graphmode.ymax);
+
+  set_int_variable ("EAST_RIGHT", !graphmode.flipeast);
+  set_int_variable ("NORTH_UP", !graphmode.flipnorth);
+
+  graphmode.coords.pc1_1 = (graphmode.flipeast) ? -1 : 1;
+  graphmode.coords.pc2_2 = (graphmode.flipnorth) ? -1 : 1;
+
+  graphmode.coords.pc1_2 = graphmode.coords.pc2_1 = 0.0;
+  graphmode.coords.crval1 = Ra;
+  graphmode.coords.crval2 = Dec;
+  graphmode.coords.crpix1 = 0.0;
+  graphmode.coords.crpix2 = 0.0;
+  graphmode.coords.cdelt1 = graphmode.coords.cdelt2 = 1.0;
+
+  KapaClearSections (kapa);
+  KapaSetLimits (kapa, &graphmode);
+
+  /* drop this? */
+  sprintf (string, "%8.4f %8.4f (%f)", Ra, Dec, Radius);
+  KapaSendLabel (kapa, string, 2);
+
+  // XXX is this the right thing to be doing?
+  SetGraph (&graphmode);
+  return (TRUE);
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/rotcurve.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/rotcurve.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/rotcurve.c	(revision 15879)
@@ -0,0 +1,120 @@
+# include "astro.h"
+
+int rotcurve (int argc, char **argv) {
+  
+  int i, j, X, Y, n, Ncurve;
+  float *Vin, *Vout, *Vmask;
+  int nx, ny, Nx, Ny, N;
+  double L, dL, Lo, V, Vo, dV, Bo, dB, Do, dD;
+  double xo, yo, Xo, Yo;
+  double sl, cl, wo, Ro, Rs, wr, r, fr, d, min;
+  double R[100], T[100], W[100];
+  FILE *f;
+  Buffer *in, *out, *mask;
+
+  min = -1000;
+  if ((N = get_argument (argc, argv, "-min"))) {
+    remove_argument (N, &argc, argv);
+    min = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: rotcurve in out mask curve.txt\n");
+    return (FALSE);
+  }
+
+  f = fopen (argv[4], "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "can't find rotation curve data file %s\n", argv[4]);
+    return (FALSE);
+  }
+  for (i = 0; fscanf (f, "%lf %lf", &R[i], &T[i]) != EOF; i++) {
+    W[i] = T[i] / R[i];
+  }  
+  fclose (f);
+  Ncurve = i;
+
+  if ((in   = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out  = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((mask = SelectBuffer (argv[3], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  Nx = out[0].matrix.Naxis[0];
+  Ny = out[0].matrix.Naxis[1];
+  nx = mask[0].matrix.Naxis[0];
+  ny = mask[0].matrix.Naxis[1];
+  if ((Nx != nx) && (Ny != ny)) {
+    gprint (GP_ERR, "output and mask must have same dimensions\n");
+    return (FALSE);
+  }
+  nx = in[0].matrix.Naxis[0];
+  ny = in[0].matrix.Naxis[1];
+
+  /* we expect the input image to have units of velocity, lattitude, and longitude */
+  gfits_scan (&in[0].header, "CRVAL1", "%lf", 1, &Vo);
+  gfits_scan (&in[0].header, "CDELT1", "%lf", 1, &dV);
+  gfits_scan (&in[0].header, "CRPIX1", "%lf", 1, &xo);
+  gfits_scan (&in[0].header, "CRVAL2", "%lf", 1, &Bo);
+  gfits_scan (&in[0].header, "CDELT2", "%lf", 1, &dB);
+  gfits_scan (&in[0].header, "CRPIX2", "%lf", 1, &yo);
+  gfits_scan (&in[0].header, "CRVAL3", "%lf", 1, &L);
+  Vo *= 0.001;
+  dV *= 0.001;
+
+  /* we expect the output image to have units of longitude and distance */
+  gfits_scan (&out[0].header, "CRVAL1", "%lf", 1, &Lo);
+  gfits_scan (&out[0].header, "CDELT1", "%lf", 1, &dL);
+  gfits_scan (&out[0].header, "CRPIX1", "%lf", 1, &Xo);
+  gfits_scan (&out[0].header, "CRVAL2", "%lf", 1, &Do);
+  gfits_scan (&out[0].header, "CDELT2", "%lf", 1, &dD);
+  gfits_scan (&out[0].header, "CRPIX2", "%lf", 1, &Yo);
+
+  while (L >= 360) {L -= 360.0;}
+  while (L < 0.0)  {L += 360.0;}
+  X = (L - Lo) / dL + Xo;
+  if ((X >= Nx) || (X < 0)) {
+    gprint (GP_ERR, "X out of range\n");
+    return (FALSE);
+  }
+  gprint (GP_ERR, "L: %f (%d)\n", L, X);
+
+  cl = cos (L*RAD_DEG);
+  sl = sin (L*RAD_DEG);
+  wo = 25.0;
+  Ro = 10.0;
+  Rs = Ro*sl;
+  /* this method depends on wr monotonically decreasing */
+
+  Vin  = (float *)in[0].matrix.buffer;
+  Vout = (float *)out[0].matrix.buffer;
+  Vmask = (float *)mask[0].matrix.buffer;
+  for (j = 0; j < ny; j++) {
+    for (i = 0; i < nx; i++, Vin++) {
+      if (*Vin <= min) continue;
+      V = (i - xo) * dV + Vo;
+      wr = V/Rs + wo;
+      for (n = 0; (n < Ncurve) && (wr < W[n]); n++);
+      if ((n == 0) || (n == Ncurve)) {
+	continue;
+      }
+      r = (wr - W[n]) *  (R[n-1] - R[n]) / (W[n-1] - W[n]) + R[n];
+      fr = (Ro/r);
+      if (r < fabs(Rs)) { /* can't be on rotation curve */
+	continue;
+      }
+      if (r < Ro)
+	d = Ro*cl - sqrt(r*r - Rs*Rs);
+      else 
+	d = Ro*cl + sqrt(r*r - Rs*Rs);
+      Y = (d - Do) / dD + Yo;
+      if ((Y < Ny) && (Y >= 0)) {
+	Vout[Y*Nx + X] += *Vin;
+	Vmask[Y*Nx + X] += 1.0;
+      }
+    }
+  }
+
+
+  return (TRUE);
+
+} 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/scale.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/scale.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/scale.c	(revision 15879)
@@ -0,0 +1,43 @@
+# include "astro.h"
+
+int scale (int argc, char **argv) {
+
+  Buffer *buf;
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: scale (buffer) (key) [-r/-w] (value)\n");
+    return (FALSE);
+  }  
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  if (strcasecmp (argv[2], "bzero") && strcasecmp (argv[2], "bscale")) {
+    gprint (GP_ERR, "use bzero or bscale only\n");
+    return (FALSE);
+  }
+    
+  if (strcmp (argv[3], "-r") && strcmp (argv[3], "-w")) {
+    gprint (GP_ERR, "use -r or -w only\n");
+    return (FALSE);
+  }
+    
+  if (!strcmp (argv[3], "-r")) {
+    if (!strcasecmp (argv[2], "bzero")) {
+      set_variable (argv[4], (double) buf[0].bzero);
+    } else {
+      set_variable (argv[4], (double) buf[0].bscale);
+    }      
+  } else {
+    if (!strcasecmp (argv[2], "bzero")) {
+      buf[0].bzero = atof (argv[4]);
+    } else {
+      buf[0].bscale = atof (argv[4]);
+    }      
+  }
+
+  return (TRUE);
+}
+
+/* get or set external bzero / bscale values 
+   (these keywords are set to 0,1 internally, 
+   so we can't just manipulate them like other keywords */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/sexigesimal.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/sexigesimal.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/sexigesimal.c	(revision 15879)
@@ -0,0 +1,49 @@
+# include "astro.h"
+
+int sexigesimal (int argc, char **argv) {
+  
+  int HMS, N;
+  double value;
+  char string[80];
+
+  HMS = TRUE;
+  if ((N = get_argument (argc, argv, "-hms"))) {
+    HMS = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-hh"))) {
+    HMS = FALSE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((argc != 3) && (argc != 2)) {
+    gprint (GP_ERR, "USAGE: sexigesimal (from) [to]\n");
+    return (FALSE);
+  }
+
+  if (HMS) {
+    if (!ohana_dms_to_ddd (&value, argv[1])) {
+      gprint (GP_ERR, "syntax error in input\n");
+      return (FALSE);
+    }
+    if (argc == 3) {
+      set_variable (argv[2], value);
+    } else {
+      gprint (GP_LOG, "%10.6f\n", value);
+    }
+    return (TRUE);
+  } else {
+    value = atof (argv[1]);
+    hms_format (string, value);
+    if (argc == 3) {
+      set_str_variable (argv[2], string);
+    } else {
+      gprint (GP_LOG, "%s\n", string);
+    }
+    return (TRUE);
+  }      
+
+  return (TRUE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/spec.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/spec.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/spec.c	(revision 15879)
@@ -0,0 +1,112 @@
+# include "astro.h"
+
+int spec (int argc, char **argv) {
+
+  int i, j, Xo, X1, y1, y2, Nx, Ny;
+  int Nlong, Ngap, Nrow, N, Nring;
+  float *buffer, *V;
+  double sky, sky2, S, SX, F, R, Npts;
+  Vector *xvec, *yvec;
+  Buffer *buf;
+
+  Nlong = 31;
+  if ((N = get_argument (argc, argv, "-Nlong"))) {
+    remove_argument (N, &argc, argv);
+    Nlong  = 0.5*atof(argv[N]);
+    Nlong = 2*Nlong + 1;  /* force an odd number */
+    remove_argument (N, &argc, argv);
+  }
+  
+  Ngap = 15;
+  if ((N = get_argument (argc, argv, "-Ngap"))) {
+    remove_argument (N, &argc, argv);
+    Ngap  = 0.5*atof(argv[N]);
+    Ngap = 2*Ngap + 1;  /* force an odd number */
+    remove_argument (N, &argc, argv);
+  }
+  
+  Nrow = 1;
+  if ((N = get_argument (argc, argv, "-Nrow"))) {
+    remove_argument (N, &argc, argv);
+    Nrow  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  
+  if (argc != 7) {
+    gprint (GP_ERR, "USAGE: spec buffer x y1 y2 X Y [-Nlong N] [-Ngap N] [-Nrow N]\n");
+    return (FALSE);
+  }
+  
+  if ((Nrow < 1) || (Nlong < 2) || (Ngap < 1) || (Nlong - Ngap < 2)) {
+    gprint (GP_ERR, "bad values for options\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+
+  Xo = atof (argv[2]);
+  y1 = atof (argv[3]);
+  y2 = atof (argv[4]);
+
+  if ((xvec = SelectVector (argv[5], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[6], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  N = y2 - y1;
+  REALLOCATE (xvec[0].elements, float, N);
+  REALLOCATE (yvec[0].elements, float, N);
+  xvec[0].Nelements = N;
+  yvec[0].Nelements = N;
+  
+  ALLOCATE (buffer, float, Nlong);
+
+  for (j = 0; j < y2 - y1; j++) {
+    V = (float *) (buf[0].matrix.buffer) + Nx*(y1 + j) + Xo - (int)(0.5*Nlong);
+    /* find sky on edge */
+    for (i = 0, Nring = 0; i < 0.5*(Nlong - Ngap); i++, V++, Nring++) {
+      buffer[i] = *V;
+    }
+    fsort (buffer, Nring);
+    for (Npts = sky = 0, i = 0.25*Nring; i < 0.75*Nring; i++, Npts += 1.0) {
+      sky += buffer[i];
+    }
+    sky = sky / Npts;
+    /* find center column for this row */
+    for (S = SX = i = 0, Nring = 0; i < Ngap; i++, V++, Nring++) {
+      S += (*V - sky);
+      SX += (*V - sky)*(i + Xo - 0.5*Ngap);
+    }
+    X1 = SX / S;
+    gprint (GP_ERR, "%4d %4d %5.1f ", j+y1, X1, sky);
+    /*    X1 = MAX (MIN (X1, Xo + 0.5+Ngap), Xo - 0.5+Ngap); */
+    V = (float *) (buf[0].matrix.buffer) + Nx*(y1 + j) + X1 - (int)(0.5*Nlong);
+    /* find sky on edges */
+    for (i = 0, Nring = 0; i < 0.5*(Nlong - Ngap); i++, V++, Nring++) {
+      buffer[Nring] = *V;
+    }
+    V = (float *) (buf[0].matrix.buffer) + Nx*(y1 + j) + X1 + (int)(0.5*Ngap);
+    for (i = 0; i < 0.5*(Nlong - Ngap); i++, V++, Nring++) {
+      buffer[Nring] = *V;
+    }
+    fsort (buffer, Nring);
+    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];
+    }
+    sky = sky / Npts;
+    sky2 = (sky2 / Npts - sky*sky);
+    /* find weighted flux */
+    V = (float *) (buf[0].matrix.buffer) + Nx*(y1 + j) + X1 - (int)(0.5*Ngap);
+    for (F = R = i = 0; i < Ngap; i++, V++) {
+      F += (*V - sky) / sky2;
+      R += 1.0 / sky2;
+    }
+    xvec[0].elements[j] = j + y1; 
+    yvec[0].elements[j] = F / R; 
+    gprint (GP_ERR, " %5.1f %7.1f  %6.2f\n", sky, sky2, (F/R));
+  }    
+
+  free (buffer);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/star.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/star.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/star.c	(revision 15879)
@@ -0,0 +1,41 @@
+# include "astro.h"
+
+int star (int argc, char **argv) {
+
+  int x, y, N, dx, Nborder;
+  double Z, max;
+  Buffer *buf;
+
+  Nborder = 3;
+  if ((N = get_argument (argc, argv, "-border"))) {
+    remove_argument (N, &argc, argv);
+    Nborder  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  Nborder = MAX (Nborder, 1);
+  
+  max = 60000;
+  if ((N = get_argument (argc, argv, "-sat"))) {
+    remove_argument (N, &argc, argv);
+    max  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  
+  if ((argc != 4) && (argc != 5)) {
+    gprint (GP_ERR, "USAGE: star (buffer) x y [dx] [-border N] [-sat cnts]\n");
+    return (FALSE);
+  }
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  dx = 11;
+  x = atof (argv[2]);
+  y = atof (argv[3]);
+  if (argc == 5) {
+    dx = atof (argv[4]);
+  }
+
+  Z = get_aperture_stats (&buf[0].matrix, x, y, dx, Nborder, max);
+  
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/testfit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/testfit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/testfit.c	(revision 15879)
@@ -0,0 +1,161 @@
+# include "astro.h"
+
+/* local private functions */
+float fgaussOD (float, float *, int, float *);
+
+int imfit (int argc, char **argv) {
+
+  float par[4], *v1, *v2, *dy, chisq, **covar;
+  int i, Npts, Npar;
+  Vector *xvec, *yvec, *svec;
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: imfit <x> <y> <dy>\n");
+    return (FALSE);
+  }
+  
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((svec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  Npts = xvec[0].Nelements;
+  ALLOCATE (dy, float, Npts);
+  v1 = svec[0].elements;
+  v2 = dy;
+  
+  for (i = 0; i < Npts; i++, v1++, v2++) *v2 = 1.0 / (*v1 * *v1);
+  
+  par[0] = 7;
+  par[1] = 2;
+  par[2] = 6;
+  par[3] = 1;
+  Npar = 4;
+
+  mrqinit (xvec[0].elements, yvec[0].elements, dy, Npts, par, Npar, fgaussOD);
+
+  for (i = 0; i < 10; i++) {
+
+    chisq = mrqmin (xvec[0].elements, yvec[0].elements, dy, Npts, par, Npar, fgaussOD);
+    gprint (GP_ERR, "chisq: %f, %f %f %f %f\n", chisq, par[0], par[1], par[2], par[3]);
+
+  }  
+
+  covar = mrqcovar (Npar);
+
+  for (i = 0; i < Npar; i++) {
+    gprint (GP_ERR, "%d  %f  %f\n", i, par[i], covar[i][i]);
+  }
+
+  mrqfree (Npar);
+  return (TRUE);
+}
+
+
+/* pars: x, y, sx, sy, sxy, sky I, */
+float fgaussOD (float x, float *par, int Npar, float *dpar) {
+
+  float X, S, Z, R, f;
+
+  X = x - par[0];
+  S = 1.0 / (par[1]*par[1]);
+  Z = -0.5*X*X*S;
+  R = exp (Z);
+  f = par[2]*R + par[3];
+
+  dpar[0] = par[2]*R*X*S;
+  dpar[1] = dpar[0]*X/par[1];
+  dpar[2] = R;
+  dpar[3] = 1;
+  
+  return (f);
+
+}
+
+# if (0)
+
+/* pars: x, y, sx, sy, sxy, sky I, */
+float testF (float x, float *par, int Npar, float *dpar) {
+
+  float f;
+
+  f = par[0]*x + par[1];
+
+  dpar[0] = x;
+  dpar[1] = 1;
+  
+  return (f);
+
+}
+
+
+/* pars: x, y, sx, sy, sxy, sky I, */
+float fgaussTD (float x, float y, float *par, int Npar) {
+
+  X = x - par[0];
+  Y = y - par[1];
+  
+  t1 = X / par[2];
+  t2 = Y * Y / par[3];
+  t3 = Y * par[4] * 2.0;
+
+  r = 0.5 * ((t1 + t3)*X + t2);
+  f = par[5] + par[6] / (1.0 + r*(1.0 + 0.5*r*(1.0 + 0.33333333*r)));
+  
+  return (f);
+
+}
+
+float chisq (float *buf, float *sig, int Nx, int Ny, float (func)(), float *par, int Npar) {
+
+  float *ptr;
+
+  X = 0;
+  ptr = buf;
+  for (i = 0; i < Nx; i++) {
+    for (j = 0; j < Ny; j++, ptr++, sig++) {
+      f = *ptr - func ((float) i, (float) j, par, Npar);
+      X += (f * f) / *sig;
+    }
+  }    
+  return (X);
+}
+
+  int i, j, Nbuf, status;
+  char *string;
+  double Npix, N1, N2, max, min, range, median;
+  float *V;
+  int sx, sy, nx, ny, *hist, Nhist, bin;
+
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: imfit <buffer> sx sy nx ny\n");
+    return (FALSE);
+  }
+
+  if (!SelectBuffer (&Nbuf, argv[1], OLDBUFFER)) return (FALSE);
+
+  sx = atof (argv[2]);
+  sy = atof (argv[3]);
+  nx = atof (argv[4]);
+  ny = atof (argv[5]);
+
+  Npix = N1 = N2 = 0;
+  if ((sx < 0) || (sy < 0) || 
+      (sx+nx > buffers[Nbuf].matrix.Naxis[0]) || 
+      (sy+ny > buffers[Nbuf].matrix.Naxis[1])) {
+    gprint (GP_ERR, "region out of range\n");
+    return (FALSE);
+  }
+
+  Npix = nx*ny;
+
+  ALLOCATE (tempbuf, float, Npix);
+
+  buf = tempbuf;
+  for (j = 0; j < ny; j++) {
+    V = (float *)(buffers[Nbuf].matrix.buffer) + (j+sy)*buffers[Nbuf].matrix.Naxis[0] + sx; 
+    for (i = 0; i < nx; i++, V++) {
+      *buf = *V;
+    }
+  }
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/transform.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/transform.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/transform.c	(revision 15879)
@@ -0,0 +1,74 @@
+# include "astro.h"
+
+int transform (int argc, char **argv) {
+
+  int i, j, Nx, Ny;
+  Coords coords_in, coords_out;
+  double scale_in, scale_out;
+  int X, Y;
+  double x, y, r, d, dx, dy;
+  double frac;
+  char *Sout, *S;
+  float *Vin, *Vout;
+  Buffer *in, *out;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: transform <from> <to>\n");
+    return (FALSE);
+  }
+
+  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  GetCoords (&coords_in, &in[0].header);
+  GetCoords (&coords_out, &out[0].header);
+
+  /* for the moment, disable WRP / DIS */
+  if (!strcmp(&coords_in.ctype[4], "-WRP") || !strcmp(&coords_out.ctype[4], "-WRP")) {
+    gprint (GP_ERR, "WRP mode not implemented for astrom\n");
+    return (FALSE);
+  }
+  
+  scale_in = sqrt(fabs(coords_in.cdelt1*coords_in.cdelt2*(coords_in.pc1_1*coords_in.pc2_2 - coords_in.pc1_2*coords_in.pc2_1)));
+  scale_out = sqrt(fabs(coords_out.cdelt1*coords_out.cdelt2*(coords_out.pc1_1*coords_out.pc2_2 - coords_out.pc1_2*coords_out.pc2_1)));
+
+  Vin  = (float *) in[0].matrix.buffer;
+  Vout = (float *) out[0].matrix.buffer;
+  Nx = out[0].header.Naxis[0];
+  Ny = out[0].header.Naxis[1];
+  bzero (Vout, Nx*Ny*sizeof(float));
+  ALLOCATE (S, char, Nx*Ny);
+  Sout = S;
+  bzero (Sout, Nx*Ny*sizeof(char));
+  frac = 0.333;
+
+  /* if (scale_in < scale_out) { */
+
+  for (j = 0; j < in[0].header.Naxis[1]; j++) {
+    gprint (GP_ERR, ".");
+    for (i = 0; i < in[0].header.Naxis[0]; i++, Vin++) {
+      for (dx = 0.0 + 0.5*frac; dx < 1.0 - 0.5*frac; dx += frac) {
+	for (dy = 0.0 + 0.5*frac; dy < 1.0 - 0.5*frac; dy += frac) {
+	  XY_to_RD (&r, &d, i + dx, j + dy, &coords_in);
+	  RD_to_XY (&x, &y, r, d, &coords_out);
+	  X = x; Y = y;
+	  if ((X > -1) && (X < Nx) && (Y > -1) && (Y < Ny)) {
+	    Vout[X + Y*Nx] += *Vin;
+	    Sout[X + Y*Nx] ++;
+	  }
+	}
+      }
+    }
+  }
+
+  Sout = S;
+  Vout = (float *) out[0].matrix.buffer;
+  for (i = 0; i < Nx*Ny; i++, Vout++, Sout++) {
+    *Vout = *Vout / *Sout;
+  }
+
+  free (S);
+    
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/warp.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/warp.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.astro/warp.c	(revision 15879)
@@ -0,0 +1,237 @@
+# include "astro.h"
+
+/*** needs mosaic astrometry ***/
+
+static double XO, XX, XY;
+static double YO, YX, YY;
+int ZERO;
+
+int map_output_to_input (int Npix, double df);
+int map_input_to_output (int Npix, double df);
+void set_linear_terms (Coords *in, Coords *out, int i, int j, int Npix);
+void apply_terms (double *Xout, double *Yout, double Xin, double Yin);
+
+Coords coords_in, coords_out;
+Buffer *in, *out, *wt;
+
+int warp (int argc, char **argv) {
+
+  int Nlinear, Np, N;
+  double scale_in, scale_out, df;
+
+  ZERO = FALSE;
+  if ((N = get_argument (argc, argv, "-zero"))) {
+    ZERO = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: transform <from> <to> <weight> (Nlinear)\n");
+    gprint (GP_ERR, "  output buffer must exist with target astrometry header\n");
+    gprint (GP_ERR, "  Nlinear is the pixel scale for linear astrometric transformation\n");
+    return (FALSE);
+  }
+
+  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((wt  = SelectBuffer (argv[3], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  Nlinear = atoi (argv[4]);
+
+  GetCoords (&coords_in, &in[0].header);
+  GetCoords (&coords_out, &out[0].header);
+
+  /* for the moment, disable WRP / DIS */
+  if (!strcmp(&coords_in.ctype[4], "-WRP") || !strcmp(&coords_out.ctype[4], "-WRP")) {
+    gprint (GP_ERR, "WRP mode not implemented for astrom\n");
+    return (FALSE);
+  }
+  
+  scale_in = sqrt(fabs(coords_in.cdelt1*coords_in.cdelt2*(coords_in.pc1_1*coords_in.pc2_2 - coords_in.pc1_2*coords_in.pc2_1)));
+  scale_out = sqrt(fabs(coords_out.cdelt1*coords_out.cdelt2*(coords_out.pc1_1*coords_out.pc2_2 - coords_out.pc1_2*coords_out.pc2_1)));
+  
+  gprint (GP_ERR, "%f - %f\n", scale_in, scale_out);
+
+  if (scale_in > scale_out) {
+    Np = MAX (1, 3*scale_out / scale_in);
+    df = 1.0 / Np;
+    map_output_to_input (Nlinear, df);
+  } else {
+    Np = MAX (1, 3*scale_in / scale_out);
+    df = 1.0 / Np;
+    map_input_to_output (Nlinear, df);
+  }
+  return (TRUE);
+}
+
+/* mode 1: input pixels >> output pixels: loop over output pixels */
+/* mode 2: input pixels << output pixels: loop over input pixels */
+/* mode 3: input pixels ~= output pixels: drizzle input to output */
+
+/* loop over the input pixels, map input output image */
+int map_output_to_input (int Npix, double df) {
+
+  int i, j, Ni, No, Nx, Ny, nx, ny;
+  float *Vin, *Vout, *Vwt;
+  double x, y, X, Y;
+
+  /* loop over output pixels */
+  /* set up pointers for buffers */
+  Vin  = (float *) in[0].matrix.buffer;
+  Vout = (float *) out[0].matrix.buffer;
+  Vwt  = (float *) wt[0].matrix.buffer;
+
+  nx = in[0].header.Naxis[0];
+  ny = in[0].header.Naxis[1];
+  Nx = out[0].header.Naxis[0];
+  Ny = out[0].header.Naxis[1];
+
+  if (ZERO) {
+    bzero (Vout, Nx*Ny*sizeof(float));
+    bzero (Vwt,  Nx*Ny*sizeof(float));
+  }
+
+  for (j = 0; j < Ny; j+=Npix) {
+    for (i = 0; i < Nx; i+=Npix) {
+      
+      /* define linear transformation in region */
+      set_linear_terms (&coords_out, &coords_in, i, j, Npix);
+
+      for (X = i; (X < i + Npix) && (X < Nx); X += df) {
+	for (Y = j; (Y < j + Npix) && (Y < Ny); Y += df) {
+	  
+	  No = (int)X + ((int)Y)*Nx;
+	  apply_terms (&x, &y, X, Y);
+	  if (x < 0) continue;
+	  if (x >= nx) continue;
+	  if (y < 0) continue;
+	  if (y >= ny) continue;
+	  Ni = (int)x + ((int)y)*nx;
+
+	  Vout[No] += Vin[Ni];
+	  Vwt[No] ++;
+	}
+      }
+    }
+  }
+  return (TRUE);
+}
+
+/* loop over the input pixels, map input output image */
+int map_input_to_output (int Npix, double df) {
+
+  int i, j, Ni, No, Nx, Ny, nx, ny;
+  float *Vin, *Vout, *Vwt;
+  double x, y, X, Y;
+
+  /* loop over output pixels */
+  /* set up pointers for buffers */
+  Vin  = (float *) in[0].matrix.buffer;
+  Vout = (float *) out[0].matrix.buffer;
+  Vwt  = (float *) wt[0].matrix.buffer;
+
+  Nx = in[0].header.Naxis[0];
+  Ny = in[0].header.Naxis[1];
+  nx = out[0].header.Naxis[0];
+  ny = out[0].header.Naxis[1];
+
+  if (ZERO) {
+    bzero (Vout, nx*ny*sizeof(float));
+    bzero (Vwt,  nx*ny*sizeof(float));
+  }
+
+  for (j = 0; j < Ny; j+=Npix) {
+    for (i = 0; i < Nx; i+=Npix) {
+      
+      /* define linear transformation in region */
+      set_linear_terms (&coords_in, &coords_out, i, j, Npix);
+
+      for (X = i; (X < i + Npix) && (X < Nx); X += df) {
+	for (Y = j; (Y < j + Npix) && (Y < Ny); Y += df) {
+	  
+	  Ni = (int)X + ((int)Y)*Nx;
+	  apply_terms (&x, &y, X, Y);
+	  if (x < 0) continue;
+	  if (x >= nx) continue;
+	  if (y < 0) continue;
+	  if (y >= ny) continue;
+	  No = (int)x + ((int)y)*nx;
+
+	  Vout[No] += Vin[Ni];
+	  Vwt[No] ++;
+	}
+      }
+    }
+  }
+  return (TRUE);
+}
+
+/* find the linear astrometric fix between images at this location */
+void set_linear_terms (Coords *in, Coords *out, int i, int j, int Npix) {
+
+  int n;
+  double x, y, x2, y2, xy, X, Y, Xx, Xy, Yx, Yy;
+  double Xin, Yin, Xout, Yout;
+  double Sx2, Sy2, Sxy, SXx, SXy, SYx, SYy;
+  double N, r, d;
+
+  Xin = Yin = 0;
+  N = x = y = x2 = y2 = xy = X = Y = Xx = Xy = Yx = Yy = 0;
+
+  /* define several test points, fit a line to the input,output pairs */
+  for (n = 0; n < 3; n++) {
+
+    switch (n) {
+    case 0:
+      Xin = i;
+      Yin = j;
+      break;
+    case 1:
+      Xin = i + Npix;
+      Yin = j;
+      break;
+    case 2:
+      Xin = i;
+      Yin = j + Npix;
+      break;
+    }
+
+    XY_to_RD (&r, &d, Xin, Yin, in);
+    RD_to_XY (&Xout, &Yout, r, d, out);
+
+    x  += Xin;
+    y  += Yin;
+    x2 += Xin*Xin;
+    y2 += Yin*Yin;
+    xy += Xin*Yin;
+    X  += Xout;
+    Y  += Yout;
+    Xx += Xout*Xin;
+    Xy += Xout*Yin;
+    Yx += Yout*Xin;
+    Yy += Yout*Yin;
+    N  += 1.0;
+  }
+
+  Sx2 = x2 - x*x/N;
+  Sy2 = y2 - y*y/N;
+  Sxy = xy - x*y/N;
+  SXx = Xx - X*x/N;
+  SXy = Xy - X*y/N;
+  SYx = Yx - Y*x/N;
+  SYy = Yy - Y*y/N;
+  
+  XX = (SXx*Sy2 - SXy*Sxy) / (Sx2*Sy2 - Sxy*Sxy);
+  XY = (SXy*Sx2 - SXx*Sxy) / (Sx2*Sy2 - Sxy*Sxy);
+  XO = X/N - XX*x/N - XY*y/N;
+
+  YX = (SYx*Sy2 - SYy*Sxy) / (Sx2*Sy2 - Sxy*Sxy);
+  YY = (SYy*Sx2 - SYx*Sxy) / (Sx2*Sy2 - Sxy*Sxy);
+  YO = Y/N - YX*x/N - YY*y/N;
+
+}
+
+
+void apply_terms (double *Xout, double *Yout, double Xin, double Yin) {
+  *Xout = XO + XX*Xin + XY*Yin;
+  *Yout = YO + YX*Xin + YY*Yin;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/Makefile	(revision 15879)
@@ -0,0 +1,75 @@
+default: libbasiccmd
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+SRC     =       $(HOME)/cmd.basic
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+FULL_CFLAGS   = $(BASE_CFLAGS) -fPIC
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(BASE_LDFLAGS)
+
+# basic user commands ########################
+
+srcs = \
+$(SRC)/init.$(ARCH).o       \
+$(SRC)/break.$(ARCH).o	     \
+$(SRC)/cd.$(ARCH).o	     \
+$(SRC)/config.$(ARCH).o     \
+$(SRC)/continue.$(ARCH).o   \
+$(SRC)/date.$(ARCH).o	     \
+$(SRC)/echo.$(ARCH).o	     \
+$(SRC)/file.$(ARCH).o	     \
+$(SRC)/getchr.$(ARCH).o     \
+$(SRC)/help.$(ARCH).o	     \
+$(SRC)/input.$(ARCH).o	     \
+$(SRC)/list.$(ARCH).o	     \
+$(SRC)/list_help.$(ARCH).o  \
+$(SRC)/list_vars.$(ARCH).o  \
+$(SRC)/local.$(ARCH).o	     \
+$(SRC)/macro.$(ARCH).o	     \
+$(SRC)/memory.$(ARCH).o     \
+$(SRC)/module.$(ARCH).o     \
+$(SRC)/output.$(ARCH).o     \
+$(SRC)/quit.$(ARCH).o	     \
+$(SRC)/run_for.$(ARCH).o    \
+$(SRC)/run_if.$(ARCH).o     \
+$(SRC)/run_while.$(ARCH).o  \
+$(SRC)/scan.$(ARCH).o	     \
+$(SRC)/shell.$(ARCH).o	     \
+$(SRC)/sprintf.$(ARCH).o    \
+$(SRC)/fprintf.$(ARCH).o    \
+$(SRC)/strlen.$(ARCH).o     \
+$(SRC)/substr.$(ARCH).o     \
+$(SRC)/strpop.$(ARCH).o     \
+$(SRC)/usleep.$(ARCH).o     \
+$(SRC)/sleep.$(ARCH).o	     \
+$(SRC)/wait.$(ARCH).o	     \
+$(SRC)/which.$(ARCH).o
+
+# dependancy rules for include files ########################
+incs = \
+$(INC)/opihi.h \
+$(INC)/external.h \
+$(INC)/shell.h \
+$(INC)/dvomath.h \
+$(INC)/convert.h \
+$(INC)/display.h 
+
+$(srcs): $(incs)
+
+$(LIB)/libbasiccmd.$(ARCH).a: $(srcs)
+$(LIB)/libbasiccmd.$(ARCH).$(DLLTYPE): $(srcs)
+
+$(DESTLIB)/libbasiccmd.a: $(LIB)/libbasiccmd.$(ARCH).a
+$(DESTLIB)/libbasiccmd.$(DLLTYPE): $(LIB)/libbasiccmd.$(ARCH).$(DLLTYPE)
+
+libbasiccmd: $(DESTLIB)/libbasiccmd.a $(DESTLIB)/libbasiccmd.$(DLLTYPE)
+
+uninstall:
+	rm -f $(DESTLIB)/libbasiccmd.a
+	rm -f $(DESTLIB)/libbasiccmd.$(DLLTYPE)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/break.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/break.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/break.c	(revision 15879)
@@ -0,0 +1,27 @@
+# include "basic.h"
+
+int exec_break (int argc, char **argv) {
+
+  int N, value;
+
+  if ((N = get_argument (argc, argv, "-auto"))) {
+    remove_argument (N, &argc, argv);
+    value = -1;
+    if (!strcasecmp (argv[N], "on")) value = TRUE;
+    if (!strcasecmp (argv[N], "off")) value = FALSE;
+    if (value == -1) {
+      gprint (GP_ERR, "USAGE: break -auto [on / off]\n");
+      if (auto_break) 
+	gprint (GP_ERR, "auto break on\n");
+      else 
+	gprint (GP_ERR, "auto break off\n");
+      return (FALSE);
+    }
+    auto_break = value;
+    return (TRUE);
+  }
+
+  loop_break = TRUE;
+  return (FALSE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/cd.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/cd.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/cd.c	(revision 15879)
@@ -0,0 +1,68 @@
+# include "basic.h"
+
+int cd (int argc, char **argv) {
+
+  int N, VERBOSE, status;
+  char *cwd;
+
+  VERBOSE = TRUE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    remove_argument (N, &argc, argv);
+    VERBOSE = FALSE;
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: cd <path>\n");
+    return (FALSE);
+  }
+
+  status = chdir (argv[1]);
+  if (!status) {
+    if ((cwd = getcwd (NULL, 64)) == NULL) {
+      gprint (GP_ERR, "error getting cwd\n");
+      return (FALSE);
+    }
+    if (VERBOSE) gprint (GP_LOG, "cwd: %s\n", cwd);
+    ohana_memregister (cwd);
+    free (cwd);
+    return (TRUE);
+  }
+
+  gprint (GP_ERR, "error changing to %s\n", argv[1]);
+  return (FALSE);
+
+}
+
+int pwd (int argc, char **argv) {
+
+  int N;
+  char *cwd, *var;
+
+  var = NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    var = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: pwd [-var variable]\n");
+    return (FALSE);
+  }
+  
+  if ((cwd = getcwd(NULL, 64)) == NULL) {
+    gprint (GP_ERR, "error getting cwd\n");
+    if (var != NULL) free (var);
+    return (FALSE);
+  }
+  if (var == NULL) {
+      gprint (GP_LOG, "cwd: %s\n", cwd);
+  } else {
+      set_str_variable (var, cwd);
+      free (var);
+  }
+  ohana_memregister (cwd);
+  free (cwd);
+  return (TRUE);
+  
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/config.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/config.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/config.c	(revision 15879)
@@ -0,0 +1,9 @@
+# include "basic.h"
+
+int config (int argc, char **argv) {
+
+  if (!ConfigInit (&argc, argv)) return (FALSE);
+
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/continue.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/continue.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/continue.c	(revision 15879)
@@ -0,0 +1,12 @@
+# include "basic.h"
+
+int exec_next (int argc, char **argv) {
+  loop_next = TRUE;
+  return (TRUE);
+}
+
+int exec_last (int argc, char **argv) {
+  loop_last = TRUE;
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/date.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/date.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/date.c	(revision 15879)
@@ -0,0 +1,57 @@
+# include "basic.h"
+
+int date (int argc, char **argv) {
+  
+  int N, SECONDS, REFTIME;
+  struct timeval now;
+  char *tstring = NULL;
+  char *varName = NULL;
+
+  SECONDS = FALSE;
+  if ((N = get_argument (argc, argv, "-seconds"))) {
+    remove_argument (N, &argc, argv);
+    SECONDS = TRUE;
+  } else {
+    ALLOCATE (tstring, char, 32);
+  }
+
+  REFTIME = 0;
+  if ((N = get_argument (argc, argv, "-reftime"))) {
+    remove_argument (N, &argc, argv);
+    REFTIME = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+  } 
+
+  varName = NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    varName = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: date [-var variable] [-seconds] [-reftime seconds]\n");
+    return (FALSE);
+  }
+
+  gettimeofday (&now, NULL);
+  if (SECONDS) {
+    if (varName) {
+      set_int_variable (varName, now.tv_sec - REFTIME);
+    } else {
+      gprint (GP_ERR, "%d\n", now.tv_sec - REFTIME);
+    }
+  } else {
+    ctime_r (&now.tv_sec, tstring);
+    N = strlen (tstring) - 1;
+    tstring[N] = 0;
+
+    if (varName) {
+      set_str_variable (varName, tstring);
+    } else {
+      gprint (GP_ERR, "%s\n", tstring);
+    }
+    free (tstring);
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/echo.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/echo.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/echo.c	(revision 15879)
@@ -0,0 +1,14 @@
+# include "basic.h"
+
+int echo (int argc, char **argv) {
+  
+  int i;
+
+  for (i = 1; i < argc - 1; i++) {
+    gprint (GP_LOG, "%s ", argv[i]);
+  }
+  if (argc >= 2) {
+      gprint (GP_LOG, "%s\n", argv[argc - 1]);
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/file.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/file.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/file.c	(revision 15879)
@@ -0,0 +1,32 @@
+# include "basic.h"
+
+int file (int argc, char **argv) {
+  
+  /* usage: file (filename) [var] */
+
+  int status, vstat;
+  struct stat fstats;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: file (filename) [var]\n");
+    return (FALSE);
+  }
+
+  status = stat (argv[1], &fstats);
+
+  vstat = !status;
+
+  if (argc == 3) {
+      
+    set_int_variable (argv[2], vstat);
+
+  } else {
+
+    gprint (GP_ERR, "file %s is ", argv[1]);
+    if (!vstat) gprint (GP_ERR, "not ");
+    gprint (GP_ERR, "found\n");
+    
+  }
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/fprintf.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/fprintf.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/fprintf.c	(revision 15879)
@@ -0,0 +1,81 @@
+# include "basic.h"
+# define NCHAR 1024
+
+// XXX this function should ALLOCATE the output buffers
+int fprintf_opihi (int argc, char **argv) {
+
+  int i;
+  char line[NCHAR], tmp[NCHAR], fmt[NCHAR];
+  char *p1, *p2, *q;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: fprintf format value value ...\n");
+    return (FALSE);
+  }
+
+  q  = line;
+  bzero (line, NCHAR);
+
+  p1 = argv[1];
+  for (i = 2; i < argc; i++) {
+    bzero (tmp, NCHAR);
+    bzero (fmt, NCHAR);
+
+    /* find next format character */
+    p2 = strchr (p1, '%');
+    if (p2 == (char *) NULL) {
+      gprint (GP_ERR, "mismatch between format and values\n");
+      return (FALSE);
+    }
+    if (strlen(q) + p2 - p1 > NCHAR) {
+      gprint (GP_ERR, "line too long");
+      return (FALSE);
+    }
+    memcpy (q, p1, p2-p1);
+    q = line + strlen(line);
+    
+    /* identify type (%NNNs %NNNNd %NNNNf) */
+    for (p1 = p2 + 1; (*p1 == '.') || (*p1 == '-') || (*p1 == '+') || (*p1 == ' ') || isdigit(*p1); p1++);
+    memcpy (fmt, p2, p1 - p2 + 1);
+    switch (*p1) {
+      case 'e':
+      case 'f':
+	sprintf (tmp, fmt, atof(argv[i]));
+	break;
+      case 's':
+	sprintf (tmp, fmt, argv[i]);
+	break;
+      case 'd':
+      case 'c':
+      case 'x':
+	sprintf (tmp, fmt, atoi(argv[i]));
+	break;
+      default:
+	gprint (GP_ERR, "syntax error in format (only e,f,s,d,c,x allowed)\n");
+	return (FALSE);
+    }
+    if (strlen(q) + strlen(tmp) > NCHAR) {
+      gprint (GP_ERR, "line too long");
+      return (FALSE);
+    }
+    memcpy (q, tmp, strlen(tmp));
+    q = line + strlen(line);
+    p1++;
+  }
+  p2 = strchr (p1, '%');
+  if (p2 != (char *) NULL) {
+    gprint (GP_ERR, "mismatch between format and values\n");
+    return (FALSE);
+  }
+  
+  p2 = p1 + strlen (p1);
+  if (strlen(q) + p2 - p1 > NCHAR) {
+    gprint (GP_ERR, "line too long");
+    return (FALSE);
+  }
+  memcpy (q, p1, p2-p1);
+  gprint (GP_LOG, "%s\n", line);
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/getchr.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/getchr.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/getchr.c	(revision 15879)
@@ -0,0 +1,29 @@
+# include "basic.h"
+
+int getchr_func (int argc, char **argv) {
+
+  /* returns position of the first given character */ 
+  char *c;
+  int pos;
+
+  if ((argc != 3) && (argc != 4)) {
+    gprint (GP_ERR, "USAGE: getchr (string) (char) [var]\n");
+    return (FALSE);
+  }
+
+  c = strchr (argv[1], argv[2][0]);
+
+  if (c == (char *) NULL) {
+    pos = -1;
+  } else {
+    pos = c - argv[1];
+  }
+
+  if (argc == 4) {
+    set_int_variable (argv[3], pos);
+  } else {
+    gprint (GP_ERR, "%d\n", pos);
+  }
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help.c	(revision 15879)
@@ -0,0 +1,39 @@
+# include "basic.h"
+
+int help (int argc, char **argv) {
+
+  int Nbytes;
+  FILE *f;
+  char *helpdir, *file, buff[512];
+
+  helpdir = get_variable ("HELPDIR");
+  if (helpdir == (char *) NULL) {
+    gprint (GP_ERR, "variable HELPDIR not found\n");
+    return (FALSE);
+  }
+
+  if (argc == 1) {
+    sprintf (buff, "ls %s", helpdir);
+    system (buff);
+    return (TRUE);
+  }
+
+  Nbytes = strlen(helpdir) + strlen(argv[1]) + 2;
+  ALLOCATE (file, char, Nbytes);
+  snprintf (file, Nbytes, "%s/%s", helpdir, argv[1]);
+
+  f = fopen (file, "r");
+  free (file);
+
+  if (f == NULL) {
+    gprint (GP_ERR, "No help for: %s\n", argv[1]);
+    return (FALSE);
+  }
+
+  while (scan_line (f, buff) != EOF)
+    gprint (GP_LOG, "%s\n", buff);
+
+  fclose (f);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/!
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/!	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/!	(revision 15879)
@@ -0,0 +1,6 @@
+
+  exec (line)
+
+  perform a system call.  this can also be invoked with "!".  
+  don't use ! in a macro or input script as it is interpreted as a
+  comment character. 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/?
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/?	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/?	(revision 15879)
@@ -0,0 +1,6 @@
+
+  exec (line)
+
+  perform a system call.  this can also be invoked with "!".  
+  don't use ! in a macro or input script as it is interpreted as a
+  comment character. 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/Opihi
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/Opihi	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/Opihi	(revision 15879)
@@ -0,0 +1,5 @@
+
+
+    Opihi
+
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/Shell
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/Shell	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/Shell	(revision 15879)
@@ -0,0 +1,5 @@
+
+
+    Opihi
+
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/Variables
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/Variables	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/Variables	(revision 15879)
@@ -0,0 +1,17 @@
+
+  Opihi shell variables (scalars):
+
+  The Opihi shell can have variables which are designated by a word
+following a dollar sign: $foo.  Certain Mana function create and set
+variables (ie, stats, cursor).  You can also set a variable to the
+result of an arithmetic expression or just a number like this:
+
+  $foo = 10.0
+  $bar = 5*$foo + 0.6
+
+Mana will replace the variables on a line before executing a command.
+See also "Math" for more description of arithmetic operations.
+
+  See Also:  Math
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/break
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/break	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/break	(revision 15879)
@@ -0,0 +1,10 @@
+
+  break [-auto on/off]
+
+  halts macro, if, or for processes and returns to the basic prompt.
+
+  -auto: enables or disables DVO from automatically breaking
+   when it encounters an error
+
+  See also: macro, if, for
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/cd
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/cd	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/cd	(revision 15879)
@@ -0,0 +1,9 @@
+
+   cd (path)
+
+   change current working directory. 
+
+   Note that Kii or Kapa will be launched in the original 
+   directory, which means PS files created by Kii or Kapa 
+   will land in that directory (perhaps an unexpected result).
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/continue
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/continue	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/continue	(revision 15879)
@@ -0,0 +1,4 @@
+
+   continue
+
+   Return to the start of a for-loop.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/date
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/date	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/date	(revision 15879)
@@ -0,0 +1,6 @@
+
+   date (variable)
+
+   Return the date and place it into (variable).
+
+   Default: print to window
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/echo
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/echo	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/echo	(revision 15879)
@@ -0,0 +1,10 @@
+
+  echo [anything]
+
+  prints the rest of the line, after variables and math expressions
+are parsed.  
+
+
+  See Also:  Opihi, math
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/exec
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/exec	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/exec	(revision 15879)
@@ -0,0 +1,6 @@
+
+   exec (shell command)
+
+   Allows a shell command to be run while running DVO
+   On the command line, this can also be done by placing a "!" before the shell
+    command
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/file
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/file	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/file	(revision 15879)
@@ -0,0 +1,9 @@
+
+   file (filename) (variable)
+
+   Checks to see if a file exists
+
+   If a variable is specified, then it is set to 1 if the file is present
+    and set to 0 if it is not.
+
+   Default: output printed to the window
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/for
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/for	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/for	(revision 15879)
@@ -0,0 +1,19 @@
+
+   for var (start) (stop) [delta]
+
+    perform a loop, with $var as the loop variable. 
+    the value of $var runs from (start) to (stop) inclusive, 
+    and is incremented by [delta] (1 by default).
+
+    The loop commands are entered until the appropriate "end" is typed;
+    if there are nested loops, macro definitions, or logical blocks,
+    the correct "end" is used!
+
+    for may be used at the command line, in a macro, or in an input
+    file with no ill effects.
+
+    the variable $var may be accessed during the loop execution.  if
+    the variable $var is assigned a value beyond (stop) during the
+    loop, the loop execution will end.
+
+    See also: macro, if
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/fprintf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/fprintf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/fprintf	(revision 15879)
@@ -0,0 +1,15 @@
+
+   fprintf ("format codes") (value1 value2 ...)
+
+   Prints output according to a specified format
+
+   Fomat codes must match the order and number of values.
+
+   FORMAT CODES:
+    %x.yf : floating point number with x total places and y places after
+             the decimal point; further decimal places are rounded
+    %x.ye : number in scientific notation with x places and y places after
+             the decimal point; further decimal places are rounded
+    %xs : ASCII output with x places
+    %xd : Integers with x places
+    %x : Express number in hexidesimal
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/getchr
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/getchr	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/getchr	(revision 15879)
@@ -0,0 +1,8 @@
+
+   getchr (string) (char) [variable]
+
+   Return the index of the string in the position of the specified character
+
+   Only the first instance of a character is returned.
+
+   If not found, the variable is set to -1.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/help
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/help	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/help	(revision 15879)
@@ -0,0 +1,7 @@
+
+   help (function)
+
+   print the contents of the help file.  
+   typing "help" without an argument will list the available help
+   files.  
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/if
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/if	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/if	(revision 15879)
@@ -0,0 +1,22 @@
+
+   if (logic)
+     (commands)
+   end
+
+   or:
+
+   if (logic)
+     (commands)
+   else 
+     (commnds)
+   end
+
+   logical block.  The commands are performed subject to the logical
+   condition.  The syntax is simplified C:  
+   examples: (x = 6), (x < 6) , (x ! 6), ((x = 6) | (x > 10))
+
+   there are no delimiter characters.
+
+   See also: for, macro
+
+   
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/input
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/input	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/input	(revision 15879)
@@ -0,0 +1,15 @@
+
+   input (filename)
+
+   execute a series of commands given in the file.
+
+   Two special examples:  
+   ~/.manarc is loaded on startup, which give the user a place to
+   define personal macros, or interesting variables, etc.
+
+   If mana is called in the form "mana file", the file is loaded
+   (after .manarc) before the user is given the command-line prompt.
+   This can be used to invoke mana in a shell script, but care should
+   be taken in a shell-script that the file ends with the word "exit"
+   or "quit", or strange things may happen...
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/list
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/list	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/list	(revision 15879)
@@ -0,0 +1,23 @@
+
+   list (name) (string1) (string2) ... end
+   OR
+   list (name) -split (string1) (string2) ...
+   OR
+   list (name) -x "(ls command)"
+   OR
+   list (name) -x "cat (file)" 
+
+   Create a list of strings that are zero indexed.
+
+   $(name):n = the number of elements in the list (name)
+
+   $(name):5 = the 6th element of the list (name)
+
+   -split option: Turn a list of strings (separated by white spaces)
+     into a list
+
+   -x option: turn an ls command or file into a list (one list element per
+     line in the file + 1 white space)
+
+   ***Note: the list ... end version of the command does not currently work
+             within macros
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/local
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/local	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/local	(revision 15879)
@@ -0,0 +1,7 @@
+
+   local (var)
+
+   Creates a variable that is accessible only within the macro
+    in which it is created.
+
+   Variable value is listed as (macro).(var) using the "??" command
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/macro
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/macro	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/macro	(revision 15879)
@@ -0,0 +1,11 @@
+
+   macro (name)
+
+   create a macro.  the commands are entered until the word 'end' is
+   reached.  nested if, for, and macro definitions use the
+   appropriately matched occurances of the 'end'.
+
+   Within a macro, the command-line arguments are refered to as $1,
+   $2, etc.  The number of command-line arguments is given by $0.
+
+   
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/memory
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/memory	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/memory	(revision 15879)
@@ -0,0 +1,12 @@
+
+  memory [x]
+
+  list the currently used memory.  This gives a (possibly very) long
+  listing of the size of every allocated piece of memory.  Placing
+  anything after the word "memory" gives a summary also.  This is
+  useful to see just how close you are to filling your computer's
+  entire memory (Does not include memory allocated to Kii!)
+
+  See Also: buffers
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/output
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/output	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/output	(revision 15879)
@@ -0,0 +1,10 @@
+
+  output (filename or "stdout")
+
+  redirect the output to a file (concat to the end of the file).  This
+  can also be done with the UNIX ">".  However, this command is useful
+  to send information to a file for a part of a Mana session.  For
+  example, you can save results of a "stats" command.
+
+  See Also: input, stats
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/pwd
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/pwd	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/pwd	(revision 15879)
@@ -0,0 +1,7 @@
+
+   pwd -var (variable)
+
+   print current working directory
+
+   Using -var will place the output into the specified variable.
+   Default: print to window
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/quit
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/quit	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/quit	(revision 15879)
@@ -0,0 +1,4 @@
+
+   quit
+
+   Exit from DVO
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/scan
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/scan	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/scan	(revision 15879)
@@ -0,0 +1,8 @@
+
+   scan (filename) (variable) [Nline]
+
+   Place the Nth line of the file into the named variable
+
+   Default N value: 1 (the 1st line)
+
+   The variable recieves the line + 1 white space
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/sleep
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/sleep	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/sleep	(revision 15879)
@@ -0,0 +1,4 @@
+
+   sleep (N)
+
+   Wait for (N) seconds before continuing
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/sprintf
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/sprintf	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/sprintf	(revision 15879)
@@ -0,0 +1,17 @@
+
+   sprintf (var) ("format codes") (value1 value2 ...)
+
+   Prints output according to a specified format
+
+   Works same as fprintf, except it places the output as a string into (var)
+
+   Fomat codes must match the order and number of values.
+
+   FORMAT CODES:
+    %x.yf : floating point number with x total places and y places after
+             the decimal point; further decimal places are rounded
+    %x.ye : number in scientific notation with x places and y places after
+             the decimal point; further decimal places are rounded
+    %xs : ASCII output with x places
+    %xd : Integers with x places
+    %x : Express number in hexidesimal
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/strlen
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/strlen	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/strlen	(revision 15879)
@@ -0,0 +1,10 @@
+
+   strlen (string) [var]
+
+   Determines the number of characters (plus white spaces) in a string
+    and places it into var
+
+   Default: print to window
+
+   Note: If the string has white spaces, you need to place it within
+    double-quotes.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/strpop
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/strpop	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/strpop	(revision 15879)
@@ -0,0 +1,12 @@
+
+   strpop (string) [var]
+
+   Pops part of a string or a list element that can be placed
+    into [var]
+
+   Default: print to window
+
+   The output is the first set of characters bordered by white space
+
+   ***Note: Both (string) and [var] must be entered without the "$"
+    variable identifier for the program to work properly.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/substr
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/substr	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/substr	(revision 15879)
@@ -0,0 +1,11 @@
+
+   substr (string) (index) (length) [var]
+
+   Returns part of a string starting at the position (index)
+    and of size (length), which can then be placed into [var]
+
+   Default: print to window
+
+   The sub-string is not removed from the original string
+
+   ***Note: Character positions in strings are zero-indexed
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/usleep
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/usleep	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/usleep	(revision 15879)
@@ -0,0 +1,4 @@
+
+   usleep (N)
+
+   Wait for (N) microseconds before continuing
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/wait
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/wait	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/wait	(revision 15879)
@@ -0,0 +1,5 @@
+
+  wait [anything]
+
+  wait echos the rest of the line and waits for <return> to be typed.
+Very useful for pausing the processing of an input file or a macro.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/which
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/which	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/which	(revision 15879)
@@ -0,0 +1,5 @@
+
+   which (command)
+
+   give a short summary info line on a command
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/while
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/while	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/help/while	(revision 15879)
@@ -0,0 +1,5 @@
+
+   while (condition) ... end
+
+   Perform a set of actions until the condition is true
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/init.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/init.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/init.c	(revision 15879)
@@ -0,0 +1,120 @@
+# include "basic.h"
+
+int config          PROTO((int, char **));
+int exec_sleep      PROTO((int, char **));
+int exec_usleep     PROTO((int, char **));
+int cd              PROTO((int, char **));
+int date            PROTO((int, char **));
+int echo            PROTO((int, char **));
+int exec_last       PROTO((int, char **));
+int exec_next       PROTO((int, char **));
+int exec_break      PROTO((int, char **));
+int file            PROTO((int, char **));
+int getchr_func     PROTO((int, char **));
+int help       	    PROTO((int, char **));
+int input      	    PROTO((int, char **));
+int list       	    PROTO((int, char **));
+int list_help  	    PROTO((int, char **));
+int list_vars  	    PROTO((int, char **));
+int local           PROTO((int, char **)); /* data? */
+int macro      	    PROTO((int, char **));
+int memory          PROTO((int, char **));
+int module    	    PROTO((int, char **));
+int output     	    PROTO((int, char **));
+int pwd        	    PROTO((int, char **));
+int quit       	    PROTO((int, char **));
+int run_for    	    PROTO((int, char **));
+int run_if     	    PROTO((int, char **));
+int run_while  	    PROTO((int, char **));
+int scan       	    PROTO((int, char **));
+int shell      	    PROTO((int, char **));
+int sprintf_opihi   PROTO((int, char **));
+int fprintf_opihi   PROTO((int, char **));
+int strlen_func     PROTO((int, char **));
+int substr_func     PROTO((int, char **));
+int strpop          PROTO((int, char **));
+int wait_func  	    PROTO((int, char **));
+int which      	    PROTO((int, char **));
+
+/** mapping of the command names to command functions **/
+static Command cmds[] = {  
+  {"config",        config,             "(re)load config file?"},
+  {"sleep",         exec_sleep,         "sleep for N seconds"},
+  {"usleep",        exec_usleep,        "sleep for N microseconds"},
+  {"cd",      	    cd,                 "change directory"},
+  {"date",    	    date,               "get current date"},
+  {"echo",    	    echo,               "type this line *"},
+  {"break",   	    exec_break,         "escape from function *"},
+  {"continue",	    exec_next,          "next loop iteration"},
+  {"next",	    exec_next,          "next loop iteration"},
+  {"last",	    exec_last,          "last loop iteration"},
+  {"return",	    exec_last,          "exit from macro"},
+  {"file",          file,               "test file existence"},
+  {"getchr",        getchr_func,        "find character in string"},
+  {"help",    	    help,               "get help on a function *"},
+  {"input",   	    input,              "read command lines from a file *"},
+  {"list",    	    list,               "get variable list"},
+  {"?",       	    list_help,          "list commands *"},
+  {"??",      	    list_vars,          "list variables *"},
+  {"local",  	    local,              "define local variables"},
+  {"macro",   	    macro,              "deal with the macros *"}, 
+  {"memory",        memory,             "long listing of the allocated memory"},
+  {"module",        module,             "load script file from the modules directories"},
+  {"output",  	    output,             "redirect output to file"},
+  {"pwd",     	    pwd,                "print current working directory"},
+  {"exit",    	    quit,               "exit program *"}, 
+  {"quit",    	    quit,               "exit program *"},
+  {"for",     	    run_for,            "for loop"}, 
+  {"if",      	    run_if,             "logical cases *"}, 
+  {"while",   	    run_while,          "while loop"}, 
+  {"scan",    	    scan,               "scan line from keyboard or file to variable *"},
+  {"!",       	    shell,              "system call"},
+  {"exec",    	    shell,              "system call"},
+  {"sprintf",       sprintf_opihi,      "formatted print to a variable"},
+  {"fprintf",       fprintf_opihi,      "formatted print to standard output"},
+  {"strlen",        strlen_func,        "string length"},
+  {"substr",        substr_func,        "substring"},
+  {"strpop",        strpop,             "pop a string"},
+  {"wait",    	    wait_func,          "wait until return is typed"},
+  {"which",   	    which,              "show command *"}
+};
+
+void InitBasic () {
+  
+  int i;
+
+  InitCommands ();
+  InitMacros ();
+  InitBuffers ();
+  InitVectors ();
+  InitVariables ();
+  InitLists ();
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+  
+}
+
+void InitBasic_PantasksClient () {
+  
+  int i;
+
+  InitCommands ();
+  InitMacros ();
+  InitBuffers ();
+  InitVectors ();
+  InitVariables ();
+  InitLists ();
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    if (!strcmp (cmds[i].name, "quit")) goto valid;
+    if (!strcmp (cmds[i].name, "exit")) goto valid;
+    if (!strcmp (cmds[i].name, "exec")) goto valid;
+    if (!strcmp (cmds[i].name, "!")) goto valid;
+    continue;
+
+  valid:
+    AddCommand (&cmds[i]);
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/input.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/input.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/input.c	(revision 15879)
@@ -0,0 +1,53 @@
+# include "basic.h"
+# define D_NLINES 100
+
+int input (int argc, char **argv) {
+  
+  int i, NLINES, status;
+  FILE *infile;
+  Macro inlist;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: input <filename>\n");
+    return (FALSE);
+  }
+
+  infile = fopen (argv[1], "r");
+  if (infile == NULL) {
+    gprint (GP_ERR, "no file %s\n", argv[1]); 
+    return (FALSE);
+  }
+
+  /* read file into the current list */
+  NLINES = D_NLINES;
+  ALLOCATE (inlist.line, char *, NLINES);
+  ALLOCATE (inlist.line[0], char, 1024);
+  for (i = 0; (scan_line (infile, inlist.line[i]) != EOF);) {
+    stripwhite (inlist.line[i]);
+    if (inlist.line[i][0] == 0) continue;
+    if (inlist.line[i][0] == '#') continue;
+    if (inlist.line[i][0] == '!') continue;
+
+    REALLOCATE (inlist.line[i], char, strlen(inlist.line[i]) + 1);
+    if (i == NLINES - 1) {
+      NLINES += D_NLINES;
+      REALLOCATE (inlist.line, char *, NLINES)
+    }
+    i++;
+    ALLOCATE (inlist.line[i], char, 1024);
+  }
+  inlist.Nlines = i;
+  fclose (infile);
+
+  /* process this list */
+  status = exec_loop (&inlist);
+
+  /* cleanup list */
+  for (i = 0; i < inlist.Nlines; i++) {
+    free (inlist.line[i]);
+  }
+  free (inlist.line[i]); /* note that we always alloc one extra line */
+  free (inlist.line);
+  return (status);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/list.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/list.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/list.c	(revision 15879)
@@ -0,0 +1,197 @@
+# include "basic.h"
+# define D_NLINES 100
+static char prompt[] = ">> ";
+
+int list (int argc, char **argv) {
+
+  int ThisList, depth, i, done, found;
+  char *input, line[1024];
+  int N, Nbytes, NBYTES, Nread, status;
+  int RunCommand;
+  char *A, *B, *val, *Cmd;
+  FILE *f;
+
+  Cmd = NULL;
+  RunCommand = FALSE;
+  if ((N = get_argument (argc, argv, "-x"))) {
+    remove_argument (N, &argc, argv);
+    Cmd = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    RunCommand = TRUE;
+  }
+
+  // return an error if -add is given with no other args
+  if ((argc > 2) && (!strcmp (argv[2], "-split"))) {
+    if (argc == 3) {
+      gprint (GP_ERR, "USAGE: list (root) -split (word) (word) ...\n");
+      return (FALSE);
+    }
+    
+    for (i = 0; i < argc - 3; i++) {
+      sprintf (line, "%s:%d", argv[1], i);
+      set_str_variable (line, argv[i+3]);
+    }
+    sprintf (line, "%s:n", argv[1]);
+    set_int_variable (line, i);
+
+    return (TRUE);
+  }
+
+  // return an error if -add is given with no other args
+  if ((argc > 2) && (!strcmp (argv[2], "-add"))) {
+    if (argc == 3) {
+      gprint (GP_ERR, "USAGE: list (root) -add (word) (word) ...\n");
+      return (FALSE);
+    }
+    
+    sprintf (line, "%s:n", argv[1]);
+    N = get_int_variable (line, &found);
+    for (i = 0; i < argc - 3; i++) {
+      sprintf (line, "%s:%d", argv[1], N + i);
+      set_str_variable (line, argv[i+3]);
+    }
+    sprintf (line, "%s:n", argv[1]);
+    set_int_variable (line, N + i);
+
+    return (TRUE);
+  }
+
+  // remove the single named entry from the list (finds entry with given name, reduces list length by one)
+  // return an error if -add is given with no other args
+  if ((argc > 2) && (!strcmp (argv[2], "-del"))) {
+    if (argc != 4) {
+      gprint (GP_ERR, "USAGE: list (root) -del (word)\n");
+      return (FALSE);
+    }
+    
+    int j;
+    char *value, *next_value;
+    char line2[1024];
+
+    sprintf (line, "%s:n", argv[1]);
+    N = get_int_variable (line, &found);
+    for (i = 0; i < N; i++) {
+      sprintf (line, "%s:%d", argv[1], i);
+      value = get_variable (line);
+      if (value == NULL) continue;
+      if (!strcmp (value, argv[3])) {
+	free (value);
+	for (j = i + 1; j < N; j++) {
+	  sprintf (line2, "%s:%d", argv[1], j);
+	  next_value = get_variable (line2);
+	  set_str_variable (line, next_value);
+	  strcpy (line, line2);
+	}
+	DeleteNamedScalar (line);
+	sprintf (line2, "%s:n", argv[1]);
+	set_int_variable (line2, N - 1);
+	return (TRUE);
+      }
+      free (value);
+    }      
+    gprint (GP_ERR, "value %s not found in list\n", argv[3]);
+    return (FALSE);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: list (root)                : supply list data, terminate with 'END'\n");
+    gprint (GP_ERR, "USAGE: list (root) -x (command)   : create list from shell output\n");
+    gprint (GP_ERR, "USAGE: list (root) -split (words) : create list from words\n");
+    gprint (GP_ERR, "USAGE: list (root) -add (words)   : extend a list\n");
+    return (FALSE);
+  }
+
+  if (RunCommand) {
+    
+    /* val will hold the result */
+    NBYTES = 1024;
+    ALLOCATE (val, char, NBYTES);
+    
+    /* need to loop until command produces no more output, 
+       REALLOCATING as needed. */
+    f = popen (Cmd, "r");
+    done = FALSE;
+    Nbytes = 0;
+    while (!done) {
+      Nread = fread (&val[Nbytes], 1, 1023, f);
+      if (Nread < 0) { 
+	gprint (GP_ERR, "error reading from command\n");
+	done = TRUE;
+      }
+      if (Nread > 0) {
+	Nbytes += Nread;
+	NBYTES = 1024 + Nbytes;
+	REALLOCATE (val, char, NBYTES);
+      }
+      if (Nread == 0) {
+	done = TRUE;
+      }
+      
+    }
+    val[Nbytes] = 0;
+    status = pclose (f);
+    free (Cmd);
+    
+    if (status) {
+      gprint (GP_ERR, "warning: exit status of command %d\n", status);
+    }
+      
+    A = B = val;
+    for (i = 0; B != (char *) NULL;) {
+      while (isspace (*A) && (*A != 0)) A++;
+      B = strchr (A, '\n');
+      if (B != (char *) NULL) { *B = 0; }
+      if (*A != 0) {
+	sprintf (line, "%s:%d", argv[1], i);
+	set_str_variable (line, A);
+	A = B + 1;
+	i++;
+      }
+    }      
+    free (val);
+    
+    sprintf (line, "%s:n", argv[1]);
+    set_int_variable (line, i);
+    return (TRUE);
+  }
+
+  /* read in loop */
+  depth = 0;
+  ThisList = current_list_depth();
+  for (i = 0, done = FALSE; !done; ) {
+
+    /* get the next line (from correct place) */
+    if (ThisList == 0) 
+      input = readline (prompt);
+    else 
+      input = get_next_listentry (ThisList);
+
+    if (input == (char *) NULL) {
+      if (ThisList == 0)  {
+	gprint (GP_ERR, "end list with 'END'\n");
+	continue;
+      } else {
+	return (FALSE);
+      }	
+    }
+    stripwhite (input);
+
+    /* test for end of nested list -- if not nested, END refers to this macro */
+    if (!strncasecmp (input, "END", 3)) {
+      depth --;
+      if (depth < 0) { /* we hit the last "END", loop is done */
+	sprintf (line, "%s:n", argv[1]);
+	set_int_variable (line, i);
+	free (input);
+	return (TRUE);
+      }
+    }
+
+    if (*input) { 
+      sprintf (line, "%s:%d", argv[1], i);
+      set_str_variable (line, input);
+      i++;
+    }
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/list_help.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/list_help.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/list_help.c	(revision 15879)
@@ -0,0 +1,24 @@
+# include "basic.h"
+
+int list_help (int argc, char **argv) {
+
+  FILE *f;
+  int fd;
+  char filename[128], line[256];
+
+  sprintf (filename, "/tmp/status.XXXXXX");
+  if ((fd = mkstemp (filename)) == -1) {
+    gprint (GP_ERR, "error opening output\n");
+    return (FALSE);
+  }
+  f = fdopen (fd, "w");
+  if (f == (FILE *) NULL) f = stdout;
+  print_commands (f);
+  if (f != stdout) {
+    fclose (f);
+    sprintf (line, "more %s", filename);
+    system (line);
+  }
+  unlink (filename);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/list_vars.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/list_vars.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/list_vars.c	(revision 15879)
@@ -0,0 +1,8 @@
+# include "basic.h"
+
+int list_vars (int argc, char **argv) {
+
+  ListVariables ();
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/local.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/local.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/local.c	(revision 15879)
@@ -0,0 +1,33 @@
+# include "basic.h"
+
+int local (int argc, char **argv) {
+
+  int i, N, STATIC;
+  char *p;
+
+  /* create a variable named MacroDepth.argv[1] */
+
+  STATIC = FALSE;
+  if ((N = get_argument (argc, argv, "-static"))) {
+    remove_argument (N, &argc, argv);
+    STATIC = TRUE;
+  }
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: local (variable)\n");
+    return (FALSE);
+  }
+  
+  for (i = 1; i < argc; i++) {
+    if (STATIC) {
+      p = get_local_variable_ptr (argv[i]);
+      if (p == NULL) {
+	set_local_variable (argv[i], "NULL");
+      }
+    } else {
+      set_local_variable (argv[i], "NULL");
+    }      
+  }
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/macro.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/macro.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/macro.c	(revision 15879)
@@ -0,0 +1,43 @@
+# include "basic.h"
+
+int macro (int argc, char **argv) {
+
+  int status;
+  CommandF *cmd;
+
+  if ((argc != 2) && (argc != 3) && (argc != 4)) {
+    gprint (GP_ERR, "USAGE: macro (cmd)\n");
+    gprint (GP_ERR, "  (cmd) can be one of:\n");
+    gprint (GP_ERR, "    (name)         -- create macro (name)\n");
+    gprint (GP_ERR, "    create (name)  -- create macro (name)\n");
+    gprint (GP_ERR, "    delete (name)  -- delete macro (name)\n");
+    gprint (GP_ERR, "    list   (name)  -- list macro (name)\n");
+    gprint (GP_ERR, "    edit   (name)  -- edit macro (name) <not working yet!> *\n");
+    gprint (GP_ERR, "    read   (name)  -- read macro(s) from file (name) <not working yet!> *\n");
+    gprint (GP_ERR, "    write  (name)  -- write macro (name) to a file <not working yet!> *\n");
+    return (FALSE);
+  }
+
+  cmd = find_macro_command (argv[1]);
+  if (cmd != NULL) {
+    status = (*cmd) (argc - 1, argv + 1);
+  } else {
+    /* sub-command was not found, pass argv[1..N] to macro_create */
+    status = macro_create (argc, argv);
+  }
+
+  return (status);
+}
+
+/* macro is called with the command "macro".  
+   the command line word "macro" is meant to be followed the one of several 
+   possible options:
+   
+   macro create
+   macro delete
+   macro list
+   macro edit
+   macro read
+   macro write
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/memory.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/memory.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/memory.c	(revision 15879)
@@ -0,0 +1,48 @@
+# include "basic.h"
+
+// XXX add a warning if ohana_memory is not compiled in 
+int memory (int argc, char **argv) {
+  
+  if (argc < 2) goto usage;
+
+  if (!strcasecmp (argv[1], "all")) {
+    ohana_memdump (1);
+    return (TRUE);
+  }
+  if (!strcasecmp (argv[1], "leaks")) {
+    ohana_memdump (0);
+    return (TRUE);
+  }
+  if (!strcasecmp (argv[1], "check")) {
+    ohana_memcheck (0);
+    return (TRUE);
+  }
+  if (!strcasecmp (argv[1], "checkfree")) {
+    ohana_memcheck (1);
+    return (TRUE);
+  }
+  if (!strncasecmp ("variables", argv[1], strlen(argv[1]))) {
+    ListVariables ();
+    return (TRUE);
+  }
+  if (!strncasecmp ("vectors", argv[1], strlen(argv[1]))) {
+    ListVectors ();
+    return (TRUE);
+  }
+  if (!strncasecmp ("buffers", argv[1], strlen(argv[1]))) {
+    PrintBuffers (0);
+    return (TRUE);
+  }
+  if (!strncasecmp ("macros", argv[1], strlen(argv[1]))) {
+    ListMacros();
+    return (TRUE);
+  }
+  if (!strncasecmp ("commands", argv[1], strlen(argv[1]))) {
+    print_commands (stderr);
+    return (TRUE);
+  }
+
+usage:
+  gprint (GP_ERR, "USAGE: memory (all/leaks)\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/module.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/module.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/module.c	(revision 15879)
@@ -0,0 +1,77 @@
+# include "basic.h"
+# define D_NLINES 100
+
+/* module loads an opihi script files from the installed module tree */
+int module (int argc, char **argv) {
+  
+  int i, NLINES, Nmodules, Nbytes, status;
+  Macro inlist;
+  char modname[16], *modpath, *filename;
+  FILE *infile = NULL;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: module <filename>\n");
+    return (FALSE);
+  }
+
+  Nmodules = get_int_variable ("MODULES:n", &status);
+  if (!status) {
+    gprint (GP_ERR, "MODULES list not found\n");
+    return (FALSE);
+  }
+
+  /* search for requested file in MODULES:0 - MODULES:n */
+  for (i = 0; i < Nmodules; i++) {
+    snprintf (modname, 16, "MODULES:%d", i);
+    modpath = get_variable (modname);
+    if (modpath == NULL) {
+      gprint (GP_ERR, "MODULES list element %d not found\n", i);
+      return (FALSE);
+    }
+
+    Nbytes = strlen(modpath) + strlen(argv[1]) + 2;
+    ALLOCATE (filename, char, Nbytes);
+    snprintf (filename, Nbytes, "%s/%s", modpath, argv[1]);
+    
+    infile = fopen (filename, "r");
+    free (filename);
+
+    if (infile != NULL) break;
+  }
+  if (infile == NULL) {
+    gprint (GP_ERR, "module %s not found\n", argv[1]); 
+    return (FALSE);
+  }
+    
+  /* read file into the current list */
+  NLINES = D_NLINES;
+  ALLOCATE (inlist.line, char *, NLINES);
+  ALLOCATE (inlist.line[0], char, 1024);
+  for (i = 0; (scan_line (infile, inlist.line[i]) != EOF);) {
+    stripwhite (inlist.line[i]);
+    if (inlist.line[i][0] == 0) continue;
+    if (inlist.line[i][0] == '#') continue;
+    if (inlist.line[i][0] == '!') continue;
+
+    REALLOCATE (inlist.line[i], char, strlen(inlist.line[i]) + 1);
+    if (i == NLINES - 1) {
+      NLINES += D_NLINES;
+      REALLOCATE (inlist.line, char *, NLINES)
+    }
+    i++;
+    ALLOCATE (inlist.line[i], char, 1024);
+  }
+  inlist.Nlines = i;
+  fclose (infile);
+
+  /* process this list */
+  status = exec_loop (&inlist);
+
+  /* cleanup list */
+  for (i = 0; i < inlist.Nlines; i++) {
+    free (inlist.line[i]);
+  }
+  free (inlist.line[i]); /* note that we always alloc one extra line */
+  free (inlist.line);
+  return (status);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/output.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/output.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/output.c	(revision 15879)
@@ -0,0 +1,58 @@
+# include "basic.h"
+
+int output (int argc, char **argv) {
+  
+  int N, Noutput;
+  gpDest dest;
+  IOBuffer *buffer;
+  char *output, *current;
+
+  dest = GP_LOG;
+  if ((N = get_argument (argc, argv, "-err"))) {
+    dest = GP_ERR;
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "-current"))) {
+    current = gprintGetName (dest);
+    remove_argument (N, &argc, argv);
+    set_str_variable (argv[N], current);
+    remove_argument (N, &argc, argv);
+    return (TRUE);
+  }
+
+  if ((N = get_argument (argc, argv, "-buffer"))) {
+    remove_argument (N, &argc, argv);
+    gprintSetBuffer (dest);
+    return (TRUE);
+  }
+    
+  /* set the output target and dump the current buffer there */
+  if ((N = get_argument (argc, argv, "-dump"))) {
+    buffer = gprintGetBuffer (dest);
+    if (buffer == NULL) return (FALSE);
+
+    /* save the current buffer contents */
+    Noutput = buffer[0].Nbuffer;
+    ALLOCATE (output, char, Noutput);
+    memcpy (output, buffer[0].buffer, Noutput);
+    
+    /* set the output target to the specified name */
+    remove_argument (N, &argc, argv);
+    gprintSetFileAllThreads (dest, argv[N]);
+    remove_argument (N, &argc, argv);
+
+    /* send the output to the appropriate destination */
+    gwrite (output, 1, Noutput, dest);
+    free (output);
+    return (TRUE);
+  }
+    
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: output <filename> [-err] [-buffer] [-current var] [-dump filename]\n");
+    return (FALSE);
+  }
+
+  gprintSetFileAllThreads (dest, argv[1]);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/quit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/quit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/quit.c	(revision 15879)
@@ -0,0 +1,22 @@
+# include "basic.h"
+
+int quit (int argc, char **argv) {
+
+  int state;
+
+  cleanup ();
+
+  state = 0;
+  if (argc > 1) {
+    state = atof (argv[1]);
+  } 
+
+// the libedit version of readline does not support an incremental write to history file
+# ifndef RL_READLINE_VERSION
+  history = get_variable("HISTORY");
+  if (history != NULL) write_history (history);
+# endif
+
+  exit (state);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/run_for.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/run_for.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/run_for.c	(revision 15879)
@@ -0,0 +1,125 @@
+# include "basic.h"
+# define D_NLINES 100
+static char prompt[] = ">> ";
+
+int run_for (int argc, char **argv) {
+
+  int ThisList, depth, i, done, status, found, NLINES, j;
+  double start, end, delta;
+  char *input;
+  double value, sign;
+  Macro loop;
+
+  if ((argc != 4) && (argc != 5)) {
+    gprint (GP_ERR, "USAGE: for (var) (start) (stop) [delta] -- terminate with 'END'\n");
+    return (FALSE);
+  }
+
+  start = atof (argv[2]);
+  end   = atof (argv[3]);
+  delta = 1.0;
+  if (argc == 5) delta = atof (argv[4]);
+  sign = SIGN(delta);
+
+  NLINES = D_NLINES;
+  ALLOCATE (loop.line, char *, NLINES);
+
+  /* read in loop */
+  depth = 0;
+  ThisList = current_list_depth();
+  for (i = 0, done = FALSE; !done; ) {
+
+    /* get the next line (from correct place) */
+    if (ThisList == 0) 
+      input = readline (prompt);
+    else 
+      input = get_next_listentry (ThisList);
+    stripwhite (input);
+
+    /* check for end-of-data syntax error */
+    if (input == (char *) NULL) {
+      if (ThisList == 0)  {
+	gprint (GP_ERR, "end loop with 'END'\n");
+	continue;
+      } else {
+	gprint (GP_ERR, "misbalanced loop\n");
+	for (j = 0; j < loop.Nlines; j++) {
+	  free (loop.line[j]);
+	}
+	free (loop.line);
+	return (FALSE);
+      }	
+    }
+    if (ThisList == 0) ohana_memregister (input);
+
+    /* test for new macro (or other list, in the future?) */
+    if (is_list (input)) depth ++;
+
+    /* test for end of nested list -- if not nested, END refers to this macro */
+    if (!strncasecmp (input, "END", 3)) {
+      depth --;
+      if (depth < 0) break;
+    }
+
+    /* if line has data, add to loop list */
+    if (*input) { 
+      loop.line[i] = input;
+      i++;
+      if (i == NLINES - 1) {
+	NLINES += D_NLINES;
+	REALLOCATE (loop.line, char *, NLINES);
+      }
+    }
+  }
+
+  /* cleanup loop data */
+  free (input);
+  loop.Nlines = i;
+  REALLOCATE (loop.line, char *, MAX (loop.Nlines, 1));
+
+  status = TRUE;
+  interrupt = FALSE;
+  for (value = start; (sign*value < sign*end) && !interrupt; value += delta) {
+    if ((int)value == value) 
+      set_int_variable (argv[1], (int) value);
+    else 
+      set_variable (argv[1], value);
+    status = exec_loop (&loop);
+    value = get_double_variable (argv[1], &found);
+    if (loop_next) continue;
+    if (loop_last) break;
+    if (loop_break) break;
+  }
+  /* 'last' and 'next' should only affect one loop */
+  loop_last = loop_next = FALSE; 
+
+  /* break should propagate up if auto_break is set */
+  loop_break = FALSE;
+  if (auto_break && !status) loop_break = TRUE;
+
+  /* cleanup list */
+  for (j = 0; j < loop.Nlines; j++) {
+    free (loop.line[j]);
+  }
+  free (loop.line);
+
+  if (loop_break) return (FALSE);
+  return (TRUE);
+}
+
+/*
+  If we are entering at the keyboard (ThisList == 0), use readline.
+  Otherwise, read from the current list, remove list lines.
+  execute when we hit the final "END" (the true END -- we count macro defines!!) 
+*/
+     
+/* while processing the loop, the loop status variables may be set
+   by the loop commands, or the loop may quite on a failed command,
+   setting the exec_loop return status to false. the loop status variables
+   are:
+   loop_next : stop this loop, but try another loop
+   loop_last : stop loop processing, but return true so external loop may continue
+   loop_break : stop loop processing, and return false so external loop will break
+   interrupt : external interrupt signal
+*/
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/run_if.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/run_if.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/run_if.c	(revision 15879)
@@ -0,0 +1,127 @@
+# include "basic.h"
+# define prompt    "if: "
+
+int run_if (int argc, char **argv) {
+
+  int ThisList, depth, done, status, InlineCommand;
+  int i, length, logic;
+  char *input, *val, *line;
+  int nloop, size;
+
+  InlineCommand = FALSE;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: if (conditional) : follow with commands, end with the word 'END'\n");
+    gprint (GP_ERR, "   OR: if (conditional) command\n");
+    return (FALSE);
+  }
+  if (argc > 2) {
+    InlineCommand = TRUE;
+  }
+
+  /* determine value of conditional expression */
+  val = dvomath (1, &argv[1], &size, 0);
+  if (val == NULL) {
+    gprint (GP_ERR, "syntax error in logic: %s\n", argv[1]);
+    return (FALSE);
+  }
+  logic = atof (val); /* is round-off error a danger? */ 
+  free (val);
+
+  if (InlineCommand) {
+    if (logic) {
+      /* re-build a command line from the remaining strings */
+      length = 0;
+      for (i = 2; i < argc; i++) {
+	length += strlen(argv[i]) + 1;
+      }
+      length++;
+      ALLOCATE (line, char, length);
+      memset (line, 0, length);
+      for (i = 2; i < argc; i++) {
+	if (i == 2) {
+	  strcpy (line, argv[i]);
+	} else {
+	  strcat (line, " ");
+	  strcat (line, argv[i]);
+	}
+      }
+      status = multicommand (line);
+      free (line);
+      return (status);
+    } else {
+      return (TRUE);
+    }
+  }    
+
+  /* read in if-list */
+  nloop = 0;
+  depth = 0;
+  ThisList = current_list_depth();
+
+  done = FALSE;
+  while (!done) {
+
+    nloop ++;
+    /* get the next line (from correct place) */
+    if (ThisList == 0) {
+      input = readline (prompt);
+    } else {
+      input = get_next_listentry (ThisList);
+    }
+
+    if ((ThisList == 0) && (input == (char *) NULL)) {
+      gprint (GP_ERR, "end if-block with 'END'\n");
+      continue;
+    }
+    if ((ThisList >  0) && (input == (char *) NULL)) {
+      gprint (GP_ERR, "missing 'END' in if-block\n");
+      input = strcreate ("end");
+    }
+    if (ThisList == 0) ohana_memregister (input);
+
+    stripwhite (input);
+
+    /* test for new macro, search for "end" statement */
+    if (!logic && is_list (input)) {
+      depth ++;
+      free (input);
+      continue;
+    }
+    
+    /* check for an "else", invert logic */
+    if ((depth == 0) && !strncasecmp (input, "ELSE", 4)) {
+      logic ^= TRUE;
+      free (input);
+      continue;
+    }
+
+    /* test for end of nested block -- if not nested, END refers to this if */
+    if (!strncasecmp (input, "END", 3)) {
+      depth --;
+      if (depth < 0) { 
+	/* we hit the last "END", if-block is done */
+	free (input);
+	return (TRUE);	
+      }
+      free (input);  /* a do-nothing line */
+      continue;
+    }
+
+    if (logic) {
+      if (*input) { 
+	status = multicommand (input);
+	if (ThisList == 0) add_history (input);
+	if (auto_break && !status) return (FALSE);
+      }
+    } 
+    free (input);
+  }
+  return (TRUE);
+}
+
+/*
+     If we are entering at the keyboard (ThisList == 0), use readline.
+     Otherwise, read from the current list, remove list lines.
+     End when we hit the final "END" (the true END -- we count macro defines!!) 
+     */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/run_while.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/run_while.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/run_while.c	(revision 15879)
@@ -0,0 +1,109 @@
+# include "basic.h"
+# define D_NLINES 100
+static char prompt[] = ">> ";
+
+int run_while (int argc, char **argv) {
+
+  int ThisList, depth, i, done, status, NLINES, j;
+  char *input, *val, *logic_line;
+  int logic, size;
+  Macro loop;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: while (condition)\n");
+    return (FALSE);
+  }
+
+  val = dvomath (1, &argv[1], &size, 0);
+  if (val == NULL) return (FALSE);
+  logic = atof (val); /* warning: round-off error is a danger */
+  free (val);
+  
+  NLINES = D_NLINES;
+  ALLOCATE (loop.line, char *, NLINES);
+
+  /* read in loop */
+  depth = 0;
+  ThisList = current_list_depth();
+  for (i = 0, done = FALSE; !done; ) {
+
+    /* get the next line (from correct place) */
+    if (ThisList == 0) 
+      input = readline (prompt);
+    else 
+      input = get_next_listentry (ThisList);
+    stripwhite (input);
+
+    /* check for end-of-data syntax error */
+    if (input == (char *) NULL) {
+      if (ThisList == 0)  {
+	gprint (GP_ERR, "end 'while' loop with 'END'\n");
+	continue;
+      } else {
+	gprint (GP_ERR, "misbalanced 'while' loop\n");
+	for (j = 0; j < loop.Nlines; j++) {
+	  free (loop.line[j]);
+	}
+	free (loop.line);
+	return (FALSE);
+      }	
+    }
+    if (ThisList == 0) ohana_memregister (input);
+
+    /* test for new macro (or other list, in the future?) */
+    if (is_list (input)) depth ++;
+
+    /* test for end of nested list -- if not nested, END refers to this macro */
+    if (!strncasecmp (input, "END", 3)) {
+      depth --;
+      if (depth < 0) break;
+    }
+
+    /* if line has data, add to loop list */
+    if (*input) { 
+      loop.line[i] = input;
+      i++;
+      if (i == NLINES - 1) {
+	NLINES += D_NLINES;
+	REALLOCATE (loop.line, char *, NLINES);
+      }
+    }
+  }
+
+  /* cleanup loop data */
+  free (input);
+  loop.Nlines = i;
+  REALLOCATE (loop.line, char *, MAX (loop.Nlines, 1));
+
+  /* execute for loop */
+  do { 
+    status = exec_loop (&loop);
+    if (loop_next) continue;
+    if (loop_last) break;
+    if (loop_break) break;
+
+    logic_line = strcreate (argv[1]);
+    logic_line = expand_vars (logic_line);
+    val = dvomath (1, &logic_line, &size, 0);
+    free (logic_line);
+
+    if (val == NULL) return (FALSE);
+    logic = atof (val); /* warning: round-off error is a danger */
+    free (val);
+  } while (logic && !interrupt);
+  /* 'last' and 'next' should only affect one loop */
+  loop_last = loop_next = FALSE; 
+
+  /* break should propagate up if auto_break is set */
+  loop_break = FALSE;
+  if (auto_break && !status) loop_break = TRUE;
+
+  /* cleanup list */
+  for (j = 0; j < loop.Nlines; j++) {
+    free (loop.line[j]);
+  }
+  free (loop.line);
+
+  if (loop_break) return (FALSE);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/scan.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/scan.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/scan.c	(revision 15879)
@@ -0,0 +1,47 @@
+# include "basic.h"
+
+int scan (int argc, char **argv) {
+
+  int i, N, status;
+  char *line;
+  FILE *f;
+
+  if ((argc != 3) && (argc != 4)) {
+    gprint (GP_ERR, "USAGE: scan <filename> <var> [N]\n");
+    return (FALSE);
+  }
+
+  f = stdin;
+  if (strcmp (argv[1], "stdin")) {
+    f = fopen (argv[1], "r");
+    if (f == (FILE *) NULL) {
+      gprint (GP_ERR, "file %s not found\n", argv[1]);
+      return (FALSE);
+    }
+  }
+  
+  ALLOCATE (line, char, 1024);
+  N = 1;
+  if (argc == 4) {
+    N = atof(argv[3]);
+    if (N < 1) {
+      gprint (GP_ERR, "scan: line numbers must start at 1\n");
+      return (FALSE);
+    }
+  }
+
+  for (i = 0; (i < N) && ((status = scan_line (f, line)) != EOF); i++);
+  if (i < N) {
+    set_str_variable (argv[2], "EOF");
+  } else {
+    set_str_variable (argv[2], line);
+  }
+  free (line);
+
+  if (f != stdin) {
+    fclose (f);
+  }
+  return (TRUE);
+ 
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/shell.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/shell.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/shell.c	(revision 15879)
@@ -0,0 +1,71 @@
+# include "basic.h"
+
+int shell (int argc, char **argv) {
+  
+  int i, pid;
+  int exit_status;
+  int wait_status;
+  int result;
+  char **args;
+
+  ALLOCATE (args, char *, argc);
+  for (i = 1; i < argc; i++) {
+    args[i-1] = argv[i];
+  }
+  args[i-1] = NULL;
+
+  // use execvp to enable a timeout on the system call 
+  pid = fork ();
+  if (!pid) { /* must be child process */
+    execvp (args[0], args);
+    exit (1);
+  }
+  free (args);
+  
+  // wait for process to finish or timeout
+  for (i = 0; i < 200; i++) {
+    result = waitpid (pid, &wait_status, WNOHANG);
+    switch (result) {
+      case -1:   // error on waitpid
+	switch (errno) {
+	  case ECHILD:
+	    gprint (GP_ERR, "unknown PID, not a child process: %d\n", pid);
+	    return (FALSE);
+	  default:
+	    gprint (GP_ERR, "unexpected response to waitpid: %d\n", result);
+	    abort();
+	}
+	break;
+
+      case 0:   // child not yet exited
+	usleep (10000);
+	continue;
+
+      default:
+	if (result != pid) {
+	  gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, pid);
+	  abort();
+	}
+	if (WIFEXITED(wait_status)) {
+	  exit_status = WEXITSTATUS(wait_status);
+	  if (exit_status) {
+	    return FALSE;
+	  } else {
+	    return TRUE;
+	  }
+	}
+	if (WIFSIGNALED(wait_status)) {
+	  gprint (GP_ERR, "job %d exited on signal %d\n", pid, WTERMSIG(wait_status));
+	  return (FALSE);
+	}
+	if (WIFSTOPPED(wait_status)) {
+	  gprint (GP_ERR, "waitpid returns 'stopped' programming error\n");
+	  abort();
+	}
+    }
+  }
+
+  gprint (GP_ERR, "timeout on %d\n", pid);
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/sleep.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/sleep.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/sleep.c	(revision 15879)
@@ -0,0 +1,15 @@
+# include "basic.h"
+
+int exec_sleep (int argc, char **argv) {
+
+  int i;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "usage: sleep N\n");
+    return (FALSE);
+  }
+
+  i = atof (argv[1]);
+  sleep (i);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/sprintf.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/sprintf.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/sprintf.c	(revision 15879)
@@ -0,0 +1,82 @@
+# include "basic.h"
+# define NCHAR 1024
+
+/* convert line, tmp, fmt to dynamic strings? */
+
+int sprintf_opihi (int argc, char **argv) {
+
+  int i;
+  char line[NCHAR], tmp[NCHAR], fmt[NCHAR];
+  char *p1, *p2, *q;
+
+  if (argc < 3) {
+    gprint (GP_ERR, "USAGE: sprintf var format value value ...\n");
+    return (FALSE);
+  }
+
+  q  = line;
+  bzero (line, NCHAR);
+
+  p1 = argv[2];
+  for (i = 3; i < argc; i++) {
+    bzero (tmp, NCHAR);
+    bzero (fmt, NCHAR);
+
+    /* find next format character */
+    p2 = strchr (p1, '%');
+    if (p2 == (char *) NULL) {
+      gprint (GP_ERR, "mismatch between format and values\n");
+      return (FALSE);
+    }
+    if (strlen(q) + p2 - p1 > NCHAR) {
+      gprint (GP_ERR, "line too long");
+      return (FALSE);
+    }
+    memcpy (q, p1, p2-p1);
+    q = line + strlen(line);
+    
+    /* identify type (%NNNs %NNNNd %NNNNf) */
+    for (p1 = p2 + 1; (*p1 == '.') || (*p1 == '-') || (*p1 == '+') || (*p1 == ' ') || isdigit(*p1); p1++);
+    memcpy (fmt, p2, p1 - p2 + 1);
+    switch (*p1) {
+      case 'e':
+      case 'f':
+	sprintf (tmp, fmt, atof(argv[i]));
+	break;
+      case 's':
+	sprintf (tmp, fmt, argv[i]);
+	break;
+      case 'd':
+      case 'c':
+      case 'x':
+	sprintf (tmp, fmt, atoi(argv[i]));
+	break;
+      default:
+	gprint (GP_ERR, "syntax error in format (only e,f,s,d,c,x allowed)\n");
+	return (FALSE);
+    }
+    if (strlen(q) + strlen(tmp) > NCHAR) {
+      gprint (GP_ERR, "line too long");
+      return (FALSE);
+    }
+    memcpy (q, tmp, strlen(tmp));
+    q = line + strlen(line);
+    p1++;
+  }
+  p2 = strchr (p1, '%');
+  if (p2 != (char *) NULL) {
+    gprint (GP_ERR, "mismatch between format and values\n");
+    return (FALSE);
+  }
+  
+  p2 = p1 + strlen (p1);
+  if (strlen(q) + p2 - p1 > NCHAR) {
+    gprint (GP_ERR, "line too long");
+    return (FALSE);
+  }
+  memcpy (q, p1, p2-p1);
+  set_str_variable (argv[1], line);
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/strchr.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/strchr.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/strchr.c	(revision 15879)
@@ -0,0 +1,29 @@
+# include "basic.h"
+
+int getchr_func (int argc, char **argv) {
+
+  /* returns position of the first given character */ 
+  char *c;
+  int pos;
+
+  if ((argc != 3) && (argc != 4)) {
+    gprint (GP_ERR, "USAGE: strchr (string) (char) [var]\n");
+    return (FALSE);
+  }
+
+  c = strchr (argv[1], argv[2][0]);
+
+  if (c == (char *) NULL) {
+    pos = -1;
+  } else {
+    pos = c - argv[1];
+  }
+
+  if (argc == 5) {
+    set_variable (argv[3], pos);
+  } else {
+    gprint (GP_ERR, "%d\n", pos);
+  }
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/strlen.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/strlen.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/strlen.c	(revision 15879)
@@ -0,0 +1,22 @@
+# include "basic.h"
+
+int strlen_func (int argc, char **argv) {
+
+  /* returns length of the given string */ 
+  int len;
+
+  if ((argc != 2) && (argc != 3)) {
+    gprint (GP_ERR, "USAGE: strlen (string) [var]\n");
+    return (FALSE);
+  }
+
+  len = strlen (argv[1]);
+
+  if (argc == 3) {
+    set_int_variable (argv[2], len);
+  } else {
+    gprint (GP_ERR, "%d\n", len);
+  }
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/strpop.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/strpop.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/strpop.c	(revision 15879)
@@ -0,0 +1,35 @@
+# include "basic.h"
+
+int strpop (int argc, char **argv) {
+
+  char *p, *q, *string;
+
+  if ((argc != 2) && (argc != 3)) {
+    gprint (GP_ERR, "USAGE: strpop (var) [out]\n");
+    return (FALSE);
+  }
+
+  /* string is a copy of the value on the variable stack */
+  string = get_variable (argv[1]);
+  if (string == NULL) return (FALSE);
+  
+  /* thisword is an allocated string */
+  p = thisword (string);
+
+  q = nextword (string);
+  if (q == NULL) {
+    set_str_variable (argv[1], "NULL");
+  } else {
+    set_str_variable (argv[1], q);
+  }
+  
+  if (argc == 3) {
+    set_str_variable (argv[2], p);
+  } else {
+    gprint (GP_LOG, "%s\n", p);
+  }
+
+  free (p);
+  free (string);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/substr.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/substr.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/substr.c	(revision 15879)
@@ -0,0 +1,38 @@
+# include "basic.h"
+
+int substr_func (int argc, char **argv) {
+
+  int N1, N2, len;
+  char *c, *string;
+
+  if ((argc != 4) && (argc != 5)) {
+    gprint (GP_ERR, "USAGE: substr (string) N1 N2 [var]\n");
+    return (FALSE);
+  }
+
+  N1 = atof (argv[2]);
+  N2 = atof (argv[3]);
+
+  len = strlen (argv[1]);
+  if ((N1 >= len) || (N1 + N2 > len)) {
+    c = (char *) NULL;
+  } else {
+    c = strncreate (&argv[1][N1], N2);
+  }
+
+  if (c == (char *) NULL) {
+    string = strcreate ("");
+  } else {
+    string = strcreate (c);
+  }
+
+  if (argc == 5) {
+    set_str_variable (argv[4], string);
+  } else {
+    gprint (GP_ERR, "%s\n", string);
+  }
+  free (c);
+  free (string);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/break.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/break.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/break.sh	(revision 15879)
@@ -0,0 +1,19 @@
+
+list tests
+ test1
+end
+
+# test that break will halt operation
+macro test1
+ $PASS = 1
+ break -auto off
+ for i 0 10
+   if ($i == 5)
+     break
+   end
+ end
+ if ($i != 5)
+   $PASS = 0
+ end
+end
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/cd.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/cd.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/cd.sh	(revision 15879)
@@ -0,0 +1,34 @@
+
+list tests
+ test1
+ test2
+end
+
+# test that cd will go into a new directory
+macro test1
+ $PASS = 1
+ exec mkdir test.dir
+ output /dev/null
+ cd test.dir
+ exec touch foo.test
+ cd ..
+ output stdout
+ file test.dir/foo.test exists
+ if ($exists != 1)
+   $PASS = 0
+ end
+ exec rm -f test.dir/foo.test
+ exec rmdir test.dir
+end
+
+# test that pwd output is correct
+macro test2
+ $PASS = 1
+ exec touch foo.test
+ pwd -var testdir
+ file $testdir\/foo.test exists
+ if ($exists != 1)
+  $PASS = 0
+ end
+ exec rm foo.test
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/config.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/config.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/config.sh	(revision 15879)
@@ -0,0 +1,14 @@
+
+list tests
+ test1
+end
+
+# test that config does not return an error
+macro test1
+ $PASS = 1
+ config
+ if ($STATUS == 0)
+   $PASS = 0
+ end
+end
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/continue.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/continue.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/continue.sh	(revision 15879)
@@ -0,0 +1,18 @@
+
+list tests
+ test1
+end
+
+# test that continue skips within a loop
+macro test1
+ $PASS = 1
+ for i 0 10
+   if ($i > 5)
+      continue
+   end
+   $j = $i
+ end
+ if ($j != 5)
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/date.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/date.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/date.sh	(revision 15879)
@@ -0,0 +1,33 @@
+
+list tests
+ test1
+ test2
+end
+
+# test that date does not return an error
+macro test1
+ $PASS = 1
+ date -var var
+ if ($STATUS == 0)
+   $PASS = 0
+ end
+end
+
+# test that date constructs a reasonable sample date
+macro test2
+ $PASS = 1
+ date -var date1
+ $date2 = `date`
+ list w1 -split $date1
+ list w2 -split $date2
+ # check the first 3 entries (day, month, date)
+ if ($w1:0 != $w2:0)
+   $PASS = 0
+ end
+ if ($w1:1 != $w2:1)
+   $PASS = 0
+ end
+ if ($w1:2 != $w2:2)
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/echo.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/echo.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/echo.sh	(revision 15879)
@@ -0,0 +1,19 @@
+
+list tests
+ test1
+end
+
+# test that echo actually echoes
+macro test1
+ $PASS = 1
+ exec rm -f test.dat
+ output test.dat
+ echo foobar
+ output stdout
+ $line = `cat test.dat`
+ # exec rm -f test.dat
+ if ($line != foobar)
+   $PASS = 0
+ end
+end
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/file.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/file.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/file.sh	(revision 15879)
@@ -0,0 +1,19 @@
+
+list tests
+ test1
+end
+
+# test that the file test function works at all
+macro test1
+ $PASS = 1
+ exec touch foo.test
+ file foo.test exists
+ if ($exists != 1)
+   $PASS = 0
+ end
+ exec rm -f foo.test
+ file foo.test exists
+ if ($exists != 0)
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/for.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/for.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/for.sh	(revision 15879)
@@ -0,0 +1,216 @@
+
+list tests
+ test1
+ test2
+ test3
+ test4
+ test5
+ memtest1
+ memtest2
+ memtest3
+end
+
+# do we loop up correctly?
+macro test1
+
+  $PASS = 0
+
+  local i
+
+  for i 0 100
+  end    
+  
+ if ($i == 99)
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+
+end
+
+# do we loop down correctly?
+macro test2
+
+  $PASS = 0
+
+  local i
+
+  for i 100 0 -1
+  end    
+  
+ if ($i == 1)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i : $i"
+ end
+
+end
+
+# do we loop up in small steps correctly?
+macro test3
+
+  $PASS = 0
+
+  local i N
+
+  $N = 0
+  for i 0 100 0.1
+   $N = $N + 1
+  end    
+  
+ if (($i == 99.9) && ($N == 1000))
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i: $i"
+   echo "N: $N"
+ end
+
+end
+
+# do we loop down in small steps correctly?
+macro test4
+
+  $PASS = 0
+
+  local i N
+
+  $N = 0
+  for i 100 0 -0.1
+   $N = $N + 1
+  end    
+  
+ if (($i == 0.1) && ($N == 1000))
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i: $i"
+   echo "N: $N"
+ end
+
+end
+
+# do we break from a loop correctly
+macro test5
+
+  $PASS = 0
+
+  break -auto off
+
+  local i N
+
+  $N = 0
+  for i 0 100
+   $N = $N + 1
+   if ($i == 30)
+     break
+   end
+  end    
+
+  $PASS = 1
+  
+  if (($i != 30) || ($N != 31))
+    $PASS = 0
+    echo "i: $i"
+    echo "N: $N"
+  end
+end
+
+# check memleaks
+macro memtest1
+
+ $PASS = 0
+
+ local i N
+
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 10000
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks with many loop lines
+macro memtest2
+
+ $PASS = 0
+
+ local i N
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+  echo "test line in loop"
+  echo "test line in loop"
+  echo "test line in loop"
+  echo "test line in loop"
+  echo "test line in loop"
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks on break
+macro memtest3
+
+ $PASS = 0
+
+ local i N
+
+ break -auto off
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 10000
+  for j 0 5
+    break
+    echo "test line in loop"
+    echo "test line in loop"
+    echo "test line in loop"
+    echo "test line in loop"
+    echo "test line in loop"
+  end
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($i != 9999)
+   $PASS = 0
+   echo "break jumped outer loop: i = $i" 
+ end
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/fprintf.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/fprintf.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/fprintf.sh	(revision 15879)
@@ -0,0 +1,84 @@
+
+list tests
+ test1
+ test2
+ test3
+ test4
+ test5
+end
+
+macro test1
+ exec rm -f test.dat
+ output test.dat
+ fprintf "test %03d" 50
+ output stdout
+ $line = `cat test.dat`
+ if ("$line" == "test 050")
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+macro test2
+ exec rm -f test.dat
+ output test.dat
+ fprintf "test %6.3f" 123.45678
+ output stdout
+ $line = `cat test.dat`
+ if ("$line" == "test 123.457")
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+macro test3
+ exec rm -f test.dat
+ output test.dat
+ fprintf "test %x" 32
+ output stdout
+ $line = `cat test.dat`
+ if ("$line" == "test 20")
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+macro test4
+ exec rm -f test.dat
+ output test.dat
+ fprintf "test %10s" foobar
+ output stdout
+ $line = `cat test.dat`
+ if ("$line" == "test     foobar")
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+# check for memory leaks
+macro test5
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 1000
+   fprintf "test %10s" foobar
+ end
+ output stdout
+
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ($endmem - $startmem < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo growth: {$endmem - $startmem}
+   echo kB/loop: {($endmem - $startmem)/1000}
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/getchr.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/getchr.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/getchr.sh	(revision 15879)
@@ -0,0 +1,23 @@
+
+list tests
+ test1
+ test2
+end
+
+# index test
+macro test1
+ $PASS = 1
+ getchr "a long string.string" . var
+ if ($var != 13)
+   $PASS = 0
+ end
+end
+
+# null test
+macro test2
+ $PASS = 1
+ getchr "a long string.string" x var
+ if ($var != -1)
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/if.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/if.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/if.sh	(revision 15879)
@@ -0,0 +1,263 @@
+
+list tests
+ test1
+ test2
+ test3
+ test4
+ test5
+ test6
+ test7
+ test8
+ test9
+ test10
+ test11
+ test12
+ test13
+# test14
+end
+
+# basic logical test
+macro test1
+
+ local a
+
+ $a = 1
+
+ if ($a == 1)
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+
+# basic logical test
+macro test2
+
+ local a b
+
+ $a = 1
+ $b = 2
+
+ if (($a == 1) && ($b == 2))
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+
+# basic logical test
+macro test3
+
+ local a b
+
+ $a = 1
+ $b = 5
+
+ if (($a == 1) && ($b < 10))
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+
+# basic logical test
+macro test4
+
+ local a
+
+ $a = 0
+
+ if ($a == 1)
+   $PASS = 0
+ else
+   $PASS = 1
+ end
+end
+
+
+# basic logical test
+macro test5
+
+ local a
+
+ $a = 1
+
+ if ($a > 0)
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+
+# basic logical test
+macro test6
+
+ local a
+
+ $a = 1
+
+ if ($a < 2)
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+
+# basic logical test
+macro test7
+
+ local a
+
+ $a = test
+
+ if ("$a" == "test")
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+
+# basic logical test
+macro test8
+
+ local a
+
+ $a = foobar
+
+ if ("$a" == "test")
+   $PASS = 0
+ else
+   $PASS = 1
+ end
+end
+
+
+# basic logical test
+macro test9
+
+ local a b
+
+ $a = 1
+ $b = 2
+
+ if (($a == 0) || ($b == 2))
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+end
+
+
+# basic logical test
+macro test10
+
+ local a b
+
+ $a = 1
+ $b = 2
+
+ if (($a == 0) || ($b == 1))
+   $PASS = 0
+ else
+   $PASS = 1
+ end
+end
+
+
+# basic logical test
+macro test11
+
+ local a b
+
+ $a = 1
+ $b = 2
+
+ if (($a <= 0) || ($b >= 3))
+   $PASS = 0
+ else
+   $PASS = 1
+ end
+end
+
+
+# basic logical test
+macro test12
+
+ local a
+
+ $a = 1
+
+ if ($a != 1)
+   $PASS = 0
+ else
+   $PASS = 1
+ end
+end
+
+
+# check memleaks
+macro test13
+
+ local a b i N
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ $a = 1
+ $b = 2
+ for i 0 10000
+   if (($a == 1) && ($b == 2))
+    echo "run"    
+   end
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# memory test using break
+macro test14
+
+ local a b i N
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ $a = 1
+ $b = 2
+ for i 0 10000
+   if (($a == 1) && ($b == 2))
+    break
+    echo "run"    
+   end
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/list.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/list.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/list.sh	(revision 15879)
@@ -0,0 +1,174 @@
+list tests
+ test1
+ test2
+ test3
+ test4
+ memtest2
+ memtest3
+ memtest4
+end
+
+list check
+  this
+  is
+  a
+  list
+end
+
+# Does list work?
+macro test1
+ $PASS = 1
+ if ($check:n != 4)
+  $PASS = 0
+  echo "Number of list elements: $check:n"
+ end
+ if (("$check:0" != "this") || ("$check:1" != "is") || ("$check:2" != "a") || ("$check:3" != "list"))
+  $PASS = 0
+  echo "List element does not return correctly!"
+ end
+end
+
+# Test split option
+macro test2
+ $PASS = 1
+ list check2 -split This is a list
+ if ($check2:n != 4)
+  $PASS = 0
+  echo "Number of list elements: $check2:n"
+ end
+ if (("$check2:0" != "This") || ("$check2:1" != "is") || ("$check2:2" != "a") || ("$check2:3" != "list"))
+  $PASS = 0
+  echo "List element does not return correctly!"
+ end
+end
+
+# Test -x option for the ls command
+macro test3
+ $PASS = 1
+ list check3 -x "ls /dev/null"
+ if ($check3:n != 1)
+  $PASS = 0
+  echo "Number of list elements: $check3:n"
+ end
+ if ("$check3:0" != "/dev/null")
+  $PASS = 0
+  echo "List element does not return correctly!"
+ end
+end
+
+# Test -x for files
+macro test4
+ $PASS = 1
+ file list_test.txt fchk
+ if ($fchk)
+  exec rm list_test.txt
+ end
+ output list_test.txt
+ echo This
+ echo is
+ echo a
+ echo list
+ output stdout
+ list check4 -x "cat list_test.txt"
+ if ($check4:n != 4)
+  $PASS = 0
+  echo "Number of list elements: $check4:n"
+ end
+ if (("$check4:0" != "This ") || ("$check4:1" != "is ") || ("$check4:2" != "a ") || ("$check4:3" != "list "))
+  $PASS = 0
+  echo "List element does not return correctly!"
+ end
+ if ($PASS)
+  exec rm list_test.txt
+ end
+end
+
+# Memory test for list -split
+macro memtest2
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  list check2 -split This is a list
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+
+end
+
+# Memory test for list -x
+macro memtest3
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  list check3 -x "ls /dev/null"
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+
+end
+
+# Memory test for list -x
+macro memtest4
+
+ file list_test.txt fchk
+ if ($fchk)
+  exec rm list_test.txt
+ end
+ output list_test.txt
+ echo This
+ echo is
+ echo a
+ echo list
+ output stdout
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  list check4 -x "cat list_test.txt"
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+
+ if ($PASS)
+  exec rm list_test.txt
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/local.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/local.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/local.sh	(revision 15879)
@@ -0,0 +1,51 @@
+list tests
+ test1
+ memtest1
+end
+
+# Does local work?
+macro test1
+
+ $PASS = 1
+
+ local lvar
+
+ $lvar = 5
+
+ if ($?lvar != 1)
+  $PASS = 0
+  echo "Local variable failed to be created!"
+ end
+
+ if ($lvar != 5)
+  $PASS = 0
+  echo "Local variable value not assigned!"
+ end
+
+end
+
+
+# Memory test for local
+macro memtest1
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  local lvar2
+  $lvar2 = 9
+ end
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/macro.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/macro.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/macro.sh	(revision 15879)
@@ -0,0 +1,48 @@
+list tests
+ test_prep
+ test1
+ memtest1
+end
+
+# Is the macro working?
+macro test_prep
+ $test_var1 = check1
+ $test_var2 = check2
+ $var_count = $0
+end
+
+macro test1
+ $PASS = 1
+ $var_count = 0
+ $test_var1 = blank
+ $test_var2 = blank
+ test_prep var1 var2 var3
+ if ($var_count != 4)
+  $PASS = 0
+  echo "Number of parameters (should be 4): $var_count"
+ end
+ if (("$test_var1" != "check1") || ("$test_var2" != "check2"))
+  $PASS = 0
+  echo "Paramaters not assigned correctly!: $test_var1 $test_var2"
+ end
+end
+
+# Memory Test for macro
+macro memtest1
+ $PASS = 1
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 10000
+  test_prep
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/math.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/math.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/math.sh	(revision 15879)
@@ -0,0 +1,149 @@
+
+list tests
+ test1
+ test2
+ testmem1
+ testmem2
+ testmem3
+ testmem4
+end
+
+# test subtraction
+macro test1
+
+  $PASS = 1
+  local i
+
+  exec rm -f tmp.txt
+  output tmp.txt
+  echo {99 - 98}
+  output stdout
+
+  $i = `cat tmp.txt` 
+ 
+ if ($i != 1)
+   $PASS = 0
+   echo "i : $i"
+ end
+
+end
+
+# test addition, division, and multiplication
+macro test2
+
+ $PASS = 1
+ local a b c
+
+ $a = {2 + 4}
+ $b = {12 / 2}
+ $c = {2 * 3}
+
+ if (($a != 6) || ($b != 6) || ($c != 6))
+   $PASS = 0
+   echo "ALL VALUES NOT 6: a=$a\ b=$b\ c=$c\"
+ end
+
+end
+
+# check memleaks (set global)
+macro testmem1
+
+ $PASS = 1
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   echo {99 - 98}
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (set global)
+macro testmem2
+
+ $PASS = 1
+ local i N
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   $N = 99 - 98
+   $N = 1 + 1
+   $N = 2 * 2
+   $N = 22/7
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (set global)
+macro testmem3
+
+ $PASS = 1
+ local i N
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   $N = 99
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (set global)
+macro testmem4
+
+ $PASS = 1
+ local i N
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   $N = word
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/output.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/output.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/output.sh	(revision 15879)
@@ -0,0 +1,63 @@
+
+list tests
+ test1
+ testmem1
+end
+
+# test subtraction
+macro test1
+
+ $PASS = 1
+
+ output testout.txt
+
+ file testout.txt fchk
+ output stdout
+ if ($fchk != 1)
+  $PASS = 0
+  echo "Output did not create test file!"
+ end
+
+ output testout.txt
+ echo "This is a test."
+ output stdout
+ $line = `cat testout.txt`
+ if ("$line" == "This is a test. ")
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "Output: $line"
+ end
+
+ exec rm testout.txt
+
+end
+
+
+# check memleaks
+macro testmem1
+
+ $PASS = 1
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 1000
+  output testout.txt
+  echo "This is a test."
+  output stdout
+  exec rm testout.txt
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/scan.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/scan.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/scan.sh	(revision 15879)
@@ -0,0 +1,117 @@
+list tests
+ test1
+ memtest1
+ memtest2
+end
+
+# Does scan work?
+macro test1
+ $PASS = 1
+ file test_file.txt fchk
+ if ($fchk)
+  exec rm test_file.txt
+ end
+ output test_file.txt
+ echo This
+ echo is
+ echo a
+ echo test
+ echo file
+ output stdout
+ scan test_file.txt fscan
+ if ("$fscan" != "This ")
+  $PASS = 0
+  echo "Default not working!"
+ end
+ scan test_file.txt fscan 4
+ if ("$fscan" != "test ")
+  $PASS = 0
+  echo "Scan failure!"
+ end
+ if ($PASS)
+  exec rm test_file.txt
+ end
+end
+
+# Memory test for scan (default)
+macro memtest1
+
+ file test_file.txt fchk
+ if ($fchk)
+  exec rm test_file.txt
+ end
+ output test_file.txt
+ echo This
+ echo is
+ echo a
+ echo test
+ echo file
+ output stdout
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  scan test_file.txt fscan
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+
+ if ($PASS)
+  exec rm test_file.txt
+ end
+
+end
+
+
+# Memory test for scan (specified)
+macro memtest2
+
+ file test_file.txt fchk
+ if ($fchk)
+  exec rm test_file.txt
+ end
+ output test_file.txt
+ echo This
+ echo is
+ echo a
+ echo test
+ echo file
+ output stdout
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  scan test_file.txt fscan 5
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+
+ if ($PASS)
+  exec rm test_file.txt
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/shell.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/shell.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/shell.sh	(revision 15879)
@@ -0,0 +1,35 @@
+
+list tests
+ test1
+ test2
+end
+
+# test that a shell function works at all
+macro test1
+ $PASS = 1
+ exec touch foo.test
+ file foo.test exists
+ if ($exists != 1)
+   $PASS = 0
+ end
+ exec rm -f foo.test
+ file foo.test exists
+ if ($exists != 0)
+   $PASS = 0
+ end
+end
+
+# test that the shell status is returned
+macro test2
+ $PASS = 1
+ exec touch foo.test
+ exec ls foo.test >& /dev/null
+ if ($STATUS != 1)
+   $PASS = 0
+ end
+ exec rm -f foo.test
+ exec ls foo.test >& /dev/null
+ if ($STATUS != 0)
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/sleep.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/sleep.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/sleep.sh	(revision 15879)
@@ -0,0 +1,25 @@
+list tests
+ test1
+end
+
+# Does sleep work?
+macro test1
+ $PASS = 1
+
+ list tstart -x "date +%S"
+
+ sleep 3
+
+ list tend -x "date +%S"
+
+ if ($tstart:0 >= 57)
+  $tend:0 = $tend:0 + 60
+ end
+
+ $diff = abs (3 - abs($tstart:0 - $tend:0))
+
+ if ($diff > 1.1)
+  $PASS = 0
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/sprintf.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/sprintf.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/sprintf.sh	(revision 15879)
@@ -0,0 +1,43 @@
+list tests
+ test1
+ memtest1
+end
+
+# Does sprintf work?
+macro test1
+ $PASS = 1
+
+ local test_var
+
+ sprint test_var "%7s %5.2f %9.3e" float 34.5 12630000
+
+ if ("$test_var" != "  float 34.50 1.263e+07")
+  $PASS = 0
+ end
+
+end
+
+# Memory test
+macro memtest1
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 10000
+  sprint test_var "%7s %5.2f %9.3e" float 34.5 12630000
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/strlen.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/strlen.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/strlen.sh	(revision 15879)
@@ -0,0 +1,47 @@
+list tests
+ test1
+ memtest1
+end
+
+# Does strlen work?
+macro test1
+ 
+ $PASS = 1
+
+ $tstr = "Test string"
+
+ strlen $tstr len
+
+ if ($len != 11)
+  $PASS = 0
+  echo "Incorrect length: $len"
+ end
+
+end
+
+# Memory Test
+macro memtest1
+
+ local i
+
+ $tstr = "Test string"
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  strlen $tstr len
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/strpop.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/strpop.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/strpop.sh	(revision 15879)
@@ -0,0 +1,105 @@
+list tests
+ test1
+ test2
+ memtest1
+ memtest2
+end
+
+# Does strpop work with variables?
+macro test1
+
+ $PASS = 1
+
+ $tstr = a test string
+
+ local a b c
+
+ strpop tstr a
+ strpop tstr b
+ strpop tstr c
+
+ if (("$a" != "a") || ("$b" != "test") || ("$c" != "string"))
+  $PASS = 0
+  echo "Incorrect value returned!"
+ end
+end
+
+
+# Does strpop work with lists?
+macro test2
+
+ $PASS = 1
+
+ list tlis -split list of strings
+
+ local a b c
+
+ strpop tlis:0 a
+ strpop tlis:1 b
+ strpop tlis:2 c
+
+ if (("$a" != "list") || ("$b" != "of") || ("$c" != "strings"))
+  $PASS = 0
+  echo "Incorrect value returned!"
+ end
+end
+
+
+# Memory test for variables
+macro memtest1
+
+ local i tstr a b c d
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  $tstr = one two three
+  strlen tstr a
+  strlen tstr b
+  strlen tstr c
+  strlen tstr d
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+
+end
+
+
+# Memory test for lists
+macro memtest2
+
+ local i tstr a b c d
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  list tstr -split one two three
+  strlen tstr:0 a
+  strlen tstr:1 b
+  strlen tstr:2 c
+  strlen tstr:0 d
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/substr.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/substr.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/substr.sh	(revision 15879)
@@ -0,0 +1,49 @@
+list tests
+ test1
+ memtest1
+end
+
+# Does substr work?
+macro test1
+
+ $PASS = 1
+
+ local tstr ss
+
+ $tstr = "riddle me this"
+
+ substr $tstr 4 8 ss
+
+ if ("$ss" != "le me th")
+  $PASS = 0
+  echo "Incorrect substring returned!"
+ end
+end
+
+
+# Memory test
+macro memtest1
+
+ local i tstr ss
+
+ $tstr = "riddle me this"
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 10000
+  substr $tstr 4 8 ss
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/test.dat
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/test.dat	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/test.dat	(revision 15879)
@@ -0,0 +1,1 @@
+test     foobar
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/usleep.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/usleep.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/usleep.sh	(revision 15879)
@@ -0,0 +1,25 @@
+list tests
+ test1
+end
+
+# Does usleep work?
+macro test1
+ $PASS = 1
+
+ list tstart -x "date +%S"
+
+ usleep 3000000
+
+ list tend -x "date +%S"
+
+ if ($tstart:0 >= 57)
+  $tend:0 = $tend:0 + 60
+ end
+
+ $diff = abs (3 - abs($tstart:0 - $tend:0))
+
+ if ($diff > 1.1)
+  $PASS = 0
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/variable.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/variable.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/variable.sh	(revision 15879)
@@ -0,0 +1,504 @@
+
+list tests
+ test1
+ test2
+ test3
+ test4
+ test5
+ test6
+ test7
+ test8
+ test9
+ test10
+ test11
+ test12
+ test13
+ test14
+ testmem1
+ testmem2
+ testmem3
+ testmem4
+ testmem5
+ testmem6
+ testmem7
+ testmem8
+ testmem9
+ testmem10
+end
+
+# do we set variables correctly?
+macro test1
+
+ local i
+
+ $i = 99
+  
+ if ($i == 99)
+   $PASS = 1
+ else
+   $PASS = 0
+ end
+
+end
+
+# do math expressions assign the correct value (test2 -> test8)
+macro test2
+
+  local i
+
+  $i = 99 - 98
+  
+ if ($i == 1)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i : $i"
+ end
+
+end
+
+macro test3
+
+  local i
+
+  $i = 2*3
+  
+ if ($i == 6)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i: $i"
+ end
+
+end
+
+macro test4
+
+  local i
+
+  $i = 2^3
+
+ if ($i == 8)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i: $i"
+ end
+
+end
+
+macro test5
+
+  local i
+
+  $i = 2+3
+
+ if ($i == 5)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i: $i"
+ end
+
+end
+
+macro test6
+
+  local i
+
+  $i = 6/3
+
+ if ($i == 2)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i: $i"
+ end
+
+end
+
+# testing operation priority
+macro test7
+
+  local i j
+
+  $i = 2 - 3*2
+  $j = 10/2*5+5
+
+ if (($i == -4) && ($j == 30))
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i: $i\ j: $j"
+ end
+
+end
+
+# testing math on negative numbers
+macro test8
+
+  local i
+
+  $i = -2 - -3
+
+ if ($i == 1)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i: $i"
+ end
+
+end
+
+# testing the existance of variables
+macro test9
+
+  local i
+
+  $i = 0
+
+ if ($?i == 1)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "i: $i"
+ end
+end
+
+# test increment
+macro test10
+
+  local i N
+
+  $N = 0
+  for i 0 100
+    $N ++
+  end
+
+  if ($N == 100)
+   $PASS = 1
+  else
+   $PASS = 0
+   echo "N: $N"
+ end
+end
+
+# test decrement
+macro test11
+
+  local i N
+
+  $N = 100
+  for i 0 100
+    $N --
+  end
+
+  if ($N == 0)
+   $PASS = 1
+  else
+   $PASS = 0
+   echo "N: $N"
+ end
+end
+
+# test command assign
+macro test12
+
+  local i N
+
+  $N = `ls -dF /etc`
+
+  if ("$N" == "/etc/")
+   $PASS = 1
+  else
+   $PASS = 0
+   echo "N: $N"
+ end
+end
+
+# test vector assign
+macro test13
+
+  local i N
+
+  create v1 0 100
+  v1[5] = 10
+  set v2 = v1 + 20
+
+  if (v2[5] == 30)
+   $PASS = 1
+  else
+   $PASS = 0
+   echo "v1\[5\]: v1[5]"
+   echo "v2\[5\]: v2[5]"
+ end
+end
+
+# test local variables
+macro test14
+
+ $PASS = 1
+
+ if (($?i == 1) || ($?N == 1))
+  $PASS = 0
+ end
+end
+
+# check memleaks (set global)
+macro testmem1
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 10000
+   $Nvar = 10
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (set string)
+macro testmem2
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   $Nvar = test line
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (set double)
+macro testmem3
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 10000
+   $Nvar = 5.212
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (set local)
+macro testmem4
+
+ local i N
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 10000
+   $N = 10
+ end    
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (existence)
+macro testmem5
+
+ local i N
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   echo $?N
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (get variable)
+macro testmem6
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ $Nvar = 5
+ output /dev/null
+ for i 0 10000
+   echo $Nvar
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (increment)
+macro testmem7
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ $Nvar = 0
+ output /dev/null
+ for i 0 10000
+   $Nvar ++
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (decrement)
+macro testmem8
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ $Nvar = 10000
+ output /dev/null
+ for i 0 10000
+   $Nvar --
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# check memleaks (command)
+macro testmem9
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 100
+   $Nvar = `ls -d /etc`
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/100}"
+ end
+end
+
+# check memleaks (vector assign)
+macro testmem10
+
+ local i
+
+ create v1 0 100
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   v1[5] = $i
+ end    
+ output stdout
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/while.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/while.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/test/while.sh	(revision 15879)
@@ -0,0 +1,19 @@
+list tests
+ test1
+end
+
+# Does while work?
+macro test1
+ $PASS = 1
+ local i
+ $i = 0
+ while ($i <= 10)
+  if ($i == 11)
+   $PASS = 0
+   echo "While loop failure!"
+   echo "i: $i"
+   break
+  end
+  $i++
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/usleep.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/usleep.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/usleep.c	(revision 15879)
@@ -0,0 +1,15 @@
+# include "basic.h"
+
+int exec_usleep (int argc, char **argv) {
+
+  int i;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "usage: usleep N\n");
+    return (FALSE);
+  }
+
+  i = atof (argv[1]);
+  usleep (i);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/wait.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/wait.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/wait.c	(revision 15879)
@@ -0,0 +1,14 @@
+# include "basic.h"
+
+int wait_func (int argc, char **argv) {
+
+  char buff[1024];
+  int i;
+
+  for (i = 1; i < argc; i++) {
+    gprint (GP_ERR, "%s ", argv[i]);
+  }
+  gprint (GP_ERR, "\n");
+  scan_line (stdin, buff);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/which.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/which.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.basic/which.c	(revision 15879)
@@ -0,0 +1,18 @@
+# include "basic.h"
+
+int which (int argc, char **argv) {
+
+  Command *cmd;
+ 
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: which <filename>\n");
+    return (FALSE);
+  }
+
+  cmd = MatchCommand (argv[1], TRUE, TRUE);
+  if (cmd == NULL) return (FALSE);
+
+  gprint (GP_ERR, "%-25s -- %s\n", cmd[0].name, cmd[0].help);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/Makefile	(revision 15879)
@@ -0,0 +1,155 @@
+default: libdatacmd
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+SRC     =       $(HOME)/cmd.data
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+DATA    =       $(DESTDATA)/mana
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+FULL_CFLAGS   = $(BASE_CFLAGS) -fPIC
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(BASE_LDFLAGS)
+
+# data user commands ########################
+srcs = \
+$(SRC)/init.$(ARCH).o          \
+$(SRC)/accum.$(ARCH).o		\
+$(SRC)/applyfit2d.$(ARCH).o	\
+$(SRC)/applyfit.$(ARCH).o	\
+$(SRC)/box.$(ARCH).o		\
+$(SRC)/book.$(ARCH).o		\
+$(SRC)/book_commands.$(ARCH).o	\
+$(SRC)/center.$(ARCH).o	\
+$(SRC)/clear.$(ARCH).o		\
+$(SRC)/clip.$(ARCH).o		\
+$(SRC)/close.$(ARCH).o		\
+$(SRC)/concat.$(ARCH).o	\
+$(SRC)/contour.$(ARCH).o	\
+$(SRC)/create.$(ARCH).o	\
+$(SRC)/cumulative.$(ARCH).o	\
+$(SRC)/cursor.$(ARCH).o	\
+$(SRC)/cut.$(ARCH).o		\
+$(SRC)/delete.$(ARCH).o	\
+$(SRC)/device.$(ARCH).o	\
+$(SRC)/dimendown.$(ARCH).o	\
+$(SRC)/dimenup.$(ARCH).o	\
+$(SRC)/dbconnect.$(ARCH).o	\
+$(SRC)/dbselect.$(ARCH).o	\
+$(SRC)/erase.$(ARCH).o		\
+$(SRC)/extract.$(ARCH).o	\
+$(SRC)/fft1d.$(ARCH).o		\
+$(SRC)/fft2d.$(ARCH).o		\
+$(SRC)/fit2d.$(ARCH).o		\
+$(SRC)/fit.$(ARCH).o		\
+$(SRC)/gaussj.$(ARCH).o	\
+$(SRC)/gaussdeviate.$(ARCH).o	\
+$(SRC)/grid.$(ARCH).o		\
+$(SRC)/gridify.$(ARCH).o       \
+$(SRC)/ungridify.$(ARCH).o     \
+$(SRC)/histogram.$(ARCH).o	\
+$(SRC)/imcut.$(ARCH).o	 	\
+$(SRC)/imhist.$(ARCH).o	\
+$(SRC)/imsmooth.$(ARCH).o	\
+$(SRC)/integrate.$(ARCH).o	\
+$(SRC)/interpolate.$(ARCH).o	\
+$(SRC)/jpeg.$(ARCH).o		\
+$(SRC)/kern.$(ARCH).o		\
+$(SRC)/keyword.$(ARCH).o	\
+$(SRC)/labels.$(ARCH).o	\
+$(SRC)/limits.$(ARCH).o	\
+$(SRC)/line.$(ARCH).o		\
+$(SRC)/list_buffers.$(ARCH).o	\
+$(SRC)/list_header.$(ARCH).o	\
+$(SRC)/list_vectors.$(ARCH).o	\
+$(SRC)/load.$(ARCH).o		\
+$(SRC)/lookup.$(ARCH).o	\
+$(SRC)/mkrgb.$(ARCH).o	\
+$(SRC)/mcreate.$(ARCH).o	\
+$(SRC)/medacc.$(ARCH).o	\
+$(SRC)/mget.$(ARCH).o		\
+$(SRC)/minterpolate.$(ARCH).o	\
+$(SRC)/mset.$(ARCH).o		\
+$(SRC)/peak.$(ARCH).o		\
+$(SRC)/periodogram.$(ARCH).o	\
+$(SRC)/plot.$(ARCH).o		\
+$(SRC)/dot.$(ARCH).o		\
+$(SRC)/point.$(ARCH).o		\
+$(SRC)/ps.$(ARCH).o		\
+$(SRC)/queuedelete.$(ARCH).o	\
+$(SRC)/queuedrop.$(ARCH).o	\
+$(SRC)/queuelist.$(ARCH).o	\
+$(SRC)/queueload.$(ARCH).o	\
+$(SRC)/queuesize.$(ARCH).o	\
+$(SRC)/queuepush.$(ARCH).o	\
+$(SRC)/queuepop.$(ARCH).o	\
+$(SRC)/queueprint.$(ARCH).o	\
+$(SRC)/queueinit.$(ARCH).o	\
+$(SRC)/radial.$(ARCH).o	\
+$(SRC)/rd.$(ARCH).o		\
+$(SRC)/rdseg.$(ARCH).o		\
+$(SRC)/read_vectors.$(ARCH).o	\
+$(SRC)/rebin.$(ARCH).o		\
+$(SRC)/resize.$(ARCH).o	\
+$(SRC)/roll.$(ARCH).o		\
+$(SRC)/rotate.$(ARCH).o	\
+$(SRC)/save.$(ARCH).o		\
+$(SRC)/section.$(ARCH).o	\
+$(SRC)/select.$(ARCH).o	\
+$(SRC)/set.$(ARCH).o		\
+$(SRC)/shift.$(ARCH).o		\
+$(SRC)/sort.$(ARCH).o		\
+$(SRC)/spline_apply.$(ARCH).o	\
+$(SRC)/spline_construct.$(ARCH).o \
+$(SRC)/stats.$(ARCH).o		   \
+$(SRC)/style.$(ARCH).o		   \
+$(SRC)/subraster.$(ARCH).o	   \
+$(SRC)/subset.$(ARCH).o	   \
+$(SRC)/svd.$(ARCH).o		   \
+$(SRC)/swapbytes.$(ARCH).o	   \
+$(SRC)/textline.$(ARCH).o	   \
+$(SRC)/tv.$(ARCH).o		   \
+$(SRC)/tvcontour.$(ARCH).o	   \
+$(SRC)/tvgrid.$(ARCH).o	   \
+$(SRC)/uniq.$(ARCH).o		   \
+$(SRC)/unsign.$(ARCH).o	   \
+$(SRC)/vbin.$(ARCH).o		   \
+$(SRC)/vclip.$(ARCH).o		   \
+$(SRC)/vgauss.$(ARCH).o           \
+$(SRC)/vmaxwell.$(ARCH).o           \
+$(SRC)/vgrid.$(ARCH).o		   \
+$(SRC)/vload.$(ARCH).o		   \
+$(SRC)/vpop.$(ARCH).o		   \
+$(SRC)/vroll.$(ARCH).o		   \
+$(SRC)/vsmooth.$(ARCH).o	\
+$(SRC)/vstat.$(ARCH).o		   \
+$(SRC)/wd.$(ARCH).o		   \
+$(SRC)/write_vectors.$(ARCH).o	   \
+$(SRC)/zap.$(ARCH).o		   \
+$(SRC)/zplot.$(ARCH).o
+
+# dependancy rules for include files ########################
+incs = \
+$(INC)/opihi.h \
+$(INC)/external.h \
+$(INC)/shell.h \
+$(INC)/dvomath.h \
+$(INC)/convert.h \
+$(INC)/display.h 
+
+$(srcs): $(incs)
+
+$(LIB)/libdatacmd.$(ARCH).a: $(srcs)
+$(LIB)/libdatacmd.$(ARCH).$(DLLTYPE): $(srcs)
+
+$(DESTLIB)/libdatacmd.a: $(LIB)/libdatacmd.$(ARCH).a
+$(DESTLIB)/libdatacmd.$(DLLTYPE): $(LIB)/libdatacmd.$(ARCH).$(DLLTYPE)
+
+libdatacmd: $(DESTLIB)/libdatacmd.a  $(DESTLIB)/libdatacmd.$(DLLTYPE)
+
+uninstall:
+	rm -f $(DESTLIB)/libdatacmd.a
+	rm -f $(DESTLIB)/libdatacmd.$(DLLTYPE)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/accum.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/accum.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/accum.c	(revision 15879)
@@ -0,0 +1,74 @@
+# include "data.h"
+
+int accum (int argc, char **argv) {
+  
+  int i, Nbins, bin, N, Normalize;
+  float start, end, delta;
+  float *V, *K, *O, *NV;
+  Vector *val, *key, *out;
+
+  NV = NULL;
+  Normalize = FALSE;
+  if ((N = get_argument (argc, argv, "-norm"))) {
+    remove_argument (N, &argc, argv);
+    Normalize = TRUE;
+  }
+
+  if ((argc != 6) && (argc != 7)) {
+    gprint (GP_ERR, "USAGE: accum <value> <vector> <key> start end [delta]\n");
+    gprint (GP_ERR, "  sum <value> in bins corresponding to the value of <key>\n");
+    return (FALSE);
+  }
+
+  if ((val = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((key = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if (val[0].Nelements != key[0].Nelements) {
+    gprint (GP_ERR, "key and value don't match\n");
+    return (FALSE);
+  }
+  if ((out = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  start = atof (argv[4]);
+  end   = atof (argv[5]);
+  if (argc == 7) 
+    delta = atof (argv[6]);
+  else 
+    delta = 1;
+  if ((start == end) || (delta == 0)) {
+    gprint (GP_ERR, "error in value: %f to %f, %f\n", start, end, delta);
+    return (FALSE);
+  }
+  delta = fabs (delta);
+  if (end - start < 0) {
+    delta = -1.0 * delta;
+  }
+  Nbins = (end - start) / delta;
+
+  out[0].Nelements = Nbins;
+  REALLOCATE (out[0].elements, float, out[0].Nelements);
+  bzero (out[0].elements, sizeof(float)*out[0].Nelements);
+  if (Normalize) {
+    ALLOCATE (NV, float, Nbins);
+    bzero (NV, sizeof(float)*Nbins);
+  }
+
+  V = val[0].elements;
+  K = key[0].elements;
+  O = out[0].elements;
+
+  for (i = 0; i < val[0].Nelements; i++, V++, K++) {
+    bin = MIN (MAX (0, (*K - start) / delta), Nbins - 1);
+    O[bin] += *V;
+    if (Normalize) NV[bin] ++;
+  }      
+
+  if (Normalize) {
+    for (i = 0; i < Nbins; i++) {
+      O[i] /= (float) NV[i];
+    }
+    free (NV);
+  }
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/applyfit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/applyfit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/applyfit.c	(revision 15879)
@@ -0,0 +1,59 @@
+# include "data.h"
+
+char *get_variable (char *);
+
+int applyfit (int argc, char **argv) {
+  
+  int i, j, order;
+  char *c, name[64];
+  double *C, X;
+  float *x, *y;
+  Vector *xvec, *yvec;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: applyfit x y\n");
+    return (FALSE);
+  }
+
+  c = get_variable ("Cn");
+  if (c == (char *) NULL) {
+    gprint (GP_ERR, "no fit available\n");
+    return (FALSE);
+  }
+  order = atof (c);
+
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+  if ((yvec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);    
+
+  ALLOCATE (C, double, order+1);
+  for (i = 0; i < order + 1; i++) {
+    sprintf (name, "C%d", i);
+    c = get_variable (name);
+    if (c == (char *) NULL) {
+      gprint (GP_ERR, "missing fit term %d\n", i);
+      return (FALSE);
+    }
+    C[i] = atof (c);
+  }
+  yvec[0].Nelements = xvec[0].Nelements;
+  REALLOCATE (yvec[0].elements, float, yvec[0].Nelements);
+  bzero (yvec[0].elements, sizeof(float)*yvec[0].Nelements);
+  x = xvec[0].elements;
+  y = yvec[0].elements;
+
+  for (j = 0; j < xvec[0].Nelements; j++, x++, y++) {
+    X = 1;
+    for (i = 0; i < order + 1; i++) {
+      *y += C[i]*X;
+      X = X * (*x);
+    }
+  }
+
+  free (C);
+  return (TRUE);
+
+}
+
+
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/applyfit2d.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/applyfit2d.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/applyfit2d.c	(revision 15879)
@@ -0,0 +1,68 @@
+# include "data.h"
+
+char *get_variable (char *);
+
+int applyfit2d (int argc, char **argv) {
+  
+  int i, j, n, order;
+  char *c, name[64];
+  double **C, X, Y;
+  float *x, *y, *z;
+  Vector *xvec, *yvec, *zvec;
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: applyfit x y z\n");
+    return (FALSE);
+  }
+
+  c = get_variable ("Cnn");
+  if (c == (char *) NULL) {
+    gprint (GP_ERR, "no fit available\n");
+    return (FALSE);
+  }
+  order = atof (c);
+
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+  if ((zvec = SelectVector (argv[3], ANYVECTOR, TRUE)) == NULL) return (FALSE);    
+
+  ALLOCATE (C, double *, order+1);
+  for (i = 0; i < order + 1; i++) {
+    ALLOCATE (C[i], double, order+1);
+    for (j = 0; j < order + 1 - i; j++) {
+      sprintf (name, "CX%dY%d", i, j);
+      c = get_variable (name);
+      if (c == (char *) NULL) {
+	gprint (GP_ERR, "missing fit term %d,%d\n", i, j);
+	return (FALSE);
+      }
+      C[i][j] = atof (c);
+    }
+  }
+
+  zvec[0].Nelements = xvec[0].Nelements;
+  REALLOCATE (zvec[0].elements, float, zvec[0].Nelements);
+  bzero (zvec[0].elements, sizeof(float)*zvec[0].Nelements);
+  x = xvec[0].elements;
+  y = yvec[0].elements;
+  z = zvec[0].elements;
+
+  for (n = 0; n < xvec[0].Nelements; n++, x++, y++, z++) {
+    Y = X = 1;
+    for (j = 0; j < order + 1; j++) {
+      X = Y;
+      for (i = 0; i < order + 1 - j; i++) {
+	*z += C[i][j]*X;
+	X = X * (*x);
+      }
+      Y = Y * (*y);
+    }
+  }
+
+  return (TRUE);
+
+}
+
+
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/book.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/book.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/book.c	(revision 15879)
@@ -0,0 +1,81 @@
+# include "data.h"
+
+int book_list (int argc, char **argv);
+int book_init (int argc, char **argv);
+int book_create (int argc, char **argv);
+int book_delete (int argc, char **argv);
+int book_getbook (int argc, char **argv);
+int book_listbook (int argc, char **argv);
+int book_npages (int argc, char **argv);
+int book_newpage (int argc, char **argv);
+int book_getpage (int argc, char **argv);
+int book_delpage (int argc, char **argv);
+int book_listpage (int argc, char **argv);
+int book_setword (int argc, char **argv);
+int book_getword (int argc, char **argv);
+
+static Command book_commands[] = {
+  {"list",     book_list,     "list books"},
+  {"init",     book_init,     "initialize a book"},
+  {"create",   book_create,   "create a book"},
+  {"delete",   book_delete,   "delete a book"},
+  {"getbook",  book_getbook,  "get book name by location"},
+  {"listbook", book_listbook, "list pages in a book"},
+  {"npages",   book_npages,   "return number of pages in a book"},
+  {"newpage",  book_newpage,  "create a new page in a book"},
+  {"getpage",  book_getpage,  "get page name by location"},
+  {"delpage",  book_delpage,  "delete a page in a book"},
+  {"listpage", book_listpage, "list a page in a book"},
+  {"setword",  book_setword,  "set the value of a word in a page"},
+  {"getword",  book_getword,  "set the value of a word from a page"},
+};
+
+int book_command (int argc, char **argv) {
+
+  int i, N, status;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: book (command)\n");
+    gprint (GP_ERR, "    book list                                  : list books\n");
+    gprint (GP_ERR, "    book init     (book)                       : removes all pages from book\n");
+    gprint (GP_ERR, "    book create   (book)                       : create a book\n");
+    gprint (GP_ERR, "    book delete   (book)                       : delete a book\n");
+    gprint (GP_ERR, "    book getbook  (where) [-var var]           : get book name\n");
+    gprint (GP_ERR, "    book listbook (book)                       : list a book\n");
+    gprint (GP_ERR, "    book npages   (book) [-var var] [-key key] : return number of pages in a book\n");
+    gprint (GP_ERR, "    book newpage  (book) (page)                : create a new page in a book\n");
+    gprint (GP_ERR, "    book getpage  (book) (where) [-var var] [-key key value] : get page name in a book\n");
+    gprint (GP_ERR, "    book delpage  (book) (page) [-key key]     : delete a page in a book\n");
+    gprint (GP_ERR, "    book delpage  (book) -key name value       : delete a page in a book\n");
+    gprint (GP_ERR, "    book listpage (book) (page)                : list a page in a book\n");
+    gprint (GP_ERR, "    book setword  (book) (page) (word) (value) : set the value of a word in a page\n");
+    gprint (GP_ERR, "    book getword  (book) (page) (word) [-var var] : set the value of a word from a page\n");
+    return (FALSE);
+  }
+
+  N = sizeof (book_commands) / sizeof (Command);
+
+  /* find the book sub-command which matches */
+  for (i = 0; i < N; i++) {
+    if (!strcmp (book_commands[i].name, argv[1])) {
+      status = (*book_commands[i].func) (argc - 1, argv + 1);
+      return (status);
+    }
+  }
+
+  gprint (GP_ERR, "unknown book command %s\n", argv[1]);
+  return (FALSE);
+}
+
+/* book is called with the command "book".  
+   the command line word "book" is meant to be followed the one of several 
+   possible options:
+   
+   book create
+   book delete
+   book list
+   book edit
+   book read
+   book write
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/book_commands.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/book_commands.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/book_commands.c	(revision 15879)
@@ -0,0 +1,439 @@
+# include "data.h"
+
+int book_list (int argc, char **argv) {
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: book list\n");
+    return FALSE;
+  }
+
+  ListBooks();
+  return TRUE;
+}
+
+int book_create (int argc, char **argv) {
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: book create (book)\n");
+    return FALSE;
+  }
+
+  CreateBook (argv[1]);
+  return TRUE;
+}
+
+int book_delete (int argc, char **argv) {
+
+  int status;
+  Book *book;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: book delete (book)\n");
+    return FALSE;
+  }
+
+  book = FindBook (argv[1]);
+  if (book == NULL) {
+    gprint (GP_ERR, "book %s not found\n", argv[1]);
+    return FALSE;
+  }
+
+  status = DeleteBook (book);
+  if (!status) abort ();
+  return TRUE;
+}
+
+int book_init (int argc, char **argv) {
+
+  int status;
+  Book *book;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: book init (book)\n");
+    return FALSE;
+  }
+
+  book = FindBook (argv[1]);
+  if (book != NULL) {
+      status = DeleteBook (book);
+      if (!status) abort ();
+  }
+
+  CreateBook (argv[1]);
+  return TRUE;
+}
+
+int book_listbook (int argc, char **argv) {
+
+  Book *book;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: book listbook (book)\n");
+    return FALSE;
+  }
+
+  book = FindBook (argv[1]);
+  if (book == NULL) {
+    gprint (GP_ERR, "book %s not found\n", argv[1]);
+    return FALSE;
+  }
+
+  ListPages (book);
+  return TRUE;
+}
+
+int book_npages (int argc, char **argv) {
+
+  int i, N, Npages;
+  Book *book;
+  char *varName;
+  char *Key, *Value, *value;
+
+  varName = NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    varName = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  Key = NULL;
+  Value = NULL;
+  if ((N = get_argument (argc, argv, "-key"))) {
+    remove_argument (N, &argc, argv);
+    Key = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    Value = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: book npages (book) [-var result] [-key name value]\n");
+    gprint (GP_ERR, "  reports the number of pages (optionally limited to those matching the key)\n");
+    FREE (varName);
+    return FALSE;
+  }
+
+  book = FindBook (argv[1]);
+  if (book == NULL) {
+    gprint (GP_ERR, "book %s not found\n", argv[1]);
+    FREE (varName);
+    return FALSE;
+  }
+
+  Npages = book[0].Npages;
+  if (Key) {
+    /* count only matching key */
+    Npages = 0;
+    for (i = 0; i < book[0].Npages; i++) {
+      value = BookGetWord (book[0].pages[i], Key);
+      if (value == NULL) {
+	if (!strcmp(Value, "NULL")) { 
+	  Npages ++;
+	} else {
+	  continue;
+	}
+      } else {
+	if (!strcmp(value, Value)) Npages ++;
+      }
+    }
+  }
+
+  if (varName) {
+    set_int_variable (varName, Npages);
+  } else {
+    gprint (GP_ERR, "%d pages\n", Npages);
+  }
+  FREE (Key);
+  FREE (Value);
+  FREE (varName);
+  return TRUE;
+}
+
+int book_getbook (int argc, char **argv) {
+
+  int where, N;
+  char *varName;
+  Book *book;
+
+  varName = NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    varName = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: book getbook (where) [-var var]\n");
+    FREE (varName);
+    return FALSE;
+  }
+
+  where = atoi (argv[1]);
+  book = GetBook (where);
+  if (book == NULL) {
+    gprint (GP_ERR, "book %s not found\n", argv[1]);
+    FREE (varName);
+    return FALSE;
+  }
+
+  if (varName) {
+    set_str_variable (varName, book[0].name);
+  } else {
+    gprint (GP_ERR, "%s\n", book[0].name);
+  }
+  FREE (varName);
+  return TRUE;
+}
+
+int book_newpage (int argc, char **argv) {
+
+  Book *book;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: book newpage (book) (page)\n");
+    return FALSE;
+  }
+
+  book = FindBook (argv[1]);
+  if (book == NULL) {
+    gprint (GP_ERR, "book %s not found\n", argv[1]);
+    return FALSE;
+  }
+  
+  CreatePage (book, argv[2]);
+  return TRUE;
+}
+
+int book_delpage (int argc, char **argv) {
+
+  int i, N;
+  Page *page;
+  Book *book;
+  char *Key, *Value, *value;
+
+  Key = NULL;
+  Value = NULL;
+  if ((N = get_argument (argc, argv, "-key"))) {
+    remove_argument (N, &argc, argv);
+    Key = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    Value = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((argc != 3) && (argc != 2)) {
+    gprint (GP_ERR, "USAGE: book delpage (book) (page)\n");
+    gprint (GP_ERR, "USAGE: book delpage (book) -key name value\n");
+    FREE (Key);
+    FREE (Value);
+    return FALSE;
+  }
+
+  book = FindBook (argv[1]);
+  if (book == NULL) {
+    gprint (GP_ERR, "book %s not found\n", argv[1]);
+    FREE (Key);
+    FREE (Value);
+    return FALSE;
+  }
+  
+  if (Key) {
+    /* delete by matching key */
+    for (i = 0; i < book[0].Npages; i++) {
+      value = BookGetWord (book[0].pages[i], Key);
+      if (value == NULL) continue;
+      if (!strcmp(value, Value)) {
+	DeletePage (book, book[0].pages[i]);
+	i--; /* if we delete this page, don't advance the counter */
+      }
+    }
+    FREE (Key);
+    FREE (Value);
+    return TRUE;
+  }
+
+  page = FindPage (book, argv[2]);
+  if (page == NULL) {
+    gprint (GP_ERR, "page %s in book %s not found\n", argv[2], argv[1]);
+    FREE (Key);
+    FREE (Value);
+    return FALSE;
+  }
+
+  DeletePage (book, page);
+  FREE (Key);
+  FREE (Value);
+  return TRUE;
+}
+
+int book_listpage (int argc, char **argv) {
+
+  Page *page;
+  Book *book;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: book listpage (book) (page)\n");
+    return FALSE;
+  }
+
+  book = FindBook (argv[1]);
+  if (book == NULL) {
+    gprint (GP_ERR, "book %s not found\n", argv[1]);
+    return FALSE;
+  }
+  
+  page = FindPage (book, argv[2]);
+  if (page == NULL) {
+    gprint (GP_ERR, "page %s in book %s not found\n", argv[2], argv[1]);
+    return FALSE;
+  }
+
+  ListWords (page);
+  return TRUE;
+}
+
+int book_getpage (int argc, char **argv) {
+
+  int where, N;
+  char *pageName, *varName, *keyName, *keyValue;
+  Book *book;
+  Page *page;
+
+  varName = NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    varName = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  keyValue = keyName = NULL;
+  if ((N = get_argument (argc, argv, "-key"))) {
+    remove_argument (N, &argc, argv);
+    keyName = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    keyValue = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: book getpage (book) (where) [-var var] [-key key value]\n");
+    FREE (varName);
+    FREE (keyName);
+    FREE (keyValue);
+    return FALSE;
+  }
+
+  where = atoi (argv[2]);
+
+  book = FindBook (argv[1]);
+  if (book == NULL) {
+    gprint (GP_ERR, "book %s not found\n", argv[1]);
+    FREE (varName);
+    FREE (keyName);
+    FREE (keyValue);
+    return FALSE;
+  }
+
+  if (keyName == NULL) {
+    page = GetPage (book, where);
+  } else {
+    page = GetPageRestricted (book, where, keyName, keyValue);
+  }
+  if (page == NULL) {
+    pageName = strcreate ("NULL");
+  } else {
+    pageName = strcreate (page[0].name);
+  }
+
+  if (varName) {
+    set_str_variable (varName, pageName);
+  } else {
+    gprint (GP_ERR, "%s\n", pageName);
+  }
+  FREE (pageName);
+  FREE (varName);
+  FREE (keyName);
+  FREE (keyValue);
+  return TRUE;
+}
+
+int book_setword (int argc, char **argv) {
+
+  Page *page;
+  Book *book;
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: book setword (book) (page) (word) (value)\n");
+    return FALSE;
+  }
+
+  book = FindBook (argv[1]);
+  if (book == NULL) {
+    gprint (GP_ERR, "book %s not found\n", argv[1]);
+    return FALSE;
+  }
+  
+  page = FindPage (book, argv[2]);
+  if (page == NULL) {
+    gprint (GP_ERR, "page %s in book %s not found\n", argv[2], argv[1]);
+    return FALSE;
+  }
+
+  BookSetWord (page, argv[3], argv[4]);
+  return TRUE;
+}
+
+int book_getword (int argc, char **argv) {
+
+  int N;
+  Page *page;
+  Book *book;
+  char *value, *varName;
+
+  varName = NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    varName = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: book getword (book) (page) (word)\n");
+    FREE (varName);
+    return FALSE;
+  }
+
+  book = FindBook (argv[1]);
+  if (book == NULL) {
+    gprint (GP_ERR, "book %s not found\n", argv[1]);
+    FREE (varName);
+    return FALSE;
+  }
+  
+  page = FindPage (book, argv[2]);
+  if (page == NULL) {
+    gprint (GP_ERR, "page %s in book %s not found\n", argv[2], argv[1]);
+    FREE (varName);
+    return FALSE;
+  }
+
+  value = BookGetWord (page, argv[3]);
+  if (value == NULL) {
+    if (varName == NULL) {
+      gprint (GP_ERR, "value %s on page %s in book %s not found\n", argv[3], argv[2], argv[1]);
+      FREE (varName);
+      return FALSE;
+    } else {
+      set_str_variable (varName, "NULL");
+      FREE (varName);
+      return TRUE;
+    }
+  }
+
+  if (varName) {
+    set_str_variable (varName, value);
+  } else {
+    gprint (GP_ERR, "%s\n", value);
+  }
+    
+  FREE (varName);
+  return TRUE;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/box.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/box.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/box.c	(revision 15879)
@@ -0,0 +1,91 @@
+# include "data.h"
+
+int box (int argc, char **argv) {
+  
+  int i, N, kapa;
+  char *name;
+  Graphdata graphmode;
+  
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetGraph (&graphmode, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  strcpy (graphmode.ticks, "2222");
+  if ((N = get_argument (argc, argv, "-ticks"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (graphmode.ticks, argv[N]);
+    remove_argument (N, &argc, argv);
+    if (strlen (graphmode.ticks) != 4) { goto usage; }
+    for (i = 0; i < strlen (graphmode.ticks); i++) {
+      if ((graphmode.ticks[i] != '0') && (graphmode.ticks[i] != '1') && (graphmode.ticks[i] != '2')) { goto usage; }
+    }
+  }
+  
+  strcpy (graphmode.labels, "2222");
+  if ((N = get_argument (argc, argv, "-labels"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (graphmode.labels, argv[N]);
+    remove_argument (N, &argc, argv);
+    if (strlen (graphmode.labels) != 4) { goto usage; }
+    for (i = 0; i < strlen (graphmode.labels); i++) {
+      if ((graphmode.labels[i] != '0') && (graphmode.labels[i] != '1') && (graphmode.labels[i] != '2')) { goto usage; }
+    }
+  }
+
+  strcpy (graphmode.axis, "2222");
+  if ((N = get_argument (argc, argv, "-axis"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (graphmode.axis, argv[N]);
+    remove_argument (N, &argc, argv);
+    if (strlen (graphmode.axis) != 4) { goto usage; }
+    for (i = 0; i < strlen (graphmode.axis); i++) {
+      if ((graphmode.axis[i] != '0') && (graphmode.axis[i] != '1') && (graphmode.axis[i] != '2')) { goto usage; }
+    }
+  }
+
+  if (argc != 1) goto usage;
+
+  KapaBox (kapa, &graphmode);
+  return (TRUE);
+      
+ usage:
+  gprint (GP_ERR, "USAGE: box [-ticks NNNN] [-axis NNNN] [-labels NNNN]\n");
+  return (FALSE);
+}
+
+
+/* box has:
+   axis
+   labels
+   ticks
+
+   assign like this:   
+   -axis 0000
+   -labels 0000
+   -ticks 0000
+
+   default:
+   -axis 1111
+   -labels 1100
+   -ticks 1111
+
+   messages to kapa:
+
+   DBOX
+   (xmin) (xmax) (ymin) (ymax)
+   AAAA LLLL TTTT
+
+   A = axis
+   L = label
+   T = ticks
+   
+   0 = off
+   1 = on
+   2 = default / maintain
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/center.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/center.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/center.c	(revision 15879)
@@ -0,0 +1,31 @@
+# include "data.h"
+
+int center (int argc, char **argv) {
+  
+  double x, y;
+  int zoom;
+  int kapa, N;
+  char *name;
+  
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImage (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  if ((argc != 3) && (argc != 4)) {
+    gprint (GP_ERR, "USAGE: center x y [zoom]\n");
+    return (FALSE);
+  }
+
+  x = atof (argv[1]);
+  y = atof (argv[2]);
+  zoom = 0;
+  if (argc == 4) zoom = atof (argv[3]);
+
+  KiiCenter (kapa, x, y, zoom);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/clear.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/clear.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/clear.c	(revision 15879)
@@ -0,0 +1,48 @@
+# include "data.h"
+
+// default is to clear all plots, but not the sections or the images
+int clear (int argc, char **argv) {
+  
+  int N;
+  int kapa;
+  char *name;
+
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetGraph (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  // clear all sections
+  if ((N = get_argument (argc, argv, "-s")) || 
+      (N = get_argument (argc, argv, "-section"))) {
+      KapaClearSections (kapa);
+      return (TRUE);
+  }
+
+  // clear all sections
+  if ((N = get_argument (argc, argv, "-graph"))) {
+      KapaClearCurrentPlot (kapa);
+      return (TRUE);
+  }
+
+  // clear image
+  if ((N = get_argument (argc, argv, "-image"))) {
+      KapaClearImage (kapa);
+      return (TRUE);
+  }
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: clear [-n Xgraph] [-s|-section] [-image] [-graph]\n");
+    gprint (GP_ERR, "       [-s|-section] : clear all sections\n");
+    gprint (GP_ERR, "       [-graph]      : clear current graph\n");
+    gprint (GP_ERR, "       [-image]      : clear current image\n");
+    return (FALSE);
+  }
+
+  KapaClearPlots (kapa);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/clip.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/clip.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/clip.c	(revision 15879)
@@ -0,0 +1,73 @@
+# include "data.h"
+
+int clip (int argc, char **argv) {
+
+  int i, Npix, DO_NAN, DO_INF, N;
+  double min, Vmin, max, Vmax, nan_val, inf_val;
+  float *in;
+  Buffer *buf;
+
+  inf_val = nan_val = min = Vmin = max = Vmax = 0;
+
+  DO_NAN = FALSE;
+  if ((N = get_argument (argc, argv, "-nan"))) {
+    remove_argument (N, &argc, argv);
+    nan_val  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    DO_NAN = TRUE;
+  }
+
+  DO_INF = FALSE;
+  if ((N = get_argument (argc, argv, "-inf"))) {
+    remove_argument (N, &argc, argv);
+    inf_val  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    DO_INF = TRUE;
+  }
+
+  if ((argc != 6) && (!(DO_INF || DO_NAN))) {
+    gprint (GP_ERR, "USAGE: clip (buffer) [min Vmin max Vmax] [-inf val] [-nan val]\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  if (argc == 6) {
+    min = atof (argv[2]);
+    Vmin = atof (argv[3]);
+    max = atof (argv[4]);
+    Vmax = atof (argv[5]);
+  }
+
+  Npix = buf[0].matrix.Naxis[0]*buf[0].matrix.Naxis[1];
+  in = (float *) buf[0].matrix.buffer;
+
+  if (argc == 6) {
+    for (i = 0; i < Npix; i++, in++) {
+      if (*in < min) 
+	*in = Vmin;
+      if (*in > max)
+	*in = Vmax;
+    }
+  }
+  in = (float *) buf[0].matrix.buffer;
+  if (DO_NAN) {
+    for (i = 0; i < Npix; i++, in++) {
+      if (isnan (*in)) {
+	*in = nan_val;
+      }
+    }
+  }
+  in = (float *) buf[0].matrix.buffer;
+  if (DO_INF) {
+    for (i = 0; i < Npix; i++, in++) {
+      if (!finite (*in)) {
+	*in = inf_val;
+      }
+    }
+  }
+  return (TRUE);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/close.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/close.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/close.c	(revision 15879)
@@ -0,0 +1,22 @@
+# include "data.h"
+
+int close_device (int argc, char **argv) {
+
+  int N, kapa;
+  char *name;
+  /* close current graphics device */
+
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (!GetGraph (NULL, &kapa, name)) return (FALSE);
+
+  close_kapa (name); 
+  FREE (name);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/concat.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/concat.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/concat.c	(revision 15879)
@@ -0,0 +1,36 @@
+# include "data.h"
+
+int concat (int argc, char **argv) {
+
+  int  i, j, Nin;
+  double value;
+  Vector *ivec, *ovec;
+
+  /** check basic syntax **/
+  if (argc != 3) {
+    gprint (GP_ERR, "SYNTAX: concat (vector/value) vector\n");
+    gprint (GP_ERR, "  concatanate (vector/value) to vector\n");
+    return (FALSE);
+  }
+
+  if ((ovec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (SelectScalar (argv[1], &value)) {
+    Nin = ovec[0].Nelements;
+    ovec[0].Nelements++;
+    REALLOCATE (ovec[0].elements, float, ovec[0].Nelements);
+    ovec[0].elements[Nin] = value;
+    return (TRUE);
+  } 
+  
+  if ((ivec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  
+  REALLOCATE (ovec[0].elements, float, ovec[0].Nelements + ivec[0].Nelements);
+  for (j = ovec[0].Nelements, i = 0; i < ivec[0].Nelements; i++, j++) {
+    ovec[0].elements[j] = ivec[0].elements[i];
+  }
+  ovec[0].Nelements += ivec[0].Nelements;
+  
+  return (TRUE);
+    
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/contour.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/contour.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/contour.c	(revision 15879)
@@ -0,0 +1,262 @@
+# include "data.h"
+# define LL { \
+ dx =  d00 / (*v01 - *v00); \
+ dy = -d00 / (*v10 - *v00); \
+ x = i - 0.5; \
+ y = j - dy - 0.5; }
+
+# define UL { \
+ tmp = d00 / (*v10 - *v00); \
+ dy = 1 - tmp; \
+ dx =  d10 / (*v11 - *v10); \
+ x = i - 0.5; \
+ y = j + tmp - 0.5; }
+      
+# define LR { \
+ tmp = d00 / (*v01 - *v00); \
+ dx = 1 - tmp; \
+ dy = d01 / (*v11 - *v01); \
+ x = i + tmp - 0.5; \
+ y = j - 0.5; }
+
+# define UR { \
+ tmp = d10 / (*v11 - *v10); \
+ dx = 1 - tmp; \
+ dy = -d11 / (*v01 - *v11); \
+ x = i + tmp - 0.5; \
+ y = j + 1 - 0.5; }
+      
+# define HZ { \
+ tmp = d00 / (*v10 - *v00); \
+ dy = d01 / (*v11 - *v01) - tmp; \
+ dx = 1; \
+ x = i - 0.5; \
+ y = j + tmp - 0.5; }
+
+# define VT { \
+ tmp = d00 / (*v01 - *v00); \
+ dx = d10 / (*v11 - *v10) - tmp; \
+ x = i + tmp - 0.5; \
+ dy = 1; \
+ y = j - 0.5; }
+
+Vector *xv, *yv;
+int N, NVEC;
+
+void DUMP (float x, float y, float dx, float dy) {
+  
+  xv[0].elements[N]   = x;
+  xv[0].elements[N+1] = x+dx;
+  
+  yv[0].elements[N]   = y;
+  yv[0].elements[N+1] = y+dy;
+  
+  N+=2;
+
+  if (N >= NVEC - 2) {
+    NVEC += 100;
+    REALLOCATE (xv[0].elements, float, NVEC);
+    REALLOCATE (yv[0].elements, float, NVEC);
+  }
+}
+
+int contour (int argc, char **argv) {
+
+  int i, j, Nx, Ny;
+  float level, d00, d01, d10, d11, tmp;
+  float x, y, dx, dy;
+  float *v00, *v01, *v10, *v11;
+  float *matrix;
+  Buffer *buf;
+  
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: contour <buffer> X Y level\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((xv = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yv = SelectVector (argv[3], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  level = atof (argv[4]);
+  matrix = (float *)(buf[0].matrix.buffer);
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+
+  v00 = matrix;
+  v01 = matrix + 1;
+  v10 = matrix + Nx;
+  v11 = matrix + Nx + 1;
+  d01 = (level - *v00);
+  d11 = (level - *v10);
+
+  N = 0;
+  NVEC = 100;
+  REALLOCATE (xv[0].elements, float, NVEC);
+  REALLOCATE (yv[0].elements, float, NVEC);
+
+  for (j = 1; j < Ny; j++) {
+    if (!(j%10)) gprint (GP_ERR, ".");
+    for (i = 1; i < Nx; i++, v00++, v01++, v10++, v11++) {
+
+      d00 = d01;
+      d10 = d11;
+      d01 = (level - *v01);
+      d11 = (level - *v11);
+
+      if (((d00 > 0) && (d01 > 0) && (d10 > 0) && (d11 > 0)) ||
+	  ((d00 < 0) && (d01 < 0) && (d10 < 0) && (d11 < 0)))
+	continue;
+
+      if ((d00 > 0) && (d10 <= 0)) { 
+	if ((d01 <= 0) && (d11 <= 0)) { /* \  */
+	  LL;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+	if ((d01 > 0) && (d11 <= 0)) { /* -  */
+	  HZ;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+	if ((d01 > 0) && (d11 > 0)) { /* /  */
+	  UL;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 > 0)) { /* \\  */
+	  LL;
+	  DUMP (x,y,dx,dy);
+	  UR;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+      }
+
+      if ((d00 <= 0) && (d10 > 0)) {
+	if ((d01 > 0) && (d11 > 0)) { /* \  */
+	  LL;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 > 0)) { /* -  */
+	  HZ;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 <= 0)) { /* /  */
+	  UL;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+	if ((d01 > 0) && (d11 <= 0)) { /* //  */
+	  UL;
+	  DUMP (x,y,dx,dy);
+	  LR;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+      }
+      
+
+      if ((d00 <= 0) && (d10 <= 0)) { 
+	if ((d01 > 0) && (d11 <= 0)) {
+	  LR;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 > 0)) {
+	  UR;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+	if ((d01 > 0) && (d11 > 0)) {
+	  VT;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+      }
+
+      if ((d00 > 0) && (d10 > 0)) { 
+	if ((d01 <= 0) && (d11 > 0)) {
+	  LR;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+	if ((d01 > 0) && (d11 <= 0)) {
+	  UR;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 <= 0)) {
+	  VT;
+	  DUMP (x,y,dx,dy);
+	  continue;
+	}
+      }
+
+    }
+    /* skip left-hand edge */
+    v00++; v01++; v10++; v11++;
+    d01 = (level - *v00);
+    d11 = (level - *v10);
+  }
+
+  /****** bottom line *******/
+  v00 = matrix;  
+  v01 = matrix + 1;  
+  y = 0;
+  dx = 0;
+  dy = -0.5;
+  for (i = 1; i < Nx; i++, v00++, v01++) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      x = i + (level - *v01)/(*v01 - *v00);
+      DUMP (x,y,dx,dy);
+    }
+  }
+
+  /********** top line *******/
+  v00 = matrix + Nx*(Ny - 1);  
+  v01 = v00 + 1;
+  y = Ny - 1;
+  dx = 0;
+  dy = 0.5;
+  for (i = 1; i < Nx; i++, v00++, v01++) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      x = i + (level - *v01)/(*v01 - *v00);
+      DUMP (x,y,dx,dy);
+    }
+  }
+
+  /******** left line *********/
+  v00 = matrix; 
+  v01 = matrix + Nx;
+  x = 0;
+  dx = -0.5;
+  dy = 0;
+  for (j = 1; j < Ny; j++, v00+=Nx, v01+=Nx) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      y = j + (level - *v01)/(*v01 - *v00);
+      DUMP (x,y,dx,dy);
+    }
+  }
+
+  /******** right line *********/
+  v00 = matrix + Nx - 1; 
+  v01 = v00 + Nx;
+  x = Nx - 1;
+  dx = 0.5;
+  dy = 0;
+  for (j = 1; j < Ny; j++, v00+=Nx, v01+=Nx) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      y = j + (level - *v01)/(*v01 - *v00);
+      DUMP (x,y,dx,dy);
+    }
+  }
+  
+/* free anything? */
+
+  xv[0].Nelements = N;
+  yv[0].Nelements = N;
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/create.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/create.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/create.c	(revision 15879)
@@ -0,0 +1,37 @@
+# include "data.h"
+
+int create (int argc, char **argv) {
+  
+  int i;
+  float start, end, delta;
+  Vector *vec;
+  
+  if ((argc != 5) && (argc != 4)) {
+    gprint (GP_ERR, "USAGE: create vector start end [delta]\n");
+    return (FALSE);
+  }
+
+  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  start = atof (argv[2]);
+  end   = atof (argv[3]);
+  delta = 1;
+  if (argc == 5) delta = atof (argv[4]);
+  if ((start == end) || (delta == 0)) {
+    gprint (GP_ERR, "error in value: %f to %f, %f\n", start, end, delta);
+    return (FALSE);
+  }
+  delta = fabs (delta);
+  if (end - start < 0) {
+    delta = -1.0 * delta;
+  }
+
+  vec[0].Nelements = (end - start) / delta;
+  REALLOCATE (vec[0].elements, float, vec[0].Nelements);
+
+  for (i = 0; i < vec[0].Nelements; i++) {
+    vec[0].elements[i] = start + i*delta;
+  }
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/cumulative.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/cumulative.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/cumulative.c	(revision 15879)
@@ -0,0 +1,28 @@
+# include "data.h"
+
+int cumulative (int argc, char **argv) {
+  
+  int i;
+  float *Vi, *Vo;
+  Vector *ivec, *ovec;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: cumulative invec outvec\n");
+    return (FALSE);
+  }
+
+  if ((ivec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((ovec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  ovec[0].Nelements = ivec[0].Nelements;
+    
+  REALLOCATE (ovec[0].elements, float, ovec[0].Nelements);
+  bzero (ovec[0].elements, sizeof(float)*ovec[0].Nelements);
+
+  Vi = ivec[0].elements;
+  Vo = ovec[0].elements;
+  *Vo = *Vi;
+  for (i = 1; i < ivec[0].Nelements; i++, Vi++, Vo++) {
+    *Vo = Vo[-1] + *Vi;
+  }      
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/cursor.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/cursor.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/cursor.c	(revision 15879)
@@ -0,0 +1,63 @@
+# include "data.h"
+
+int cursor (int argc, char **argv) {
+
+  char string[20], key[20], *name;
+  int i, N, kapa;
+  double X, Y, R, D, Z;
+  void *oldsignal;
+
+  // XXX need to be able to specify graph vs image coords
+  // currently, if only one exists, that frame will be used
+  // if both exist, defaults to ??
+  // if ((N = get_argument (argc, argv, "-g"))) {
+  // if ((N = get_argument (argc, argv, "-i"))) {
+
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetGraphData (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  N = 0;
+  if (argc == 2) N = atof (argv[1]);
+
+  if ((argc != 1) && (argc != 2)) {
+    gprint (GP_ERR, "USAGE: cursor [Npts] [-n window] [-g | -i]\n");
+    return (FALSE);
+  }
+  
+  KiiCursorOn (kapa);
+  
+  oldsignal = signal (SIGINT, handle_interrupt);
+  interrupt = FALSE;
+
+  for (i = 0; ((i < N) || (N == 0)) && !interrupt; i++) {
+
+    KiiCursorRead (kapa, &X, &Y, &Z, &R, &D, key);
+
+    sprintf (string, "X%s", key);
+    set_variable (string, X);
+    sprintf (string, "Y%s", key);
+    set_variable (string, Y);
+    sprintf (string, "Z%s", key);
+    set_variable (string, Z);
+    sprintf (string, "R%s", key);
+    set_variable (string, R);
+    sprintf (string, "D%s", key);
+    set_variable (string, D);
+
+    set_str_variable ("KEY", key);
+    
+    gprint (GP_LOG, "%s %f %f %f %f %f\n", key, X, Y, Z, R, D);
+
+    if (!strcasecmp (key, "Q")) break;
+  }
+
+  signal (SIGINT, oldsignal);
+  KiiCursorOff (kapa);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/cut.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/cut.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/cut.c	(revision 15879)
@@ -0,0 +1,120 @@
+# include "data.h"
+
+enum {SUM, MEAN, MEDIAN};
+
+int cut (int argc, char **argv) {
+  
+  int i, j, N, Nx, Ny, Mode;
+  float *Vin, *Vbuf, value;
+  int sx, sy, nx, ny;
+  Vector *xvec, *yvec;
+  Buffer *buf;
+
+  Mode = SUM;
+  if ((N = get_argument (argc, argv, "-median"))) {
+    remove_argument (N, &argc, argv);
+    Mode = MEDIAN;
+  }
+  if ((N = get_argument (argc, argv, "-mean"))) {
+    remove_argument (N, &argc, argv);
+    Mode = MEAN;
+  }
+
+  if (argc != 9) {
+    gprint (GP_ERR, "USAGE: cut <buffer> <X vector> <Y vector> <X|Y> sx sy nx ny\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+ 
+  sx = atof (argv[5]);
+  sy = atof (argv[6]);
+  nx = atof (argv[7]);
+  ny = atof (argv[8]);
+
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+
+  if ((sx < 0) || (sy < 0) || (sx+nx > Nx) || (sy+ny > Ny)) {
+    gprint (GP_ERR, "region out of range\n");
+    return (FALSE);
+  }
+
+  if ((xvec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[3], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  switch (argv[4][0]) {
+  case 'x':
+  case 'X':
+    /* create output vectors */
+    xvec[0].Nelements = yvec[0].Nelements = nx;
+    REALLOCATE (xvec[0].elements, float, MAX (nx, 1));
+    REALLOCATE (yvec[0].elements, float, MAX (nx, 1));
+    bzero (yvec[0].elements, nx*sizeof(float));
+    for (i = 0; i < nx; i++) {
+      xvec[0].elements[i] = i + sx; 
+    }
+    ALLOCATE (Vbuf, float, MAX (ny, 1));
+
+    for (i = 0; i < nx; i++) {
+      /* accumulate values */
+      Vin = (float *)(buf[0].matrix.buffer) + sy*Nx + sx + i; 
+      for (j = 0; j < ny; j++, Vin += Nx) {
+	Vbuf[j] = *Vin;
+      }
+      /* apply stat of choice */
+      if (Mode == MEDIAN) {
+	fsort (Vbuf, ny);
+	value = Vbuf[(int)(0.5*ny)];
+      } else {
+	value = 0;
+	for (j = 0; j < ny; j++) {
+	  value += Vbuf[j];
+	}
+	if (Mode == MEAN) { value /= ny; }
+      }
+      yvec[0].elements[i] = value;
+    }
+    break;
+    
+  case 'y':
+  case 'Y':
+    xvec[0].Nelements = yvec[0].Nelements = ny;
+    REALLOCATE (xvec[0].elements, float, ny);
+    REALLOCATE (yvec[0].elements, float, ny);
+    bzero (yvec[0].elements, ny*sizeof(float));
+    for (i = 0; i < ny; i++) {
+      xvec[0].elements[i] = i + sy; 
+    }
+    ALLOCATE (Vbuf, float, MAX (nx, 1));
+
+    for (i = 0; i < ny; i++) {
+      /* accumulate values */
+      Vin = (float *)(buf[0].matrix.buffer) + (sy + i)*Nx + sx; 
+      for (j = 0; j < nx; j++, Vin ++) {
+	Vbuf[j] = *Vin;
+      }
+      /* apply stat of choice */
+      if (Mode == MEDIAN) {
+	fsort (Vbuf, nx);
+	value = Vbuf[(int)(0.5*nx)];
+      } else {
+	value = 0;
+	for (j = 0; j < nx; j++) {
+	  value += Vbuf[j];
+	}
+	if (Mode == MEAN) { value /= nx; }
+      }
+      yvec[0].elements[i] = value;
+    }
+    break;
+
+  default:
+    gprint (GP_ERR, "<dir> can be X or Y\n");
+    return (FALSE);
+    break;
+  }
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dbconnect.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dbconnect.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dbconnect.c	(revision 15879)
@@ -0,0 +1,117 @@
+# include "data.h"
+# if (HAVE_MYSQL_H)
+# include "mysql.h"
+
+MYSQL mysql;
+MYSQL *connection = NULL;
+
+int dbconnect (int argc, char **argv) {
+  
+  char query[256];
+  char password[1024];
+  MYSQL_RES *result;
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: dbconnect (hostname) (username) (database)\n");
+    return FALSE;
+  }
+
+  fprintf (stdout, "Enter password: ");
+  scan_line (stdin, password);
+
+# if (0)
+  int i;
+  char c;
+
+  initscr();
+  noecho();
+  i = 0;
+  while (((c = getch()) != EOF) && (c != '\n')) {
+    password[i] = c;
+    i++;
+  }
+  password[i] = 0;
+# endif
+
+  mysql_init (&mysql);
+  connection = mysql_real_connect (&mysql, argv[1], argv[2], password, argv[3], 0, 0, 0);
+
+  if (connection == NULL) {
+    gprint (GP_ERR, "failed to connect to database\n");
+    gprint (GP_ERR, "%s\n", mysql_error (&mysql));
+    return (FALSE);
+  }
+    
+  sprintf (query, "set @@interactive_timeout = 30000");
+  if (mysql_query (connection, query)) {
+    gprint (GP_ERR, "failed to set interactive timout\n");
+    gprint (GP_ERR, "%s\n", mysql_error (connection));
+    free (query);
+    return (FALSE);
+  }
+  result = mysql_store_result (connection);
+  mysql_free_result (result);
+    
+  sprintf (query, "set @@wait_timeout = 30000");
+  if (mysql_query (connection, query)) {
+    gprint (GP_ERR, "failed to set wait timout\n");
+    gprint (GP_ERR, "%s\n", mysql_error (connection));
+    free (query);
+    return (FALSE);
+  }
+  result = mysql_store_result (connection);
+  mysql_free_result (result);
+    
+# if (0)
+  int Nrows;
+  MYSQL_ROW row;
+
+  sprintf (query, "select @@interactive_timeout");
+  if (mysql_query (connection, query)) {
+    gprint (GP_ERR, "failed to get timout\n");
+    gprint (GP_ERR, "%s\n", mysql_error (connection));
+    free (query);
+    return (FALSE);
+  }
+  result = mysql_store_result (connection);
+  Nrows = mysql_num_rows(result);
+  row = mysql_fetch_row(result);
+  fprintf (stderr, "interactive timeout: %s\n", row[0]);
+  mysql_free_result (result);
+
+  sprintf (query, "select @@wait_timeout");
+  if (mysql_query (connection, query)) {
+    gprint (GP_ERR, "failed to get timout\n");
+    gprint (GP_ERR, "%s\n", mysql_error (connection));
+    free (query);
+    return (FALSE);
+  }
+  result = mysql_store_result (connection);
+  Nrows = mysql_num_rows(result);
+  row = mysql_fetch_row(result);
+  fprintf (stderr, "wait timeout: %s\n", row[0]);
+  mysql_free_result (result);
+# endif
+    
+  return (TRUE);
+}
+
+// XXX do I need to close the connection before opening a new one? 
+
+void *db_getConnection () {
+  return connection;
+}
+
+# else 
+
+int dbconnect (int argc, char **argv) {
+
+  gprint (GP_ERR, "mysql library is not available\n");
+  return FALSE;
+}
+
+void *db_getConnection () {
+  return NULL;
+}
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dbselect.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dbselect.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dbselect.c	(revision 15879)
@@ -0,0 +1,100 @@
+# include "data.h"
+# if (HAVE_MYSQL_H) 
+# include "mysql.h"
+
+int dbselect (int argc, char **argv) {
+  
+  int i, j, Nbytes, Ncols, Nrows;
+  char *query;
+  Vector **vec;
+
+  MYSQL_RES *result;
+  MYSQL_ROW row;
+  MYSQL_FIELD *fields;
+  MYSQL *connection = NULL;
+
+  if (argc < 4) {
+    gprint (GP_ERR, "USAGE: dbselect (fields) from (table) [where]\n");
+    return FALSE;
+  }
+
+  connection = db_getConnection ();
+  if (connection == NULL) {
+    gprint (GP_ERR, "database not defined; use dbconnect\n");
+    return (FALSE);
+  }
+
+  // generate the query line (concat the argv[i] entries)
+  Nbytes = 0;
+  for (i = 1; i < argc; i++) {
+    Nbytes += strlen(argv[i]) + 1;
+  }
+  Nbytes += 10;
+
+  ALLOCATE (query, char, Nbytes);
+  bzero (query, Nbytes);
+  strcat (query, "select ");
+  for (i = 1; i < argc; i++) {
+    strcat (query, argv[i]);
+    strcat (query, " ");
+  }
+  // strcat (query, ";");
+  // fprintf (stderr, "query: %s\n", query);
+
+  if (mysql_query (connection, query)) {
+    gprint (GP_ERR, "problem with query\n");
+    gprint (GP_ERR, "%s\n", mysql_error (connection));
+    free (query);
+    return (FALSE);
+  }
+    
+  result = mysql_store_result (connection);
+
+  Nrows = mysql_num_rows(result);
+  Ncols = mysql_num_fields(result);
+  fields = mysql_fetch_fields (result);
+
+  // fprintf (stderr, "Nrows: %d\n", Nrows);
+  // fprintf (stderr, "Ncols: %d\n", Ncols);
+
+  ALLOCATE (vec, Vector *, Ncols);
+  for (i = 0; i < Ncols; i++) {
+    if ((vec[i] = SelectVector (fields[i].name, ANYVECTOR, TRUE)) == NULL) {
+      gprint (GP_ERR, "trouble creating vector named %s\n", fields[i].name);
+      free (query);
+      free (vec);
+      return (FALSE);
+    }
+    REALLOCATE (vec[i][0].elements, float, Nrows);
+    vec[i][0].Nelements = Nrows;
+  }
+
+  for (j = 0; j < Nrows; j++) {
+    row = mysql_fetch_row(result);
+    if (row == NULL) {
+      gprint (GP_ERR, "inconsistent row count: expected %d, got %d\n", Nrows, j);
+      free (query);
+      free (vec);
+      mysql_free_result (result);
+      return (FALSE);
+    }
+    for (i = 0; i < Ncols; i++) {
+      vec[i][0].elements[j] = atof (row[i]);
+    }
+  }
+
+  free (query);
+  free (vec);
+  mysql_free_result (result);
+  return (TRUE);
+}
+
+# else 
+
+int dbselect (int argc, char **argv) {
+
+  gprint (GP_ERR, "mysql library is not available\n");
+  return FALSE;
+}
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/delete.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/delete.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/delete.c	(revision 15879)
@@ -0,0 +1,31 @@
+# include "data.h"
+
+int delete (int argc, char **argv) {
+  
+  int i, N, Quiet;
+
+  Quiet = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: delete <obiect> [<object> ..]\n");
+    return (FALSE);
+  }
+
+  for (i = 1; i < argc; i++) {
+    if (DeleteNamedBuffer (argv[i])) continue; 
+    if (DeleteNamedVector (argv[i])) continue;
+    if (DeleteNamedScalar (argv[i])) continue; 
+    if (!Quiet) gprint (GP_ERR, "can't find object %s\n", argv[i]);
+  }
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/device.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/device.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/device.c	(revision 15879)
@@ -0,0 +1,28 @@
+# include "data.h"
+
+int device (int argc, char **argv) {
+
+  int N, kapa;
+  char *name;;
+  /* set / get current graphics device */
+
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (name == NULL) {
+    name = GetKapaName ();
+    if (name == NULL) {
+      gprint (GP_ERR, "no device defined\n");
+      return (FALSE);
+    }
+  } else {
+    if (!GetGraph (NULL, &kapa, name)) return (FALSE);
+  }
+  gprint (GP_ERR, "kapa %s\n", name); 
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dimendown.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dimendown.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dimendown.c	(revision 15879)
@@ -0,0 +1,64 @@
+# include "data.h"
+
+enum {VALUE, XCOORD, YCOORD};
+
+int dimendown (int argc, char **argv) {
+  
+  int i, Nx, Ny, Npix, N, mode;
+  float *in, *out;
+  Vector *vec;
+  Buffer *buf;
+
+  mode = VALUE;
+  if ((N = get_argument (argc, argv, "-x"))) {
+    remove_argument (N, &argc, argv);
+    mode = XCOORD;
+  }
+  if ((N = get_argument (argc, argv, "-y"))) {
+    remove_argument (N, &argc, argv);
+    mode = YCOORD;
+  }
+
+  if (argc != 3) goto usage;
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((vec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+  Npix = Nx * Ny;
+
+  vec[0].Nelements = Npix;
+  REALLOCATE (vec[0].elements, float, Npix);
+
+  in = (float *) buf[0].matrix.buffer;
+  out = vec[0].elements;
+
+  switch (mode) {
+    case VALUE:
+      for (i = 0; i < Npix; i++, in++, out++) {
+	*out = *in;
+      }
+      break;
+
+    case XCOORD:
+      for (i = 0; i < Npix; i++, out++) {
+	*out = i % Nx;
+      }
+      break;
+
+    case YCOORD:
+      for (i = 0; i < Npix; i++, out++) {
+	*out = i / Nx;
+      }
+      break;
+  }
+      
+  return (TRUE);
+
+ usage:
+    gprint (GP_ERR, "USAGE: dimendown <buffer> <vector>\n");
+    gprint (GP_ERR, "  -x : fill vector with buffer x-coords\n");
+    gprint (GP_ERR, "  -y : fill vector with buffer y-coords\n");
+    return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dimenup.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dimenup.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dimenup.c	(revision 15879)
@@ -0,0 +1,39 @@
+# include "data.h"
+
+int dimenup (int argc, char **argv) {
+  
+  int i, Nx, Ny, Npix;
+  float *in, *out;
+  Vector *vec;
+  Buffer *buf;
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: dimenup <vector> <buffer> Nx Ny\n");
+    return (FALSE);
+  }
+
+  if ((vec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((buf = SelectBuffer (argv[2], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  Npix = vec[0].Nelements;
+  Nx = atof (argv[3]);
+  Ny = atof (argv[4]);
+  if (Npix != Nx * Ny) {
+    gprint (GP_ERR, "dimensions don't match\n");
+    return (FALSE);
+  }
+
+  gfits_free_matrix (&buf[0].matrix);
+  gfits_free_header (&buf[0].header);
+  CreateBuffer (buf, Nx, Ny, -32, 0.0, 1.0);
+
+  out = (float *) buf[0].matrix.buffer;
+  in = vec[0].elements;
+
+  for (i = 0; i < Npix; i++, in++, out++) {
+    *out = *in;
+  }
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dot.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dot.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/dot.c	(revision 15879)
@@ -0,0 +1,27 @@
+# include "data.h"
+
+int dot (int argc, char **argv) {
+  
+  int kapa;
+  Graphdata graphmode;
+  float x, y;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: dot <x> <y>\n");
+    return (FALSE);
+  }
+  x = atof(argv[1]);
+  y = atof(argv[2]);
+
+  /* set point style and errorbar mode (these are NOT sticky) */
+  graphmode.style = 2;
+  graphmode.etype = 0;
+
+  if (!KapaPrepPlot (kapa, 1, &graphmode)) return (FALSE);
+  KapaPlotVector (kapa, 1, &x, "x");
+  KapaPlotVector (kapa, 1, &y, "y");
+  
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/erase.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/erase.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/erase.c	(revision 15879)
@@ -0,0 +1,39 @@
+# include "data.h"
+
+int erase (int argc, char **argv) {
+  
+  int i, N;
+  int kapa;
+  char *name;
+  
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImage (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: erase (overlay) [overlay, overlay, ..] \n");
+    gprint (GP_ERR, " (overlay) may be: red (0), green (1), blue (2), yellow (3) or all\n");
+    return (FALSE);
+  }
+
+  for (i = 1; i < argc; i++) {
+    if (!(strcasecmp (argv[i], "all"))) {
+      KiiEraseOverlay (kapa, "red");
+      KiiEraseOverlay (kapa, "green");
+      KiiEraseOverlay (kapa, "blue");
+      KiiEraseOverlay (kapa, "yellow");
+      continue;
+    }
+    if (!KiiSelectOverlay (argv[i], &N)) {
+      gprint (GP_ERR, "%s is not a valid overlay\n", argv[i]);
+      return (FALSE);
+    }
+    KiiEraseOverlay (kapa, argv[i]);
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/extract.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/extract.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/extract.c	(revision 15879)
@@ -0,0 +1,92 @@
+# include "data.h"
+
+int extract (int argc, char **argv) {
+  
+  int i, j;
+  float *Vin, *Vout;
+  int sx, sy, nx, ny, NX, NY;
+  int Sx, Sy, Nx, Ny;
+  Buffer *in, *out;
+
+  if (argc != 11) {
+    gprint (GP_ERR, "USAGE: extract <from> <to> sx sy nx ny Sx Sy Nx Ny\n");
+    return (FALSE);
+  }
+
+  if ((in = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  NX = in[0].matrix.Naxis[0];
+  NY = in[0].matrix.Naxis[1];
+
+  sx = atof (argv[3]);
+  sy = atof (argv[4]);
+  nx = atof (argv[5]);
+  ny = atof (argv[6]);
+
+  Sx = atof (argv[7]);
+  Sy = atof (argv[8]);
+  Nx = atof (argv[9]);
+  Ny = atof (argv[10]);
+
+  if ((Sy + ny > Ny) || (Sx + nx > Nx)) {
+    gprint (GP_ERR, "mismatch between source and dest regions\n");
+    gprint (GP_ERR, "%d + %d > %d or %d + %d > %d\n", Sy, ny, Ny, Sx, nx, Nx);
+    return (FALSE);
+  }
+
+  /* region is not on first image */
+  if ((sx + nx < 0) || (sy + ny < 0) || 
+      (sx > in[0].matrix.Naxis[0]) || 
+      (sy > in[0].matrix.Naxis[1])) {
+    gprint (GP_ERR, "region outside of source image\n");
+    return (FALSE);
+  }
+
+  if ((Sx + nx > Nx) || (Sy + ny > Ny)) {
+    gprint (GP_ERR, "source region larger than dest region\n");
+    return (FALSE);
+  }
+  if ((Sx < 0) || (Sy < 0)) {
+    gprint (GP_ERR, "dest region out of range\n");
+    return (FALSE);
+  }
+
+  if ((out = SelectBuffer (argv[2], OLDBUFFER, FALSE)) == NULL) {
+    if ((out = SelectBuffer (argv[2], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+    gfits_free_matrix (&out[0].matrix);
+    gfits_free_header (&out[0].header);
+
+    out[0].bitpix = in[0].bitpix;
+    out[0].unsign = in[0].unsign;
+    out[0].bscale = in[0].bscale;
+    out[0].bzero  = in[0].bzero;
+    gfits_copy_header (&in[0].header, &out[0].header);
+    gfits_modify (&out[0].header, "NAXIS1", "%d", 1, Nx);
+    gfits_modify (&out[0].header, "NAXIS2", "%d", 1, Ny);
+    out[0].header.Naxis[0] = Nx;
+    out[0].header.Naxis[1] = Ny;
+    gfits_create_matrix (&out[0].header, &out[0].matrix);
+  } else {
+    if ((out[0].header.Naxis[1] != Ny) || (out[0].header.Naxis[0] != Nx)) {
+      gprint (GP_ERR, "matrix sizes mis-matched\n");
+      gprint (GP_ERR, "%d x %d  vs  %d x %d\n", Nx, Ny, 
+	       out[0].header.Naxis[0], out[0].header.Naxis[1]);
+      return (FALSE);
+    }
+  }
+
+  for (j = 0; j < ny; j++) {
+    if (j + sy < 0) continue;
+    if (j + sy >= NY) continue;
+    Vin = (float *)(in[0].matrix.buffer) + (j + sy)*in[0].matrix.Naxis[0] + sx;  
+    Vout = (float *)(out[0].matrix.buffer) + (j + Sy)*out[0].matrix.Naxis[0] + Sx;   
+    for (i = 0; i < nx; i++, Vin++, Vout++) {
+      if (i + sx < 0) continue;
+      if (i + sx >= NX) continue;
+      *Vout = *Vin;
+    }
+  }
+
+  return (TRUE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fft1d.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fft1d.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fft1d.c	(revision 15879)
@@ -0,0 +1,70 @@
+# include "data.h"
+
+int fft1d (int argc, char **argv) {
+  
+  int i, Npix, ZeroImaginary;
+  float *t1, *t2, *temp;
+  Vector *Ire, *Iim, *Ore, *Oim;
+
+  if ((argc != 6) || (strcmp (argv[3], "to"))) {
+    gprint (GP_ERR, "USAGE: fft1d (real) (imag) to (real) (imag)\n");
+    return (FALSE);
+  }
+
+  Iim = NULL;
+  ZeroImaginary = TRUE;
+  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);
+
+  Npix = Ire[0].Nelements;
+  if (!ZeroImaginary && (Npix != Iim[0].Nelements)) {
+    gprint (GP_ERR, "vector mismatch in size\n");
+    return (FALSE);
+  }
+
+  if (!IsBinary (Npix)) {
+    gprint (GP_ERR, "Npix is not a binary number!\n");
+    return (FALSE);
+  }
+  
+  ALLOCATE (temp, float, 2*Npix);
+  if (ZeroImaginary) {
+    t1 = Ire[0].elements;
+    for (i = 0; i < Npix; i++, t1++) {
+      temp[2*i  ] = *t1;
+      temp[2*i+1] = 0;
+    }
+  } else {
+    t1 = Ire[0].elements;
+    t2 = Iim[0].elements;
+    for (i = 0; i < Npix; i++, t1++, t2++) {
+      temp[2*i  ] = *t1;
+      temp[2*i+1] = *t2;
+    }
+  }    
+    
+  fft (temp, Npix, 1); 
+
+  Ore[0].Nelements = Npix;
+  Oim[0].Nelements = Npix;
+  REALLOCATE (Ore[0].elements, float, Npix);
+  REALLOCATE (Oim[0].elements, float, Npix);
+ 
+  t1 = Ore[0].elements;
+  t2 = Oim[0].elements;
+  for (i = 0; i < Npix; i++, t1++, t2++) {
+    *t1 = temp[2*i  ] / Npix;
+    *t2 = temp[2*i+1] / Npix;
+  }    
+  
+  free (temp);
+  
+  return (TRUE);
+}
+
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fft2d.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fft2d.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fft2d.c	(revision 15879)
@@ -0,0 +1,113 @@
+# include "data.h"
+
+int fft2d (int argc, char **argv) {
+  
+  int i, N, Nx, Ny, Naxis[2];
+  int Npix, ZeroImaginary, isign;
+  float *t1, *t2, *out, *temp;
+  Buffer *Ire, *Iim, *Ore, *Oim;;
+
+  isign = 1;
+  if ((N = get_argument (argc, argv, "-inverse"))) {
+    remove_argument (N, &argc, argv);
+    isign = -1;
+  }
+
+  if ((argc != 6) || (strcmp (argv[3], "to"))) {
+    gprint (GP_ERR, "USAGE: fft2d (real) (imag) to (real) (imag)\n");
+    return (FALSE);
+  }
+
+  /* select input / output buffers */
+  Iim = NULL;
+  ZeroImaginary = TRUE; /* Input(imaginary) may be 0, in which case we create a 0 filled image */
+  if (!strcmp (argv[2], "0")) { 
+  } else {
+    ZeroImaginary = FALSE;
+    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);
+
+  /* free up output space */
+  gfits_free_matrix (&Ore[0].matrix);
+  gfits_free_header (&Ore[0].header);
+  gfits_free_matrix (&Oim[0].matrix);
+  gfits_free_header (&Oim[0].header);
+
+  /* get image dimensions, check value */
+  Npix = Ire[0].header.Naxis[0]*Ire[0].header.Naxis[1];
+  Nx = Ire[0].header.Naxis[0];
+  Ny = Ire[0].header.Naxis[1];
+  Naxis[0] = Ny; Naxis[1] = Nx;
+  if (!IsBinary (Npix)) {
+    gprint (GP_ERR, "dimensions are not binary!\n");
+    return (FALSE);
+  }
+  
+  /* create working space */
+  t1 = (float *) Ire[0].matrix.buffer;
+  ALLOCATE (temp, float, 2*Npix);
+  out = temp;
+
+  /* copy input to working space */
+  if (ZeroImaginary) {
+    for (i = 0; i < Npix; i++, t1++) {
+      *out = *t1;
+      out++;
+      *out = 0;
+      out++;
+    }
+  } else {
+    t2 = (float *) Iim[0].matrix.buffer;
+    for (i = 0; i < Npix; i++, t1++, t2++) {
+      *out = *t1;
+      out++;
+      *out = *t2;
+      out++;
+    }
+  } 
+    
+  /* run the fft */
+  fftN (temp, Naxis, 2, isign);
+
+  /* fix up output headers (real) */
+  gfits_copy_header (&Ire[0].header, &Ore[0].header);
+  gfits_modify (&Ore[0].header, "NAXIS1", "%d", 1, Nx);
+  gfits_modify (&Ore[0].header, "NAXIS2", "%d", 1, Ny);
+  Ore[0].header.Naxis[0] = Nx;
+  Ore[0].header.Naxis[1] = Ny;
+  Ore[0].bitpix = Ire[0].bitpix;
+  Ore[0].unsign = Ire[0].unsign;
+  Ore[0].bscale = Ire[0].bscale;
+  Ore[0].bzero  = Ire[0].bzero;
+  gfits_create_matrix (&Ore[0].header, &Ore[0].matrix);
+
+  /* fix up output headers (imaginary) */
+  gfits_copy_header (&Ire[0].header, &Oim[0].header);
+  gfits_modify (&Oim[0].header, "NAXIS1", "%d", 1, Nx);
+  gfits_modify (&Oim[0].header, "NAXIS2", "%d", 1, Ny);
+  Oim[0].header.Naxis[0] = Nx;
+  Oim[0].header.Naxis[1] = Ny;
+  Oim[0].bitpix = Ire[0].bitpix;
+  Oim[0].unsign = Ire[0].unsign;
+  Oim[0].bscale = Ire[0].bscale;
+  Oim[0].bzero  = Ire[0].bzero;
+  gfits_create_matrix (&Oim[0].header, &Oim[0].matrix);
+
+  /* move data from working space to output buffers */
+  out = temp;
+  t1 = (float *) Ore[0].matrix.buffer;
+  t2 = (float *) Oim[0].matrix.buffer;
+  for (i = 0; i < Npix; i++, t1++, t2++) {
+    *t1 = *out / Npix;
+    out ++;
+    *t2 = *out / Npix;
+    out ++;
+  }    
+
+  free (temp);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fit.c	(revision 15879)
@@ -0,0 +1,227 @@
+# include "data.h"
+
+int fit (int argc, char **argv) {
+  
+  double **c, **b, *s, X, Y, dY, dY2;
+  double ClipNSigma, mean, sigma, maxsigma;
+  int i, j, nterm, mterm, order, Npt, Nmask;
+  int N, Weight, Quiet, ClipNiter;
+  Vector *xvec, *yvec, *dyvec;
+  float *x, *y, *dy, *yf, *yfit;
+  char name[64], *mask;
+
+  Quiet = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  ClipNSigma = 0;
+  ClipNiter  = 1;
+  if ((N = get_argument (argc, argv, "-clip"))) {
+    remove_argument (N, &argc, argv);
+    ClipNSigma = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    ClipNiter  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  dy = NULL;
+  dyvec = NULL;
+  Weight = FALSE;
+  if ((N = get_argument (argc, argv, "-dy"))) {
+    remove_argument (N, &argc, argv);
+    if ((dyvec = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+    remove_argument (N, &argc, argv);
+    Weight = TRUE;
+  }
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: fit x y order [-dy wt] [-quiet/-q] [-clip Nsigma Niter]\n");
+    return (FALSE);
+  }
+
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+
+  if (xvec[0].Nelements != yvec[0].Nelements) {
+    gprint (GP_ERR, "vectors must have same length\n");
+    return (FALSE);
+  }
+  if (Weight && xvec[0].Nelements != dyvec[0].Nelements) {
+    gprint (GP_ERR, "vectors must have same length\n");
+    return (FALSE);
+  }
+  
+  /* nterm is number of polynomial terms, starting at x^0 */
+  order = atof (argv[3]);
+  nterm = order + 1;
+  mterm = 2*nterm;
+
+  ALLOCATE (yfit, float, xvec[0].Nelements);
+  ALLOCATE (mask, char, xvec[0].Nelements);
+  memset (mask, 0, xvec[0].Nelements);
+
+  ALLOCATE (s, double, mterm);
+  ALLOCATE (b, double *, nterm);
+  ALLOCATE (c, double *, nterm);
+  for (i = 0; i < nterm; i++) {
+    ALLOCATE (c[i], double, nterm);
+    ALLOCATE (b[i], double, 1);
+  }
+
+  Nmask = 0;
+  sigma = 0.0;
+
+  for (N = 0; N < ClipNiter; N++) {
+
+    /* init registers for current pass */
+    memset (s, 0, mterm*sizeof(double));
+    for (i = 0; i < nterm; i++) {
+      memset (c[i], 0, nterm*sizeof(double));
+      memset (b[i], 0, sizeof(double));
+    }
+
+    /* perform linear fit */
+    x = xvec[0].elements;
+    y = yvec[0].elements;
+    if (Weight) dy = dyvec[0].elements;
+
+    for (i = 0; i < xvec[0].Nelements; i++, x++, y++) {
+      if (mask[i]) continue;
+      if (!(finite(*x) && finite(*y))) continue;
+      dY = 1.0;
+      if (Weight) { 
+	dY = 1.0 / SQ(*dy);
+	dy ++;
+      }
+      X = 1*dY;
+      Y = *y*dY;
+      for (j = 0; j < nterm; j++) {
+	s[j] += X;
+	b[j][0] += Y;
+	X = X * (*x);
+	Y = Y * (*x);
+      }
+      for (j = nterm; j < mterm; j++) {
+	s[j] += X;
+	X = X * (*x);
+      }
+    }
+    for (i = 0; i < nterm; i++) {
+      for (j = 0; j < nterm; j++) {
+	c[i][j] = s[i + j];
+      }
+    }
+    if (!dgaussj (c, nterm, b, 1)) goto escape;
+
+    /* generate fitted values */
+    x = xvec[0].elements;
+    yf = yfit;
+    for (i = 0; i < xvec[0].Nelements; i++, x++, yf++) {
+      if (!finite(*x)) continue;
+      *yf = 0;
+      X = 1;
+      for (j = 0; j < order + 1; j++) {
+	*yf += b[j][0]*X;
+	X = X * (*x);
+      }
+    }
+
+    /* measure fit residual scatter */
+    x  = xvec[0].elements;
+    y  = yvec[0].elements;
+    yf = yfit;
+    dY = dY2 = 0;
+    for (i = Npt = 0; i < xvec[0].Nelements; i++, x++, y++, yf++) {
+      if (mask[i]) continue;
+      if (!finite(*x)) continue;
+      dY  += (*y - *yf);
+      dY2 += SQ(*y - *yf);
+      Npt ++;
+    }
+    mean  = dY / Npt;
+    sigma = sqrt (fabs(dY2/Npt - SQ(mean)));
+    maxsigma = ClipNSigma * sigma;
+
+    /* mask outlier points */
+    x  = xvec[0].elements;
+    y  = yvec[0].elements;
+    yf = yfit;
+    Nmask = 0;
+    for (i = 0; ClipNSigma && (i < xvec[0].Nelements); i++, x++, y++, yf++) {
+      dY = (*y - *yf);
+      if (fabs(dY) > maxsigma) {
+	mask[i] = TRUE;
+	Nmask ++;
+      } else {
+	mask[i] = FALSE;
+      }	
+    }
+  }
+      
+  /* print & save basic fit parameters */
+  if (!Quiet) gprint (GP_ERR, "y = ");
+  for (i = 0; i < nterm; i++) {
+    sprintf (name, "C%d", i);
+    set_variable (name, b[i][0]);
+    if (!Quiet) gprint (GP_ERR, "%f x^%d ", b[i][0], i);
+  }
+  sprintf (name, "Cn");
+  set_variable (name, (double) order);
+  
+  /* print & save basic fit parameters */
+  if (!Quiet) gprint (GP_ERR, "\n");
+  if (!Quiet) gprint (GP_ERR, "    ");
+  for (i = 0; i < nterm; i++) {
+    sprintf (name, "dC%d", i);
+    set_variable (name, sqrt(c[i][i]));
+    if (!Quiet) gprint (GP_ERR, "%f     ", sqrt(c[i][i]));
+  }
+  if (!Quiet) gprint (GP_ERR, "\n");
+
+  set_variable ("dC", sigma);
+  set_variable ("Cnv", (xvec[0].Nelements - Nmask));
+
+  /* save mask and yfit for testing? */
+  if (1) { 
+    Vector *fvec, *mvec;
+    if ((fvec = SelectVector ("yfit", ANYVECTOR, TRUE)) == NULL) return (FALSE);    
+    if ((mvec = SelectVector ("mask", ANYVECTOR, TRUE)) == NULL) return (FALSE);    
+    free (fvec[0].elements);
+    fvec[0].elements = yfit;
+    fvec[0].Nelements = xvec[0].Nelements;
+    mvec[0].Nelements = xvec[0].Nelements;
+
+    REALLOCATE (mvec[0].elements, float, xvec[0].Nelements);
+    for (i = 0; i < xvec[0].Nelements; i++) {
+      mvec[0].elements[i] = mask[i];
+    }
+  } else {
+    free (yfit);
+  }
+  free (mask);
+
+  for (i = 0; i < nterm; i++) {
+    free (b[i]);
+    free (c[i]);
+  }
+  free (b);
+  free (c);
+  free (s);
+  return (TRUE);
+
+escape:
+  for (i = 0; i < nterm; i++) {
+    free (b[i]);
+    free (c[i]);
+  }
+  free (b);
+  free (c);
+  free (s);
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fit2d.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fit2d.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/fit2d.c	(revision 15879)
@@ -0,0 +1,265 @@
+# include "data.h"
+
+int fit2d (int argc, char **argv) {
+  
+  double **c, **b, **s, X, Y, dZ, dZ2;
+  double ClipNSigma, mean, sigma, maxsigma;
+  int k, K, i, j, n, Npt, Nmask, nx, ny, nterm, mterm, wterm, order;
+  int N, Weight, Quiet, ClipNiter, VERBOSE;
+  float *x, *y, *z, *dz, *zfit, *zf; 
+  char name[64], *mask;
+  Vector *xvec, *yvec, *zvec, *dzvec;
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    VERBOSE = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  Quiet = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  ClipNSigma = 0;
+  ClipNiter  = 1;
+  if ((N = get_argument (argc, argv, "-clip"))) {
+    remove_argument (N, &argc, argv);
+    ClipNSigma = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    ClipNiter  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  dz = NULL;
+  dzvec = NULL;
+  Weight = FALSE;
+  if ((N = get_argument (argc, argv, "-dz"))) {
+    remove_argument (N, &argc, argv);
+    if ((dzvec = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+    remove_argument (N, &argc, argv);
+    Weight = TRUE;
+  }
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: fit x y z order [-dz wt]\n");
+    return (FALSE);
+  }
+
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+  if ((zvec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+
+  if (xvec[0].Nelements != yvec[0].Nelements) {
+    gprint (GP_ERR, "vectors must have same length\n");
+    return (FALSE);
+  }
+  if (xvec[0].Nelements != zvec[0].Nelements) {
+    gprint (GP_ERR, "vectors must have same length\n");
+    return (FALSE);
+  }
+  if (Weight && xvec[0].Nelements != dzvec[0].Nelements) {
+    gprint (GP_ERR, "vectors must have same length\n");
+    return (FALSE);
+  }
+  
+  order = atof (argv[4]);
+  nterm = order + 1;
+  wterm = nterm*(nterm + 1)/2;
+  mterm = 2*order + 1;
+
+  ALLOCATE (zfit, float, xvec[0].Nelements);
+  ALLOCATE (mask, char, xvec[0].Nelements);
+  memset (mask, 0, xvec[0].Nelements);
+
+  /* allocate the summation matrices */
+  ALLOCATE (s, double *, mterm);
+  ALLOCATE (b, double *, wterm);
+  ALLOCATE (c, double *, wterm);
+  for (i = 0; i < wterm; i++) {
+    ALLOCATE (c[i], double, wterm);
+    ALLOCATE (b[i], double, 1);
+  }
+  for (i = 0; i < mterm; i++) {
+    ALLOCATE (s[i], double, mterm);
+  }
+
+  for (N = 0; N < ClipNiter; N++) {
+
+    /* init registers for current pass */
+    // XXX this was incorrectly using nterm (missing 1 row)
+    for (i = 0; i < wterm; i++) {
+      memset (c[i], 0, wterm*sizeof(double));
+      memset (b[i], 0, sizeof(double));
+    }
+    for (i = 0; i < mterm; i++) {
+      memset (s[i], 0, mterm*sizeof(double));
+    }
+
+    x = xvec[0].elements;
+    y = yvec[0].elements;
+    z = zvec[0].elements;
+    if (Weight) dz = dzvec[0].elements;
+
+    /* add up the x,y values */
+    for (i = 0; i < xvec[0].Nelements; i++, x++, y++) {
+      if (mask[i]) continue;
+      if (!finite(*x) || !finite(*y)) continue;
+      dZ = 1.0;
+      if (Weight) { 
+	dZ = 1.0 / SQ(*dz);
+	dz ++;
+      }
+      Y = X = 1*dZ;
+      for (ny = 0; ny < mterm; ny++) {
+	X = Y;
+	for (nx = 0; nx < mterm - ny; nx++) {
+	  s[nx][ny] += X;
+	  X = X * (*x);
+	}
+	Y = Y * (*y);
+      }
+    }
+
+    /* add up the z values */
+    x = xvec[0].elements;
+    y = yvec[0].elements;
+    z = zvec[0].elements;
+    for (i = 0; i < xvec[0].Nelements; i++, x++, y++, z++) {
+      if (mask[i]) continue;
+      if (!finite(*x) || !finite(*y)) continue;
+      dZ = 1.0;
+      if (Weight) { 
+	dZ = 1.0 / SQ(*dz);
+	dz ++;
+      }
+      Y = X = *z*dZ;
+      for (j = 0, ny = 0; ny < nterm; ny++) {
+	X = Y;
+	for (nx = 0; nx < nterm - ny; nx++, j++) {
+	  b[j][0] += X;
+	  X = X * (*x);
+	}
+	Y = Y * (*y);
+      }
+    }
+
+    /* re-sort mterm x mterm matrix to wterm matrix */
+    for (k = j = 0; j < nterm; j++) {
+      for (i = 0; i < nterm - j; i++, k++) {
+	for (K = ny = 0; ny < nterm; ny++) {
+	  for (nx = 0; nx < nterm - ny; nx++, K++) {
+	    c[K][k] = s[nx+i][ny+j];
+	  }
+	}
+      }
+    }
+
+    dgaussj (c, wterm, b, 1);
+
+    /** test print **/
+    if (VERBOSE) {
+      for (i = ny = 0; ny < nterm; ny++) {
+	for (nx = 0; nx < nterm - ny; nx++, i++) {
+	  gprint (GP_ERR, "x^%d y^%d: %g\n", nx, ny, b[i][0]);
+	}
+      }
+    }
+
+    /* the b[][0] terms are in the following order:
+       y^0 x^0, y^0 x^1, ... y^0 x^N
+       y^1 x^0, y^1 x^1, ... y^1 x^N
+       ...
+       y^N x^0, y^N x^1, ... y^N x^N
+    */
+    /* generate fitted values */
+    x = xvec[0].elements;
+    y = yvec[0].elements;
+    zf = zfit;
+    for (n = 0; n < xvec[0].Nelements; n++, x++, y++, zf++) {
+      if (!finite(*x) || !finite(*y)) continue;
+      *zf = 0;
+      Y = X = 1;
+      for (i = ny = 0; ny < nterm; ny++) {
+	Y = X;
+	for (nx = 0; nx < nterm - ny; nx++, i++) {
+	  *zf += b[i][0]*Y;
+	  Y = Y * (*y);
+	}
+	X = X * (*x);
+      }
+    }
+
+    /* measure fit residual scatter */
+    x  = xvec[0].elements;
+    y  = yvec[0].elements;
+    z  = zvec[0].elements;
+    zf = zfit;
+    dZ = dZ2 = 0;
+    for (i = Npt = 0; i < xvec[0].Nelements; i++, x++, y++, z++, zf++) {
+      if (mask[i]) continue;
+      if (!finite(*x) || !finite(*y)) continue;
+      dZ  += (*z - *zf);
+      dZ2 += SQ(*z - *zf);
+      Npt ++;
+    }
+    mean  = dZ / Npt;
+    sigma = sqrt (fabs(dZ2/Npt - SQ(mean)));
+    maxsigma = ClipNSigma * sigma;
+
+    if (VERBOSE) gprint (GP_ERR, "mean: %g, sigma: %g, maxsigma: %g\n", mean, sigma, maxsigma);
+
+    /* mask outlier points */
+    x  = xvec[0].elements;
+    y  = yvec[0].elements;
+    z  = zvec[0].elements;
+    zf = zfit;
+    Nmask = 0;
+    for (i = 0; ClipNSigma && (i < xvec[0].Nelements); i++, x++, y++, z++, zf++) {
+      dZ = (*z - *zf);
+      if (fabs(dZ) > maxsigma) {
+	mask[i] = TRUE;
+	Nmask ++;
+      } else {
+	mask[i] = FALSE;
+      }	
+    }
+    if (VERBOSE) gprint (GP_ERR, "pass: %d, Nmask: %d\n", N, Nmask);
+  }
+
+  if (!Quiet) gprint (GP_ERR, "z = ");
+  for (N = ny = 0; ny < nterm; ny++) {
+    for (nx = 0; nx < nterm - ny; nx++, N++) {
+      sprintf (name, "CX%dY%d", nx, ny);
+      set_variable (name, b[N][0]);
+      if (!Quiet) gprint (GP_ERR, "%f x^%d y^%d  ", b[N][0], nx, ny);
+    }
+  }
+  sprintf (name, "Cnn");
+  set_variable (name, (double) order);
+  
+  if (!Quiet) gprint (GP_ERR, "\n");
+
+  /* free internal data */
+  free (zfit);
+  free (mask);
+
+  for (i = 0; i < wterm; i++) {
+    free (c[i]);
+    free (b[i]);
+  }
+  free (b);
+  free (c);
+
+  for (i = 0; i < mterm; i++) {
+    free (s[i]);
+  }
+  free (s);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/gaussdeviate.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/gaussdeviate.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/gaussdeviate.c	(revision 15879)
@@ -0,0 +1,61 @@
+# include "data.h"
+
+int gaussdeviate (int argc, char **argv) {
+  
+  int i, Npts;
+  double mean, sigma;
+  Vector *vec;
+
+  if (argc != 5) goto usage;
+
+  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);    
+
+  Npts = atoi (argv[2]);
+  mean = atof (argv[3]);
+  sigma = atof (argv[4]);
+
+  vec[0].Nelements = Npts;
+  REALLOCATE (vec[0].elements, float, Npts);
+
+  gauss_init (2048);
+  for (i = 0; i < Npts; i++) {
+    vec[0].elements[i] = rnd_gauss (mean, sigma);
+  }
+  return (TRUE);
+
+ usage:
+  gprint (GP_ERR, "USAGE: gaussdeviate (vector) Npts mean sigma\n");
+  return (FALSE);
+    
+}
+
+double int_gauss (int i);
+
+int gaussintegral (int argc, char **argv) {
+  
+  int i, Npts;
+  double mean, sigma;
+  Vector *vec;
+
+  if (argc != 5) goto usage;
+
+  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);    
+
+  Npts = atoi (argv[2]);
+  mean = atof (argv[3]);
+  sigma = atof (argv[4]);
+
+  vec[0].Nelements = Npts;
+  REALLOCATE (vec[0].elements, float, Npts);
+
+  gauss_init (Npts);
+  for (i = 0; i < Npts; i++) {
+    vec[0].elements[i] = int_gauss (i);
+  }
+  return (TRUE);
+
+ usage:
+  gprint (GP_ERR, "USAGE: gaussintegral Npts mean sigma\n");
+  return (FALSE);
+    
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/gaussj.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/gaussj.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/gaussj.c	(revision 15879)
@@ -0,0 +1,63 @@
+# include "data.h"
+
+int gaussjordan (int argc, char **argv) {
+  
+  float *m, *v;
+  double **a, **b;
+  int i, j, N, status;
+  Vector *B;
+  Buffer *A;
+
+  if (argc != 3) goto usage;
+
+  if ((A = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);    
+  if ((B = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+
+  N = B[0].Nelements;
+  if (A[0].matrix.Naxis[0] != N) goto usage;
+  if (A[0].matrix.Naxis[1] != N) goto usage;
+  
+  ALLOCATE (a, double *, N);
+  ALLOCATE (b, double *, N);
+  for (i = 0; i < N; i++) {
+    ALLOCATE (a[i], double, N);
+    ALLOCATE (b[i], double, 1);
+  }
+
+  m = (float *) A[0].matrix.buffer;
+  v = B[0].elements;
+  for (i = 0; i < N; i++) {
+    for (j = 0; j < N; j++) {
+      a[i][j] = m[i+j*N];
+    }
+    b[i][0] = v[i]; 
+  }
+
+  status = dgaussj (a, N, b, 1);
+
+  for (i = 0; i < N; i++) {
+    for (j = 0; j < N; j++) {
+       m[i+j*N] = a[i][j];
+    }
+    v[i] = b[i][0]; 
+  }
+
+  for (i = 0; i < N; i++) {
+    free (a[i]);
+    free (b[i]);
+  }
+  free (a);
+  free (b);
+
+  if (!status) {
+      gprint (GP_ERR, "failure in matrix solution\n");
+  }
+  return (status);
+
+ usage:
+  gprint (GP_ERR, "USAGE: gaussj A B\n");
+  gprint (GP_ERR, "  solves Ax = B, returns 1/A in A and x in B\n");
+  gprint (GP_ERR, "  A must be square, B same dimensions\n");
+  return (FALSE);
+    
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/grid.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/grid.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/grid.c	(revision 15879)
@@ -0,0 +1,203 @@
+# include "data.h"
+
+int grid (int argc, char **argv) {
+  
+  int j, kapa, N, MinorTick, MajorTick;
+  Vector Xvec, Yvec;
+  double range, lrange, factor, mantis, fmantis, power, major, minor, first, next;
+  Graphdata graphmode;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return (FALSE);
+
+  MajorTick = TRUE;
+  MinorTick = FALSE;
+  if ((N = get_argument (argc, argv, "-all"))) {
+    remove_argument (N, &argc, argv);
+    MinorTick = TRUE;
+  }
+
+  if (argc > 1) {
+    gprint (GP_ERR, "USAGE: grid [-n graph]\n");
+    return (FALSE);
+  }
+
+  N = 0;
+  Xvec.Nelements = 200;
+  Yvec.Nelements = 200;
+  ALLOCATE (Xvec.elements, float, Xvec.Nelements);
+  ALLOCATE (Yvec.elements, float, Yvec.Nelements);
+
+  major = minor = 1;
+  range = graphmode.xmax - graphmode.xmin;
+  lrange = log10(MAX(fabs(range), 1e-30));
+  factor = (int) (lrange);
+  if (lrange < 0) { factor -= 1; }
+  mantis = lrange - factor;
+  power = pow(10.0, factor);
+  fmantis = pow(10.0, mantis);
+  if ((fmantis >= 1.0) && (fmantis <=  2.0)) {
+    major = 0.5 * power;
+    minor = 0.1 * power;
+  }
+  if ((fmantis > 2.0) && (fmantis <=  4.0)) {
+    major = 1.0 * power;
+    minor = 0.2 * power;
+  }
+  if ((fmantis > 4.0) && (fmantis <=  6.0)) {
+    major = 1.0 * power;
+    minor = 0.5 * power;
+  }
+  if ((fmantis > 6.0) && (fmantis <=  10.0)) {
+    major = 2.0 * power;
+    minor = 0.5 * power;
+  }
+  if (graphmode.xmin > 0)
+    first = minor + minor*((int)(graphmode.xmin/minor));
+  else 
+    first = -minor + minor*((int)(graphmode.xmin/minor));
+  if (minor*((int)(graphmode.xmin/minor)) == graphmode.xmin) {
+    first = graphmode.xmin;
+  }
+  
+  for (j = 0, next = first; next <= graphmode.xmax; j++) {
+    if ((fabs((int)(next/major) - (next/major)) < 0.5*(minor/major)) || (fabs ((int)((next + 0.5*minor)/major) - (next/major)) < 0.5*(minor/major))) {
+      if (MajorTick) {
+	/* major tick */
+	Xvec.elements[N] = next;
+	Yvec.elements[N] = graphmode.ymin;
+	N++;
+	if (N == Xvec.Nelements) {
+	  Xvec.Nelements += 200;
+	  Yvec.Nelements += 200;
+	  REALLOCATE (Xvec.elements, float, Xvec.Nelements);
+	  REALLOCATE (Yvec.elements, float, Yvec.Nelements);
+	}
+	Xvec.elements[N] = next;
+	Yvec.elements[N] = graphmode.ymax;
+	N++;
+	if (N == Xvec.Nelements) {
+	  Xvec.Nelements += 200;
+	  Yvec.Nelements += 200;
+	  REALLOCATE (Xvec.elements, float, Xvec.Nelements);
+	  REALLOCATE (Yvec.elements, float, Yvec.Nelements);
+	}
+      }
+    } else {
+      if (MinorTick) {
+	/* minor tick */
+	Xvec.elements[N] = next;
+	Yvec.elements[N] = graphmode.ymin;
+	N++;
+	if (N == Xvec.Nelements) {
+	  Xvec.Nelements += 200;
+	  Yvec.Nelements += 200;
+	  REALLOCATE (Xvec.elements, float, Xvec.Nelements);
+	  REALLOCATE (Yvec.elements, float, Yvec.Nelements);
+	}
+	Xvec.elements[N] = next;
+	Yvec.elements[N] = graphmode.ymax;
+	N++;
+	if (N == Xvec.Nelements) {
+	  Xvec.Nelements += 200;
+	  Yvec.Nelements += 200;
+	  REALLOCATE (Xvec.elements, float, Xvec.Nelements);
+	  REALLOCATE (Yvec.elements, float, Yvec.Nelements);
+	}
+      }
+    }
+    next += minor;
+  }
+
+  range = graphmode.ymax - graphmode.ymin;
+  lrange = log10(MAX(fabs(range), 1e-30));
+  factor = (int) (lrange);
+  if (lrange < 0) { factor -= 1; }
+  mantis = lrange - factor;
+  power = pow(10.0, factor);
+  fmantis = pow(10.0, mantis);
+  if ((fmantis >= 1.0) && (fmantis <=  2.0)) {
+    major = 0.5 * power;
+    minor = 0.1 * power;
+  }
+  if ((fmantis > 2.0) && (fmantis <=  4.0)) {
+    major = 1.0 * power;
+    minor = 0.2 * power;
+  }
+  if ((fmantis > 4.0) && (fmantis <=  6.0)) {
+    major = 1.0 * power;
+    minor = 0.5 * power;
+  }
+  if ((fmantis > 6.0) && (fmantis <=  10.0)) {
+    major = 2.0 * power;
+    minor = 0.5 * power;
+  }
+  if (graphmode.ymin > 0)
+    first = minor + minor*((int)(graphmode.ymin/minor));
+  else 
+    first = -minor + minor*((int)(graphmode.ymin/minor));
+  if (minor*((int)(graphmode.ymin/minor)) == graphmode.ymin) {
+    first = graphmode.ymin;
+  }
+  
+  for (j = 0, next = first; next <= graphmode.ymax; j++) {
+    if ((fabs((int)(next/major) - (next/major)) < 0.5*(minor/major)) || (fabs ((int)((next + 0.5*minor)/major) - (next/major)) < 0.5*(minor/major))) {
+      if (MajorTick) {
+	/* major tick */
+	Xvec.elements[N] = graphmode.xmin;
+	Yvec.elements[N] = next;
+	N++;
+	if (N == Xvec.Nelements) {
+	  Xvec.Nelements += 200;
+	  Yvec.Nelements += 200;
+	  REALLOCATE (Xvec.elements, float, Xvec.Nelements);
+	  REALLOCATE (Yvec.elements, float, Yvec.Nelements);
+	}
+	Xvec.elements[N] = graphmode.xmax;
+	Yvec.elements[N] = next;
+	N++;
+	if (N == Xvec.Nelements) {
+	  Xvec.Nelements += 200;
+	  Yvec.Nelements += 200;
+	  REALLOCATE (Xvec.elements, float, Xvec.Nelements);
+	  REALLOCATE (Yvec.elements, float, Yvec.Nelements);
+	}
+      }
+    } else {
+      if (MinorTick) {
+	/* minor tick */
+	Xvec.elements[N] = graphmode.xmin;
+	Yvec.elements[N] = next;
+	N++;
+	if (N == Xvec.Nelements) {
+	  Xvec.Nelements += 200;
+	  Yvec.Nelements += 200;
+	  REALLOCATE (Xvec.elements, float, Xvec.Nelements);
+	  REALLOCATE (Yvec.elements, float, Yvec.Nelements);
+	}
+	Xvec.elements[N] = graphmode.xmax;
+	Yvec.elements[N] = next;
+	N++;
+	if (N == Xvec.Nelements) {
+	  Xvec.Nelements += 200;
+	  Yvec.Nelements += 200;
+	  REALLOCATE (Xvec.elements, float, Xvec.Nelements);
+	  REALLOCATE (Yvec.elements, float, Yvec.Nelements);
+	}
+      }
+    }
+    next += minor;
+  }
+
+  Xvec.Nelements = Yvec.Nelements = N;
+  graphmode.style = 2; /* points */
+  graphmode.ptype = 100; /* connect a pair */
+  graphmode.etype = 0;
+  PlotVectorPair (kapa, N, Xvec.elements, Yvec.elements, &graphmode);
+
+  free (Xvec.elements);
+  free (Yvec.elements);
+
+  return (TRUE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/gridify.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/gridify.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/gridify.c	(revision 15879)
@@ -0,0 +1,82 @@
+# include "data.h"
+
+int gridify (int argc, char **argv) {
+
+  int i, Nx, Ny, Xb, Yb, Normalize, N;
+  float Xmin, Xmax, dX, Ymin, Ymax, dY;
+  float *buf, *val, *x, *y, *z;
+  int *Nval;
+  Buffer *bf;
+  Vector *vx, *vy, *vz;
+
+  Normalize = TRUE;
+  if ((N = get_argument (argc, argv, "-raw"))) {
+    remove_argument (N, &argc, argv);
+    Normalize = FALSE;
+  }
+
+  if (argc != 11) {
+    gprint (GP_ERR, "USAGE: gridify x y z buffer Xmin Xmax dX Ymin Ymax dY\n");
+    return (FALSE);
+  }
+  
+  if ((vx = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vy = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vz = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((bf = SelectBuffer (argv[4], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  if (vx[0].Nelements != vy[0].Nelements) return (FALSE);
+  if (vx[0].Nelements != vz[0].Nelements) return (FALSE);
+
+  Xmin = atof (argv[5]);
+  Xmax = atof (argv[6]);
+  dX   = atof (argv[7]);
+
+  Ymin = atof (argv[8]);
+  Ymax = atof (argv[9]);
+  dY   = atof (argv[10]);
+
+  Nx = (Xmax - Xmin) / dX + 1;
+  Ny = (Ymax - Ymin) / dY + 1;
+  
+  gfits_free_matrix (&bf[0].matrix);
+  gfits_free_header (&bf[0].header);
+  CreateBuffer (bf, Nx, Ny, -32, 0.0, 1.0);
+  strcpy (bf[0].file, "(empty)");
+
+  ALLOCATE (val, float, Nx*Ny);
+  bzero (val, Nx*Ny*sizeof(float));
+  ALLOCATE (Nval, int, Nx*Ny);
+  bzero (Nval, Nx*Ny*sizeof(int));
+
+  x = vx[0].elements;
+  y = vy[0].elements;
+  z = vz[0].elements;
+  for (i = 0; i < vx[0].Nelements; i++, x++, y++, z++) {
+    Xb = (*x - Xmin) / dX;
+    Yb = (*y - Ymin) / dY;
+    if (Xb >= Nx) continue;
+    if (Yb >= Ny) continue;
+    val[Xb + Yb*Nx] += *z;
+    Nval[Xb + Yb*Nx]++;
+  }
+
+  buf = (float *) bf[0].matrix.buffer;
+  for (i = 0; i < Nx*Ny; i++) {
+    if (Normalize) {
+      if (Nval[i] == 0) {
+	buf[i] = 0;
+	continue;
+      }
+      buf[i] = val[i] / Nval[i];
+    } else {
+      buf[i] = val[i];
+    }
+  }
+
+  free (val);
+  free (Nval);
+
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/Graphics
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/Graphics	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/Graphics	(revision 15879)
@@ -0,0 +1,20 @@
+
+  Kapa, the graphics window.
+
+  Kapa is the program which Status uses to display plots on an X
+terminal.  There are actually 5 graphics windows available to Status,
+though several functions write to specific windows by default.  All
+plots of sky coordinates are displayed on window 0, while 
+functions which plot other types of data use window 1.  Most functions
+have an option -n which allows the user to specify which Kapa window.
+If it is not specified, the last window used will receive the action.
+
+  Below are the available Resources.  
+
+  kii*Foreground:			white
+  kii*Background:			maroon
+  kii*geometry:				540x540+10+10
+
+  See Also: box, clear, limits, plot
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/Kii
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/Kii	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/Kii	(revision 15879)
@@ -0,0 +1,57 @@
+
+
+  Kii (= "picture" in Hawaiian) is the program which Mana uses to
+display images on an X terminal.  The window consists of a main region
+where the image is displayed, a small "zoom box" where a magnified
+view of the region around the cursor is shown, a colorbar showing the
+current color map across the top of the window, a status box where the
+coordinates and pixel values are displayed, and several buttons.
+Clicking with the mounse in the different regions produces different
+effects.
+
+  Image Window:  Clicking with the left mouse button (mouse-1)
+recenters the image at the specified location.  Clicking with the
+right button (mouse-3) also recenters, but increases the zoom factor
+by one.  Clicking with the middle button centers and decreases the
+zoom factor.  
+
+  Colorbar: Clicking and draging with the left button (mouse-1) alters
+the color mapping.  Moving left-to-right slides the center of the
+color scale with the mouse.  Moving up-and-down squeezes or expands
+the color scale.  The middle button resets the color mapping.
+Clicking and dragging side-to-side with the right button expands or
+squeezes the color mapping.  **Note: the dynamic colormap cannot be
+used with a 24 or 32 bit visual.  The standard Linux XFree86 server
+does not support 8 bit visuals in 24 or 32 bit/pixel mode.  In this
+case, the Kii window must resort to a static colormap with the
+colorbar disabled.  In Linux, it is possible to run startx with the
+following command-line options to force the 8 bit/pixel mode:
+# startx -- -bpp 8 
+This assumes that you have an 8bpp Display mode set in the XF86Config
+file.  If not, you can just duplicate the 24 or 32 bpp Display modes
+which will enable this option.
+
+  Buttons:
+    PS: this button creates a PostScript version of the image.
+    Grey: this button makes the colormap a greyscale.
+    Rainbow: this button makes the colormap a rainbow.
+    Puns: this button make the colormap a blue and yellow mapping.
+    Recenter: this button recenters the image and resets the zoom.
+
+  Kii also recognizes several X Resource values:
+
+  Below are the available Resources (with Gene's default values).  Unlike
+most standard X programs, the geometry resource specifies the size of
+the Image Window, not the borders of the entire window.  Valid values
+for the colormap are: greyscale, grayscale (photonegative), -greyscale,
+-grayscale (photopositive), Puns, GoBears (buff 'n blue colormap),
+Rainbow (a rainbow map).  
+
+  kii*Foreground:			white
+  kii*Background:			maroon
+  kii*Colormap:				greyscale
+  kii*geometry:				540x540+10+10
+  
+
+  See Also: tv, cursor
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/Math
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/Math	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/Math	(revision 15879)
@@ -0,0 +1,58 @@
+
+  Opihi shell math operations:
+
+  Mana will evaluate scalar (1D) arithmetic expresions in two
+situations.  To set a variable equal to a math operation, use the
+syntax is:
+
+  $foo = expression
+
+where "expression" is an arithmetic expression on numbers and
+variables, including a variety of functions (see below).  After
+performing the arithmetic and setting the variable to the resulting
+value, mana returns the prompts without performing any further
+command.  Mana will also evaluate any arithmetic expression enclosed
+in curly brackets before attempting to perform the given command.  For
+example, if the variables $MEAN and $SIGMA contain the mean and
+standard deviation of an image, it would be possible to display the
+image with a zero and range based on $MEAN and $SIGMA like this:
+
+  tv image {$MEAN - 1.5*$SIGMA} {5*$SIGMA}
+
+
+The two expressions in curly brackets are evaluated and the resulting
+numbers passed as arguments to the "tv" command.
+
+  See Also:  Variables, tv
+
+
+list of valid math operations:
+
+  binary operators:
+  * (times)
+  / (divided by)
+  + (plus)
+  - (minus)
+  ^ (to the power of: 2^3 = 8)
+
+  unary operators:
+  exp (e to the power of)
+  ten (10 to the power of)
+  ln  (natural logarithm)
+  log (log base 10)
+
+  angles in radians:
+  sin (sine)
+  cos (cosine)
+  tan (tangent)
+  asin (arcsin)
+  acos (arccos)
+  atan (arctan)
+
+  angles in degrees:
+  dsin (sine)
+  dcos (cosine)
+  dtan (tangent)
+  dasin (arcsin)
+  dacos (arccos)
+  datan (arctan)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/applyfit
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/applyfit	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/applyfit	(revision 15879)
@@ -0,0 +1,10 @@
+
+  applyfit x y
+
+  apply the results of a polynomial fit (stored in variables 
+  $C0, $C1, etc, with $Cn representing the order of the fit).
+  The second vector will contain the function value at the 
+  corresponding x coordinates of the first vector.
+
+  See also: fit
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/box
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/box	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/box	(revision 15879)
@@ -0,0 +1,11 @@
+
+  box [-n Nwindow]
+
+  draw a coordinate box on the current kapa window, or on the window
+specified by -n (0 - 4).
+
+  See also: Kapa
+
+
+
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/buffers
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/buffers	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/buffers	(revision 15879)
@@ -0,0 +1,9 @@
+
+  buffers
+
+  buffers gives information about the currently allocated buffers.  
+A * next to the filename means the data has been altered from the
+originally read in image.
+
+  See also: memory
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/center
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/center	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/center	(revision 15879)
@@ -0,0 +1,10 @@
+
+  center (xpix) (ypix) [magnification]
+
+  "center" centers the Kii window at the specified pixel coordinates.
+Specifying a magnification will change the image scale to the
+specified magnification.  If you do not specify a magnification
+(default), the image scale will remain the same.
+
+  See also: Kii, tv
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/clear
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/clear	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/clear	(revision 15879)
@@ -0,0 +1,5 @@
+
+   clear
+
+   clear the Kapa window
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/clip
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/clip	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/clip	(revision 15879)
@@ -0,0 +1,8 @@
+
+  clip (buffer) [min Vmin max Vmax] [-inf val] [-nan val]
+
+  clip values in an image.  A min/max clip can be applied, 
+  in which case all values above max are set to Vmax and all
+  below min are set to Vmin.  -nan and -inf flags will set all 
+  instances of NaN or any non-finite values to the given value.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/close
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/close	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/close	(revision 15879)
@@ -0,0 +1,14 @@
+
+
+   close [-n win] [-g Kapa win] [-i Kii win]
+
+   Closes the specified graphics window
+
+   Default: the most recently activated window (only works
+    for the first call)
+
+   [win]: the index of the window to close
+
+   -n: any graphics or plotting window
+   -g: the Kapa plotting window
+   -i: the Kii image window
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/concat
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/concat	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/concat	(revision 15879)
@@ -0,0 +1,7 @@
+
+   concat v1 v2
+
+   Concatenates the values of vector v1 to the end of vector
+    v2, increasing the length of v2.
+
+   See also: subset, set
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/contour
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/contour	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/contour	(revision 15879)
@@ -0,0 +1,13 @@
+
+  contour <buffer> (overlay) level [Npix]
+
+  "contour" makes a contour plot from the given <buffer> at the
+specified level.  If Npix is specified, the image is rebinned by a
+factor of Npix in each direction.  The contour is drawn as a series of
+lines on the specified overlay.  The new lines are added to any
+existing shapes.  (Use "erase" first to erase all objects if desired).
+
+Valid overlays may be: 0, red, 1, green, 2, blue, 3, yellow.
+
+  See also: load, save, erase
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/create
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/create	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/create	(revision 15879)
@@ -0,0 +1,9 @@
+
+   create (vector) (start) (end) [delta]
+
+   Create a vector of uniformly spaced values, starting at
+   (start) and going to (end).  By default the spacing is 1, but
+   may be chosen with the [delta] option.
+
+   Note: A vector cannot be created if an image buffer already
+    exists with the same name
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/cumulative
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/cumulative	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/cumulative	(revision 15879)
@@ -0,0 +1,8 @@
+
+
+   cumulative (invec) (outvec)
+
+   Creates a vector (outvec) where the element N is the sum of the elements
+    0-N of (invec)
+
+   Note: The final element of (outvec) is always 0
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/cursor
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/cursor	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/cursor	(revision 15879)
@@ -0,0 +1,13 @@
+
+  cursor
+
+  place cursor coordinates (and values ??) into Mana variables.  to do
+this, type cursor, then place the cursor on the desired spot in the
+Ki'i window and type a digit (0 - 9).  The coordinates of the cursor
+are then placed in the variables $Xn and $Yn (where n is the digit you
+typed).  To exit the cursor mode, type "q" (or "Q") in the Ki'i
+window.  
+
+  See Also: Kii, tv, center
+
+ 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/cut
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/cut	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/cut	(revision 15879)
@@ -0,0 +1,9 @@
+
+   cut buffer <X vector> <Y vector> <X|Y> sx sy nx ny
+
+   take a cut from an image and place it in a pair of vectors.
+   the <X vector> gets the pixel coordinate in the given direction,
+   the <Y vector> gets the pixel values.  <X|Y> specifies the 
+   direction of the cut.  the region sx, sy, nx, ny specifies the
+   region for the cut, with summation in the cross-direction.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/datafile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/datafile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/datafile	(revision 15879)
@@ -0,0 +1,6 @@
+
+   datafile (filename)
+
+   define a data file for subsequent vector reads.
+
+   See also: read
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/delete
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/delete	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/delete	(revision 15879)
@@ -0,0 +1,10 @@
+
+  delete (buffer/vector/variable)
+
+  Delete the named buffer/vector/variable.
+
+  Warning: no second chances are given!
+
+  Note: Delete will remove the buffer/vector of a
+   given name first, then delete the variable of
+   the same name upon the second call.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/dimendown
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/dimendown	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/dimendown	(revision 15879)
@@ -0,0 +1,7 @@
+
+
+   dimendown (buffer) (vector) [-x/-y]
+
+   Compresses an image into a vector
+
+   The vector can be given either the x or y coordinates of the image
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/dimenup
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/dimenup	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/dimenup	(revision 15879)
@@ -0,0 +1,5 @@
+
+
+   dimenup (vector) (buffer) (Nx) (Ny)
+
+   Expands a vector into an image with dimensions Nx,Ny
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/dot
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/dot	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/dot	(revision 15879)
@@ -0,0 +1,7 @@
+
+
+   dot (x) (y)
+
+   Plots a single point
+
+   Uses the same style options as plot
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/erase
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/erase	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/erase	(revision 15879)
@@ -0,0 +1,8 @@
+
+  erase (overlay)
+
+  "erase" erases all objects on the specified overlay.  
+  Valid overlays may be: all, red, green, blue, yellow.
+
+  See also: load, save, contour
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/extract
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/extract	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/extract	(revision 15879)
@@ -0,0 +1,12 @@
+
+  extract <from> <to> sx sy nx ny sx sy nx ny
+
+  extract takes a portion of an image (buffer <from>) and creates a
+new image (buffer <to>).  The source region is defined by the first
+set of (sx sy nx ny), the resulting image and the location of the
+extracted image are defined by the second (sx sy nx ny).  This allows
+a portion of an image to be overlayed at a particular location in a
+larger image.
+
+  See also: Kii, tv
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/fit
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/fit	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/fit	(revision 15879)
@@ -0,0 +1,15 @@
+
+   fit (-q) x y (order) (-dy wt) (-clip sig N)
+
+   perform a lease-square polynomial fit to the data defined 
+   by vectors x and y.  the coefficients are placed in the variables
+   $C0, $C1, ..., and the order is placed in $Cn.
+
+   order: order of fit
+   -q: quiets the fit (no output to window)
+   -dy: take into account the error vector wt
+   -clip: remove outliers beyond sig*sigma from the fit;
+           perform N iterations of this
+
+   See also: applyfit
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/grid
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/grid	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/grid	(revision 15879)
@@ -0,0 +1,6 @@
+
+   grid (overlay) (buffer)
+
+   draw a coordinate grid for the given buffer in the 
+   given overlay in Kii.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/header
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/header	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/header	(revision 15879)
@@ -0,0 +1,8 @@
+
+   header (buffer)
+
+   print the header information for the given buffer.  The header
+   information is Meta-information associated with an image.  It is
+   well-defined for the FITS images, but may not exist for some of the
+   other possible data types.  
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/histogram
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/histogram	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/histogram	(revision 15879)
@@ -0,0 +1,8 @@
+
+   histogram <buffer> <x> <y> [-region sx sy nx ny] [-range min max]
+
+   calculate a histogram of the image pixel values in the given
+   buffer, optionally constrained to the given region, with optional
+   max and min values.  the results are placed in the vectors x and y,
+   which contain the pixel values and the number of occurences.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/integrate
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/integrate	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/integrate	(revision 15879)
@@ -0,0 +1,10 @@
+
+   integrate (x) (y) (start) (end)
+
+   Perform an integration of (y) as a function of (x) from (start) to (end)
+
+   The result is placed into the variable: $sum
+
+   Caution!: Program uses the front end of each x bin to approximate the integral.
+    Very coarse bins (delta x = 1) over small regions (x=1->5) can introduce
+    errors as large as 20%. Fine bins are reccommended.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/interpolate
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/interpolate	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/interpolate	(revision 15879)
@@ -0,0 +1,5 @@
+
+   interpolate (xin) (yin) (xout) (yout)
+
+   Performs an interpolation of (xin) and (yin) onto the new grid (xout),
+    producing the corresponding y values in (yout)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/kern
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/kern	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/kern	(revision 15879)
@@ -0,0 +1,4 @@
+
+   kern buffer (kernel file or -)
+
+   apply a 3x3 kernel to the image.  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/keyword
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/keyword	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/keyword	(revision 15879)
@@ -0,0 +1,11 @@
+
+  keyword <buffer> (KEYWORD) [variable] [-w value]
+
+  "keyword" extracts the specified keyword from the header of the
+   specified buffer.  If a third word is listed, the value of the
+   keyword is stored in a variable with the given name.  If the -w
+   option is given, the value is written to the header keyword.
+
+   The header Meta-data is well-defined for FITS, but not necessarily
+   for other data types.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/labels
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/labels	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/labels	(revision 15879)
@@ -0,0 +1,23 @@
+
+   labels 
+
+   write a label on the Kapa window.  there are many options:
+
+   -fn font size -- define the font (may be times, helvetica, courier)
+
+   -x "a long line" -- label on the bottom x-axis
+
+   +x "a long line" -- label on the top x-axis
+
+   -y "a long line" -- label on the left y-axis
+
+   +y "a long line" -- label on the right y-axis
+
+   -ul "a long line" -- label on the upper left of plot
+
+   -ll "a long line" -- label on the lower left of plot
+
+   -ur "a long line" -- label on the upper right of plot
+
+   -lr "a long line" -- label on the lower right of plot
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/limits
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/limits	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/limits	(revision 15879)
@@ -0,0 +1,12 @@
+
+   limits min max min max
+   limits x y
+   limits x min max
+   limits min max y
+   
+   set Kapa plot limits.  The x and y axis limits may be explicitly
+   set (first example), or they may be assigned based on the range of
+   values in a pair of vectors (second examples), or one range may be
+   explicit and the other range assigned from a vector.
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/load
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/load	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/load	(revision 15879)
@@ -0,0 +1,20 @@
+
+   load (overlay) (filename)
+
+  "load" reads a file with objects in SAOimage style into the
+  specified overlay.  If the specified overlay is already used, the
+  new objects are added to the old.  If you do not want this, use
+  "erase" to erase all objects in the overlay first.  Valid overlays
+  may be: 0, red, 1, green, 2, blue, 3, yellow.
+
+Examples of SAOimage style objects:
+BOX   300  200  100 50  : draws a box centered at pixel 300,200 that
+			  is 100 pixels wide, and 50 pixels high
+
+CIRCLE 500 400 200 : draws a circle centered at pixel 500,400 with a
+                     radius of 200 pixels
+
+LINE 100 100 200 200 : draws a line from (100,100) with length (200,200)
+
+  See also: save, erase, contour
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/peak
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/peak	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/peak	(revision 15879)
@@ -0,0 +1,12 @@
+
+   peak [-q] (x) (y) [startx endx]
+
+   Determines the peak of the y vector between starx and endx
+    or between the extrema of the x vector (default)
+
+   -q: quiets the script (no output to the window)
+
+   Outputs:
+    $peakval: Value of the peak
+    $peakpos: X value corresponding to the peak value
+    $peaknum: Index of the peak value
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/periodogram
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/periodogram	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/periodogram	(revision 15879)
@@ -0,0 +1,6 @@
+
+   periodogram (time) (flux) (minP) (maxP) (period) (power)
+
+   creates a periodogram from the vectors (time) and (flux)
+    between (minP) and (maxP) and outputs the results to
+    (period) and (power)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/plot
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/plot	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/plot	(revision 15879)
@@ -0,0 +1,13 @@
+
+   plot <x> <y> [-dx dx] [-dy dy] [+dx dx] [+dy dy]
+
+   plot a pair of vectors.  the options allow for errorbars.  If only
+   one of -dy or +dy is given, the given vector is used for the
+   errorbar.  If both are given, -dy defines the lower errorbar, while
+   +dy defines the upper errorbar.  This allows for assymetric errors
+   in a trivial fashion.  The same applies to the -dx, +dx values.  
+
+   The vectors are plotted with the current plot style.  See style for
+   all of the options.
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/ps
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/ps	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/ps	(revision 15879)
@@ -0,0 +1,16 @@
+
+   ps [-name file.ps] [-g | -i] [-n device] [-raw] [-noscale] [-newpage]
+
+   create a PostScript file from the current graphics window (Kii or
+   Kapa).  The target graphics window may be selected with the -g or
+   -i options (to choose between Kii or Kapa) in combination the -n
+   option (to specify which instance).
+
+   With no additional arguments, Kii produces an encapsulated
+   postscript file called Ximage.ps, while Kapa produces a file called
+   Xgraph.ps.  The output name may be set with the -name (file.ps)
+   option. 
+
+   By default, the output is scaled to fit on a letter page 
+
+   
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queuedelete
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queuedelete	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queuedelete	(revision 15879)
@@ -0,0 +1,4 @@
+
+   queuedelete (name)
+
+   Deletes the entire queue (name)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queueinit
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queueinit	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queueinit	(revision 15879)
@@ -0,0 +1,4 @@
+
+   queueinit (name)
+
+   Creates a queue (name) with an initial size of 0
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queuepush
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queuepush	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queuepush	(revision 15879)
@@ -0,0 +1,8 @@
+
+   queuepush (queue) (value) [-key N] [-uniq] [-replace]
+
+   Pushes (value) onto the back of (queue)
+
+   -key N:
+   -uniq:
+   -replace:
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queuesize
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queuesize	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/queuesize	(revision 15879)
@@ -0,0 +1,5 @@
+
+   queuesize (name) [-var variable]
+
+   Returns the size of the queue (name), either to variable
+    or to the window (default)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/rd
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/rd	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/rd	(revision 15879)
@@ -0,0 +1,10 @@
+
+  rd (buffer) (filename)
+
+  "rd" reads a file into the specified buffer, creating the buffer if
+  none exists.  A buffer name may consist of any letters, numbers, and
+  some limited other characters.  However, the name may not start with
+  a digit.
+
+  See also: wd, tv
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/read
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/read	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/read	(revision 15879)
@@ -0,0 +1,10 @@
+
+   read vect col [vect col, ...]
+
+   read vector values from a file.  An arbitrary number of vectors can
+   be specified, and the (whitespace-separated) field number given for
+   each vector.  Data is read from the file defined by "datafile".
+
+   See also: datafile
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/rebin
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/rebin	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/rebin	(revision 15879)
@@ -0,0 +1,9 @@
+
+  rebin <from> <to> scale
+
+  "rebin" rebins the specified buffer by the given scale factor and
+  places the result in the <to> buffer.  Negative integer values imply
+  expansion, positive numbers imply compression.
+
+  See also: extract
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/resize
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/resize	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/resize	(revision 15879)
@@ -0,0 +1,6 @@
+
+   resize Nx Ny
+
+   change the size of the Kii window to have image dimensions Nx x
+   Ny.  
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/rotate
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/rotate	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/rotate	(revision 15879)
@@ -0,0 +1,10 @@
+
+   rotate (buffer) (angle) [-center x y]
+
+   rotate the buffer by the given angle.  The angle may also be one of
+   the following special words:
+
+   -flipx - flip in the x direction
+   -flipy - flip in the y direction
+
+   if the optional center is given the rotation is about this position.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/save
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/save	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/save	(revision 15879)
@@ -0,0 +1,16 @@
+  save (overlay) (filename)
+
+  "save" stores the objects from the specified overlay into the named
+file.  Valid overlays may be: 0, red, 1, green, 2, blue, 3, yellow.
+
+Examples of SAOimage style objects:
+BOX   300  200  100 50  : draws a box centered at pixel 300,200 that
+			  is 100 pixels wide, and 50 pixels high
+
+CIRCLE 500 400 200 : draws a circle centered at pixel 500,400 with a
+                     radius of 200 pixels
+
+LINE 100 100 200 200 : draws a line from (100,100) with length (200,200)
+
+  See also: load, erase, contour
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/set
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/set	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/set	(revision 15879)
@@ -0,0 +1,41 @@
+
+  set (buffer) = expression..
+
+  perform math operations on images.  there are several allowed
+  operators.  the standard math functions are + - * /.  Exponentiation
+  is performed with ^ (set c = a ^ b).  There are several "logic"
+  operators which need some explanation.
+
+  set c = a < b  -- c is 1 if a < b, 0 otherwise
+  set c = a > b  -- c is 1 if a > b, 0 otherwise
+  set c = m1 & m1 - c is 1 if m1 AND m2 true (non-zero is true)
+  set c = m1 | m1 - c is 1 if m1 OR m2 true (non-zero is true)
+  set c = a << b -- c is the minimum of a and b
+  set c = a >> b -- c is maximum of a and b
+
+  complex operations may be performed:
+
+  set c = a*(a < b) + c*((a < c) | (c < d))
+
+  unary operators also exist:
+
+  exp(a) - e to the power of a
+  ten(a) - 10 to the power of a
+  ln(a) - log base e of a
+  log(a) - log base 10 of a
+  sqrt(a) - square root of a
+  sin(a) - sin of a
+  cos(a) - sin of a
+  tan(a) - sin of a
+  not(a) - logical inverse of a
+  abs(a) - absolute value of a
+  int(a) - integer value of a
+
+  Examples:
+  
+  set a = b + 10  (add 10 to every pixel in b and put the answer in a)
+  set a = a / b   (divide every pixel in a by the corresponding pixel
+                     b and put the answer in a)
+  set b = 10 / a  (divide 10 by every pixel in a and put the answer
+                     in b)
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/shift
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/shift	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/shift	(revision 15879)
@@ -0,0 +1,6 @@
+
+   shift buffer dx dy
+
+   shift image by dx,dy pixels (may be fractional values).
+
+   
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/stats
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/stats	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/stats	(revision 15879)
@@ -0,0 +1,10 @@
+
+  stats (buffer) (x) (y) (nx) (ny)
+
+  report the statistics on a portion of an image.  (x) and (y) specify
+the starting corner of the region, (nx) and (ny) specify the width and
+height of the region.  stats reports the mean, sigma, and number of
+pixels in the region.
+
+  See Also: ??
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/style
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/style	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/style	(revision 15879)
@@ -0,0 +1,36 @@
+
+   style -- many options
+
+   define or check the Kapa plotting style.  without any command-line arguments,
+   style prints the current style.  
+
+   option definitions:
+
+   -n	window number (0-4), can also be used to change active window.
+   -pt	point style: 
+		0 = filled box
+		1 = open box
+		2 = +
+		3 = X
+		4 = filled triangle
+		5 = blank
+		6 = open triangle 
+		7 = open circle
+		100 = connect pair of points
+   -x	plotting method:
+		0 = connect
+		1 = histogram
+		2 = points
+   -lt	line type:
+		0 = solid
+		1 = dashed
+		2 = dotted??
+   -lw	line weight (0-10)
+   -sz	point size
+   -c   color:
+	black, white, red, orange, 
+	yellow, green, blue, indigo, violet
+   -eb  errorbar with no top
+   +eb  errorbar with top
+
+   See also: plot, box
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/subset
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/subset	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/subset	(revision 15879)
@@ -0,0 +1,12 @@
+
+   subset vec = vec if (logic expression)
+
+   reduce the length of a vector based on logical expression.  The
+   logic expression is some function of vectors of equal length to the
+   main vector.
+
+   for example, we have vectors x and y of the same length:
+   
+   subset X = x if ((y > 100) | (x < 10))
+
+    
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/textline
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/textline	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/textline	(revision 15879)
@@ -0,0 +1,7 @@
+
+   textline x y (line) [-fn (font) size] [-rot angle]
+
+   write the string at the given coordinates and rotation,
+   in the given font.
+
+   (enclose long strings with spaces in quotes)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/tv
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/tv	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/tv	(revision 15879)
@@ -0,0 +1,13 @@
+
+  tv [-log] (buffer) [zero range]
+
+  display an image in the Ki'i window (X display program).  zero and
+  range specify the data values corresponding to the color mapping.
+  If they are not specified, the old values are used (default is 0,
+  1024).
+
+  If -log is specified the color mapping scale will be logarithmic.  
+
+
+  See Also: Kii, rd, cursor
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/unsign
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/unsign	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/unsign	(revision 15879)
@@ -0,0 +1,20 @@
+  unsign
+
+  "unsign" toggles the status of the UNSIGN mode.  Warning: This is a
+non-FITS standard implementation.  The FITS standard does not allow
+for unsigned integer data values, but many sites write CCD images with
+16 bit UNSIGNED data.  Mana looks for a FITS keyword "UNSIGN" to
+determine if an image which is read in has signed or unsigned
+integers.  However, since this is a non-standard concept, many sites
+do not use the UNSIGN flag, yet still write unsigned data.  If the
+user knows the data in the file is unsigned (ie, the user must have
+apriori knowledge -- a FITS no-no!), then the user should set the
+UNSIGN mode to true.  In the event that the UNSIGN mode is set, if a
+FITS file is encountered which contains integers, but which does not
+contain the UNSIGN keyword, Mana will make the default assumption that
+the data is unsigned.  If the SIGNED mode is set, Mana will assume all
+integer FITS files contain signed integers.  
+
+((( should be able to say "unsign <buffer>" to convert the status of a
+buffer to UNSIGN or to toggle the buffer's status, but not yet
+implemented)))
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/vectors
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/vectors	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/vectors	(revision 15879)
@@ -0,0 +1,5 @@
+
+   vectors
+
+   list the currently defined vectors and lengths
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/wd
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/wd	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/wd	(revision 15879)
@@ -0,0 +1,29 @@
+
+  wd (buffer) (filename) [BITPIX]
+
+  wd writes a buffer to the specified file in FITS format.  (You may
+need quotes around the filename if there are any /'s in the path).
+The FITS keyword BITPIX may be specified.  Valid values are 8, 16, 32
+(integer formats) and -32, -64 (floating point formats).  If BITPIX is
+unspecified, the original value of the image is used.  The image is
+converted blindly to the format and written out.  This may mean that
+values are rounded (integers), or wrapped by the range of the number
+of bits.  Also beware of the issue of signed vs unsigned images.
+
+  See Also: rd
+
+bitpix  bzero  bscale  file range     data range
+16      0      1       -32k : 32k     -32k : 32k
+16	32k    1       -32k : 32k        0 : 64k
+16	0      2       -32k : 32k     -64k : 64k
+16	0      0.001   -32k : 32k     -32. : 32.
+32	0      1       -2e9 : 2e9     -2e9 : 2e9
+8	0      1       -128 : 128     -128 : 128
+
+so for example, a file with a data range of -128k to +128k written
+with bitpix 16, bzero 0, bscale 1 will have all data outside -32k :
++32k wrapped back in that range.
+
+note: on write, bzero is subtracted from the data before the data is
+      divided by bscale.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/zplot
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/zplot	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/help/zplot	(revision 15879)
@@ -0,0 +1,7 @@
+
+   zplot x y z min max
+
+   plot the vector pair x and y as a series of points with size scaled
+   by the values in the vector z, with the smallest point having
+   values <= min and the largest having values >= max.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/histogram.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/histogram.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/histogram.c	(revision 15879)
@@ -0,0 +1,46 @@
+# include "data.h"
+
+int histogram (int argc, char **argv) {
+  
+  int i, bin, Nbins;
+  float *V, start, end, delta;
+  Vector *xvec, *yvec;
+
+  if ((argc != 6) && (argc != 5)) {
+    gprint (GP_ERR, "USAGE: hist invec outvec start end [delta]\n");
+    return (FALSE);
+  }
+
+  delta = 1;
+  start = atof (argv[3]);
+  end   = atof (argv[4]);
+  if (argc == 6) delta = atof (argv[5]);
+ 
+  if ((start == end) || (delta == 0)) {
+    gprint (GP_ERR, "error in value: %f to %f, %f\n", start, end, delta);
+    return (FALSE);
+  }
+  delta = fabs (delta);
+  if (end - start < 0) {
+    delta = -1.0 * delta;
+  }
+  Nbins = (end - start) / delta;
+  /* number here should match number in create.c */
+
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  yvec[0].Nelements = Nbins;
+    
+  REALLOCATE (yvec[0].elements, float, yvec[0].Nelements);
+  bzero (yvec[0].elements, sizeof(float)*yvec[0].Nelements);
+
+  V = xvec[0].elements;
+  for (i = 0; i < xvec[0].Nelements; i++, V++) {
+    if (isnan(*V)) continue;
+    bin = MIN (MAX (0, (*V - start) / delta), Nbins - 1);
+    yvec[0].elements[bin] += 1.0;
+  }      
+
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/imcut.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/imcut.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/imcut.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "data.h"
+
+int imcut (int argc, char **argv) {
+  
+  int i, Nx, Ny, xi, yi, L;
+  double xs, ys, xe, ye, dX, dY;
+  Vector *xvec, *yvec;
+  Buffer *buf;
+  float *V;
+
+  if (argc != 8) {
+    gprint (GP_ERR, "USAGE: cut <buffer> <X vector> <Y vector> xs ys xe ye\n");
+    return (FALSE);
+  }
+
+  if ((buf  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) goto missed;
+  if ((xvec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) goto usage;
+  if ((yvec = SelectVector (argv[3], ANYVECTOR, TRUE)) == NULL) goto usage;
+ 
+  xs = atof (argv[4]);
+  ys = atof (argv[5]);
+  xe = atof (argv[6]);
+  ye = atof (argv[7]);
+
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+
+  if ((xs < 0) || (xs > Nx)) goto range;
+  if ((ys < 0) || (ys > Ny)) goto range;
+  if ((xe < 0) || (xe > Nx)) goto range;
+  if ((ye < 0) || (ye > Ny)) goto range;
+
+  dX = xe - xs;
+  dY = ye - ys;
+  L = hypot (dX, dY);
+  dX = dX / L;
+  dY = dY / L;
+
+  REALLOCATE (xvec[0].elements, float, MAX (L, 1));
+  REALLOCATE (yvec[0].elements, float, MAX (L, 1));
+  xvec[0].Nelements = L;
+  yvec[0].Nelements = L;
+
+  V = (float *)buf[0].matrix.buffer;
+  for (i = 0; i < L; i++) {
+    xi = xs + i*dX - 0.5;
+    yi = ys + i*dY - 0.5;
+    xvec[0].elements[i] = i;
+    yvec[0].elements[i] = V[xi + Nx*yi];
+  }
+
+  return (TRUE);
+
+ usage: 
+  gprint (GP_ERR, "USAGE: circstats <buffer> x y radius\n");
+  return (FALSE);
+
+ range:
+  gprint (GP_ERR, "ERROR: coordinates out of range\n");
+  return (FALSE);
+
+ missed:
+  gprint (GP_ERR, "ERROR: buffer not found\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/imhist.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/imhist.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/imhist.c	(revision 15879)
@@ -0,0 +1,111 @@
+# include "data.h"
+
+int imhist (int argc, char **argv) {
+  
+  int i, j, N, Nbins;
+  int sx, sy, nx, ny, bin;
+  float *V, delta;
+  double max, min, dx;
+  Vector *vec1, *vec2;
+  Buffer *buf;
+
+  delta = 0;
+  if ((N = get_argument (argc, argv, "-delta"))) {
+    remove_argument (N, &argc, argv);
+    delta = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  min = max = 0.0;
+  if ((N = get_argument (argc, argv, "-range"))) {
+    remove_argument (N, &argc, argv);
+    min = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    max = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  sx = sy = 0.0;
+  nx = ny = 0.0;
+  if ((N = get_argument (argc, argv, "-region"))) {
+    remove_argument (N, &argc, argv);
+    sx = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    sy = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    nx = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    ny = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: histogram <buffer> <x> <y> [-region sx sy nx ny] [-range min max] [-delta binsize]\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  
+  /* if either range is set to zero, use the rest of the chip */
+  if (nx == 0)
+    nx = buf[0].matrix.Naxis[0] - sx;
+  if (ny == 0)
+    ny = buf[0].matrix.Naxis[1] - sy;
+
+  if ((sx < 0) || (sy < 0) || 
+      (sx+nx > buf[0].matrix.Naxis[0]) || 
+      (sy+ny > buf[0].matrix.Naxis[1])) {
+    gprint (GP_ERR, "region out of range\n");
+    return (FALSE);
+  }
+
+  if ((vec1 = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vec2 = SelectVector (argv[3], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  /* unfortunately, we must do this in two passes:
+     first pass finds the max and min and defines the bin size
+     second pass counts the pixes in each bin 
+     */
+
+  if ((max == 0) && (min == 0)) {
+    max = min = *((float *)(buf[0].matrix.buffer) + sy*buf[0].matrix.Naxis[0] + sx);
+    gprint (GP_ERR, "sx: %d, sy: %d, first: %f\n", sx, sy, max);
+    for (j = sy; j < sy + ny; j++) {
+      V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + sx; 
+      for (i = 0; i < nx; i++, V++) {
+	max = MAX (max, *V);
+	min = MIN (min, *V);
+      }
+    }
+  }
+
+  if (delta == 0) {
+    Nbins = 1024;
+    dx = (max - min) / Nbins;
+  } else {
+    dx = delta;
+    Nbins = (max - min) / dx;
+  }
+  gprint (GP_ERR, "max %f, min %f, dx %f\n", max, min, dx);
+  
+  vec1[0].Nelements = Nbins + 1;
+  vec2[0].Nelements = Nbins + 1;
+  REALLOCATE (vec1[0].elements, float, vec1[0].Nelements);
+  bzero (vec1[0].elements, vec1[0].Nelements*sizeof(float));
+  REALLOCATE (vec2[0].elements, float, vec2[0].Nelements);
+  bzero (vec2[0].elements, vec2[0].Nelements*sizeof(float));
+  
+  for (j = sy; j < sy + ny; j++) {
+    V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + sx; 
+    for (i = 0; i < nx; i++, V++) {
+      bin = MAX (MIN (Nbins, (*V - min) / dx), 0);
+      vec2[0].elements[bin] += 1.0;
+    }
+  }
+  for (i = 0; i < Nbins + 1; i++, V++) {
+    vec1[0].elements[i] = i*dx + min;
+  }
+  
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/imsmooth.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/imsmooth.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/imsmooth.c	(revision 15879)
@@ -0,0 +1,75 @@
+# include "data.h"
+
+int imsmooth (int argc, char **argv) {
+  
+  int i, j, n, N, Nx, Ny, Ns, Ngauss;
+  float *vi, *vo, *gauss, *gaussnorm;
+  float g, s, sigma, Nsigma;
+  Buffer *in;
+  float *temp;
+
+  Nsigma = 3;
+  if ((N = get_argument (argc, argv, "-Nsigma"))) {
+    remove_argument (N, &argc, argv);
+    Nsigma = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: imsmooth (input) sigma\n");
+    return (FALSE);
+  }
+  
+  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  sigma = atof (argv[2]);
+
+  Nx = in[0].matrix.Naxis[0];
+  Ny = in[0].matrix.Naxis[1];
+  ALLOCATE (temp, float, Nx*Ny);
+
+  /* build a 1D gaussian */
+  Ns = (int) (Nsigma*sigma + 0.5);
+  Ngauss = 2*Ns + 1;
+  ALLOCATE (gaussnorm, float, Ngauss);
+  gauss = &gaussnorm[Ns];
+  for (i = -Ns; i < Ns + 1; i++) {
+    gauss[i] = exp ((i*i)/(-2*sigma*sigma));
+  }
+
+  /* smooth in X direction */
+  for (j = 0; j < Ny; j++) {
+    vi = (float *) in[0].matrix.buffer + j*Nx;
+    vo = &temp[j*Nx];
+    for (i = 0; i < Nx; i++) {
+      g = s = 0;
+      for (n = -Ns; n < Ns + 1; n++) {
+	if (i+n < 0) continue;
+	if (i+n >= Nx) continue;
+	s += gauss[n]*vi[i+n];
+	g += gauss[n];
+      }
+      vo[i] = s / g;
+    }
+  }
+
+  /* smooth in Y direction */
+  for (i = 0; i < Nx; i++) {
+    vi = &temp[i];
+    vo = (float *)in[0].matrix.buffer + i;
+    for (j = 0; j < Ny; j++) {
+      g = s = 0;
+      for (n = -Ns; n < Ns + 1; n++) {
+	if (j+n < 0) continue;
+	if (j+n >= Ny) continue;
+	s += gauss[n]*vi[(n+j)*Nx];
+	g += gauss[n];
+      }
+      vo[j*Nx] = s / g;
+    }
+  }
+
+  free (temp);
+  free (gaussnorm);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/init.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/init.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/init.c	(revision 15879)
@@ -0,0 +1,248 @@
+# include "data.h"
+
+int accum            PROTO((int, char **));
+int applyfit         PROTO((int, char **));
+int applyfit2d       PROTO((int, char **));
+int box              PROTO((int, char **));
+int book_command     PROTO((int, char **));
+int center           PROTO((int, char **));
+int circstats        PROTO((int, char **));
+int clear            PROTO((int, char **));
+int clip             PROTO((int, char **));
+int close_device     PROTO((int, char **));
+int concat           PROTO((int, char **));
+int contour          PROTO((int, char **));
+int create           PROTO((int, char **));
+int cumulative       PROTO((int, char **));
+int cursor           PROTO((int, char **));
+int cut              PROTO((int, char **));
+int datafile         PROTO((int, char **));
+int dbconnect        PROTO((int, char **));
+int dbselect         PROTO((int, char **));
+int delete           PROTO((int, char **));
+int device           PROTO((int, char **));
+int dimendown        PROTO((int, char **));
+int dimenup          PROTO((int, char **));
+int erase            PROTO((int, char **));
+int extract          PROTO((int, char **));
+int fft1d            PROTO((int, char **));
+int fft2d            PROTO((int, char **));
+int fit2d            PROTO((int, char **));
+int fit              PROTO((int, char **));
+int gaussjordan      PROTO((int, char **));
+int gaussdeviate     PROTO((int, char **));
+int gaussintegral    PROTO((int, char **));
+int grid             PROTO((int, char **));
+int gridify          PROTO((int, char **));
+int ungridify        PROTO((int, char **));
+int histogram        PROTO((int, char **));
+int imcut            PROTO((int, char **));
+int imhist           PROTO((int, char **));
+int imsmooth         PROTO((int, char **));
+int integrate        PROTO((int, char **));
+int interpolate      PROTO((int, char **));
+int jpeg             PROTO((int, char **));
+int kern             PROTO((int, char **));
+int keyword          PROTO((int, char **));
+int labels           PROTO((int, char **));
+int limits           PROTO((int, char **));
+int line             PROTO((int, char **));
+int list_buffers     PROTO((int, char **));
+int header           PROTO((int, char **));
+int list_vectors     PROTO((int, char **));
+int load             PROTO((int, char **));
+int lookup           PROTO((int, char **));
+int mkrgb            PROTO((int, char **));
+int mcreate          PROTO((int, char **));
+int medacc           PROTO((int, char **));
+int mget             PROTO((int, char **));
+int minterp          PROTO((int, char **));
+int mset             PROTO((int, char **));
+int peak             PROTO((int, char **));
+int periodogram      PROTO((int, char **));
+int plot             PROTO((int, char **));
+int dot              PROTO((int, char **));
+int point            PROTO((int, char **));
+int ps               PROTO((int, char **));
+int queuelist        PROTO((int, char **));
+int queueload        PROTO((int, char **));
+int queueinit        PROTO((int, char **));
+int queuedelete      PROTO((int, char **));
+int queuedrop        PROTO((int, char **));
+int queuepop         PROTO((int, char **));
+int queueprint       PROTO((int, char **));
+int queuepush        PROTO((int, char **));
+int queuesize        PROTO((int, char **));
+int rd               PROTO((int, char **));
+int rdseg            PROTO((int, char **));
+int read_vectors     PROTO((int, char **));
+int rebin            PROTO((int, char **));
+int resize           PROTO((int, char **));
+int roll             PROTO((int, char **));
+int rotate           PROTO((int, char **));
+int save             PROTO((int, char **));
+int section          PROTO((int, char **));
+int set              PROTO((int, char **));
+int shift            PROTO((int, char **));
+int sort_vectors     PROTO((int, char **));
+int spline_apply     PROTO((int, char **));
+int spline_construct PROTO((int, char **));
+int stats            PROTO((int, char **));
+int style            PROTO((int, char **));
+int subraster        PROTO((int, char **));
+int subset           PROTO((int, char **));
+int svd              PROTO((int, char **));
+int swapbytes        PROTO((int, char **));
+int textline         PROTO((int, char **));
+int tv               PROTO((int, char **));
+int tvcontour        PROTO((int, char **));
+int tvgrid           PROTO((int, char **));
+int uniq             PROTO((int, char **));
+int unsign           PROTO((int, char **));
+int vbin             PROTO((int, char **));
+int vclip            PROTO((int, char **));
+int vect_select      PROTO((int, char **));
+int vgrid            PROTO((int, char **));
+int vgauss           PROTO((int, char **));
+int vmaxwell         PROTO((int, char **));
+int vload            PROTO((int, char **));
+int vstat            PROTO((int, char **));
+int vroll            PROTO((int, char **));
+int vpop             PROTO((int, char **));
+int vsmooth          PROTO((int, char **));
+int wd               PROTO((int, char **));
+int write_vectors    PROTO((int, char **));
+int zap              PROTO((int, char **));
+int zplot            PROTO((int, char **));
+
+static Command cmds[] = {  
+  {"accum",        accum,	     "accumulate vector values in another vector"},
+  {"applyfit",     applyfit,	     "apply fit to new vector"},
+  {"applyfit2d",   applyfit2d,	     "apply 2-d fit to new vector"},
+  {"box",     	   box,		     "draw a box on the plot"},
+  {"book",    	   book_command,     "commands to manipulate book/page/word data"},
+  {"center",       center,	     "center image on coords"},
+  {"circstats",    circstats,	     "circular statistics"},
+  {"clear",   	   clear,	     "erase plot"},
+  {"clip",         clip,	     "clip values in a buffer to be within a range"},
+  {"close",        close_device,     "close the current display device"},
+  {"concat",  	   concat,	     "reduce vector dimension"},
+  {"contour", 	   contour,	     "create contour from image"},
+  {"create",  	   create,	     "create a new vector"},
+  {"cumulative",   cumulative,	     "build a cumulative histogram from a specific histogram"},
+  {"cursor",  	   cursor,	     "get coords from cursor"},
+  {"cut",	   cut,		     "extract a cut across an image"},
+  {"datafile",     datafile,	     "define file to read vectors"},
+  {"dbconnect",    dbconnect,	     "setup mysql db connection"},
+  {"dbselect", 	   dbselect,	     "extract vectors from mysql database table"},
+  {"delete",  	   delete,	     "delete vectors or matrices"},
+  {"device",  	   device,	     "set / get current graphics device"},
+  {"dimendown",	   dimendown,	     "convert matrix to vector"},
+  {"dimenup",	   dimenup,	     "convert vector to matrix"},
+  {"erase",        erase,	     "erase objects on an overlay"},
+  {"extract",      extract,	     "extract a portion of a buffer into another buffer"},
+  {"fft1d",        fft1d,	     "fft on the pixel-stream in an image"},
+  {"fft2d",        fft2d,	     "fft on an image"},
+  {"fit",     	   fit,		     "fit polynomial to vector pair"},
+  {"fit2d",        fit2d,	     "fit 2-d polynomial to vector triplet"},
+  {"gaussj",  	   gaussjordan,	     "solve Ax = B (N-D)"},
+  {"gaussdev",	   gaussdeviate,     "generate a gaussian deviate vector"},
+  {"gaussint",	   gaussintegral,    "return the integrated gaussian vector"},
+  {"grid",    	   grid,	     "plot cartesian grid"},
+  {"gridify",      gridify,	     "convert vector triplet to buffer"},
+  {"ungridify",    ungridify,        "convert buffer region to vector triplet"},
+  {"header",       header,	     "print buffer header"},
+  {"histogram",    histogram,	     "generate histogram from vector"},
+  {"imcut",        imcut,	     "linear image cut between arbitrary coords"},
+  {"imhist",       imhist,	     "histogram of an image region"},
+  {"imsmooth",     imsmooth,	     "circular gaussian smoothing"},
+  {"integrate",    integrate,	     "integrate a vector"},
+  {"interpolate",  interpolate,	     "interpolate between vector pairs"},
+  {"jpeg",         jpeg,	     "write text line on graph"},
+  {"png",          jpeg,	     "write text line on graph"},
+  {"ppm",          jpeg,	     "write text line on graph"},
+  {"kern",         kern,	     "convolve with 3x3 kernel"},
+  {"keyword",      keyword,	     "extract a FITS keyword from buffer header"},
+  {"labels",  	   labels,	     "define labels for plot"},
+  {"limits",  	   limits,	     "define plot limits"},
+  {"line",         line,	     "plot line"},
+  {"buffers",      list_buffers,     "list the currently allocated buffers"},
+  {"vectors", 	   list_vectors,     "list vectors"},
+  {"load",         load,	     "load an SAOimage style overlay"},
+  {"lookup",       lookup,	     "convert vector via lookup table (vector pair)"},
+  {"mkrgb", 	   mkrgb,	     "convert 3 images to rgb jpeg"},
+  {"mcreate", 	   mcreate,	     "create a matrix"},
+  {"medacc",       medacc,	     "accumulate vector values in another vector"},
+  {"mget",    	   mget,	     "extract a vector from a matrix"},
+  {"minterp",      minterp,	     "interpolate image pixels"},
+  {"mset",    	   mset,	     "insert a vector in a matrix"},
+  {"peak",	   peak,	     "find vector peak in range"},
+  {"periodogram",  periodogram,	     "measure periods in unevenly sampled data"},
+  {"plot",    	   plot,	     "plot a pair of vectors"},
+  {"dot",    	   dot,	             "plot a single point"},
+  {"point",	   point,	     "load overlay with single point"},
+  {"ps",      	   ps,		     "define labels for plot"},
+  {"queuepop", 	   queuepop,	     "pop value from queue to variable"},
+  {"queuedrop",    queuedrop,	     "drop values from queue matching a key"},
+  {"queueprint",   queueprint,	     "print the contents of a queue"},
+  {"queuepush",	   queuepush,	     "push value onto queue"},
+  {"queueinit",	   queueinit,	     "create an empty queue"},
+  {"queuedelete",  queuedelete,	     "delete a queue"},
+  {"queuelist",	   queuelist,	     "list defined queues"},
+  {"queueload",	   queueload,	     "load queue from command"},
+  {"queuesize",    queuesize,	     "show queue size"},
+  {"rd",           rd,		     "load fits image"},
+  {"rdseg",	   rdseg,	     "read a segment of an image from a file"},
+  {"read",         read_vectors,     "read vectors from datafile"},
+  {"rebin",	   rebin,	     "rebin data by factor of N"},
+  {"resize",  	   resize,	     "set graphics/image window size"},
+  {"roll",	   roll,	     "roll image to new start point"},
+  {"rotate",	   rotate,	     "rotate image"},
+  {"save",	   save,	     "save an SAOimage style overlay"},
+  {"section", 	   section,	     "define section of graph"},
+  {"set",     	   set,		     "vector math"},
+  {"shift",	   shift,	     "shift data in an image"},
+  {"sort",    	   sort_vectors,     "sort list of vectors"},
+  {"spline.apply", spline_apply,     "apply spline fit to generate an image"},
+  {"spline.const", spline_construct, "create spline 2nd deriv. terms"},
+  {"stats",   	   stats,	     "give statistics on a portion of a buffer"},
+  {"style",   	   style,	     "set the style for graph plots"},
+  {"subraster",    subraster,	     "subraster of fits image"},
+  {"subset",  	   subset,	     "expand vector dimension"},
+  {"svd",	   svd,		     "singular value decomposition of a matrix"},
+  {"swapbytes",	   swapbytes,        "byte swap thing"},
+  {"textline",     textline,	     "write text line on graph"},
+  {"tv",      	   tv,		     "display an image on the Kii window"},
+  {"tvcontour",	   tvcontour,	     "send contour to overlay"},
+  {"tvgrid",	   tvgrid,	     "wait until return is typed"},
+  {"uniq",    	   uniq,	     "create a uniq vector subset from a vector"},
+  {"unsign",	   unsign,	     "toggle the UNSIGN status"},
+  {"vbin",	   vbin,	     "bin values in a vector to be within a range"},
+  {"vclip",	   vclip,	     "clip values in a vector to be within a range"},
+  {"select",	   vect_select,	     "selective vector assignment"},
+  {"vgauss",       vgauss,	     ""},
+  {"vmaxwell",     vmaxwell,	     ""},
+  {"vgrid",        vgrid,	     ""},
+  {"vload",        vload,	     "load vectors on Kii"},
+  {"vstat",        vstat,	     "get info from imreg database"},
+  {"vsmooth",      vsmooth,	     "gaussian smooth of a vector"},
+  {"vroll",        vroll,	     "roll vector elements"},
+  {"vpop",         vpop, 	     "remove first element"},
+  {"wd",      	   wd,		     "write an image to a file"},
+  {"write",   	   write_vectors,    "write vectors to datafile"},
+  {"zap",     	   zap,		     "delete pixels"},
+  {"zplot",   	   zplot,	     "plot x y with size scaled by z"},
+}; 
+
+void InitData () {
+  
+  int i;
+
+  InitKapa ();
+  InitQueues ();
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/integrate.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/integrate.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/integrate.c	(revision 15879)
@@ -0,0 +1,44 @@
+# include "data.h"
+
+int integrate (int argc, char **argv) {
+  
+  int i, N, VERBOSE;
+  float *X, *Y;
+  double start, end, value, range;
+  Vector *vecx, *vecy;
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    VERBOSE = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: integrate <x> <y> start end\n");
+    return (FALSE);
+  }
+
+  if ((vecx = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vecy = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  start = atof (argv[3]);
+  end   = atof (argv[4]);
+
+  X = vecx[0].elements;
+  Y = vecy[0].elements;
+
+  value = 0;
+  range = 0;
+  for (i = 0; i < vecx[0].Nelements-1; i++, X++, Y++) {
+    if ((*X >= start) && (*X <= end)) {
+      value += *Y * (X[1] - X[0]);
+      range += (X[1] - X[0]);
+    }
+  }      
+
+  set_variable ("sum", value); 
+  set_variable ("range", range);
+  if (VERBOSE) gprint (GP_LOG, "sum: %f\n", value);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/interpolate.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/interpolate.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/interpolate.c	(revision 15879)
@@ -0,0 +1,53 @@
+# include "data.h"
+
+int interpolate (int argc, char **argv) {
+
+  int  i, j;
+  double x0, x1, dx, dy, y0;
+  Vector *xout, *yout, *xin, *yin;
+
+  /** check basic syntax **/
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: interpolate Xi Yi Xo Yo\n");
+    gprint (GP_ERR, "  Xi Yi - sorted reference vectors\n");
+    gprint (GP_ERR, "  Xo    - output positions\n");
+    gprint (GP_ERR, "  Yo    - output values\n");
+    return (FALSE);
+  }
+
+  if ((xin  = SelectVector (argv[1],  OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yin  = SelectVector (argv[2],  OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((xout = SelectVector (argv[3],  OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yout = SelectVector (argv[4],  ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  yout[0].Nelements = xout[0].Nelements;
+  REALLOCATE (yout[0].elements, float, yout[0].Nelements);
+
+  dx = xin[0].elements[1] - xin[0].elements[0];
+  dy = yin[0].elements[1] - yin[0].elements[0];
+  x0 = xin[0].elements[0];
+  y0 = yin[0].elements[0];
+  
+  /* in vectors are sorted, out vectors are not */
+  for (j = 0; j < xin[0].Nelements - 1; j++) {
+    dx = xin[0].elements[j+1] - xin[0].elements[j];
+    dy = yin[0].elements[j+1] - yin[0].elements[j];
+    x0 = xin[0].elements[j];
+    y0 = yin[0].elements[j];
+    x1 = xin[0].elements[j+1];
+    for (i = 0; i < xout[0].Nelements; i++) {
+      if ((xout[0].elements[i] >= x0) && (xout[0].elements[i] < x1)) {
+	yout[0].elements[i] = (dy/dx)*(xout[0].elements[i] - x0) + y0;
+      }
+      if ((j == 0) && (xout[0].elements[i] < x0)) {
+	yout[0].elements[i] = (dy/dx)*(xout[0].elements[i] - x0) + y0;
+      }
+      if ((j == xin[0].Nelements - 2) && (xout[0].elements[i] >= x1)) {
+	yout[0].elements[i] = (dy/dx)*(xout[0].elements[i] - x0) + y0;
+      }
+    }    
+  }
+
+  return (TRUE);
+    
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/jpeg.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/jpeg.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/jpeg.c	(revision 15879)
@@ -0,0 +1,67 @@
+# include "data.h"
+
+int jpeg (int argc, char **argv) {
+
+  char filename[1024];
+  int N, kapa, IsPNG, IsPPM;
+  char *name;
+  
+  if ((N = get_argument (argc, argv, "--help"))) {
+    gprint (GP_ERR, "USAGE: jpeg [-name file] [-g | -i] [-n device] [-ppm]\n");
+    return (FALSE);
+  }
+
+  /* image type */
+  IsPPM = IsPNG = FALSE;
+  if ((N = get_argument (argc, argv, "-ppm"))) {
+    remove_argument (N, &argc, argv);
+    IsPPM = TRUE;
+  }
+  if ((N = get_argument (argc, argv, "-png"))) {
+    remove_argument (N, &argc, argv);
+    IsPNG = TRUE;
+  }
+  if (!strcmp (argv[0], "png")) IsPNG = TRUE;
+  if (!strcmp (argv[0], "ppm")) IsPPM = TRUE;
+
+  /* file name */
+  filename[0] = 0;
+  if ((N = get_argument (argc, argv, "-name"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (filename, argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  /* display source */
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  /* XXX output png / jpeg needs to include both graph and image
+     if available.  this is a poor mix of data representations 
+     (png for image / jpeg for plots)
+  if ((N = get_argument (argc, argv, "-g"))) {
+  if ((N = get_argument (argc, argv, "-i"))) {
+  */
+
+  if (!GetGraph (NULL, &kapa, name)) return (FALSE);
+  if (!IsPNG && !IsPPM) {
+    if (!filename[0]) strcpy (filename, "kapa.jpg");
+    KiiJPEG (kapa, filename);
+  }
+  if (IsPNG) {
+    if (!filename[0]) strcpy (filename, "kapa.png");
+    KapaPNG (kapa, filename);
+  } 
+  if (IsPPM) {
+    if (!filename[0]) strcpy (filename, "kapa.ppm");
+    KapaPPM (kapa, filename);
+  }
+  return (TRUE);
+}
+
+/* jpeg converts graph to png or ppm
+   jpeg converts image to jpeg */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/kern.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/kern.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/kern.c	(revision 15879)
@@ -0,0 +1,123 @@
+# include "data.h"
+
+/** need to allow larger kernels (5x5, 7x7, etc) **/
+int kern (int argc, char **argv) {
+
+  int i, n, m;
+  int NX, NY, status;
+  FILE *f;
+  float *in_buff, *out_buff, *ib, *ob;
+  char line[256], *list;
+  double kernel[3][3], val;
+  Buffer *buf;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: kern buffer (file)\n");
+    gprint (GP_ERR, "USAGE: kern buffer (list)\n");
+    gprint (GP_ERR, "USAGE: kern buffer -\n");
+    gprint (GP_ERR, "kernel file contains a 3x3 matrix for convolution\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  /* open file to read in kernel */
+  if (!strcmp (argv[2], "-")) {
+    for (i = 0; i < 3; i++) {
+      status = scan_line (stdin, line);
+      if (status == EOF) {
+	gprint (GP_ERR, "kernel should be a 3x3 matrix...\n");
+	return (FALSE);
+      }
+      dparse (&kernel[0][i], 1, line);
+      dparse (&kernel[1][i], 2, line);
+      dparse (&kernel[2][i], 3, line);
+    }
+    goto have_kernel;
+  }
+  /* test list */
+  sprintf (line, "%s:n", argv[2]);
+  if ((list = get_variable (line)) == (char *) NULL) {
+    /* file */
+    f = fopen (argv[2], "r");
+    if (f == NULL) {
+      gprint (GP_ERR, "file not found: %s\n", argv[2]);
+      return (FALSE);
+    }
+    for (i = 0; i < 3; i++) {
+      status = scan_line (f, line);
+      if (status == EOF) {
+	gprint (GP_ERR, "kernel should be a 3x3 matrix...\n");
+	fclose (f);
+      }
+      return (FALSE);
+      dparse (&kernel[0][i], 1, line);
+      dparse (&kernel[1][i], 2, line);
+      dparse (&kernel[2][i], 3, line);
+    }
+    fclose (f);
+    goto have_kernel;
+  }
+  if (atoi (list) != 9) {
+    gprint (GP_ERR, "kernel should be a 3x3 matrix...\n");
+    return (FALSE);
+  }
+  free (list);
+  for (i = 0; i < 9; i++) {
+    sprintf (line, "%s:%d", argv[2], i);
+    list = get_variable (line);
+    if (list == (char *) NULL) {
+      gprint (GP_ERR, "kernel should be a 3x3 matrix...\n");
+      return (FALSE);
+    }
+    kernel[(int)(i/3)][i%3] = atof (list);
+    free (list);
+  }
+  goto have_kernel;
+
+ have_kernel:
+  /* normalize kernel */
+  val = 0;
+  for (n = 0; n < 3; n++) {
+    for (m = 0; m < 3; m++) {
+      val += kernel[n][m];
+    }
+  }
+  if (val == 0) {
+    gprint (GP_ERR, "kernel has zero power, not renormalizing...");
+  } else {
+    for (n = 0; n < 3; n++) {
+      for (m = 0; m < 3; m++) {
+	kernel[n][m] /= val;
+      }
+    }
+  }
+
+  gprint (GP_ERR, "working...");
+  
+  /* create output buffer */
+  NX = buf[0].header.Naxis[0];
+  NY = buf[0].header.Naxis[1];
+  in_buff = (float *)buf[0].matrix.buffer;
+  ALLOCATE (buf[0].matrix.buffer, char, sizeof(float)*NX*NY);
+  out_buff = (float *)buf[0].matrix.buffer;
+  
+  /* do the convolution (on all but outer rows) */
+  
+  for (n = 0; n < 3; n++) {
+    for (m = 0; m < 3; m++) {
+      gprint (GP_ERR, "%d", n*3 + m + 1);
+      val = kernel[n][m];
+      ob = out_buff + NX + 1;
+      ib = in_buff + m*NX + n;
+      for (i = 0; i < (NX-2)*(NY-2); i++, ob++, ib++) {
+	*ob += *ib*val;
+      }
+    }
+  }
+  gprint (GP_ERR, "(done)\n");
+
+  free (in_buff);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/keyword.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/keyword.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/keyword.c	(revision 15879)
@@ -0,0 +1,158 @@
+# include "data.h"
+
+enum {NONE, STRING, FLOAT, INT, BOOLEAN, KEYCOMMENT, COMMENT};
+
+/** WARNING: no error checking on variable validity **/
+int keyword (int argc, char **argv) {
+
+  int ivalue, status, N, ascomment, asfloat, delete, soft, Wmode;
+  char line[80];
+  double value;
+  Buffer *buf;
+
+  asfloat = FALSE;
+  if ((N = get_argument (argc, argv, "-f"))) {
+    remove_argument (N, &argc, argv);
+    asfloat = TRUE;
+  }
+  
+  ascomment = FALSE;
+  if ((N = get_argument (argc, argv, "-c"))) {
+    remove_argument (N, &argc, argv);
+    ascomment = TRUE;
+  }
+  
+  delete = FALSE;
+  if ((N = get_argument (argc, argv, "-d"))) {
+    remove_argument (N, &argc, argv);
+    delete = TRUE;
+  }
+  
+  /* return TRUE for missing keyword if soft */
+  soft = FALSE;
+  if ((N = get_argument (argc, argv, "-soft"))) {
+    remove_argument (N, &argc, argv);
+    soft = TRUE;
+  }
+  
+  /* identify write modes */
+  Wmode = NONE;
+  if ((N = get_argument (argc, argv, "-w"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (line, argv[N]);
+    remove_argument (N, &argc, argv);
+    Wmode = STRING;
+  }
+  if ((N = get_argument (argc, argv, "-wf"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (line, argv[N]);
+    remove_argument (N, &argc, argv);
+    Wmode = FLOAT;
+  }
+  if ((N = get_argument (argc, argv, "-wd"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (line, argv[N]);
+    remove_argument (N, &argc, argv);
+    Wmode = INT;
+  }
+  if ((N = get_argument (argc, argv, "-wc"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (line, argv[N]);
+    remove_argument (N, &argc, argv);
+    Wmode = KEYCOMMENT;
+  }
+  if ((N = get_argument (argc, argv, "-ws"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (line, argv[N]);
+    remove_argument (N, &argc, argv);
+    Wmode = COMMENT;
+  }
+  if ((N = get_argument (argc, argv, "-wb"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (line, argv[N]);
+    remove_argument (N, &argc, argv);
+    Wmode = BOOLEAN;
+  }
+
+  if (!((argc == 3) || (!N && argc == 4))) {
+    gprint (GP_ERR, "USAGE: keyword <buffer> (KEYWORD) [variable] [-d] [-w(mode) value]\n");
+    gprint (GP_ERR, " -w modes: \n");
+    gprint (GP_ERR, "  -w  - string\n");
+    gprint (GP_ERR, "  -wf - float\n");
+    gprint (GP_ERR, "  -wd - int\n");
+    gprint (GP_ERR, "  -wb - boolean\n");
+    gprint (GP_ERR, "  -wc - comment\n");
+    gprint (GP_ERR, "  -ws - full string comment\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  if (Wmode != NONE) {
+    switch (Wmode) {
+    case STRING:
+      gfits_modify (&buf[0].header, argv[2], "%s", 1, line);
+      return (TRUE);
+    case FLOAT:
+      value = atof(line);
+      gfits_modify (&buf[0].header, argv[2], "%lf", 1, value);
+      return (TRUE);
+    case INT:
+      gfits_modify (&buf[0].header, argv[2], "%d", 1, atoi(line));
+      return (TRUE);
+    case BOOLEAN:
+      if (strcasecmp (line, "T") && strcasecmp (line, "TRUE") && strcasecmp (line, "F") && strcasecmp (line, "FALSE")) {
+	gprint (GP_ERR, "syntax error in boolean value\n");
+	return (FALSE);
+      }
+      ivalue = !strcasecmp (line, "T");
+      gfits_modify (&buf[0].header, argv[2], "%t", 1, ivalue);
+      return (TRUE);
+    case KEYCOMMENT:
+      gfits_modify (&buf[0].header, argv[2], "%C", 1, line);
+      return (TRUE);
+    case COMMENT:
+      gfits_modify (&buf[0].header, argv[2], "%S", 0, line);
+      return (TRUE);
+    }
+  }
+  
+  if (delete) {
+    gfits_delete (&buf[0].header, argv[2], -1);
+    return (TRUE);
+  }
+  
+  /* grab the value in the given format, either a string or a digit */
+  if (asfloat) {
+    status = gfits_scan (&buf[0].header, argv[2], "%lf", 1, &value);
+    if (!status) goto failure;
+    if (argc == 4) 
+      set_variable (argv[3], value);
+    else 
+      gprint (GP_LOG, "%s: %f\n", argv[2], value);
+    return (TRUE);
+  } 
+
+  if (ascomment) {
+    status = gfits_scan (&buf[0].header, argv[2], "%C", 1, line);
+    if (!status) goto failure;
+    if (argc == 4) 
+      set_str_variable (argv[3], line);
+    else 
+      gprint (GP_LOG, "%s: %s\n", argv[2], line);
+    return (TRUE);
+  }    
+
+  /* not-specified */
+  status = gfits_scan (&buf[0].header, argv[2], "%s", 1, line);
+  if (!status) goto failure;
+  if (argc == 4) 
+    set_str_variable (argv[3], line);
+  else 
+    gprint (GP_LOG, "%s: %s\n", argv[2], line);
+  return (TRUE);
+
+ failure: 
+  if (!soft) gprint (GP_ERR, "keyword %s not found\n", argv[2]);
+  return (soft);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/labels.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/labels.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/labels.c	(revision 15879)
@@ -0,0 +1,95 @@
+# include "data.h"
+
+int labels (int argc, char **argv) {
+  
+  char name[64];
+  int N, size, kapa;
+
+  if (!GetGraph (NULL, &kapa, NULL)) return (FALSE);
+
+  if (get_argument (argc, argv, "-h")) {
+    gprint (GP_ERR, "label options: \n");
+    gprint (GP_ERR, " -x : bottom-center\n");
+    gprint (GP_ERR, " +x : top-center\n");
+    gprint (GP_ERR, " -y : right-side\n");
+    gprint (GP_ERR, " +y : left-side\n\n");
+
+    gprint (GP_ERR, " -ul : upper-left corner\n");
+    gprint (GP_ERR, " -ll : lower-left corner\n");
+    gprint (GP_ERR, " -ur : upper-right corner\n");
+    gprint (GP_ERR, " -lr : lower-right corner\n\n");
+
+    gprint (GP_ERR, " -fn (font) (size) : set font and size\n");
+    gprint (GP_ERR, "   (font) : courier, helvetica, times, symbol\n\n");
+    gprint (GP_ERR, " label special characters:\n");
+    gprint (GP_ERR, " ^ : superscript\n");
+    gprint (GP_ERR, " _ : subscript\n");
+    gprint (GP_ERR, " | : default script \n");
+    gprint (GP_ERR, " &c, &h, &t, &s : set font\n\n");
+    return (FALSE);
+  }
+
+  if ((N = get_argument (argc, argv, "-fn"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (name, argv[N]);
+    remove_argument (N, &argc, argv);
+    size = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    KapaSetFont (kapa, name, size);
+  } 
+
+  if ((N = get_argument (argc, argv, "-x"))) {
+    remove_argument (N, &argc, argv);
+    KapaSendLabel (kapa, argv[N], 0);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "-y"))) {
+    remove_argument (N, &argc, argv);
+    KapaSendLabel (kapa, argv[N], 1);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "+x"))) {
+    remove_argument (N, &argc, argv);
+    KapaSendLabel (kapa, argv[N], 2);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "+y"))) {
+    remove_argument (N, &argc, argv);
+    KapaSendLabel (kapa, argv[N], 3);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "-ul"))) {
+    remove_argument (N, &argc, argv);
+    KapaSendLabel (kapa, argv[N], 4);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "-ur"))) {
+    remove_argument (N, &argc, argv);
+    KapaSendLabel (kapa, argv[N], 5);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "-ll"))) {
+    remove_argument (N, &argc, argv);
+    KapaSendLabel (kapa, argv[N], 6);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((N = get_argument (argc, argv, "-lr"))) {
+    remove_argument (N, &argc, argv);
+    KapaSendLabel (kapa, argv[N], 7);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: labels [-x] [-y] [+x] [+y] [-ul] [-ur] [-ll] [-lr]\n");
+    return (FALSE);
+  }
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/limits.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/limits.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/limits.c	(revision 15879)
@@ -0,0 +1,76 @@
+# include "data.h"
+
+int limits (int argc, char **argv) {
+
+  int N, APPLY;
+  int kapa;
+  char *name;
+  Graphdata graphmode;
+  Vector *xvec, *yvec;
+
+  xvec = yvec = NULL;
+
+  APPLY = FALSE;
+  if ((N = get_argument (argc, argv, "-a"))) {
+    remove_argument (N, &argc, argv);
+    APPLY = TRUE;
+  }
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetGraph (&graphmode, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  if (argc == 1) {
+    gprint (GP_ERR, "limits: %f %f %f %f [-a] [-n device]\n",
+	     graphmode.xmin, graphmode.xmax,
+	     graphmode.ymin, graphmode.ymax);
+    goto success;
+  }
+
+  if (argc == 3) { /* expect to see: limits x y */
+    if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+    if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+    goto success;
+  }
+    
+  if (argc == 4) { /* expect to see: limits x num num or limits num num y */
+    if (ISNUM(argv[1][0]) && ISNUM(argv[2][0])) {
+      if ((yvec = SelectVector (argv[3], OLDVECTOR, FALSE)) == NULL) goto error;
+      graphmode.xmin = atof (argv[1]);
+      graphmode.xmax = atof (argv[2]);
+      goto success;
+    }
+    if (ISNUM(argv[2][0]) && ISNUM(argv[3][0])) {
+      if ((xvec = SelectVector (argv[1], OLDVECTOR, FALSE)) == NULL) goto error;
+      graphmode.ymin = atof (argv[2]);
+      graphmode.ymax = atof (argv[3]);
+      goto success;
+    }
+    goto error;
+  }
+  
+  if (argc == 5) {
+    graphmode.xmin = atof (argv[1]);
+    graphmode.xmax = atof (argv[2]);
+    graphmode.ymin = atof (argv[3]);
+    graphmode.ymax = atof (argv[4]);
+    goto success;
+  }
+
+  gprint (GP_ERR, "USAGE: limits [xrange] [yrange]\n");
+  gprint (GP_ERR, " [range] may be either [min max] or a vector\n");
+  return (FALSE);
+
+ error:
+  gprint (GP_ERR, "error in vectors\n");
+  return (FALSE);
+
+ success:
+  SetLimits (xvec, yvec, &graphmode);
+  if (APPLY) KapaSetLimits (kapa, &graphmode);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/line.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/line.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/line.c	(revision 15879)
@@ -0,0 +1,29 @@
+# include "data.h"
+
+int line (int argc, char **argv) {
+  
+  int kapa;
+  Graphdata graphmode;
+  float x[2], y[2];
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: line <x> <y> to <x> <y>\n");
+    return (FALSE);
+  }
+  x[0] = atof(argv[1]);
+  y[0] = atof(argv[2]);
+  x[1] = atof(argv[4]);
+  y[1] = atof(argv[5]);
+
+  /* set point style and errorbar mode (these are NOT sticky) */
+  graphmode.style = 0;
+  graphmode.etype = 0;
+
+  if (!KapaPrepPlot (kapa, 2, &graphmode)) return (FALSE);
+  KapaPlotVector (kapa, 2, x, "x");
+  KapaPlotVector (kapa, 2, y, "y");
+  
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/list_buffers.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/list_buffers.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/list_buffers.c	(revision 15879)
@@ -0,0 +1,10 @@
+# include "data.h"
+
+int list_buffers (int argc, char **argv) {
+
+  if (argc == 3) PrintBuffers (TRUE);
+  else PrintBuffers (FALSE);
+
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/list_header.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/list_header.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/list_header.c	(revision 15879)
@@ -0,0 +1,81 @@
+# include "data.h"
+
+int header (int argc, char **argv) {
+  
+  int j, N, nlines, nbytes, Nbytes, LOADHEAD, status, bitpix, unsign;
+  char *p, filename[128];
+  FILE *f;
+  double bscale, bzero;
+  Buffer *buf;
+
+  LOADHEAD = FALSE;
+  if ((N = get_argument (argc, argv, "-w"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (filename, argv[N]);
+    remove_argument (N, &argc, argv);
+    LOADHEAD = TRUE;
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: header <buffer> [-w filename]\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  if (LOADHEAD) {
+    f = fopen (filename, "r");
+    if (f == (FILE *) NULL) {
+      gprint (GP_ERR, "file %s not found\n", filename);
+      return (FALSE);
+    }
+    fclose (f);
+    
+    bitpix = buf[0].header.bitpix;
+    bzero  = buf[0].header.bzero;
+    bscale = buf[0].header.bscale;
+    unsign = buf[0].header.unsign;
+    gfits_free_header (&buf[0].header);
+    
+    strcpy (filename, buf[0].file);
+    strcpy (buf[0].file, "*");
+    strcat (buf[0].file, filename);
+    status = gfits_read_header (argv[2], &buf[0].header);
+    buf[0].header.bitpix = bitpix;     
+    buf[0].header.bzero  = bzero;      
+    buf[0].header.bscale = bscale;     
+    buf[0].header.unsign = unsign;     
+    gfits_modify (&buf[0].header, "BITPIX", "%d",  1, bitpix);
+    gfits_modify (&buf[0].header, "BSCALE", "%lf", 1, bscale);
+    gfits_modify (&buf[0].header, "BZERO",  "%lf", 1, bzero);
+    gfits_modify (&buf[0].header, "UNSIGN", "%t",  1, unsign);
+    
+  } else {
+
+    f = popen ("more", "w");
+    
+    p = gfits_header_field (&buf[0].header, "END", 1);
+    nlines = (p - buf[0].header.buffer) / 80;
+    nbytes = 81*nlines;
+
+    /* duplicate the header, add in the <return> chars, send to more */
+    ALLOCATE (p, char, nbytes);
+    for (j = 0; j < nlines; j++) {
+      memcpy (&p[81*j], &buf[0].header.buffer[80*j], 80);
+      p[81*j+80] = 10;
+    }
+    Nbytes = fwrite (p, sizeof(char), nbytes, f);
+    if (Nbytes != nbytes) {
+      gprint (GP_ERR, "warning: not all printed...\n");
+    }
+    free (p);
+
+    pclose (f);
+
+  }
+
+  return (TRUE);
+
+}
+
+/* XXX this function is not written in the context of the output file/buffer */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/list_vectors.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/list_vectors.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/list_vectors.c	(revision 15879)
@@ -0,0 +1,8 @@
+# include "data.h"
+
+int list_vectors (int argc, char **argv) {
+
+  ListVectors ();
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/load.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/load.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/load.c	(revision 15879)
@@ -0,0 +1,144 @@
+# include "data.h"
+
+int load (int argc, char **argv) {
+  
+  int i, N, n, ISCEL;
+  int kapa, Noverlay, NOVERLAY;
+  char *c, type[10], string[128], line[1024];
+  double x, y, dx, dy, x1, y1;
+  double dra, ddec, ra1, dec1, ra, dec;
+  FILE *f;
+  char *buffer, *name;
+  Coords coords;
+  Buffer *buf;
+  KiiOverlay *overlay;
+  KapaImageData data;
+  
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImageData (&data, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  ISCEL = FALSE;
+  if ((N = get_argument (argc, argv, "-c"))) {
+    remove_argument (N, &argc, argv);
+    ISCEL = TRUE;
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: load (overlay) <filename>\n [-c] [-n]");
+    gprint (GP_ERR, "  -c: read overlay in celestial coords\n");
+    return (FALSE);
+  }
+  
+  if (!strcmp (argv[2], "-")) {
+    f = stdin;
+  } else {
+    f = fopen (argv[2], "r");
+  }
+  if (f == NULL) {
+    gprint (GP_ERR, "can't find file %s\n", argv[2]);
+    return (FALSE);
+  }
+
+  if (ISCEL) {
+    if ((buf = SelectBuffer (data.name, OLDBUFFER, TRUE)) == NULL) return (FALSE);
+    GetCoords (&coords, &buf[0].header);
+  }
+
+  Noverlay = 0;
+  NOVERLAY = 1000;
+  ALLOCATE (overlay, KiiOverlay, NOVERLAY);
+
+  ALLOCATE (buffer, char, 65536);  /* space for 512 lines of 128 bytes */
+  bzero (buffer, 65536);
+
+  dx = dy = 0;
+  for (n = 0; scan_line (f, line) != EOF;) {
+    c = strchr (line, '#');
+    if (c != (char *) NULL) 
+      *c = 0;  /* force end of line at comment! */
+    while ((c = strchr (line, '(')) != (char *) NULL) 
+      *c = ' ';
+    while ((c = strchr (line, ')')) != (char *) NULL) 
+      *c = ' ';
+    while ((c = strchr (line, ',')) != (char *) NULL) 
+      *c = ' ';
+    /* we could use some syntactial checks here */
+    /* have to get all three for this to be any valid object, if the line is commented out,
+     we should get none, so check that N == 3 before continuing: */
+    N = sscanf (line, "%s %lf %lf %lf %lf", type, &ra, &dec, &dra, &ddec);
+    switch (N) {
+    case 0:
+    case -1:
+      continue;
+    case 1:
+    case 2:
+    case 3:
+      if (strcmp (type, "TEXT")) {
+	gprint (GP_ERR, "syntax error in line:\n   %s\n", line);
+	continue;
+      }
+      sscanf (line, "%s %lf %lf %127s", type, &ra, &dec, string);
+    case 4:
+      ddec = dra;
+    case 5:
+      x = ra;
+      y = dec;
+      dx = dra;
+      dy = ddec;
+      if (ISCEL) {
+	if (!strcmp (type, "LINE")) {
+	  RD_to_XY (&x, &y, ra, dec, &coords);
+	  ra1 = ra + dra;
+	  dec1 = dec + ddec;
+	  RD_to_XY (&x1, &y1, ra1, dec1, &coords);
+	  dy = (y1 - y);
+	  dx = (x1 - x);
+	} else {
+	  RD_to_XY (&x, &y, ra, dec, &coords);
+	  ra1 = ra;
+	  dec1 = dec + ddec;
+	  RD_to_XY (&x1, &y1, ra1, dec1, &coords);
+	  dy = (fabs(x1 - x) + fabs(y1 - y));
+	  ra1 = ra + dra/cos(dec*RAD_DEG);;
+	  dec1 = dec;
+	  RD_to_XY (&x1, &y1, ra1, dec1, &coords);
+	  dx = (fabs(x1 - x) + fabs(y1 - y));
+	}
+      }
+    }
+    overlay[Noverlay].type = KiiOverlayTypeByName (type);
+    if (overlay[Noverlay].type == KII_OVERLAY_TEXT) {
+      overlay[Noverlay].text = strcreate (string);
+    } else {
+      overlay[Noverlay].text = NULL;
+    }
+    overlay[Noverlay].x = x;
+    overlay[Noverlay].y = y;
+    overlay[Noverlay].dx = dx;
+    overlay[Noverlay].dy = dy;
+    Noverlay++;
+    CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000);
+  }
+
+  KiiLoadOverlay (kapa, overlay, Noverlay, argv[1]);
+
+  for (i = 0; i < Noverlay; i++) {
+    if (overlay[i].text == NULL) continue;
+    free (overlay[i].text);
+  }
+  free (overlay);
+
+  gprint (GP_ERR, "loaded %d objects\n", Noverlay);
+
+  if (f != stdin) {
+    fclose (f);
+  }
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/lookup.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/lookup.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/lookup.c	(revision 15879)
@@ -0,0 +1,40 @@
+# include "data.h"
+
+int lookup (int argc, char **argv) {
+  
+  int i, j;
+  float *ip, *op, *xp, *yp;
+  Vector *in, *out, *xv, *yv;
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: lookup (input) (output) (x) (y)\n");
+    return (FALSE);
+  }
+
+  if ((in  = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((xv  = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yv  = SelectVector (argv[4], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (xv[0].Nelements != yv[0].Nelements) {
+      gprint (GP_ERR, "unmatched lookup table lengths\n");
+      return (FALSE);
+  }
+
+  out[0].Nelements = in[0].Nelements;
+  REALLOCATE (out[0].elements, float, out[0].Nelements);
+
+  ip = in[0].elements;
+  op = out[0].elements;
+
+  for (i = 0; i < in[0].Nelements; i++, ip++, op++) {
+    // re-write this using bisection
+    xp = xv[0].elements;
+    yp = yv[0].elements;
+
+    for (j = 0; (*ip < *xp) && (j < yv[0].Nelements); j++);
+    *op = j;
+  }      
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mcreate.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mcreate.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mcreate.c	(revision 15879)
@@ -0,0 +1,22 @@
+# include "data.h"
+
+int mcreate (int argc, char **argv) {
+  
+  int Nx, Ny;
+  Buffer *buf;
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: mcreate <buffer> Nx Ny\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+  Nx = atof (argv[2]);
+  Ny = atof (argv[3]);
+
+  /* I should encapsulate this in a create_default_buffer */
+  gfits_free_matrix (&buf[0].matrix);
+  gfits_free_header (&buf[0].header);
+  CreateBuffer (buf, Nx, Ny, -32, 1.0, 0.0);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/medacc.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/medacc.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/medacc.c	(revision 15879)
@@ -0,0 +1,83 @@
+# include "data.h"
+
+int medacc (int argc, char **argv) {
+  
+  int i, j, Nbins, Nvalues, N, N0, N1;
+  double start, end, delta, k0, k1, fn;
+  float *V, *K, *V1, *K1, *O, *tmpvec, *tmpkey;
+  Vector *val, *key, *out;
+
+  if ((argc != 6) && (argc != 7)) {
+    gprint (GP_ERR, "USAGE: medacc <value> <vector> <key> start end [delta]\n");
+    return (FALSE);
+  }
+
+  if ((val = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((key = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if (val[0].Nelements != key[0].Nelements) {
+    gprint (GP_ERR, "key and value don't match\n");
+    return (FALSE);
+  }
+  if ((out = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  start = atof (argv[4]);
+  end   = atof (argv[5]);
+  if (argc == 7) 
+    delta = atof (argv[6]);
+  else 
+    delta = 1;
+
+  delta = fabs (delta);
+  if (end - start < 0) {
+    delta = -1.0 * delta;
+  }
+  Nbins = 1 + (int)((end - start) / delta);
+
+  out[0].Nelements = Nbins;
+  REALLOCATE (out[0].elements, float, out[0].Nelements);
+  bzero (out[0].elements, sizeof(float)*out[0].Nelements);
+
+  /* copy vec and key to temp vectors */
+  ALLOCATE (tmpvec, float, val[0].Nelements);
+  ALLOCATE (tmpkey, float, val[0].Nelements);
+
+  V = val[0].elements;
+  K = key[0].elements;
+  V1 = tmpvec;
+  K1 = tmpkey;
+  Nvalues = val[0].Nelements;
+  for (i = 0; i < Nvalues; i++, V++, K++, V1++, K1++) {
+    *V1 = *V;
+    *K1 = *K;
+  }      
+
+  /* sort vec and key by key */
+  fsortpair (tmpkey, tmpvec, Nvalues);
+
+  O = out[0].elements;
+  /* find the start and end key for each range */
+  N0 = 0;
+  N1 = 0;
+  for (i = 0; i < Nbins; i++) {
+    k0 = i*delta + start;
+    k1 = (i+1)*delta + start;
+    for (j = N1; (j < Nvalues) && (tmpkey[j] < k0); j++);
+    N0 = j;
+    for (j = N0; (j < Nvalues) && (tmpkey[j] < k1); j++);
+    N1 = j;
+    N = N1 - N0;
+    fsort (&tmpvec[N0], N);
+    fn = O[i] = 0;
+    for (j = N0 + 0.25*N; j < N0 + 0.75*N; j++) {
+      O[i] += tmpvec[j];
+      fn += 1.0;
+    }
+    if (fn > 0) O[i] /= fn;
+  }      
+  
+  free (tmpvec);
+  free (tmpkey);
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mget.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mget.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mget.c	(revision 15879)
@@ -0,0 +1,61 @@
+# include "data.h"
+
+int mget (int argc, char **argv) {
+  
+  int i, Nx, Ny, Npix, xdir, Nset;
+  float *in, *out;
+  Buffer *buf;
+  Vector *vec;
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: mget <buffer> <vector> <-x/-y> <N>\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((vec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (strcasecmp (argv[3], "-x") && strcasecmp (argv[3], "-y")) {
+    gprint (GP_ERR, "USAGE: mget <buffer> <vector> <-x/-y> <N>\n");
+    return (FALSE);
+  }
+  xdir = TRUE;
+  if (!strcasecmp (argv[3], "-y")) xdir = FALSE;
+
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+  Nset = atof (argv[4]);
+  if (Nset < 0) {
+    gprint (GP_ERR, "selection out of range\n");
+    return (FALSE);
+  }
+
+  if (xdir) {
+    vec[0].Nelements = Npix = Nx;
+    REALLOCATE (vec[0].elements, float, Npix);
+    if (Nset >= Ny) {
+      gprint (GP_ERR, "row out of range\n");
+      return (FALSE);
+    }
+    in  = (float *) buf[0].matrix.buffer + Nx*Nset;
+    out = vec[0].elements;
+    for (i = 0; i < Npix; i++, in++, out++) {
+      *out = *in;
+    }
+    return (TRUE);
+  } else {
+    vec[0].Nelements = Npix = Ny;
+    REALLOCATE (vec[0].elements, float, Npix);
+    if (Nset >= Nx) {
+      gprint (GP_ERR, "column out of range\n");
+      return (FALSE);
+    }
+    in  = (float *) buf[0].matrix.buffer + Nset;
+    out = vec[0].elements;
+    for (i = 0; i < Npix; i++, in+=Nx, out++) {
+      *out = *in;
+    }
+    return (TRUE);
+  }    
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/minterpolate.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/minterpolate.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/minterpolate.c	(revision 15879)
@@ -0,0 +1,159 @@
+# include "data.h"
+
+int minterp (int argc, char **argv) {
+  
+  int i, j, status, nx, ny, Nx, Ny, N, Extrapolate;
+  int ic, jc, dx, dy, Npix;
+  char temp[1024];
+  double scale, scale2, dX, dY;
+  float *V00, *V01, *V10, *V11, *Vout, dV1, dV2, dV3;
+  float *buf, I, J, x, y, xs, xe, ys, ye;
+  Buffer *in, *out;
+
+  /* choose the appropriate graphing window */
+  Extrapolate = FALSE;
+  if ((N = get_argument (argc, argv, "-extrapolate"))) {
+    remove_argument (N, &argc, argv);
+    Extrapolate = TRUE;
+  }
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: minterpolate <from> <to> scale [-extrapolate]\n");
+    return (FALSE);
+  }
+
+  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectBuffer (argv[2], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  gfits_free_matrix (&out[0].matrix);
+  gfits_free_header (&out[0].header);
+
+  scale  = atof (argv[3]);
+  scale2 = scale*scale;
+  Nx = in[0].header.Naxis[0];
+  Ny = in[0].header.Naxis[1];
+  nx = Nx * scale;
+  ny = Ny * scale;
+
+  /* create new matrix */
+  out[0].bitpix = in[0].bitpix;
+  out[0].unsign = in[0].unsign;
+  out[0].bscale = in[0].bscale;
+  out[0].bzero  = in[0].bzero;
+  gfits_copy_header (&in[0].header, &out[0].header);
+
+  gfits_modify (&out[0].header, "NAXIS1", "%d", 1, nx);
+  gfits_modify (&out[0].header, "NAXIS2", "%d", 1, ny);
+  out[0].header.Naxis[0] = nx;
+  out[0].header.Naxis[1] = ny;
+  gfits_create_matrix (&out[0].header, &out[0].matrix);
+
+  /* fix astrometric terms */
+  status =  gfits_scan (&out[0].header, "CDELT1", "%lf", 1, &dX);
+  status &= gfits_scan (&out[0].header, "CDELT2", "%lf", 1, &dY);
+  dX /= scale;
+  dY /= scale;
+  if (status) {
+    gfits_modify (&out[0].header, "CDELT1", "%lf", 1, dX);
+    gfits_modify (&out[0].header, "CDELT2", "%lf", 1, dY);
+  }
+  status =  gfits_scan (&out[0].header, "CRPIX1", "%lf", 1, &dX);
+  status &= gfits_scan (&out[0].header, "CRPIX2", "%lf", 1, &dY);
+  dX *= scale;
+  dY *= scale;
+  if (status) {
+    gfits_modify (&out[0].header, "CRPIX1", "%lf", 1, dX);
+    gfits_modify (&out[0].header, "CRPIX2", "%lf", 1, dY);
+  }
+
+  /* adjust filename */
+  temp[0] = 0;
+  if ((in[0].file[0] != '*') && (in[0].file[0] != '(')) {
+    strcpy (temp, "*");
+  }
+  strcat (temp, in[0].file);
+  strcpy (out[0].file, temp);
+
+  dX = dY = scale;
+
+  buf = (float *)in[0].matrix.buffer;
+  Npix = 0;
+
+  if (Extrapolate) {
+    for (j = 0; j < Ny - 1; j++) {
+      for (i = 0; i < Nx - 1; i++) {
+	V00 = buf + i + j*Nx;
+	V10 = V00 + 1;
+	V01 = V00 + Nx;
+	V11 = V01 + 1;
+	dV1 = (*V11 + *V00 - *V01 - *V10) / scale2;
+	dV2 = (*V01 - *V00) / scale;
+	dV3 = (*V10 - *V00) / scale;
+
+	x = (i + 0.5) * scale;
+	y = (j + 0.5) * scale;
+
+	xs = ys = 0;
+	xe = ye = scale;
+
+	if (i == 0)      { xs = -0.5*scale; }
+	if (i == Nx - 2) { xe =  1.5*scale; }
+
+	if (j == 0)      { ys = -0.5*scale; }
+	if (j == Ny - 2) { ye =  1.5*scale; }
+
+	for (J = ys; J < ye; J += 1.0) {
+	  dx = (x + xs);
+	  dy = (y + J);
+	  Vout = (float *)(out[0].matrix.buffer) + dy*nx + dx;
+	  for (I = xs; I < xe; I += 1.0, Vout++) {
+	    *Vout = dV1 * (I*J) + dV2 * J + dV3 * I + *V00;
+	    Npix ++;
+	  }
+	}
+      }
+    }
+  } else {
+     for (j = -1; j < Ny; j++) {
+      for (i = -1; i < Nx; i++) {
+	ic = MIN (MAX (i, 0), Nx-1);  /* we never actually reach Nx, Ny */
+	jc = MIN (MAX (j, 0), Ny-1);
+	V00 = buf + ic + jc*Nx;
+	V10 = V00 + 1;
+	V01 = V00 + Nx;
+	V11 = V01 + 1;
+
+	if ((i == -1) || (i == Nx - 1)) { V10 = V00; } else { V10 = V00 + 1; }
+	if ((j == -1) || (j == Ny - 1)) { V01 = V00; } else { V01 = V00 + Nx; }
+	if ((i == -1) || (i == Nx - 1)) { V11 = V01; } else { V11 = V01 + 1; }
+
+	dV1 = (*V11 + *V00 - *V01 - *V10) / scale2;
+	dV2 = (*V01 - *V00) / scale;
+	dV3 = (*V10 - *V00) / scale;
+
+	x = (i + 0.5) * scale;
+	y = (j + 0.5) * scale;
+
+	xs = ys = 0;
+	xe = ye = scale;
+
+	if (i == -1)     { xs = 0.5*scale; }
+	if (i == Nx - 1) { xe = 0.5*scale; }
+
+	if (j == -1)     { ys = 0.5*scale; }
+	if (j == Ny - 1) { ye = 0.5*scale; }
+
+	for (J = ys; J < ye; J += 1.0) {
+	  dx = (x + xs);
+	  dy = (y + J);
+	  Vout = (float *)(out[0].matrix.buffer) + dy*nx + dx;
+	  for (I = xs; I < xe; I += 1.0, Vout++) {
+	    *Vout = dV1 * (I*J) + dV2 * J + dV3 * I + *V00;
+	    Npix ++;
+	  }
+	}
+      }
+    }
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mkrgb.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mkrgb.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mkrgb.c	(revision 15879)
@@ -0,0 +1,78 @@
+# include "data.h"
+# include "jpeglib.h"
+
+int mkrgb (int argc, char **argv) {
+ 
+  int i, j, Nx, Ny;
+  FILE *f;
+  Buffer *red, *green, *blue;
+  float *Vr, *Vg, *Vb;
+
+  struct jpeg_compress_struct cinfo;
+  struct jpeg_error_mgr jerr;
+  JSAMPROW row_pointer[1];	/* pointer to JSAMPLE row[s] */
+  JSAMPLE *image_buffer;	/* Points to data for current line */
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: mkrgb (red) (green) (blue) (output)\n");
+    return (FALSE);
+  }
+
+  // define the input buffer and examine the shift
+  if ((red    = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((green  = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((blue   = SelectBuffer (argv[3], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  Nx = red[0].matrix.Naxis[0];
+  Ny = red[0].matrix.Naxis[1];
+  if (Nx != blue[0].matrix.Naxis[0]) return (FALSE);
+  if (Ny != blue[0].matrix.Naxis[1]) return (FALSE);
+  if (Nx != green[0].matrix.Naxis[0]) return (FALSE);
+  if (Ny != green[0].matrix.Naxis[1]) return (FALSE);
+
+  f = fopen (argv[4], "w");
+  if (f == (FILE *) NULL) {
+    fprintf (stderr, "failed to open %s for output\n", argv[4]);
+    return (FALSE);
+  }
+
+  /* set up the error handler , initialize the JPEG compression object. */
+  cinfo.err = jpeg_std_error (&jerr);
+  jpeg_create_compress (&cinfo);
+  jpeg_stdio_dest(&cinfo, f);
+  
+  // set up the basic jpeg output file
+  cinfo.image_width = Nx; 	/* image width and height, in pixels */
+  cinfo.image_height = Ny;
+  cinfo.input_components = 3;		        
+  cinfo.in_color_space = JCS_RGB; 	
+  jpeg_set_defaults (&cinfo);
+  jpeg_set_quality (&cinfo, 75, TRUE       /* limit to baseline-JPEG values */);
+  jpeg_start_compress (&cinfo, TRUE);
+
+  ALLOCATE (image_buffer, JSAMPLE, 3*Nx);
+
+  // ??
+  // && (cinfo.next_scanline < cinfo.image_height)
+
+  Vr = (float *) red[0].matrix.buffer;
+  Vg = (float *) green[0].matrix.buffer;
+  Vb = (float *) blue[0].matrix.buffer;
+
+  for (j = 0; j < Ny; j++) {
+    for (i = 0; i < Nx; i++, Vr++, Vg++, Vb++) {
+      image_buffer[3*i+0] = MAX (0.0, MIN (255.0, *Vr));
+      image_buffer[3*i+1] = MAX (0.0, MIN (255.0, *Vg));
+      image_buffer[3*i+2] = MAX (0.0, MIN (255.0, *Vb));
+    }
+    row_pointer[0] = image_buffer;
+    (void) jpeg_write_scanlines (&cinfo, row_pointer, 1);
+  }
+
+  jpeg_finish_compress (&cinfo);
+  fclose (f);
+
+  jpeg_destroy_compress (&cinfo);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mset.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mset.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/mset.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "data.h"
+
+int mset (int argc, char **argv) {
+  
+  int i, Nx, Ny, Npix, xdir, Nset;
+  float *in, *out;
+  Buffer *buf;
+  Vector *vec;
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: mset <buffer> <vector> <-x/-y> <N>\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((vec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (strcasecmp (argv[3], "-x") && strcasecmp (argv[3], "-y")) {
+    gprint (GP_ERR, "USAGE: mset <buffer> <vector> <-x/-y> <N>\n");
+    return (FALSE);
+  }
+  xdir = TRUE;
+  if (!strcasecmp (argv[3], "-y")) xdir = FALSE;
+
+  Npix = vec[0].Nelements;
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+  Nset = atof (argv[4]);
+  if (Nset < 0) {
+    gprint (GP_ERR, "selection out of range\n");
+    return (FALSE);
+  }
+
+  if (xdir) {
+    if (Nx != Npix) {
+      gprint (GP_ERR, "dimensions don't match\n");
+      return (FALSE);
+    }
+    if (Nset >= Ny) {
+      gprint (GP_ERR, "row out of range\n");
+      return (FALSE);
+    }
+    out = (float *) buf[0].matrix.buffer + Nx*Nset;
+    in = vec[0].elements;
+    for (i = 0; i < Npix; i++, in++, out++) {
+      *out = *in;
+    }
+    return (TRUE);
+  } else {
+    if (Ny != Npix) {
+      gprint (GP_ERR, "dimensions don't match\n");
+      return (FALSE);
+    }
+    if (Nset >= Nx) {
+      gprint (GP_ERR, "column out of range\n");
+      return (FALSE);
+    }
+    out = (float *) buf[0].matrix.buffer + Nset;
+    in = vec[0].elements;
+    for (i = 0; i < Npix; i++, in++, out+=Nx) {
+      *out = *in;
+    }
+    return (TRUE);
+  }    
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/peak.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/peak.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/peak.c	(revision 15879)
@@ -0,0 +1,55 @@
+# include "data.h"
+
+int peak (int argc, char **argv) {
+  
+  int i, N, imax, QUIET;
+  double start, end, xmax, ymax;
+  float *X, *Y;
+  Vector *vecx, *vecy;
+
+  QUIET = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    QUIET = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((argc != 5) && (argc != 3)) {
+    gprint (GP_ERR, "USAGE: peak <x> <y> [start end]\n");
+    return (FALSE);
+  }
+
+  if ((vecx = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vecy = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (argc == 5) {
+    start = atof (argv[3]);
+    end   = atof (argv[4]);
+  } else {
+    start = vecx[0].elements[0];
+    end   = vecx[0].elements[vecx[0].Nelements - 1];
+  }
+
+  X = vecx[0].elements;
+  Y = vecy[0].elements;
+
+  imax = -1;
+  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)) {
+	xmax = *X;
+	ymax = *Y;
+	imax = i;
+      }
+    }
+  }      
+
+  set_variable ("peakval", ymax);
+  set_variable ("peakpos", xmax);
+  set_variable ("peaknum", imax);
+
+  if (!QUIET) gprint (GP_LOG, "peak %f @ %f (%d)\n", ymax, xmax, imax);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/periodogram.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/periodogram.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/periodogram.c	(revision 15879)
@@ -0,0 +1,114 @@
+# include "data.h"
+
+int periodogram (int argc, char **argv) {
+  
+  int i, N, Npt, Np, NP, VERBOSE;
+  float *tv, *fv;
+  float minP, maxP, minT, maxT, dTime;
+  float mean, var, w, tau, P, Pc, Ps, Po;
+  float C, S, cs, sn, cs2, sn2, ratio;
+  Vector *time, *flux, *power, *period;
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    VERBOSE = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 7) {
+    gprint (GP_ERR, "USAGE: periodogram (time) (flux) (minP) (maxP) (period) (power)\n");
+    return (FALSE);
+  }
+  
+  if ((time = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((flux = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  minP = atof(argv[3]);
+  maxP = atof(argv[4]);
+  if ((period = SelectVector (argv[5], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((power = SelectVector (argv[6], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  /* find the max baseline, mean, and variance */
+  minT = maxT = time[0].elements[0];
+  Npt = time[0].Nelements;
+  tv = time[0].elements;
+  fv = flux[0].elements;
+  mean = var = 0;
+  for (i = 0; i < Npt; i++, tv++, fv++) {
+    minT = MIN (minT, *tv);
+    maxT = MAX (maxT, *tv);
+    mean += *fv;
+  }
+  mean = mean / Npt;
+  fv = flux[0].elements;
+  for (i = 0; i < Npt; i++, fv++) {
+    var += SQ(*fv - mean);
+  }
+  var = var / (Npt - 1);
+
+  if (VERBOSE) gprint (GP_ERR, "mean: %f, var: %f, minT: %f, maxT: %f\n", mean, var, minT, maxT);
+
+  dTime = maxT - minT;
+  if (dTime == 0) {
+    gprint (GP_ERR, "ERROR: time range is zero\n");
+    return (FALSE);
+  }
+
+  Np = 0;
+  NP = 100;
+  REALLOCATE (power[0].elements, float, NP);
+  REALLOCATE (period[0].elements, float, NP);
+
+  P = minP;
+  while (P < maxP) {
+    w = 2*M_PI/P;
+    
+    /* find the period offset tau  */
+    tv = time[0].elements;
+    cs = sn = 0;
+    for (i = 0; i < Npt; i++, tv++) {
+      cs += cos (*tv*w*2);
+      sn += sin (*tv*2*2);
+    }
+    tau = 0.5*atan2 (sn, cs) / w;
+      
+    /* find the power at this period */
+    tv = time[0].elements;
+    fv = flux[0].elements;
+    cs = sn = cs2 = sn2 = 0;
+    for (i = 0; i < Npt; i++, tv++, fv++) {
+      C = cos (w*(*tv-tau));
+      S = sin (w*(*tv-tau));
+      // C = cos (w**tv);
+      // S = sin (w**tv);
+      cs += (*fv - mean) * C;
+      sn += (*fv - mean) * S;
+      cs2 += SQ(C);
+      sn2 += SQ(S);
+    }
+    Pc = SQ(cs) / cs2;
+    Ps = SQ(sn) / sn2;
+    Po = (Pc + Ps) / (2*var);
+
+    power[0].elements[Np] = Po;
+    period[0].elements[Np] = P;
+    Np ++;
+    if (Np >= NP) {
+      NP += 100;
+      REALLOCATE (power[0].elements, float, NP);
+      REALLOCATE (period[0].elements, float, NP);
+    }
+
+    ratio = 1 + 0.1*P/dTime;
+
+    if (VERBOSE) gprint (GP_ERR, "tau: %f, P: %f, ratio: %f, dTime: %f, nextP: %f\n", tau, P, ratio, dTime, P*ratio);
+
+    P *= ratio;
+  }
+
+  power[0].Nelements = Np;
+  period[0].Nelements = Np;
+  REALLOCATE (power[0].elements, float, Np);
+  REALLOCATE (period[0].elements, float, Np);
+ 
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/plot.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/plot.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/plot.c	(revision 15879)
@@ -0,0 +1,71 @@
+# include "data.h"
+
+int plot (int argc, char **argv) {
+  
+  int kapa, N, Npts;
+  Graphdata graphmode;
+  Vector *xvec, *yvec, *dxmvec, *dxpvec, *dymvec, *dypvec;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  /* decide on error bars */
+  dxmvec = dxpvec = dymvec = dypvec = NULL;
+  if ((N = get_argument (argc, argv, "-dx"))) {
+    remove_argument (N, &argc, argv);
+    if ((dxmvec = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "+dx"))) {
+    remove_argument (N, &argc, argv);
+    if ((dxpvec = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-dy"))) {
+    remove_argument (N, &argc, argv);
+    if ((dymvec = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "+dy"))) {
+    remove_argument (N, &argc, argv);
+    if ((dypvec = SelectVector (argv[N], OLDVECTOR, TRUE)) == NULL) return (FALSE);    
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: plot <x> <y> [style]\n");
+    return (FALSE);
+  }
+
+  /* set errorbar mode (these are NOT sticky) */
+  graphmode.etype = 0;
+  if ((dymvec != NULL) && (dypvec == NULL)) dypvec = dymvec;
+  if ((dypvec != NULL) && (dymvec == NULL)) dymvec = dypvec;
+  if ((dypvec != NULL) || (dymvec != NULL)) graphmode.etype |= 0x01;
+  if ((dxmvec != NULL) && (dxpvec == NULL)) dxpvec = dxmvec;
+  if ((dxpvec != NULL) && (dxmvec == NULL)) dxmvec = dxpvec;
+  if ((dxpvec != NULL) || (dxmvec != NULL)) graphmode.etype |= 0x02;
+  
+  /* find vectors */
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if (xvec[0].Nelements != yvec[0].Nelements) {
+    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[1], argv[2]);
+    return (FALSE);
+  }
+  Npts = xvec[0].Nelements;
+  if (Npts == 0) return (TRUE);
+
+  if (!KapaPrepPlot (kapa, Npts, &graphmode)) return (FALSE);
+  
+  KapaPlotVector (kapa, Npts, xvec[0].elements, "x");
+  KapaPlotVector (kapa, Npts, yvec[0].elements, "y");
+  if (graphmode.etype & 0x01) {
+    KapaPlotVector (kapa, Npts, dymvec[0].elements, "dym");
+    KapaPlotVector (kapa, Npts, dypvec[0].elements, "dyp");
+  }
+  if (graphmode.etype & 0x02) {
+    KapaPlotVector (kapa, Npts, dxmvec[0].elements, "dxm");
+    KapaPlotVector (kapa, Npts, dxpvec[0].elements, "dxp");
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/point.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/point.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/point.c	(revision 15879)
@@ -0,0 +1,81 @@
+# include "data.h"
+
+int point (int argc, char **argv) {
+  
+  int N, celestial, pixscale;
+  int kapa;
+  double ra, dec, dra, ddec, angle;
+  double x1, y1, ra1, dec1;
+  char *name;
+  Coords coords;
+  Buffer *buf;
+  KiiOverlay overlay;
+  KapaImageData data;
+
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImageData (&data, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  celestial = FALSE;
+  if ((N = get_argument (argc, argv, "-c"))) {
+    remove_argument (N, &argc, argv);
+    celestial = TRUE;
+  }
+  
+  pixscale = FALSE;
+  if ((N = get_argument (argc, argv, "-pixscale"))) {
+    remove_argument (N, &argc, argv);
+    pixscale = TRUE;
+  }
+
+  angle = 0.0;
+  if ((N = get_argument (argc, argv, "-angle"))) {
+    remove_argument (N, &argc, argv);
+    angle = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 7) {
+    gprint (GP_ERR, "USAGE: point (overlay) TYPE x y dx dy [-c]\n");
+    return (FALSE);
+  }
+  
+  if (celestial) {
+    if ((buf = SelectBuffer (data.name, OLDBUFFER, TRUE)) == NULL) return (FALSE);
+    GetCoords (&coords, &buf[0].header);
+  }
+
+  if (celestial) {
+    ra   = atof(argv[3]);
+    dec  = atof(argv[4]);
+    dra  = atof(argv[5]);
+    ddec = atof(argv[6]);
+
+    fRD_to_XY (&overlay.x, &overlay.y, ra, dec, &coords);
+    if (pixscale) {
+      overlay.dx = atof(argv[5]);
+      overlay.dy = atof(argv[6]);
+    } else {
+      ra1 = ra + dra;
+      dec1 = dec + ddec;
+      RD_to_XY (&x1, &y1, ra1, dec1, &coords);
+      overlay.dx = x1 - overlay.x;
+      overlay.dy = y1 - overlay.y;
+    }
+  }
+  else {
+    overlay.x  = atof(argv[3]);
+    overlay.y  = atof(argv[4]);
+    overlay.dx = atof(argv[5]);
+    overlay.dy = atof(argv[6]);
+  }
+  overlay.angle = angle;
+  overlay.type = KiiOverlayTypeByName (argv[2]);
+  KiiLoadOverlay (kapa, &overlay, 1, argv[1]);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/ps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/ps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/ps.c	(revision 15879)
@@ -0,0 +1,71 @@
+# include "data.h"
+
+int ps (int argc, char **argv) {
+
+  char filename[1024], pagename[1024], *name;
+  int N, kapa, scaleMode, pageMode;
+  
+  if ((N = get_argument (argc, argv, "--help"))) goto help;
+  if ((N = get_argument (argc, argv, "-h"))) goto help;
+
+  pageMode = KAPA_PS_NEWPLOT;
+
+  /* new page? */
+  if ((N = get_argument (argc, argv, "-newpage"))) {
+    remove_argument (N, &argc, argv);
+    pageMode = KAPA_PS_NEWPAGE;
+  }
+  if ((N = get_argument (argc, argv, "-raw"))) {
+    remove_argument (N, &argc, argv);
+    pageMode = KAPA_PS_RAWPAGE;
+  }
+
+  /* scale image? */
+  scaleMode = TRUE;
+  if ((N = get_argument (argc, argv, "-noscale"))) {
+    remove_argument (N, &argc, argv);
+    scaleMode = TRUE;
+  }
+
+  /* what file? */
+  filename[0] = 0;
+  if ((N = get_argument (argc, argv, "-name"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (filename, argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  /* pagename ? */
+  strcpy (pagename, "default");
+  if ((N = get_argument (argc, argv, "-pagename"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (pagename, argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  /* which tool */
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((argc > 1) && filename[0]) goto help;
+
+  if (argc > 1) strcpy (filename, argv[1]);
+
+  // get the connection to kapa, false if none available
+  if (!GetGraphData (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  if (!filename[0]) strcpy (filename, "kapa.ps");
+  
+  /* tell Ximage/Xgraph to ps the image */
+  KiiPS (kapa, filename, scaleMode, pageMode, pagename);
+  return (TRUE);
+
+help:
+  gprint (GP_ERR, "USAGE: ps [-name file.ps] [-g | -i] [-n device] [-raw] [-noscale] [-newpage] [-pagename (name]\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuedelete.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuedelete.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuedelete.c	(revision 15879)
@@ -0,0 +1,21 @@
+# include "data.h"
+
+int queuedelete (int argc, char **argv) {
+  
+  Queue *queue;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: queuedelete (name)\n");
+    return (FALSE);
+  }
+
+  queue = FindQueue (argv[1]);
+  if (queue == NULL) {
+    gprint (GP_ERR, "ERROR: queue %s not found\n", argv[1]);
+    return (FALSE);
+  }
+
+  DeleteQueue (queue);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuedrop.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuedrop.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuedrop.c	(revision 15879)
@@ -0,0 +1,38 @@
+# include "data.h"
+
+int queuedrop (int argc, char **argv) {
+  
+  int N;
+  char *Key;
+  char *line;
+  char *Value;
+  Queue *queue;
+
+  Key = NULL;
+  if ((N = get_argument (argc, argv, "-key"))) {
+    remove_argument (N, &argc, argv);
+    Key = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    Value = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((argc != 2) || (Key == NULL)) {
+    gprint (GP_ERR, "USAGE: queuedrop (queue) [-key N value]\n");
+    return (FALSE);
+  }
+
+  /* will create a queue if none exists */
+  queue = FindQueue (argv[1]);
+  if (queue == NULL) {
+    gprint (GP_ERR, "ERROR: queue %s not found\n", argv[1]);
+    return (FALSE);
+  }
+
+  /* drop all matching entries, if any exist */
+  while ((line = PopQueueMatch (queue, Key, Value)) != NULL) {
+    free (line);
+  }
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queueinit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queueinit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queueinit.c	(revision 15879)
@@ -0,0 +1,15 @@
+# include "data.h"
+
+int queueinit (int argc, char **argv) {
+
+  Queue *queue;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: queueinit (name)\n");
+    return (FALSE);
+  }
+
+  queue = CreateQueue (argv[1]);
+  InitQueue (queue);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuelist.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuelist.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuelist.c	(revision 15879)
@@ -0,0 +1,12 @@
+# include "data.h"
+
+int queuelist (int argc, char **argv) {
+  
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: queuelist\n");
+    return (FALSE);
+  }
+
+  ListQueues ();
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queueload.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queueload.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queueload.c	(revision 15879)
@@ -0,0 +1,69 @@
+# include "data.h"
+
+int queueload (int argc, char **argv) {
+  
+  char *A, *B, *val;
+  int i, status;
+  int Nread, Nbytes, NBYTES;
+  FILE *f;
+  Queue *queue;
+
+  if (argc != 4) goto usage;
+  if (strcmp(argv[2], "-x")) goto usage;
+  
+  /* will create a queue if none exists */
+  queue = CreateQueue (argv[1]);
+
+  /* val will hold the result of the command */
+  NBYTES = 1024;
+  ALLOCATE (val, char, NBYTES);
+    
+  /* loop until command produces no more output,  REALLOCATE as needed. */
+  f = popen (argv[3], "r");
+  Nbytes = 0;
+  Nread = 1;
+  while (Nread > 0) {
+    Nread = fread (&val[Nbytes], 1, 1023, f);
+    if (Nread < 0) { 
+      gprint (GP_ERR, "error reading from command\n");
+    }
+    if (Nread > 0) {
+      Nbytes += Nread;
+      NBYTES = 1024 + Nbytes;
+      REALLOCATE (val, char, NBYTES);
+    }
+  }
+  val[Nbytes] = 0;
+  status = pclose (f);
+    
+  if (status) {
+    gprint (GP_ERR, "warning: exit status of command %d\n", status);
+  }
+      
+  A = B = val;
+  for (i = 0; B != (char *) NULL;) {
+    while (isspace (*A) && (*A != 0)) A++;
+    B = strchr (A, '\n');
+    if (B != (char *) NULL) { *B = 0; }
+    if (*A != 0) {
+      PushQueue (queue, A);
+      A = B + 1;
+      i++;
+    }
+  }      
+  free (val);
+    
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: queueload (queue) -x (command)\n");
+  return (FALSE);
+}
+
+
+/* 
+ * -key only needed for replace or unique : give an error otherwise
+ * -uniq searched for a match and does NOT replace if matched
+ * -replace searches for a match and replaces if matched
+ * should trigger an error if -uniq and -replace...
+ */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuepop.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuepop.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuepop.c	(revision 15879)
@@ -0,0 +1,71 @@
+# include "data.h"
+
+int queuepop (int argc, char **argv) {
+  
+  int N;
+  char *Key;
+  char *var;
+  char *line;
+  char *Value;
+  Queue *queue;
+
+  var = (char *) NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    var = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  Key = NULL;
+  Value = NULL;
+  if ((N = get_argument (argc, argv, "-key"))) {
+    remove_argument (N, &argc, argv);
+    Key = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    Value = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: queuepop (queue) [-var variable] [-key N value]\n");
+    return (FALSE);
+  }
+
+  /* will create a queue if none exists */
+  queue = FindQueue (argv[1]);
+  if (queue == NULL) {
+    gprint (GP_ERR, "ERROR: queue %s not found\n", argv[1]);
+    return (FALSE);
+  }
+
+  if (Key == NULL) {
+    line = PopQueue (queue);
+  } else {
+    line = PopQueueMatch (queue, Key, Value);
+  }
+
+  if (var == NULL) {
+    if (line == NULL) {
+      gprint (GP_ERR, "queue %s is empty or match not found\n", argv[1]);
+      return (FALSE);
+    } else {
+      gprint (GP_LOG, "%s\n", line);
+      free (line);
+      return (TRUE);
+    }
+  }
+
+  if (line == NULL) {
+    set_str_variable (var, "NULL");
+  } else {
+    set_str_variable (var, line);
+    free (line);
+  }
+
+  free (var);
+  if (Key != NULL) free (Key);
+  if (Value != NULL) free (Value);
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queueprint.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queueprint.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queueprint.c	(revision 15879)
@@ -0,0 +1,21 @@
+# include "data.h"
+
+int queueprint (int argc, char **argv) {
+  
+  Queue *queue;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: queueprint (name)\n");
+    return (FALSE);
+  }
+
+  queue = FindQueue (argv[1]);
+  if (queue == NULL) {
+    gprint (GP_ERR, "ERROR: queue %s not found\n", argv[1]);
+    return (FALSE);
+  }
+
+  PrintQueue (queue);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuepush.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuepush.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuepush.c	(revision 15879)
@@ -0,0 +1,56 @@
+# include "data.h"
+
+int queuepush (int argc, char **argv) {
+  
+  char *Key;
+  int N, Unique, Replace;
+  Queue *queue;
+
+  Unique = FALSE;
+  if ((N = get_argument (argc, argv, "-uniq"))) {
+    remove_argument (N, &argc, argv);
+    Unique = TRUE;
+  }
+
+  Replace = FALSE;
+  if ((N = get_argument (argc, argv, "-replace"))) {
+    remove_argument (N, &argc, argv);
+    Replace = TRUE;
+  }
+
+  Key = NULL;
+  if ((N = get_argument (argc, argv, "-key"))) {
+    remove_argument (N, &argc, argv);
+    Key = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: queuepush (queue) (value) [-key N] [-uniq] [-replace]\n");
+    return (FALSE);
+  }
+
+  /* will create a queue if none exists */
+  queue = CreateQueue (argv[1]);
+
+  if (Unique) {
+    PushQueueUnique (queue, argv[2], Key);
+  }
+  if (Replace) {
+    PushQueueReplace (queue, argv[2], Key);
+  }
+  if (!Unique && !Replace) {
+    PushQueue (queue, argv[2]);
+  }
+
+  if (Key != NULL) free (Key);
+  return (TRUE);
+}
+
+
+/* 
+ * -key only needed for replace or unique : give an error otherwise
+ * -uniq searched for a match and does NOT replace if matched
+ * -replace searches for a match and replaces if matched
+ * should trigger an error if -uniq and -replace...
+ */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuesize.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuesize.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/queuesize.c	(revision 15879)
@@ -0,0 +1,36 @@
+# include "data.h"
+
+int queuesize (int argc, char **argv) {
+  
+  int N;
+  char *var;
+  Queue *queue;
+
+  var = (char *) NULL;
+  if ((N = get_argument (argc, argv, "-var"))) {
+    remove_argument (N, &argc, argv);
+    var = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: queuesize (name) [-var variable]\n");
+    return (FALSE);
+  }
+
+  queue = FindQueue (argv[1]);
+  if (queue == NULL) {
+    gprint (GP_ERR, "ERROR: queue %s not found\n", argv[1]);
+    return (FALSE);
+  }
+
+  if (var == (char *) NULL) {
+    gprint (GP_ERR, "Nlines: %d\n", queue[0].Nlines);
+    return (TRUE);
+  }
+
+  set_int_variable (var, queue[0].Nlines);
+  free (var);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/radial.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/radial.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/radial.c	(revision 15879)
@@ -0,0 +1,97 @@
+# include "data.h"
+
+int circstats (int argc, char **argv) {
+  
+  int i, j;
+  double Npix, S1, S2, max, min, Sum, Mean, Stdev, IgnoreValue; 
+  double xc, yc, radius, R2, r;
+  float *V;
+  int xs, ys, xe, ye;
+  int Ignore, Quiet, N, Nx, Ny;
+  Buffer *buf;
+
+  Ignore = FALSE;
+  IgnoreValue = 0;
+  if ((N = get_argument (argc, argv, "-ignore"))) {
+    Ignore = TRUE;
+    remove_argument (N, &argc, argv);
+    IgnoreValue = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  Quiet = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 5) goto usage;
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) goto missed;
+
+  xc = atof (argv[2]);
+  yc = atof (argv[3]);
+  radius = atof (argv[4]);
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+
+  if (xc < 0) goto range;
+  if (yc < 0) goto range;
+  if (xc >= Nx) goto range;
+  if (yc >= Ny) goto range;
+
+  xs = MAX (0, xc - radius);
+  ys = MAX (0, yc - radius);
+  xe = MIN (Nx, xc + radius + 1);
+  ye = MAX (Ny, yc + radius + 1);
+  R2 = radius*radius;
+
+  S1 = S2 = Npix = 0;
+  min = max = *(float *)(buf[0].matrix.buffer) + (int)(yc)*buf[0].matrix.Naxis[0] + (int)(xc); 
+  for (j = ys; j < ye; j++) {
+    V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + xs; 
+    for (i = xs; i < xe; i++, V++) {
+      r = SQ(i - xc) + SQ(j - yc);
+      if (r > R2) continue;
+      if (Ignore && (fabs (*V - IgnoreValue) < 1e-8)) continue;
+      S1 += *V;
+      S2 += (*V)*(*V);
+      Npix += 1.0;
+      max = MAX (max, *V);
+      min = MIN (min, *V);
+    }
+  }
+  Mean = S1 / Npix;
+  Sum  = Mean * M_PI * R2;
+  Stdev = sqrt (S2/Npix - Mean*Mean);
+
+  if (!Quiet) {
+    gprint (GP_LOG, "     mean     stdev       min       max    Npix     Total\n");
+    gprint (GP_LOG, "%9.4g %9.4g %9.4g %9.4g %7.0f %9.4g\n", Mean, Stdev, min, max, Npix, Sum);
+  }
+
+  set_variable ("MIN",    min);
+  set_variable ("MAX",    max);
+  set_variable ("MEAN",   Mean);
+  set_variable ("SUM",    Sum);
+  set_variable ("NPIX",   Npix);
+  set_variable ("SIGMA",  Stdev);
+
+  return (TRUE);
+
+ usage: 
+  gprint (GP_ERR, "USAGE: circstats <buffer> x y radius\n");
+  return (FALSE);
+
+ range:
+  gprint (GP_ERR, "ERROR: coordinates out of range\n");
+  return (FALSE);
+
+ missed:
+  gprint (GP_ERR, "ERROR: buffer not found\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rd.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rd.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rd.c	(revision 15879)
@@ -0,0 +1,227 @@
+# include "data.h"
+
+/* there is some confusion in this function with the several possible options */
+int rd (int argc, char **argv) {
+  
+  int i, N, status, plane, Nplane, extend, Nextend, Nskip, JustHead;
+  int ccdsel, done, Nword, IsCompressed;
+  char region[512], *ccdid, *filename;
+  FILE *f;
+  Buffer *buf;
+
+  JustHead = FALSE;
+  if ((N = get_argument (argc, argv, "-head"))) {
+    remove_argument (N, &argc, argv);
+    JustHead = TRUE;
+  }
+
+  plane = 1;
+  if ((N = get_argument (argc, argv, "-plane"))) {
+    remove_argument (N, &argc, argv);
+    plane  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  extend = FALSE;
+  Nextend = -1;
+  if ((N = get_argument (argc, argv, "-x"))) {
+    remove_argument (N, &argc, argv);
+    Nextend  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    extend = TRUE;
+  }
+
+  ccdsel = FALSE;
+  ccdid = (char *) NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    ccdid  = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    ccdsel = TRUE;
+  }
+
+  if (extend && ccdsel) {
+    gprint (GP_ERR, "only specify one of -n and -x\n");
+    return (FALSE);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: rd <buffer> <filename> [-head] [-plane N] [-n ccdid] [-x extnum]\n");
+    return (FALSE);
+  }
+
+  /* test if file exists */
+  f = fopen (argv[2], "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "file %s not found\n", argv[2]);
+    return (FALSE);
+  }
+
+  /* find matrix, free old data */
+  if ((buf = SelectBuffer (argv[1], ANYBUFFER, TRUE)) == NULL) {
+      fclose (f);
+      return (FALSE);
+  }
+  gfits_free_matrix (&buf[0].matrix);
+  gfits_free_header (&buf[0].header);
+
+  /* save file name */
+  filename = filebasename (argv[2]);
+  strcpy (buf[0].file, filename);
+  free (filename);
+
+  status = FALSE;
+  IsCompressed = FALSE;
+
+  /*** advance to the correct FITS extension ***/
+
+  /* FITS extension by number */
+  if (extend) {
+    /* load in appropriate header */
+    Nskip = gfits_fread_Xheader (f, &buf[0].header, Nextend);
+    if (!Nskip) {
+      gprint (GP_ERR, "entry in %s not found\n", argv[2]);
+      DeleteBuffer (buf);
+      fclose (f);
+      return (FALSE);
+    }
+    if (gfits_extension_is_compressed (&buf[0].header)) {
+	IsCompressed = TRUE;
+    }
+  } 
+
+  /* FITS extension by name */
+  if (ccdsel) {
+    char *CCDKeyword, ID[64];
+
+    CCDKeyword = get_variable ("CCDKEYWORD");
+    if (CCDKeyword == (char *) NULL) {
+      // gprint (GP_ERR, "CCDKEYWORD variable is not set; ");
+      // gprint (GP_ERR, "using EXTNAME as default\n");
+      CCDKeyword = strcreate ("EXTNAME");
+    }
+    done = FALSE;
+    for (i = 0; !done; i++) {
+      Nskip = gfits_fread_Xheader (f, &buf[0].header, i);
+      if (!Nskip) {
+	gprint (GP_ERR, "extension %s in %s not found\n", ccdid, argv[2]);
+	DeleteBuffer (buf);
+	free (CCDKeyword);
+	fclose (f);
+	return (FALSE);
+      }
+
+      // for compressed data tables, EXTNAME may be duplicated, with the first one containing the
+      // word 'COMPRESSED_IMAGE'.  in this case, check the second EXTNAME, if CCDKeyword == EXTNAME 
+      // this may have to be a more obscure test specifically for 'imcopy' data...
+      // need to check each header, since file may contain a mix
+      
+      Nword = 1;
+      IsCompressed = FALSE;
+      if (gfits_extension_is_compressed (&buf[0].header)) {
+	if (!strcmp (CCDKeyword, "EXTNAME")) Nword = 1;
+	IsCompressed = TRUE;
+      }
+      if (!gfits_scan (&buf[0].header, CCDKeyword, "%s", Nword, ID)) {
+	gprint (GP_ERR, "%s not in header\n", CCDKeyword);
+	DeleteBuffer (buf);
+	free (CCDKeyword);
+	fclose (f);
+	return (FALSE);
+      }
+
+      /* compare as numbers if both are pure numbers, else as strings */
+      done = strnumcmp (ccdid, ID);
+      if (!done) gfits_free_header (&buf[0].header);
+    }
+    free (CCDKeyword);
+  }
+
+  /* fix up header, if needed */
+  if (extend || ccdsel) {
+    if (!IsCompressed) {
+      gfits_extended_to_primary (&buf[0].header, TRUE, "Standard FITS");
+    }
+  } else {
+      gfits_fread_header (f, &buf[0].header);
+  }
+
+  /* for JustHead, we skip reading the data segment */ 
+  // XXX for compressed data, we need to convert the header to the equivalent uncompressed version
+  if (JustHead) {
+    // XXX what are we doing here exactly?
+    buf[0].header.Naxes = 0;
+    ALLOCATE (buf[0].matrix.buffer, char, 1);
+    buf[0].matrix.size = 0;
+    buf[0].bitpix = 16;
+    buf[0].bzero = 0;
+    buf[0].bscale = 1;
+    buf[0].matrix.bitpix = 16;
+    buf[0].matrix.bzero = 0;
+    buf[0].matrix.bscale = 1;
+    buf[0].header.bitpix = 16;
+    buf[0].header.bzero = 0;
+    buf[0].header.bscale = 1;
+    fclose (f);
+    return (TRUE);
+  }
+
+  /* check for valid plane */
+  Nplane = buf[0].header.Naxis[2];
+  if (Nplane == 0) Nplane = 1;
+  if (plane > Nplane) {
+    gprint (GP_ERR, "-plane is too large: %d total planes\n", Nplane);
+    DeleteBuffer (buf);
+    fclose (f);
+    return (FALSE);
+  }
+
+  /* load matrix data */
+  if (IsCompressed) {
+    FTable ftable;
+    Header theader;
+    ftable.header = &theader;
+    gfits_copy_header (&buf[0].header, ftable.header);
+    status = gfits_fread_ftable_data (f, &ftable);  // this just reads the bytes (not even a SWAP)
+    status = gfits_uncompress_image (&buf[0].header, &buf[0].matrix, &ftable);
+    gfits_free_table (&ftable);
+    // XXX this currently does not work for a cube (we get a cube back, not a specific plane)
+  } else {
+    sprintf (region, "-1 -1 -1 -1 %d %d", (plane - 1), plane);
+    status = gfits_fread_matrix_segment (f, &buf[0].matrix, &buf[0].header, region);
+    fclose (f);
+  }
+
+  if (!status) {
+    gprint (GP_ERR, "problem reading file, buffer not opened\n");
+    DeleteBuffer (buf);
+    return (FALSE);
+  }
+
+  /* adjust buffer to represent 2D data */
+  if (Nplane > 1) {
+    buf[0].header.Naxis[2] = 0;
+    buf[0].header.Naxes = 2;
+    gfits_modify (&buf[0].header, "NAXIS", "%d", 1, 2);
+    gfits_delete (&buf[0].header, "NAXIS3", 1);
+  }
+
+  /* we need to return a 2D array, convert 1D images to 2D (Naxis[1] = 1) */
+  if (buf[0].header.Naxes == 1) {
+    buf[0].header.Naxes = 2;
+    buf[0].header.Naxis[1] = 1;
+    buf[0].matrix.Naxis[1] = 1;
+  }    
+
+  buf[0].bitpix = buf[0].header.bitpix;    /* store the original values */
+  buf[0].bscale = buf[0].header.bscale;    /* store the original values */
+  buf[0].bzero  = buf[0].header.bzero;     /* store the original values */
+  buf[0].unsign = buf[0].header.unsign;
+  gprint (GP_LOG, "read %d bytes from %s into buffer %s\n", 
+	   buf[0].header.size + buf[0].matrix.size, argv[2], argv[1]);
+
+  /** now - convert the matrix values to floats for internal use **/
+  gfits_convert_format (&buf[0].header, &buf[0].matrix, -32, 1.0, 0.0, gfits_get_unsign_mode());
+  
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rdseg.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rdseg.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rdseg.c	(revision 15879)
@@ -0,0 +1,72 @@
+# include "data.h"
+
+/* there is some confusion in this function with the several possible options */
+int rdseg (int argc, char **argv) {
+  
+  int x, y, nx, ny, status;
+  char region[512], *filename;
+  FILE *f;
+  Buffer *buf;
+
+  if (argc != 7) {
+    gprint (GP_ERR, "USAGE: rdseg <buffer> <filename> x y nx ny\n");
+    return (FALSE);
+  }
+  x = atoi (argv[3]);
+  y = atoi (argv[4]);
+  nx = atoi (argv[5]);
+  ny = atoi (argv[6]);
+
+  /* test if file exists */
+  f = fopen (argv[2], "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "file %s not found\n", argv[2]);
+    return (FALSE);
+  }
+  fclose (f);
+
+  /* find matrix, free old data */
+  if ((buf = SelectBuffer (argv[1], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+  gfits_free_matrix (&buf[0].matrix);
+  gfits_free_header (&buf[0].header);
+
+  /* save file name */
+  filename = filebasename (argv[2]);
+  strcpy (buf[0].file, filename);
+  free (filename);
+
+  status = gfits_read_header (argv[2], &buf[0].header);
+  sprintf (region, "%d %d %d %d 0 1", x, nx + x, y, ny + y);
+  status = gfits_read_matrix_segment (argv[2], &buf[0].matrix, region);
+  gfits_modify (&buf[0].header, "NAXIS1", "%d", 1, nx);
+  gfits_modify (&buf[0].header, "NAXIS2", "%d", 1, ny);
+  buf[0].header.Naxis[0] = nx;
+  buf[0].header.Naxis[1] = ny;
+  buf[0].matrix.Naxis[0] = nx;
+  buf[0].matrix.Naxis[1] = ny;
+
+  if (!status) {
+    gprint (GP_ERR, "problem reading file, buffer not opened\n");
+    DeleteBuffer (buf);
+    return (FALSE);
+  }
+  if (buf[0].header.Naxes == 1) {
+    /* we need to return an array, so make Naxis[1] = 1 */
+    buf[0].header.Naxes = 2;
+    buf[0].header.Naxis[1] = 1;
+    buf[0].matrix.Naxis[1] = 1;
+  }    
+
+  buf[0].bitpix = buf[0].header.bitpix;    /* store the original values */
+  buf[0].bscale = buf[0].header.bscale;    /* store the original values */
+  buf[0].bzero  = buf[0].header.bzero;     /* store the original values */
+  buf[0].unsign = buf[0].header.unsign;
+  gprint (GP_LOG, "read %d bytes from %s into buffer %s\n", 
+	   buf[0].header.size + buf[0].matrix.size, argv[2], argv[1]);
+
+  /** now - convert the matrix values to floats for internal use **/
+  gfits_convert_format (&buf[0].header, &buf[0].matrix, -32, 1.0, 0.0, gfits_get_unsign_mode());
+  
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/read_vectors.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/read_vectors.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/read_vectors.c	(revision 15879)
@@ -0,0 +1,325 @@
+ # include "data.h"
+
+FILE *f = (FILE *) NULL;
+char filename[256];
+
+int datafile (int argc, char **argv) {
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: datafile (filename)\n");
+    return (FALSE);
+  }
+  
+  strcpy (filename, argv[1]);
+  if (f != (FILE *) NULL) { fclose (f); }
+  f = fopen (filename, "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "failed to open file %s\n", argv[1]);
+    return (FALSE);
+  }
+  return (TRUE);
+}
+
+int read_vectors (int argc, char **argv) {
+  
+  int i, j, Nskip, Nvec, *col, done, status;
+  int Nbytes, nbytes, Nstart, NELEM, N, nread;
+  char *colstr, *c0, *c1, *buffer, *extname;
+  double value;
+  Vector **vec;
+
+  /* auto-sense table type */
+  if ((N = get_argument (argc, argv, "-fits"))) {
+    remove_argument (N, &argc, argv);
+    extname = strcreate (argv[N]);
+    if (extname == (char *) NULL) return (FALSE);
+    remove_argument (N, &argc, argv);
+    status = read_table_vectors (argc, argv, extname);
+    free (extname);
+    return (status);
+  }
+
+  Nskip = 0;
+  if ((N = get_argument (argc, argv, "-skip"))) {
+    remove_argument (N, &argc, argv);
+    Nskip = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((argc < 3) || !(argc % 2)) {
+    gprint (GP_ERR, "USAGE: read name N name N ...\n");
+    return (FALSE);
+  }
+  /* read name N name N  */
+
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "no open file for read\n");
+    return (FALSE);
+  }
+  fseek (f, 0, SEEK_SET);
+
+  Nvec = (argc - 1) / 2;
+  ALLOCATE (vec, Vector *, Nvec);
+  ALLOCATE (col, int, Nvec);
+
+  for (i = 0; i < Nvec; i++) {
+    if ((vec[i] = SelectVector (argv[2*i + 1], ANYVECTOR, TRUE)) == NULL) {
+      gprint (GP_ERR, "USAGE: read name N name N ...\n");
+      free (vec);
+      free (col);
+      return (FALSE);    
+    }
+    colstr = argv[2*i+2];
+    for (j = 0; j < strlen (colstr); j++) {
+      if (!isdigit(colstr[j])) {
+	gprint (GP_ERR, "USAGE: read name N name N ...\n");
+	free (vec);
+	free (col);
+	return (FALSE);    
+      }
+    }
+    col[i] = atof (colstr);
+  }
+  
+  NELEM = 1000;
+  for (i = 0; i < Nvec; i++) {
+    REALLOCATE (vec[i][0].elements, float, NELEM);
+  }
+  
+  ALLOCATE (buffer, char, 0x10001);
+  bzero (buffer, 0x10001);
+  for (i = 0; i < Nskip; i++) {
+    scan_line (f, buffer);
+  }
+
+  Nstart = 0;
+  N = 0;
+  done = FALSE;
+  while (!done) {
+    Nbytes = 0x10000 - Nstart;
+    bzero (&buffer[Nstart], Nbytes);
+    nread = fread (&buffer[Nstart], 1, Nbytes, f);
+    if (ferror (f)) {
+      perror ("error reading data file");
+      break;
+    }
+    if (nread == 0) break;
+    nbytes = nread + Nstart;
+    
+    status = TRUE;
+    c0 = buffer; 
+    while (status) {
+      c1 = strchr (c0, '\n');
+      if (c1 == (char *) NULL) {
+	Nstart = strlen (c0);
+	memmove (buffer, c0, Nstart);
+	status = FALSE;
+      } else {
+	*c1 = 0;
+      }      
+      if ((*c0 != '#') && (*c0 != '!')) {
+	for (i = 0; (i < Nvec) && status; i++) {
+	  status = dparse (&value, col[i], c0);
+	  vec[i][0].elements[N] = value;
+	  if (!status) vec[i][0].elements[N] = 0.0/0.0;
+	}
+	if (status) N++;
+      }
+      c0 = c1 + 1;
+      if (N == NELEM) {
+	NELEM += 1000;
+	for (i = 0; i < Nvec; i++) {
+	  REALLOCATE (vec[i][0].elements, float, NELEM);
+	}
+      }
+	
+    }
+  }
+  for (i = 0; i < Nvec; i++) {
+    REALLOCATE (vec[i][0].elements, float, MAX (N,1));
+    vec[i][0].Nelements = N;
+  }
+  
+  free (vec);
+  free (col);
+  free (buffer);
+  return (TRUE);
+
+}
+
+int read_table_vectors (int argc, char **argv, char *extname) {
+
+  int i, j, k, N, Nbytes, Nextend, Ny, Binary;
+  char type[16], ID[80], *CCDKeyword;
+  FTable table;
+  Header header;
+  Vector **vec;
+
+  table.buffer = NULL;
+  header.buffer = NULL;
+
+  CCDKeyword = NULL;
+  if ((N = get_argument (argc, argv, "-keyword"))) {
+    remove_argument (N, &argc, argv);
+    CCDKeyword = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  Nextend = -1;
+  if ((N = get_argument (argc, argv, "-extnum"))) {
+    remove_argument (N, &argc, argv);
+    Nextend = atoi (extname);
+  }
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: read -fits extension [-extnum] [-keyword key] name name ...\n");
+    gprint (GP_ERR, "  ('extension' may be a name or number)\n");
+    goto escape;
+  }
+
+  if (f == (FILE *) NULL) goto escape;
+  fseek (f, 0, SEEK_SET);
+  table.header = &header;
+
+  /* load appropriate extension (if extname is a number, use count) */
+  if (Nextend > -1) {
+    // first extension is PHU, cannot be a table. 
+    // Nextend counts from 0 for first extension
+    if (!gfits_load_header (f, &header)) goto escape;
+    Nbytes = gfits_data_size (&header);
+    fseek (f, Nbytes, SEEK_CUR);
+    gfits_free_header (&header);
+
+    for (i = 0; i < Nextend; i++) {
+      if (!gfits_load_header (f, &header)) goto escape;
+      Nbytes = gfits_data_size (&header);
+      /* skip the prior data buffers */
+      fseek (f, Nbytes, SEEK_CUR);
+      gfits_free_header (&header);
+    }
+    if (!gfits_load_header (f, &header)) goto escape;
+    if (!gfits_fread_ftable_data (f, &table)) goto escape;
+
+  } else {
+    if (CCDKeyword == NULL) {
+      CCDKeyword = get_variable ("CCDKEYWORD");
+    }
+    if (CCDKeyword == NULL) {
+      CCDKeyword = strcreate ("EXTNAME");
+    }
+
+    while (1) {
+      if (!gfits_load_header (f, &header)) goto escape;
+      Nbytes = gfits_data_size (&header);
+
+      if (!gfits_scan (&header, CCDKeyword, "%s", 1, ID)) {
+	fseek (f, Nbytes, SEEK_CUR);
+	gfits_free_header (&header);
+	continue;
+      }
+      if (strcmp (ID, extname)) {
+	fseek (f, Nbytes, SEEK_CUR);
+	gfits_free_header (&header);
+	continue;
+      }
+      if (!gfits_fread_ftable_data (f, &table)) goto escape;
+      break;
+    }
+  }
+
+  /* identify table type (ascii / binary) */
+  Binary = FALSE;
+  gfits_scan (&header, "XTENSION", "%s", 1, type);
+  if (strcmp (type, "BINTABLE") && strcmp (type, "TABLE")) {
+    gprint (GP_ERR, "specified extension (%s) is not a table\n", extname);
+    goto escape;
+  }
+  Binary = !strcmp (type, "BINTABLE");
+  Ny = header.Naxis[1];
+
+  /* find columns which match requested vectors */
+  for (i = 1; i < argc; i++) {
+    void   *data;
+    char   *Pc;
+    short  *Ps;
+    int    *Pi;
+    float  *Pf;
+    double *Pd;
+    int Nval;
+    char name[80];
+      
+    Nval = 0;
+    if (Binary) {
+      if (!gfits_get_bintable_column_type (&header, argv[i], type, &Nval)) goto escape;
+      if (!gfits_get_bintable_column (&header, &table, argv[i], &data)) goto escape;
+    } else {
+      if (!gfits_get_table_column_type (&header, argv[i], type)) goto escape;
+      if (!gfits_get_table_column (&header, &table, argv[i], &data)) goto escape;
+    }
+    if (Nval == 0) goto escape;
+
+    ALLOCATE (vec, Vector *, Nval);
+    for (j = 0; j < Nval; j++) {
+      if (Nval == 1) 
+	sprintf (name, "%s", argv[i]);
+      else
+	sprintf (name, "%s:%d", argv[i], j);
+      if ((vec[j] = SelectVector (name, ANYVECTOR, TRUE)) == NULL) goto escape;
+      REALLOCATE (vec[j][0].elements, float, MAX (Ny,1));
+      vec[j][0].Nelements = Ny;
+    }
+
+    if (!strcmp (type, "double")) {
+      Pd = (double *) data;
+      for (j = 0; j < Ny; j++) {
+	for (k = 0; k < Nval; k++, Pd++) {
+	  vec[k][0].elements[j] = *Pd;
+	}
+      }
+    }
+    if (!strcmp (type, "float")) {
+      Pf = (float *) data;
+      for (j = 0; j < Ny; j++) {
+	for (k = 0; k < Nval; k++, Pf++) {
+	  vec[k][0].elements[j] = *Pf;
+	}
+      }
+    }
+    if (!strcmp (type, "int")) {
+      Pi = (int *) data;
+      for (j = 0; j < Ny; j++) {
+	for (k = 0; k < Nval; k++, Pi++) {
+	  vec[k][0].elements[j] = *Pi;
+	}
+      }
+    }
+    if (!strcmp (type, "short")) {
+      Ps = (short *) data;
+      for (j = 0; j < Ny; j++) {
+	for (k = 0; k < Nval; k++, Ps++) {
+	  vec[k][0].elements[j] = *Ps;
+	}
+      }
+    }
+    if (!strcmp (type, "char")) {
+      Pc = (char *) data;
+      for (j = 0; j < Ny; j++) {
+	for (k = 0; k < Nval; k++, Pc++) {
+	  vec[k][0].elements[j] = *Pc;
+	}
+      }
+    }
+    free (data);
+    free (vec);
+  }
+  if (CCDKeyword != NULL) free (CCDKeyword);
+  gfits_free_table (&table);
+  gfits_free_header (&header);
+  return (TRUE);
+
+escape:
+  if (CCDKeyword != NULL) free (CCDKeyword);
+  gfits_free_table  (&table);
+  gfits_free_header (&header);
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rebin.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rebin.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rebin.c	(revision 15879)
@@ -0,0 +1,228 @@
+# include "data.h"
+
+int rebin (int argc, char **argv) {
+  
+  int i, j, status, n, nx, ny, Nx, Ny, x, y, N, *Npix, *Vn;
+  int Ignore, IgnoreValue, VERBOSE, Normalize, ExactScale;
+  char temp[1024];
+  float *Vout, *Vin, *Out, *In;
+  double scale, scale2, fx, fy, dX, dY;
+  Buffer *in, *out;
+
+  Vn = Npix = NULL;
+  Normalize = FALSE;
+  if ((N = get_argument (argc, argv, "-norm"))) {
+    remove_argument (N, &argc, argv);
+    Normalize = TRUE;
+  }
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    remove_argument (N, &argc, argv);
+    VERBOSE = TRUE;
+  }
+
+  Ignore = FALSE;
+  IgnoreValue = 0.0;
+  if ((N = get_argument (argc, argv, "-ignore"))) {
+    Ignore = TRUE;
+    remove_argument (N, &argc, argv);
+    IgnoreValue = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: rebin <from> <to> scale \n");
+    gprint (GP_ERR, "  negative integer scale expands image\n");
+    return (FALSE);
+  }
+
+  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectBuffer (argv[2], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+  gfits_free_matrix (&out[0].matrix);
+  gfits_free_header (&out[0].header);
+
+  scale  = atof (argv[3]);
+  if ((scale == (int) scale) || ((1.0/scale) == (int)(1.0/scale))) {
+    ExactScale = TRUE;
+    if (scale > 0) {
+      nx = in[0].header.Naxis[0] / scale;
+      ny = in[0].header.Naxis[1] / scale;
+    } else {
+      nx = in[0].header.Naxis[0] * fabs(scale);
+      ny = in[0].header.Naxis[1] * fabs(scale);
+    }    
+  } else {
+    ExactScale = FALSE;
+    if (scale > 0) {
+      nx = (int) (in[0].header.Naxis[0] / scale) + 1;
+      ny = (int) (in[0].header.Naxis[1] / scale) + 1;
+    } else {
+      nx = (int) (in[0].header.Naxis[0] * fabs(scale)) + 1;
+      ny = (int) (in[0].header.Naxis[1] * fabs(scale)) + 1;
+    }      
+  }
+  if (VERBOSE) gprint (GP_LOG, "rebin %s to %s (%d,%d to %d,%d)\n", argv[1], argv[2], in[0].header.Naxis[0], in[0].header.Naxis[1], nx, ny);
+
+  Nx = in[0].header.Naxis[0];
+  Ny = in[0].header.Naxis[1];
+  out[0].bitpix = in[0].bitpix;
+  out[0].unsign = in[0].unsign;
+  out[0].bscale = in[0].bscale;
+  out[0].bzero  = in[0].bzero;
+  gfits_copy_header (&in[0].header, &out[0].header);
+  gfits_modify (&out[0].header, "NAXIS1", "%d", 1, nx);
+  gfits_modify (&out[0].header, "NAXIS2", "%d", 1, ny);
+
+  status =  gfits_scan (&out[0].header, "CDELT1", "%lf", 1, &dX);
+  status &= gfits_scan (&out[0].header, "CDELT2", "%lf", 1, &dY);
+  if (scale > 0) {
+    dX *= scale;
+    dY *= scale;
+  } else {
+    dX /= fabs(scale);
+    dY /= fabs(scale);
+  }    
+  if (status) {
+    gfits_modify (&out[0].header, "CDELT1", "%lf", 1, dX);
+    gfits_modify (&out[0].header, "CDELT2", "%lf", 1, dY);
+  }
+
+  status =  gfits_scan (&out[0].header, "CRPIX1", "%lf", 1, &dX);
+  status &= gfits_scan (&out[0].header, "CRPIX2", "%lf", 1, &dY);
+  if (scale > 0) {
+    dX /= scale;
+    dY /= scale;
+  } else {
+    dX *= fabs(scale);
+    dY *= fabs(scale);
+  }    
+  if (status) {
+    gfits_modify (&out[0].header, "CRPIX1", "%lf", 1, dX);
+    gfits_modify (&out[0].header, "CRPIX2", "%lf", 1, dY);
+  }
+
+  out[0].header.Naxis[0] = nx;
+  out[0].header.Naxis[1] = ny;
+  gfits_create_matrix (&out[0].header, &out[0].matrix);
+  temp[0] = 0;
+  if ((in[0].file[0] != '*') && (in[0].file[0] != '(')) {
+    strcpy (temp, "*");
+  }
+  strcat (temp, in[0].file);
+  strcpy (out[0].file, temp);
+
+  if (Normalize) {
+    ALLOCATE (Npix, int, nx*ny);
+    bzero (Npix, nx*ny*sizeof(int));
+  }
+
+  if (ExactScale) {
+    n = scale;
+    if (n > 0) {
+      for (j = 0; j < ny; j++) {
+	for (y = 0; y < n; y++) {
+	  Vout = (float *)(out[0].matrix.buffer) + j*nx;
+	  Vin  = (float *)(in[0].matrix.buffer)  + (j*n + y)*in[0].header.Naxis[0];
+	  if (Normalize) { Vn = Npix + j*nx; }
+	  for (i = 0; i < nx; i++, Vout++) {
+	    for (x = 0; x < n; x++, Vin++) {
+	      if (Ignore && (*Vin == IgnoreValue)) continue;
+	      *Vout += *Vin;
+	      if (Normalize) {(*Vn) ++;}
+	    }
+	    if (Normalize) {Vn ++;}
+	  }
+	}
+      }
+    } else {
+      n = fabs (n);
+      for (j = 0; j < in[0].header.Naxis[1]; j++) {
+	for (y = 0; y < n; y++) {
+	  Vout = (float *)(out[0].matrix.buffer) + (j*n + y)*nx;
+	  Vin  = (float *)(in[0].matrix.buffer)  + j*in[0].header.Naxis[0];
+	  if (Normalize) { Vn = Npix + j*nx; }
+	  for (i = 0; i < in[0].header.Naxis[0]; i++, Vin++) {
+	    if (Ignore && (*Vin == IgnoreValue)) { 
+	      Vout += n; 
+	      if (Normalize) Vn += n; 
+	      continue; 
+	    }
+	    for (x = 0; x < n; x++, Vout++) {
+	      *Vout = *Vin;
+	      if (Normalize) {(*Vn) ++; Vn ++;}
+	    }
+	  }
+	}
+      }
+    }
+    if (Normalize) {
+      Vn = Npix;
+      Vout = (float *)out[0].matrix.buffer;
+      for (i = 0; i < nx*ny; i++, Vout++, Vn++) {
+	if (*Vn) { 
+	  *Vout /= *Vn; 
+	} else {
+	  *Vout = 0;
+	}
+      }
+    }
+  } else {
+    
+    /* normalization is broken.  repair please */
+    if (Normalize) { gprint (GP_ERR, "normalize not enabled for fractional scaling\n"); }
+
+    if (scale < 0) scale = 1.0 / fabs(scale);
+    In = (float *)in[0].matrix.buffer;
+    Out = (float *)out[0].matrix.buffer;
+    scale2 = scale*scale;
+    if (scale > 1) {
+      for (i = 0; i < Ny; i++) {
+	y = 0.5 + (i - 0.5) / scale;
+	fy = 0.5 + MIN (0.5, (y + 0.5) * scale - i);
+	for (j = 0; j < Nx; j++, In++) {
+	  x = 0.5 + (j - 0.5) / scale;
+	  fx = 0.5 + MIN (0.5, (x + 0.5) * scale - j);
+	  Vout = Out + y*nx + x;
+	  *Vout += fx*fy*(*In);
+	  if (fx < 1) {
+	    *(Vout+1)    += (1-fx)*fy*(*In);
+	  }
+	  if (fy < 1) {
+	    *(Vout+nx) += fx*(1-fy)*(*In);
+	  }
+	  if ((fx < 1) && (fy < 1)) {
+	    *(Vout+1+nx) += (1-fx)*(1-fy)*(*In);
+	  }
+	}
+      }
+    } else {
+      for (i = 0; i < ny; i++) {
+	y = 0.5 + (i - 0.5) * scale;
+	fy = 0.5 + MIN (0.5, (y + 0.5) / scale - i);
+	for (j = 0; j < nx; j++, Out++) {
+	  x = 0.5 + (j - 0.5) * scale;
+	  fx = 0.5 + MIN (0.5, (x + 0.5) / scale - j);
+	  Vin = In + y*Nx + x;
+	  *Out += *Vin*fx*fy;
+	  if (fx < 1) {
+	    *Out += *(Vin+1)*(1-fx)*fy;
+	  }
+	  if (fy < 1) {
+	    *Out += *(Vin+Nx)*fx*(1-fy);
+	  }
+	  if ((fx < 1) && (fy < 1)) {
+	    *Out += *(Vin+1+Nx)*(1-fx)*(1-fy);
+	  }
+	  *Out = *Out * scale2;
+	}
+      }
+    }
+  }
+
+  if (Normalize) free (Npix);
+
+  return (TRUE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/resize.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/resize.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/resize.c	(revision 15879)
@@ -0,0 +1,43 @@
+# include "data.h"
+
+int resize (int argc, char **argv) {
+
+  char *end;
+  double NX, NY;
+  int N, kapa;
+  char *name;
+  
+  /* display source */
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImage (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: resize NX NY [-n] [-g | -i]\n");
+    return (FALSE);
+  }
+
+  /* NX & NY are pixels for the screen & points for PS 
+     convert units to points (1in = 72pt, 1cm = 28pt) */
+
+  /* have kapa convert physical units to screen units 
+     for now, fixed at 96 pix / in == 38 pix / cm
+  */
+
+  NX = strtod (argv[1], &end);
+  if (!strcmp (end, "in")) { NX *= 96; }
+  if (!strcmp (end, "cm")) { NX *= 38; }
+
+  NY = strtod (argv[2], &end);
+  if (!strcmp (end, "in")) { NY *= 96; }
+  if (!strcmp (end, "cm")) { NY *= 38; }
+
+  KiiResize (kapa, NX, NY);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/roll.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/roll.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/roll.c	(revision 15879)
@@ -0,0 +1,45 @@
+# include "data.h"
+
+int roll (int argc, char **argv) {
+  
+  int Nbytes, Nextra;
+  int dX, dx, dy, nx, ny;
+  Buffer *buf;
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: roll <buffer> dx dy\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  dx = atof (argv[2]);
+  dy = atof (argv[3]);
+  if (dy != 0) {
+    gprint (GP_ERR, "only x rolls implemented for now\n");
+  }
+
+  /* if (dx < 0), we are moving the start position back by dx pixels,
+     if (dx > 0), we are moving the start position forward by dx pixels */
+  
+  nx = buf[0].matrix.Naxis[0];
+  ny = buf[0].matrix.Naxis[1];
+
+  dX = abs(dx);
+  Nbytes = nx * ny * sizeof (float);
+  Nextra = (nx * ny + dX) * sizeof (float);
+
+  REALLOCATE (buf[0].matrix.buffer, char, Nextra);
+
+  if (dx < 0) {
+    memmove (buf[0].matrix.buffer, &buf[0].matrix.buffer[dX*sizeof(float)], Nbytes);
+  } else {
+    memmove (&buf[0].matrix.buffer[dX*sizeof(float)], buf[0].matrix.buffer, Nbytes);
+  }
+
+  REALLOCATE (buf[0].matrix.buffer, char, Nbytes);
+
+  return (TRUE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rotate.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rotate.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/rotate.c	(revision 15879)
@@ -0,0 +1,298 @@
+# include "data.h"
+
+int rotate (int argc, char **argv) {
+  
+  int i, j, NX, NY, X, Y, Lx, Ly, N, newCenter;
+  float *in_buff, *out_buff, *c;
+  double angle, CosAngle, SinAngle, Xo, Yo, dX, dY, fx, fy, x, y, X1, Y1;
+  double pc11, pc12, pc21, pc22, PC11, PC12, PC21, PC22;
+  Buffer *buf;
+
+  Xo = 0;
+  Yo = 0;
+  if ((N = get_argument (argc, argv, "-center"))) {
+    newCenter = TRUE;
+    remove_argument (N, &argc, argv);
+    Xo  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    Yo  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  else 
+    newCenter  = FALSE;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: rotate <buffer> <angle>\n");
+    return (FALSE);
+  }
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  if ((atof (argv[1]) < -180) || (atof (argv[1]) > 180)) {
+    gprint (GP_ERR, "valid rotate angle between -180 and +180 degrees\n");
+    return (FALSE);
+  }
+
+  /* save starting values */
+  NX = buf[0].header.Naxis[0];
+  NY = buf[0].header.Naxis[1];
+  in_buff = (float *) buf[0].matrix.buffer;  /* don't lose reference */
+
+  if (!strcasecmp (argv[2], "LEFT") || (atof (argv[2]) == -90)) {
+    buf[0].header.Naxis[0] = NY;
+    buf[0].header.Naxis[1] = NX;
+    gfits_modify (&buf[0].header, "NAXIS1", "%d", 1, NY);
+    gfits_modify (&buf[0].header, "NAXIS2", "%d", 1, NX);
+    gfits_print  (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");
+    gfits_create_matrix (&buf[0].header, &buf[0].matrix);
+    out_buff = (float *)buf[0].matrix.buffer;
+    for (i = NX - 1; i > -1; i--) {
+      for (j = 0; j < NY; j++, out_buff++) {
+	*out_buff = in_buff[i + j*NX];
+      }
+    }
+    /* fix reference pixel */
+    gfits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &Xo);
+    gfits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &Yo);
+    X1 = Yo;
+    Y1 = NX - Xo;
+    gfits_modify (&buf[0].header, "CRPIX1", "%lf", 1, X1);
+    gfits_modify (&buf[0].header, "CRPIX2", "%lf", 1, Y1);
+    
+    /* fix rotate matrix */
+    gfits_scan (&buf[0].header, "PC001001", "%lf", 1, &pc11);
+    gfits_scan (&buf[0].header, "PC001002", "%lf", 1, &pc12);
+    gfits_scan (&buf[0].header, "PC002001", "%lf", 1, &pc21);
+    gfits_scan (&buf[0].header, "PC002002", "%lf", 1, &pc22);
+    PC11 = pc21;
+    PC12 = pc22;
+    PC21 = -pc11;
+    PC22 = -pc12;
+    gfits_modify (&buf[0].header, "PC001001", "%le", 1, PC11);
+    gfits_modify (&buf[0].header, "PC001002", "%le", 1, PC12);
+    gfits_modify (&buf[0].header, "PC002001", "%le", 1, PC21);
+    gfits_modify (&buf[0].header, "PC002002", "%le", 1, PC22);
+
+    free (in_buff);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[2], "RIGHT") || (atof (argv[2]) == 90)) {
+    buf[0].header.Naxis[0] = NY;
+    buf[0].header.Naxis[1] = NX;
+    gfits_modify (&buf[0].header, "NAXIS1", "%d", 1, NY);
+    gfits_modify (&buf[0].header, "NAXIS2", "%d", 1, NX);
+    gfits_print  (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");
+    gfits_create_matrix (&buf[0].header, &buf[0].matrix);
+    out_buff = (float *)buf[0].matrix.buffer;
+    for (i = 0; i < NX; i++) {
+      for (j = NY - 1; j > -1; j--, out_buff++) {
+	*out_buff = in_buff[i + j*NX];
+      }
+    }
+    /* fix reference pixel */
+    gfits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &Xo);
+    gfits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &Yo);
+    X1 = NY - Yo;
+    Y1 = Xo;
+    gprint (GP_ERR, "%f %f -> %f %f\n", Xo, Yo, X1, Y1);
+    gfits_modify (&buf[0].header, "CRPIX1", "%lf", 1, X1);
+    gfits_modify (&buf[0].header, "CRPIX2", "%lf", 1, Y1);
+    
+    /* fix rotate matrix */
+    gfits_scan (&buf[0].header, "PC001001", "%lf", 1, &pc11);
+    gfits_scan (&buf[0].header, "PC001002", "%lf", 1, &pc12);
+    gfits_scan (&buf[0].header, "PC002001", "%lf", 1, &pc21);
+    gfits_scan (&buf[0].header, "PC002002", "%lf", 1, &pc22);
+    PC11 = -pc21;
+    PC12 = -pc22;
+    PC21 = pc11;
+    PC22 = pc12;
+    gprint (GP_ERR, "%f %f  ->  %f %f\n", pc11, pc12, PC11, PC12);
+    gprint (GP_ERR, "%f %f  ->  %f %f\n", pc21, pc22, PC21, PC22);
+    gfits_modify (&buf[0].header, "PC001001", "%le", 1, PC11);
+    gfits_modify (&buf[0].header, "PC001002", "%le", 1, PC12);
+    gfits_modify (&buf[0].header, "PC002001", "%le", 1, PC21);
+    gfits_modify (&buf[0].header, "PC002002", "%le", 1, PC22);
+
+    free (in_buff);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[2], "UPSIDE") || (atof (argv[2]) == -180) || (atof (argv[2]) == 180)) {
+    gfits_print  (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");
+    gfits_create_matrix (&buf[0].header, &buf[0].matrix);
+    out_buff = (float *)buf[0].matrix.buffer;
+    for (j = NY - 1; j > -1; j--) {
+      for (i = NX - 1; i > -1; i--, out_buff++) {
+	*out_buff = in_buff[i + j*NX];
+      }
+    }
+    /* fix reference pixel */
+    gfits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &Xo);
+    gfits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &Yo);
+    X1 = NX - Xo;
+    Y1 = NY - Yo;
+    gfits_modify (&buf[0].header, "CRPIX1", "%lf", 1, X1);
+    gfits_modify (&buf[0].header, "CRPIX2", "%lf", 1, Y1);
+    
+    /* fix rotate matrix */
+    gfits_scan (&buf[0].header, "PC001001", "%lf", 1, &pc11);
+    gfits_scan (&buf[0].header, "PC001002", "%lf", 1, &pc12);
+    gfits_scan (&buf[0].header, "PC002001", "%lf", 1, &pc21);
+    gfits_scan (&buf[0].header, "PC002002", "%lf", 1, &pc22);
+    PC11 = -pc11;
+    PC12 = -pc12;
+    PC21 = -pc21;
+    PC22 = -pc22;
+    gfits_modify (&buf[0].header, "PC001001", "%le", 1, PC11);
+    gfits_modify (&buf[0].header, "PC001002", "%le", 1, PC12);
+    gfits_modify (&buf[0].header, "PC002001", "%le", 1, PC21);
+    gfits_modify (&buf[0].header, "PC002002", "%le", 1, PC22);
+
+    free (in_buff);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[2], "FLIPY")) {
+    gfits_print  (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");
+    gfits_create_matrix (&buf[0].header, &buf[0].matrix);
+    out_buff = (float *)buf[0].matrix.buffer;
+    for (j = NY - 1; j > -1; j--) {
+      for (i = 0; i < NX; i++, out_buff++) {
+	*out_buff = in_buff[i + j*NX];
+      }
+    }
+    /* fix reference pixel */
+    gfits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &Xo);
+    gfits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &Yo);
+    X1 = Xo;
+    Y1 = NY - Yo;
+    gfits_modify (&buf[0].header, "CRPIX1", "%lf", 1, X1);
+    gfits_modify (&buf[0].header, "CRPIX2", "%lf", 1, Y1);
+    
+    /* fix rotate matrix */
+    gfits_scan (&buf[0].header, "PC001001", "%lf", 1, &pc11);
+    gfits_scan (&buf[0].header, "PC001002", "%lf", 1, &pc12);
+    gfits_scan (&buf[0].header, "PC002001", "%lf", 1, &pc21);
+    gfits_scan (&buf[0].header, "PC002002", "%lf", 1, &pc22);
+    PC11 = pc11;
+    PC12 = -pc12;
+    PC21 = pc21;
+    PC22 = -pc22;
+    gfits_modify (&buf[0].header, "PC001001", "%le", 1, PC11);
+    gfits_modify (&buf[0].header, "PC001002", "%le", 1, PC12);
+    gfits_modify (&buf[0].header, "PC002001", "%le", 1, PC21);
+    gfits_modify (&buf[0].header, "PC002002", "%le", 1, PC22);
+
+    free (in_buff);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[2], "FLIPX")) {
+    gfits_print  (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");
+    gfits_create_matrix (&buf[0].header, &buf[0].matrix);
+    out_buff = (float *)buf[0].matrix.buffer;
+    for (j = 0; j < NY; j++) {
+      for (i = NX - 1; i > -1; i--, out_buff++) {
+	*out_buff = in_buff[i + j*NX];
+      }
+    }
+    /* fix reference pixel */
+    gfits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &Xo);
+    gfits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &Yo);
+    X1 = NX - Xo;
+    Y1 = Yo;
+    gfits_modify (&buf[0].header, "CRPIX1", "%lf", 1, X1);
+    gfits_modify (&buf[0].header, "CRPIX2", "%lf", 1, Y1);
+    
+    /* fix rotate matrix */
+    gfits_scan (&buf[0].header, "PC001001", "%lf", 1, &pc11);
+    gfits_scan (&buf[0].header, "PC001002", "%lf", 1, &pc12);
+    gfits_scan (&buf[0].header, "PC002001", "%lf", 1, &pc21);
+    gfits_scan (&buf[0].header, "PC002002", "%lf", 1, &pc22);
+    PC11 = -pc11;
+    PC12 = pc12;
+    PC21 = -pc21;
+    PC22 = pc22;
+    gfits_modify (&buf[0].header, "PC001001", "%le", 1, PC11);
+    gfits_modify (&buf[0].header, "PC001002", "%le", 1, PC12);
+    gfits_modify (&buf[0].header, "PC002001", "%le", 1, PC21);
+    gfits_modify (&buf[0].header, "PC002002", "%le", 1, PC22);
+
+    free (in_buff);
+    return (TRUE);
+  }
+
+  angle = atof (argv[2]);
+  CosAngle = cos (angle*RAD_DEG);
+  SinAngle = sin (angle*RAD_DEG);
+  
+  gprint (GP_ERR, "rotating: %f %f %f\n", angle, CosAngle, SinAngle);
+
+  Lx = NX*fabs(CosAngle) + NY*fabs(SinAngle);
+  Ly = NX*fabs(SinAngle) + NY*fabs(CosAngle);
+  dX = MAX(0,NY*SinAngle);
+  dY = MAX(0,-NX*SinAngle);
+  /*
+  gprint (GP_ERR, "%f %f  -->  ", Xo, Yo);
+  X1 = Xo*CosAngle - Yo*SinAngle + dX;
+  Y1 =  Xo*SinAngle + Yo*CosAngle + dY;
+  gprint (GP_ERR, "%f %f\n", X1, Y1);
+  */
+
+  /* fix reference pixel */
+  gfits_scan (&buf[0].header, "CRPIX1", "%lf", 1, &Xo);
+  gfits_scan (&buf[0].header, "CRPIX2", "%lf", 1, &Yo);
+  /*
+  X1 = (Xo - dX)*CosAngle - (Yo - dY)*SinAngle;
+  Y1 = (dX - Xo)*SinAngle + (Yo - dY)*CosAngle;
+  */
+  X1 = Xo*CosAngle - Yo*SinAngle + dX;
+  Y1 =  Xo*SinAngle + Yo*CosAngle + dY;
+  gfits_modify (&buf[0].header, "CRPIX1", "%lf", 1, X1);
+  gfits_modify (&buf[0].header, "CRPIX2", "%lf", 1, Y1);
+
+  /* fix rotate matrix */
+  gfits_scan (&buf[0].header, "PC001001", "%lf", 1, &pc11);
+  gfits_scan (&buf[0].header, "PC001002", "%lf", 1, &pc12);
+  gfits_scan (&buf[0].header, "PC002001", "%lf", 1, &pc21);
+  gfits_scan (&buf[0].header, "PC002002", "%lf", 1, &pc22);
+  PC11 = pc11*CosAngle - pc21*SinAngle;
+  PC12 = pc12*CosAngle - pc22*SinAngle;
+  PC21 = pc21*CosAngle + pc11*SinAngle;
+  PC22 = pc22*CosAngle + pc12*SinAngle;
+  gfits_modify (&buf[0].header, "PC001001", "%le", 1, PC11);
+  gfits_modify (&buf[0].header, "PC001002", "%le", 1, PC12);
+  gfits_modify (&buf[0].header, "PC002001", "%le", 1, PC21);
+  gfits_modify (&buf[0].header, "PC002002", "%le", 1, PC22);
+
+  buf[0].header.Naxis[0] = Lx;
+  buf[0].header.Naxis[1] = Ly;
+  gfits_modify (&buf[0].header, "NAXIS1", "%d", 1, Lx);
+  gfits_modify (&buf[0].header, "NAXIS2", "%d", 1, Ly);
+  gfits_create_matrix (&buf[0].header, &buf[0].matrix);
+  gfits_print  (&buf[0].header, "HISTORY", "%S", 1, "WARNING: rotated image!");
+  out_buff = (float *)buf[0].matrix.buffer;
+  for (j = 0; j < Ly; j++) {
+    for (i = 0; i < Lx; i++, out_buff++) {
+
+      x = (i - dX)*CosAngle + (j - dY)*SinAngle;
+      y = (dX - i)*SinAngle + (j - dY)*CosAngle;
+      X = (int) x;
+      Y = (int) y;
+
+      if (X < 0) continue;
+      if (X >= NX - 1) continue;
+      if (Y < 0) continue;
+      if (Y >= NY - 1) continue;
+
+      c = &in_buff[X * NX*Y];
+      fx = x - X;
+      fy = y - Y;
+      *out_buff = (c[0]*(1-fx) + c[1]*fx)*(1-fy) + (c[NX+1]*fx + c[NX]*(1-fx))*fy;
+    }
+  }
+  free (in_buff);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/save.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/save.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/save.c	(revision 15879)
@@ -0,0 +1,32 @@
+# include "data.h"
+
+int save (int argc, char **argv) {
+  
+  int N, celestial;
+  int kapa;
+  char *name;
+  
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImage (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  celestial = FALSE;
+  if ((N = get_argument (argc, argv, "-c"))) {
+    remove_argument (N, &argc, argv);
+    celestial = TRUE;
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: save (overlay) <filename> [-c]\n");
+    gprint (GP_ERR, "  -c: write contour in celestial coords\n");
+    return (FALSE);
+  }
+
+  KiiSaveOverlay (kapa, celestial, argv[1], argv[2]);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/section.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/section.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/section.c	(revision 15879)
@@ -0,0 +1,133 @@
+# include "data.h"
+
+enum {NONE, LIST, UP, DOWN, TOP, BOTTOM, TOOL};
+
+int section (int argc, char **argv) {
+  
+  int N, action, kapa;
+  char *name, *location;
+  Graphdata graphmode;
+  KapaSection section;
+
+  action = NONE;
+  if ((N = get_argument (argc, argv, "-list"))) {
+    action = LIST;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-up"))) {
+    action = UP;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-down"))) {
+    action = DOWN;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-top"))) {
+    action = TOP;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-bottom"))) {
+    action = BOTTOM;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-imtool"))) {
+    action = TOOL;
+    remove_argument (N, &argc, argv);
+    location = argv[N];
+    remove_argument (N, &argc, argv);
+  }
+
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetGraph (&graphmode, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  /* list sections */
+  if ((argc == 1) && (action == NONE)) {
+    KapaGetSection (kapa, "*");
+    gprint (GP_ERR, "USAGE: section name [x y dx dy] [options]\n");
+    gprint (GP_ERR, "OPTIONS: -list   : show properties of all sections\n");
+    gprint (GP_ERR, "         -up     : move section up in display stack\n");
+    gprint (GP_ERR, "         -down   : move section down in display stack\n");
+    gprint (GP_ERR, "         -top    : move section to top of display stack\n");
+    gprint (GP_ERR, "         -bottom : move section to bottom of display stack\n");
+    gprint (GP_ERR, "         -imtool (position) : set location of image zoom / status box\n");
+    gprint (GP_ERR, "                 (position may be: -x, +x, -y, +y, none)\n");
+    return (TRUE);
+  } 
+  
+  if (argc == 2) {
+    /* select / show section */
+    switch (action) {
+      case NONE:
+	KapaSelectSection (kapa, argv[1]);
+	break;
+
+      case UP:
+	KapaMoveSection (kapa, argv[1], "up");
+	break;
+      case DOWN:
+	KapaMoveSection (kapa, argv[1], "down");
+	break;
+      case TOP:
+	KapaMoveSection (kapa, argv[1], "top");
+	break;
+      case BOTTOM:
+	KapaMoveSection (kapa, argv[1], "bottom");
+	break;
+
+      case TOOL:
+	if (!strcmp(location, "-x")) {
+	  KapaSetToolbox (kapa, 1);
+	  break;
+	}
+	if (!strcmp(location, "+x")) {
+	  KapaSetToolbox (kapa, 3);
+	  break;
+	}
+	if (!strcmp(location, "-y")) {
+	  KapaSetToolbox (kapa, 2);
+	  break;
+	}
+	if (!strcmp(location, "+y")) {
+	  KapaSetToolbox (kapa, 4);
+	  break;
+	}
+	if (!strcmp(location, "none")) {
+	  KapaSetToolbox (kapa, 0);
+	  break;
+	}
+	gprint (GP_ERR, "unknown toolbox location %s\n", location);
+	gprint (GP_ERR, "valid values: -x, +x, -y, +y, none\n");
+	return (FALSE);
+
+      case LIST:
+	KapaGetSection (kapa, argv[1]);
+	break;
+    }
+    return (TRUE);
+  } 
+  
+  if (argc == 6) {
+    /* set section */
+    section.name = argv[1];
+    section.x = atof (argv[2]);
+    section.y = atof (argv[3]);
+    section.dx = atof (argv[4]);
+    section.dy = atof (argv[5]);
+    KapaSetSection (kapa, &section);
+    return (TRUE);
+  }
+  gprint (GP_ERR, "USAGE: section name [x y dx dy]\n");
+  gprint (GP_ERR, "USAGE: section name [-list] [-up] [-down] [-top] [-bottom]\n");
+  return (FALSE);
+}
+
+/* should do some range checking on x y dx dy
+   should be between 0.0 and 1.0, precision of 0.001
+   is sufficient
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/select.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/select.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/select.c	(revision 15879)
@@ -0,0 +1,46 @@
+# include "data.h"
+
+int vect_select (int argc, char **argv) {
+  
+  int  i, size;
+  char *out;
+  Vector *in1, *in2, *tvec, *ovec;
+
+  out = NULL;
+  in1 = in2 = ovec = tvec = NULL;
+
+  /** check basic syntax **/
+  if ((argc != 8) || strcmp(argv[2], "=") || strcmp (argv[4], "if") || strcmp (argv[6], "else")) {
+    gprint (GP_ERR, "SYNTAX: select vec = vec if (logic expression) else vec\n");
+    return (FALSE);
+  }
+  if ((in1  = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((in2  = SelectVector (argv[7], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((ovec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  out = dvomath (argc - 5, &argv[5], &size, 1);
+  if (out == NULL) {
+    print_error ();
+    goto error;
+  }
+  if ((tvec = SelectVector (out, OLDVECTOR, TRUE)) == NULL) goto error;
+  /* check size of in1, in2, tvec: must match */
+
+  REALLOCATE (ovec[0].elements, float, MAX (tvec[0].Nelements, 1));
+  for (i = 0; i < tvec[0].Nelements; i++) {
+    ovec[0].elements[i] = tvec[0].elements[i] ? in1[0].elements[i] : in2[0].elements[i];
+  }
+  ovec[0].Nelements = tvec[0].Nelements;
+  REALLOCATE (ovec[0].elements, float, MAX (ovec[0].Nelements, 1));
+  
+  DeleteVector (tvec);
+  free (out);
+  return (TRUE);
+
+ error:
+  DeleteVector (tvec);
+  DeleteVector (ovec);
+  DeleteNamedVector (out);
+  free (out);
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/set.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/set.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/set.c	(revision 15879)
@@ -0,0 +1,47 @@
+# include "data.h"
+
+int set (int argc, char **argv) {
+  
+  int size;
+  char *out;
+
+  /** check basic form for line **/
+  if ((argc < 3) || strcmp(argv[2], "=")) {
+    gprint (GP_ERR, "%s = (matrix expression)\n", argv[0]);
+    return (FALSE);
+  }
+
+  out = dvomath (argc - 3, &argv[3], &size, -1);
+  if (out == NULL) {
+    print_error ();
+    return (FALSE);
+  }
+  
+  switch (size) {
+    case 0:
+      set_str_variable (argv[1], out);
+      free (out);
+      break;
+
+    case 1:
+      if (!MoveNamedVector (argv[1], out)) {
+	DeleteNamedVector (out);
+	free (out);
+	gprint (GP_ERR, "invalid output vector name\n");
+	return (FALSE);
+      }
+      free (out);
+      break;
+  
+    case 2:
+      if (!MoveNamedBuffer (argv[1], out)) {
+	DeleteNamedBuffer (out);
+	free (out);
+	gprint (GP_ERR, "invalid output matrix name\n");
+	return (FALSE);
+      }
+      free (out);
+      break;
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/shift.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/shift.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/shift.c	(revision 15879)
@@ -0,0 +1,110 @@
+# include "data.h"
+
+int shift (int argc, char **argv) {
+ 
+  int i, j, N, ROLL;
+  int nx, ny, dx, dy, DXin, DXot, DYin, DYot;
+  float *Vin, *Vot;
+  double Dx, Dy, fdx, fdy;
+  Buffer *in, *out;
+
+  ROLL = FALSE;
+  if ((N = get_argument (argc, argv, "-roll"))) {
+    remove_argument (N, &argc, argv);
+    ROLL = TRUE;
+  }
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: shift (input) (output) dx dy\n");
+    return (FALSE);
+  }
+
+  // define the input buffer and examine the shift
+  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  Dx = atof (argv[3]);
+  Dy = atof (argv[4]);
+
+  dx = Dx;
+  dy = Dy;
+  fdx = Dx - dx;
+  fdy = Dy - dy;
+  if (fdx < -0.000001) {dx -= 1; fdx += 1;}
+  if (fdy < -0.000001) {dy -= 1; fdy += 1;}
+  // we always specify a positive fractional shift
+  // the above choice defines a minimum fractional shift of 1e-5
+
+  nx = in[0].matrix.Naxis[0];
+  ny = in[0].matrix.Naxis[1];
+
+  if ((dx > nx) || (dy > ny)) {
+    gprint (GP_ERR, "shifting data out of image\n");
+    return (FALSE);
+  }
+  
+  // define the output buffer
+  if ((out = SelectBuffer (argv[2], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  gfits_free_matrix (&out[0].matrix);
+  gfits_free_header (&out[0].header);
+  CreateBuffer (out, nx, ny, -32, 0.0, 1.0);
+
+  DXin = (dx < 0) ? -dx : 0;
+  DXot = (dx < 0) ?   0 : dx;
+  DYin = (dy < 0) ? -dy : 0;
+  DYot = (dy < 0) ?   0 : dy;
+  
+  for (j = 0; j < ny - abs(dy); j++) {
+    Vin = (float *)(in[0].matrix.buffer)  + (j + DYin)*nx + DXin;  
+    Vot = (float *)(out[0].matrix.buffer) + (j + DYot)*nx + DXot; 
+    for (i = 0; i < nx - abs(dx); i++, Vin++, Vot++) {
+      *Vot = *Vin;
+    }
+    // fill in the exposed x-border with 0.0
+    Vot = (dx > 0) ? 
+      (float *)(out[0].matrix.buffer) + (j + DYot)*nx : 
+      (float *)(out[0].matrix.buffer) + (j + DYot)*nx + nx - abs(dx);
+    for (i = 0; i < abs(dx); i++, Vot++) {
+      *Vot = 0.0;
+    }	
+  }
+
+  // fill in the exposed y-border with 0.0
+  Vot = (dy > 0) ? 
+    (float *)(out[0].matrix.buffer) :
+    (float *)(out[0].matrix.buffer) + (ny - abs(dy))*nx;
+
+  for (j = 0; j < nx * abs(dy); j++, Vot++) {
+    *Vot = 0.0;
+  }   
+
+  // apply the fractional shift 
+  gprint (GP_ERR, "%f %f\n", fdx, fdy);
+  if ((fdx > 0) || (fdy > 0)) {
+    double f00, f01, f10, f11;
+    float value;
+
+    f00 = (1-fdx)*(1-fdy);
+    f01 =    fdx *(1-fdy);
+    f10 = (1-fdx)*   fdy;
+    f11 =    fdx *   fdy;
+
+    Vin = (float *)out[0].matrix.buffer;
+    Vot = (float *)out[0].matrix.buffer;
+    for (j = 0; j < ny - 1; j++) {
+      for (i = 0; i < nx - 1; i++, Vin++, Vot++) {
+	value  = Vin[   0] * f00;
+	value += Vin[   1] * f01;
+	value += Vin[nx  ] * f10;
+	value += Vin[nx+1] * f11;
+	*Vot = value;
+      }
+      Vin ++;
+      Vot ++;
+    }
+  }   
+
+  return (TRUE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/sort.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/sort.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/sort.c	(revision 15879)
@@ -0,0 +1,64 @@
+# include "data.h"
+
+int sort_vectors (int argc, char **argv) {
+  
+  int i, j, Nvec, Nval;
+  float *temp, *index, *T, *V, *I;
+  Vector **vec;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: sort (vector) [vectors ...] \n");
+    gprint (GP_ERR, "  first vector is sort key for others\n");
+    return (FALSE);
+  }
+
+  Nvec = (argc - 1);
+  ALLOCATE (vec, Vector *, Nvec);
+
+  Nval = 0;
+  /* find vectors and check sizes */
+  for (i = 0; i < Nvec; i++) {
+    if ((vec[i] = SelectVector (argv[i + 1], OLDVECTOR, FALSE)) == NULL) {
+      gprint (GP_ERR, "USAGE: sort vector vector ...\n");
+      free (vec);
+      return (FALSE);    
+    }
+    if (i == 0) {
+      Nval = vec[i][0].Nelements;
+    } else {
+      if (Nval != vec[i][0].Nelements) {
+	free (vec);
+	gprint (GP_ERR, "vectors must all be same length\n");
+	return (FALSE);
+      }
+    }
+  }
+  
+  /* create index (use float to use sortpair) */
+  ALLOCATE (index, float, Nval);
+  for (i = 0; i < Nval; i++) index[i] = i;
+
+  /* sort key & index */
+  fsortpair (vec[0][0].elements, index, Nval);
+
+  ALLOCATE (temp, float, Nval);
+  for (i = 1; i < Nvec; i++) {
+    T = temp;
+    V = vec[i][0].elements;
+    I = index;
+    for (j = 0; j < Nval; j++, T++, I++) {
+      *T = V[(int)(*I)];
+    }
+    /* swap .elements (== V) and temp */ 
+    vec[i][0].elements = temp;
+    temp = V;
+  }
+  free (temp);
+  free (vec);
+  free (index);
+
+  return (TRUE);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/spline_apply.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/spline_apply.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/spline_apply.c	(revision 15879)
@@ -0,0 +1,100 @@
+# include "data.h"
+
+void spline (float *x, float *y, int N, float *y2);
+float splint (float *x, float *y, float *y2, int N, float X);
+
+int spline_apply (int argc, char **argv) {
+  
+  int i, j, I, J;
+  int nx, ny, Nx, Ny, xdir;
+  float rx, ry, x, y;
+  float *Tx1, *Tx2, *Txc, *Ty1, *Ty2, *Tyc, *V, *V1, *V2;
+  Buffer *out, *y1, *y2;
+
+  if (argc != 7) {
+    gprint (GP_ERR, "USAGE: spline_apply <Y> <Y2> <out> (x/y) Nx Ny\n");
+    return (FALSE);
+  }
+
+  if ((y1  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((y2  = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectBuffer (argv[3], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  xdir = FALSE;
+  if (!strcmp (argv[4], "x")) xdir = TRUE; 
+
+  nx = atoi (argv[5]);
+  ny = atoi (argv[6]);
+
+  Nx = y1[0].matrix.Naxis[0];
+  Ny = y1[0].matrix.Naxis[1];
+
+  rx = Nx / (float) nx;
+  ry = Ny / (float) ny;
+
+  /* create an output matrix buffer with desired nx, ny */
+  gfits_free_matrix (&out[0].matrix);
+  gfits_free_header (&out[0].header);
+
+  out[0].bitpix = y1[0].bitpix;
+  out[0].unsign = y1[0].unsign;
+  out[0].bscale = y1[0].bscale;
+  out[0].bzero  = y1[0].bzero;
+  gfits_copy_header (&y1[0].header, &out[0].header);
+  gfits_modify (&out[0].header, "NAXIS1", "%d", 1, nx);
+  gfits_modify (&out[0].header, "NAXIS2", "%d", 1, ny);
+
+  out[0].header.Naxis[0] = nx;
+  out[0].header.Naxis[1] = ny;
+  gfits_create_matrix (&out[0].header, &out[0].matrix);
+  if ((y1[0].file[0] != '*') && (y1[0].file[0] != '(')) {
+    sprintf (out[0].file, "*%s", y1[0].file);
+  } else {
+    sprintf (out[0].file, "%s", y1[0].file);
+  }
+
+  ALLOCATE (Ty2, float, Ny);
+  ALLOCATE (Ty1, float, Ny);
+  ALLOCATE (Tyc, float, Ny);
+  for (i = 0; i < Ny; i++) { Tyc[i] = i; }
+
+  ALLOCATE (Tx1, float, Nx);
+  ALLOCATE (Tx2, float, Nx);
+  ALLOCATE (Txc, float, Nx);
+  for (i = 0; i < Nx; i++) { Txc[i] = i; }
+
+  V = (float *)(out[0].matrix.buffer);
+
+  for (J = 0; J < ny; J++) {
+    y = J * ry;
+
+    /* construct spline for each element in this row */
+    for (i = 0; i < Nx; i++) {
+      V1 = (float *)(y1[0].matrix.buffer) + i;
+      V2 = (float *)(y2[0].matrix.buffer) + i;
+      for (j = 0; j < Ny; j++, V1+=Nx, V2+=Nx) {
+	Ty1[j] = *V1;
+	Ty2[j] = *V2;
+      }
+      Tx1[i] = splint (Tyc, Ty1, Ty2, Ny, y);
+    }
+    spline (Txc, Tx1, Nx, Tx2);
+
+    /* apply x-dir spline to new image */
+    for (I = 0; I < nx; I++, V++) {
+      x = I * rx;
+      *V = splint (Txc, Tx1, Tx2, Nx, x);
+    }
+  }
+
+  free (Ty1);
+  free (Ty2);
+  free (Tyc);
+  
+  free (Tx1);
+  free (Tx2);
+  free (Txc);
+  
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/spline_construct.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/spline_construct.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/spline_construct.c	(revision 15879)
@@ -0,0 +1,71 @@
+# include "data.h"
+
+int spline_construct (int argc, char **argv) {
+  
+  int i, j, Nx, Ny, xdir;
+  float *Tx, *Ty, *Ty2, *V;
+  Buffer *in, *out;
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: spline_construct <in> <out> (x/y)\n");
+    return (FALSE);
+  }
+
+  if ((in  = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectBuffer (argv[2], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  free (out[0].matrix.buffer);
+  free (out[0].header.buffer);
+  if ((in[0].file[0] != '*') && (in[0].file[0] != '(')) {
+    sprintf (out[0].file, "*%s", in[0].file);
+  } else {
+    sprintf (out[0].file, "%s", in[0].file);
+  }
+  out[0].bitpix = in[0].bitpix;
+  out[0].unsign = in[0].unsign;
+  out[0].bscale = in[0].bscale;
+  out[0].bzero  = in[0].bzero;
+  gfits_copy_matrix_info (&in[0].matrix, &out[0].matrix);
+  gfits_copy_header (&in[0].header, &out[0].header);
+  gfits_create_matrix (&out[0].header, &out[0].matrix);
+
+  xdir = FALSE;
+  if (!strcmp (argv[3], "x")) xdir = TRUE; 
+  /* ideally, the resulting image should carry this info (in header?) */
+
+  Nx = in[0].matrix.Naxis[0];
+  Ny = in[0].matrix.Naxis[1];
+
+  ALLOCATE (Ty2, float, Ny);
+  ALLOCATE (Ty, float, Ny);
+  ALLOCATE (Tx, float, Ny);
+
+  /** for now only perform the operation for the ydir splines */
+
+  /* construct coordinate vector */
+  for (j = 0; j < Ny; j++) { Tx[j] = j; }
+  
+  for (i = 0; i < Nx; i++) {
+    
+    /* construct temp vector with values to spline */
+    V = (float *)(in[0].matrix.buffer) + i;
+    for (j = 0; j < Ny; j++, V+=Nx) {
+      Ty[j] = *V;
+    }
+  
+    spline (Tx, Ty, Ny, Ty2);
+  
+    /* copy derivatives to output buffer */
+    V = (float *)(out[0].matrix.buffer) + i;
+    for (j = 0; j < Ny; j++, V+=Nx) {
+      *V = Ty2[j];
+    }
+  }
+
+  free (Tx);
+  free (Ty);
+  free (Ty2);
+  
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/stats-new.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/stats-new.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/stats-new.c	(revision 15879)
@@ -0,0 +1,259 @@
+# include "data.h"
+
+double interpolateValue (int *hist, int Nbins, float min, float binsize, int bin, float value);
+double sampleMedian (Matrix *matrix, int Nsubset);
+Stats *robustMedian (Matrix *matrix, Region *region, float minValue, float maxValue, float sigma);
+
+typedef struct {
+  int sx;
+  int sy;
+  int nx;
+  int ny;
+} Region;
+
+typedef struct {
+  float median;
+  float mean;
+  float mode;
+  float sigma;
+} Stats;
+
+int stats (int argc, char **argv) {
+  
+  int i, j, Nmode, Imode;
+  double Npix, N1, N2, max, min, range, median, mode, IgnoreValue;
+  float *V;
+  int sx, sy, nx, ny, *hist, Nhist, bin;
+  int Ignore, Quiet, N;
+  Buffer *buf;
+
+  IgnoreValue = 0;
+  Ignore = FALSE;
+  if ((N = get_argument (argc, argv, "-ignore"))) {
+    Ignore = TRUE;
+    remove_argument (N, &argc, argv);
+    IgnoreValue = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  Quiet = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((argc != 2) && (argc != 6)) {
+    gprint (GP_ERR, "USAGE: stats <buffer> sx sy nx ny\n");
+    gprint (GP_ERR, "OR:    stats <buffer>\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  if (argc == 6) {
+    sx = strcmp (argv[2], "-") ? atof (argv[2]) : 0;
+    sy = strcmp (argv[3], "-") ? atof (argv[3]) : 0;
+    nx = strcmp (argv[4], "-") ? atof (argv[4]) : buf[0].matrix.Naxis[0];
+    ny = strcmp (argv[5], "-") ? atof (argv[5]) : buf[0].matrix.Naxis[1];
+  } else {
+    sx = 0;
+    sy = 0;
+    nx = buf[0].matrix.Naxis[0];
+    ny = buf[0].matrix.Naxis[1];
+  }
+
+  Npix = N1 = N2 = 0;
+  if ((sx < 0) || (sy < 0) || 
+      (sx+nx > buf[0].matrix.Naxis[0]) || 
+      (sy+ny > buf[0].matrix.Naxis[1])) {
+    gprint (GP_ERR, "region out of range\n");
+    return (FALSE);
+  }
+
+  max = min = *((float *)(buf[0].matrix.buffer) + sy*buf[0].matrix.Naxis[0] + sx);
+  for (j = sy; j < sy + ny; j++) {
+    V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + sx; 
+    for (i = 0; i < nx; i++, V++) {
+      if (Ignore && (fabs (*V - IgnoreValue) < 1e-8)) continue;
+      N1 += *V;
+      N2 += (*V)*(*V);
+      Npix += 1.0;
+      max = MAX (max, *V);
+      min = MIN (min, *V);
+    }
+  }
+  N1 = N1 / Npix;
+
+  sigma = sqrt (N2/Npix - N1*N1);
+
+  if (ROBUST) {
+    stats = robustMedian (matrix, min, max, sigma);
+    if (stats->sigma 
+  } 
+  
+  if (!Quiet) {
+    gprint (GP_LOG, "  mean    stdev    min     max   median   Npix   Total\n");
+    gprint (GP_LOG, "%7.4g %7.4g %7.4g %7.4g %7.4g %7.0f %7.4g\n", N1, sqrt (N2/Npix - N1*N1), 
+	    min, max, median, Npix, Npix*N1);
+  }
+
+  set_variable ("MIN",    min);
+  set_variable ("MAX",    max);
+  set_variable ("MEDIAN", median);
+  set_variable ("MEAN",   N1);
+  set_variable ("MODE",   mode);
+  set_variable ("TOTAL",  N1*Npix);
+  set_variable ("NPIX",   Npix);
+  set_variable ("SIGMA",  sqrt (N2/Npix - N1*N1));
+
+  return (TRUE);
+}
+
+double sampleMedian (Matrix *matrix, int Nsubset) {
+
+  int i, Nsample, Npix;
+  long A, B;
+  float *values, *buffer, median;
+
+  /* Generate a vector of Nsample elements */
+  Npix = matrix[0].Naxis[0]*matrix[0].Naxis[1]
+    Nsample = Nsubset;
+  if (Nsubset == 0) {
+    Nsample = Npix;
+  }
+
+  ALLOCATE (values, float, Nsample);
+    
+  A = time(NULL);
+  for (B = 0; A == time(NULL); B++);
+  srand48(B);
+ 
+  *buffer = (float *) matrix[0].buffer;
+
+  for (i = 0; i < Nsample; i++) {
+    if (Nsubset) {
+      j = MIN(Npix - 1, MAX(0, Npix*drand48()));
+    } else {
+      j = i;
+    }
+    values[i] = buffer[j];
+  }
+    
+  fsort (values, Nsample);
+
+  if (Nsample == 0) return 0.0;
+
+  // these are all covered by the logic below
+  // if (Nsample == 1) return values[0];
+  // if (Nsample == 2) return (0.5*(values[0] + values[1]));
+  // if (Nsample == 3) return (values[1]);
+
+  if (Nsample % 2) {
+    median = 0.5*(values[(int)(0.5*Nsample)] + values[(int)(0.5*Nsample) - 1]);
+  } else {
+    median = values[(int)(0.5*Nsample)];
+  }
+  return (median);
+}
+
+Stats *robustMedian (Matrix *matrix, Region *region, float minValue, float maxValue, float sigma) {
+
+  Stats *stats;
+
+  ALLOCATE (stats, Stats, 1);
+
+  // no data range:
+  if (maxValue - minValue < FLT_EPSILON) {
+    stats->median = minValue;
+    stats->mean   = minValue;
+    stats->mode   = minValue;
+    stats->sigma  = 0.0;
+    return stats;
+  }
+
+  // generate a histogram ranging from min to max with step size of sigma / 4
+  // no more than 0x1000 bins, no less than 0x10
+
+  Nbins = 4.0 * (maxValue - minValue) / sigma;
+  Nbins = MIN (0x1000, MAX (0x10, Nbins));
+
+  ALLOCATE (hist, int, Nbins);
+  memset (hist, 0, Nbins*sizeof(int));
+  
+  delta = Nbins / (max - min);
+  binsize = 1.0 / delta;
+
+  Ntotal = 0;
+  for (j = region->sy; j < region->sy + region->ny; j++) {
+    V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + region->sx; 
+    for (i = 0; i < region->nx; i++, V++) {
+      if (Ignore && (fabs (*V - IgnoreValue) < 1e-8)) continue;
+      bin = MIN (MAX (0, (*V - min) * delta), Nbins - 1);
+      hist[bin] ++;
+      Ntotal ++;
+    }
+  }
+
+  // generate the cumulative histogram & find mode
+  ALLOCATE (cumu, int, Nbins);
+  memset (cumu, 0, Nbins*sizeof(int));
+
+  Nhist = 0;
+  Imode = -1;
+  Vmode = 0;
+  for (i = 0; i < Nbins; i++) {
+    Nhist += hist[i];
+    cumu[i] = Nhist;
+    if (hist[i] > Vmode) {
+      Imode = i;
+      Vmode = hist[i];
+    }
+  }
+
+  Ioo = ibracket (cumu, Nbins, 0.500000*Nhist, 1);
+  Im1 = ibracket (cumu, Nbins, 0.308538*Nhist, 1);
+  Ip1 = ibracket (cumu, Nbins, 0.691462*Nhist, 1);
+  Im2 = ibracket (cumu, Nbins, 0.022481*Nhist, 1);
+  Ip2 = ibracket (cumu, Nbins, 0.977519*Nhist, 1);
+
+  Voo = interpolateValue (cumu, Nbins, min, delta, Ioo, 0.500000*Nhist);
+  Vm1 = interpolateValue (cumu, Nbins, min, delta, Im1, 0.308538*Nhist);
+  Vp1 = interpolateValue (cumu, Nbins, min, delta, Ip1, 0.691462*Nhist);
+  Vm2 = interpolateValue (cumu, Nbins, min, delta, Im2, 0.022481*Nhist);
+  Vp2 = interpolateValue (cumu, Nbins, min, delta, Ip2, 0.977519*Nhist);
+
+  sigma1 = (Vp1 - Vm1);
+  sigma2 = (Vp2 - Vm2) / 4.0;
+
+  Vs = Vn = 0;
+  for (i = Im1; i < Ip1 + 1; i++) {
+    Vn += hist[i];
+    Vs += hist[i] * (i * binsize + min);
+  }
+
+  stats->median = Voo;
+  stats->mean = Vs / Vn;
+  stats->mode = Imode * delta + min;
+  stats->sigma = MIN (sigma1, sigma2);
+
+  free (hist);
+  free (cumu);
+
+  return (stats);
+}
+
+// what is the fractional bin position for the given value
+double interpolateValue (int *hist, int Nbins, float min, float binsize, int bin, float value) {
+
+  V0 = bin * binsize + min;
+  V1 = (bin + 1) * binsize + min;
+
+  // fbin = (value - V0) / (V1 - V0) + bin;
+  fbin = (value - V0) / binsize + bin;
+
+  return fbin;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/stats.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/stats.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/stats.c	(revision 15879)
@@ -0,0 +1,120 @@
+# include "data.h"
+
+int stats (int argc, char **argv) {
+  
+  int i, j, Nmode, Imode;
+  double Npix, N1, N2, max, min, range, median, mode, IgnoreValue;
+  float *V;
+  int sx, sy, nx, ny, *hist, Nhist, bin;
+  int Ignore, Quiet, N;
+  Buffer *buf;
+
+  IgnoreValue = 0;
+  Ignore = FALSE;
+  if ((N = get_argument (argc, argv, "-ignore"))) {
+    Ignore = TRUE;
+    remove_argument (N, &argc, argv);
+    IgnoreValue = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  Quiet = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if ((argc != 2) && (argc != 6)) {
+    gprint (GP_ERR, "USAGE: stats <buffer> sx sy nx ny\n");
+    gprint (GP_ERR, "OR:    stats <buffer>\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  if (argc == 6) {
+    sx = strcmp (argv[2], "-") ? atof (argv[2]) : 0;
+    sy = strcmp (argv[3], "-") ? atof (argv[3]) : 0;
+    nx = strcmp (argv[4], "-") ? atof (argv[4]) : buf[0].matrix.Naxis[0];
+    ny = strcmp (argv[5], "-") ? atof (argv[5]) : buf[0].matrix.Naxis[1];
+  } else {
+    sx = 0;
+    sy = 0;
+    nx = buf[0].matrix.Naxis[0];
+    ny = buf[0].matrix.Naxis[1];
+  }
+
+  Npix = N1 = N2 = 0;
+  if ((sx < 0) || (sy < 0) || 
+      (sx+nx > buf[0].matrix.Naxis[0]) || 
+      (sy+ny > buf[0].matrix.Naxis[1])) {
+    gprint (GP_ERR, "region out of range\n");
+    return (FALSE);
+  }
+
+  max = min = *((float *)(buf[0].matrix.buffer) + sy*buf[0].matrix.Naxis[0] + sx);
+  for (j = sy; j < sy + ny; j++) {
+    V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + sx; 
+    for (i = 0; i < nx; i++, V++) {
+      if (Ignore && (fabs (*V - IgnoreValue) < 1e-8)) continue;
+      N1 += *V;
+      N2 += (*V)*(*V);
+      Npix += 1.0;
+      max = MAX (max, *V);
+      min = MIN (min, *V);
+    }
+  }
+  N1 = N1 / Npix;
+
+/* calculate mode, median */
+  median = mode = 0.5*(max + min);
+  if ((max - min) != 0) {
+    range = 0xffff / (max - min);
+    ALLOCATE (hist, int, 0x10000);
+    bzero (hist, 0x10000*sizeof(int));
+    for (j = sy; j < sy + ny; j++) {
+      V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + sx; 
+      for (i = 0; i < nx; i++, V++) {
+	if (Ignore && (fabs (*V - IgnoreValue) < 1e-8)) continue;
+	bin = MIN (MAX (0, (*V - min) * range), 0xffff);
+	hist[bin] ++;
+      }
+    }
+    Nhist = 0;
+    for (i = 0; (i < 0xffff) && (Nhist < 0.5*Npix); i++) 
+      Nhist += hist[i];
+    median = i / range + min;
+    Nmode = hist[0];
+    Imode = 0;
+    for (i = 1; i < 0x10000; i++) {
+      if (hist[i] > Nmode) {
+	Nmode = hist[i];
+	Imode = i;
+      }
+    }
+    mode = Imode / range + min;
+    free (hist);
+  }  
+  
+  if (!Quiet) {
+    gprint (GP_LOG, "  mean    stdev    min     max   median   Npix   Total\n");
+    gprint (GP_LOG, "%7.4g %7.4g %7.4g %7.4g %7.4g %7.0f %7.4g\n", N1, sqrt (N2/Npix - N1*N1), 
+	    min, max, median, Npix, Npix*N1);
+  }
+
+  set_variable ("MIN",    min);
+  set_variable ("MAX",    max);
+  set_variable ("MEDIAN", median);
+  set_variable ("MEAN",   N1);
+  set_variable ("MODE",   mode);
+  set_variable ("TOTAL",  N1*Npix);
+  set_variable ("NPIX",   Npix);
+  set_variable ("SIGMA",  sqrt (N2/Npix - N1*N1));
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/style.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/style.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/style.c	(revision 15879)
@@ -0,0 +1,17 @@
+# include "data.h"
+
+int style (int argc, char **argv) {
+  
+  int kapa;
+  Graphdata data;
+
+  if (!style_args (&data, &argc, argv, &kapa)) return FALSE;
+
+  if (argc > 1) {
+    gprint (GP_ERR, "USAGE: style [-n Ngraph] [-x plot style] [-c color] [-pt point type] [-lt line type] [-lw line width] [-sz size]\n");
+    return (FALSE);
+  }
+  KapaSetGraphData (kapa, &data);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/subraster.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/subraster.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/subraster.c	(revision 15879)
@@ -0,0 +1,86 @@
+# include "data.h"
+
+int subraster (int argc, char **argv) {
+  
+  int i, j;
+  float *Vin, *Vout;
+  int sx, sy, nx, ny;
+  int Sx, Sy, Nx, Ny;
+  int NX, NY;
+  Buffer *ibuf, *obuf;
+
+  if (argc != 11) {
+    gprint (GP_ERR, "USAGE: extract <from> <to> sx sy nx ny Sx Sy Nx Ny\n");
+    return (FALSE);
+  }
+
+  if ((ibuf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  NX = ibuf[0].matrix.Naxis[0];
+  NY = ibuf[0].matrix.Naxis[1];
+
+  sx = atof (argv[3]);
+  sy = atof (argv[4]);
+  nx = atof (argv[5]);
+  ny = atof (argv[6]);
+
+  Sx = atof (argv[7]);
+  Sy = atof (argv[8]);
+  Nx = atof (argv[9]);
+  Ny = atof (argv[10]);
+
+  if ((Sy + ny > Ny) || (Sx + nx > Nx)) {
+    gprint (GP_ERR, "mismatch between source and dest regions\n");
+    gprint (GP_ERR, "%d + %d > %d or %d + %d > %d\n", Sy, ny, Ny, Sx, nx, Nx);
+    return (FALSE);
+  }
+
+  /* region is not on first image */
+  if ((sx + nx < 0) || (sy + ny < 0) || 
+      (sx > ibuf[0].matrix.Naxis[0]) || 
+      (sy > ibuf[0].matrix.Naxis[1])) {
+    gprint (GP_ERR, "region outside of source image\n");
+    return (FALSE);
+  }
+
+  if ((Sx + nx > Nx) || (Sy + ny > Ny)) {
+    gprint (GP_ERR, "source region larger than dest region\n");
+    return (FALSE);
+  }
+  if ((Sx < 0) || (Sy < 0)) {
+    gprint (GP_ERR, "dest region out of range\n");
+    return (FALSE);
+  }
+
+  if ((obuf = SelectBuffer (argv[2], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+  gfits_free_matrix (&obuf[0].matrix);
+  gfits_free_header (&obuf[0].header);
+
+  obuf[0].bitpix = ibuf[0].bitpix;
+  obuf[0].unsign = ibuf[0].unsign;
+  obuf[0].bscale = ibuf[0].bscale;
+  obuf[0].bzero  = ibuf[0].bzero;
+  /* strcpy (obuf[0].name, ibuf[0].name); */
+  strcpy (obuf[0].file, ibuf[0].file);
+  gfits_copy_header (&ibuf[0].header, &obuf[0].header);
+  gfits_modify (&obuf[0].header, "NAXIS1", "%d", 1, Nx);
+  gfits_modify (&obuf[0].header, "NAXIS2", "%d", 1, Ny);
+  obuf[0].header.Naxis[0] = Nx;
+  obuf[0].header.Naxis[1] = Ny;
+  gfits_create_matrix (&obuf[0].header, &obuf[0].matrix);
+
+  for (j = 0; j < ny; j++) {
+    if (j + sy < 0) continue;
+    if (j + sy >= NY) continue;
+    Vin = (float *)(ibuf[0].matrix.buffer) + (j + sy)*ibuf[0].matrix.Naxis[0] + sx;  
+    Vout = (float *)(obuf[0].matrix.buffer) + (j + Sy)*obuf[0].matrix.Naxis[0] + Sx;   
+    for (i = 0; i < nx; i++, Vin++, Vout++) {
+      if (i + sx < 0) continue;
+      if (i + sx >= NX) continue;
+      *Vout = *Vin;
+    }
+  }
+
+  return (TRUE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/subset.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/subset.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/subset.c	(revision 15879)
@@ -0,0 +1,51 @@
+# include "data.h"
+
+/* need to check dimensions of vectors */
+
+int subset (int argc, char **argv) {
+  
+  char *out;
+  int  i, j, size;
+  Vector *ivec, *ovec, *tvec;
+
+  out = NULL;
+  ivec = ovec = tvec = NULL;
+
+  if ((argc < 6) || strcmp(argv[2], "=") || strcmp (argv[4], "if")) {
+    gprint (GP_ERR, "SYNTAX: subset vec = vec if (logic expression)\n");
+    return (FALSE);
+  }
+
+  if ((ovec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) goto error;
+  if ((ivec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) goto error;
+
+  out = dvomath (argc - 5, &argv[5], &size, 1);
+  if (out == NULL) {
+    print_error ();
+    goto error;
+  }
+  if ((tvec = SelectVector (out, OLDVECTOR, TRUE)) == NULL) goto error;
+  /* check size of ivec, tvec: must match */
+
+  REALLOCATE (ovec[0].elements, float, MAX (tvec[0].Nelements, 1));
+  for (j = i = 0; i < tvec[0].Nelements; i++) {
+    if (tvec[0].elements[i]) {
+      ovec[0].elements[j] = ivec[0].elements[i];
+      j++;
+    }
+  }
+  ovec[0].Nelements = j;
+  REALLOCATE (ovec[0].elements, float, MAX (ovec[0].Nelements, 1));
+
+  DeleteVector (tvec);
+  free (out);
+  return (TRUE);
+
+ error:
+  DeleteVector (tvec);
+  DeleteVector (ovec);
+  DeleteNamedVector (out);
+  free (out);
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/svd.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/svd.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/svd.c	(revision 15879)
@@ -0,0 +1,71 @@
+# include "data.h"
+
+int svd (int argc, char **argv) {
+  
+  int i, Nx, Ny, status;
+  float *in, *out, *A, *U, *W, *V;
+  Vector *Vw;
+  Buffer *Ma, *Mu, *Mv;
+
+  if (argc != 6) goto usage;
+  if (strcmp (argv[2], "=")) goto usage;
+
+  if ((Ma = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((Mu = SelectBuffer (argv[3], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((Vw = SelectVector (argv[4], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((Mv = SelectBuffer (argv[5], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  Nx = Ma[0].header.Naxis[0];
+  Ny = Ma[0].header.Naxis[1];
+
+  /* U is Nx, Ny */
+  gfits_free_matrix (&Mu[0].matrix);
+  gfits_free_header (&Mu[0].header);
+  Mu[0].bitpix = Ma[0].bitpix;
+  Mu[0].unsign = Ma[0].unsign;
+  Mu[0].bscale = Ma[0].bscale;
+  Mu[0].bzero  = Ma[0].bzero;
+  gfits_copy_header (&Ma[0].header, &Mu[0].header);
+  gfits_create_matrix (&Mu[0].header, &Mu[0].matrix);
+  
+  /* V is Nx, Nx */
+  gfits_free_matrix (&Mv[0].matrix);
+  gfits_free_header (&Mv[0].header);
+  Mv[0].bitpix = Ma[0].bitpix;
+  Mv[0].unsign = Ma[0].unsign;
+  Mv[0].bscale = Ma[0].bscale;
+  Mv[0].bzero  = Ma[0].bzero;
+  gfits_copy_header (&Ma[0].header, &Mv[0].header);
+  gfits_modify (&Mv[0].header, "NAXIS2", "%d", 1, Nx);
+  Mv[0].header.Naxis[1] = Nx;
+  gfits_create_matrix (&Mv[0].header, &Mv[0].matrix);
+
+  /* w is Nx */
+  Vw[0].Nelements = Nx;
+  REALLOCATE (Vw[0].elements, float, Nx);
+
+  /* pointers to the various arrays */
+  A = (float *) Ma[0].matrix.buffer;
+  U = (float *) Mu[0].matrix.buffer;
+  W = (float *) Vw[0].elements;
+  V = (float *) Mv[0].matrix.buffer;
+
+  /* copy A to U (svdcmp replaces A with U) */
+  in  = A;
+  out = U;
+  for (i = 0; i < Nx*Ny; i++, in++, out++) *out = *in;
+  /* use a bcopy instead? */
+
+  status = svdcmp (U, W, V, Nx, Ny);
+  if (!status) {
+    gprint (GP_ERR, "error running svdcmp\n");
+    return (FALSE);
+  }
+  return (TRUE);
+
+ usage:
+  gprint (GP_ERR, "USAGE: svd A = U w Vt\n");
+  return (FALSE);
+  
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/swapbytes.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/swapbytes.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/swapbytes.c	(revision 15879)
@@ -0,0 +1,29 @@
+# include "data.h"
+
+int swapbytes (int argc, char **argv) {
+  
+  int i, nx, ny;
+  char *V, tmp;
+  Buffer *buf;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: swapbytes <buffer>\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  nx = buf[0].matrix.Naxis[0];
+  ny = buf[0].matrix.Naxis[1];
+
+  gprint (GP_ERR, "npix: %d\n", nx*ny);
+
+  V = buf[0].matrix.buffer;
+  for (i = 0; i < nx*ny; i++, V+=4) {
+    tmp = V[0]; V[0] = V[3]; V[3] = tmp;
+    tmp = V[1]; V[1] = V[2]; V[2] = tmp;
+  }
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/applyfit.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/applyfit.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/applyfit.sh	(revision 15879)
@@ -0,0 +1,51 @@
+
+list tests
+ test1
+ memtest1
+end
+
+# Test if applyfit works
+macro test1
+
+ $PASS = 1
+
+ $Cn = 2
+ $C0 = 4
+ $C1 = -2
+ $C2 = 1
+
+ create x 0 10
+
+ applyfit x y
+
+ if (y[5] != 19)
+  $PASS = 0
+  echo "Value mismatch: y[5]"
+ end
+
+end
+
+
+# Memory test
+macro memtest1
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  applyfit x y
+ end
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/concat.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/concat.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/concat.sh	(revision 15879)
@@ -0,0 +1,48 @@
+
+list tests
+ test1
+ memtest1
+end
+
+# Does concat work?
+macro test1
+
+ $PASS = 1
+
+ create a 0 10
+ set b = a
+
+ concat a b
+
+ if ((b[] != 20) || (b[10] != 0))
+  $PASS = 0
+  echo "Concat failed!: nelements: b[] b(10)= b[10]"
+ end
+end
+
+
+# Memory Test
+macro memtest1
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  create a 0 10
+  set b = a
+  concat a b
+ end
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/create.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/create.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/create.sh	(revision 15879)
@@ -0,0 +1,44 @@
+
+list tests
+ test1
+ memtest1
+end
+
+# Test create function
+macro test1
+ 
+ $PASS = 1
+
+ create x 0 10 0.5
+
+ if ((x[1] != 0.5) || (x[9] != 4.5))
+  $PASS = 0
+ end
+
+end
+
+
+# Memory test
+macro memtest1
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  create y 0 10 0.1
+ end
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/cumulative.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/cumulative.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/cumulative.sh	(revision 15879)
@@ -0,0 +1,46 @@
+
+list tests
+ test1
+ memtest1
+end
+
+# Does cumulative work?
+macro test1
+
+ $PASS = 1
+
+ create a 5 15
+
+ cumulative a acum
+
+ if (acum[5] != 45)
+  $PASS = 0
+  echo "Cumulative failed!: nelements: acum[] acum(5)= acum[5]"
+ end
+end
+
+
+# Memory Test
+macro memtest1
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  create a 5 15
+  cumulative a acum
+ end
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/delete.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/delete.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/delete.sh	(revision 15879)
@@ -0,0 +1,50 @@
+
+list tests
+ test1
+ memtest1
+end
+
+# Test delete
+macro test1
+
+ $PASS = 1
+
+ $v = 7
+
+# create v 0 10
+
+ delete v
+
+ if ($?v != 0)
+  $PASS = 0
+  echo "Variable not deleted!"
+ end
+
+end
+
+
+# Memory test
+macro memtest1
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  $u = testing
+  delete u
+ end
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/fit.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/fit.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/fit.sh	(revision 15879)
@@ -0,0 +1,207 @@
+
+list tests
+ test1
+ test2
+ test3
+ test4
+ test5
+ test6
+ test7
+ test8
+end
+
+# fit a line without errors
+macro test1
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set y = 3 + 5*x
+ fit -q x y 1
+
+ if ($Cn != 1)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 1e-5)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 1e-5)
+   $PASS = 0
+ end
+end
+
+# fit a line with errors
+macro test2
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x + dy
+ fit -q x y 1
+
+ if ($Cn != 1)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.01)
+   $PASS = 0
+ end
+end
+
+# fit a line with errors and weights
+macro test3
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x + dy
+ set dy = 0.1 + zero(x)
+ fit -q x y 1 -dy dy
+
+ if ($Cn != 1)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.02)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.02)
+   $PASS = 0
+ end
+end
+
+# fit a line with errors, weights, and outliers 
+macro test4
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x + dy
+ set dy = 0.1 + zero(x)
+ y[5] = 23
+ y[20] = -10
+ y[50] = 0.0
+ fit -q x y 1 -dy dy -clip 3 3
+
+ if ($Cn != 1)
+   $PASS = 0
+ end
+ if ($Cnv != 97)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.02)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.02)
+   $PASS = 0
+ end
+end
+
+# fit a quadratic without errors
+macro test5
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set y = 3 + 5*x - 4*x^2
+ fit -q x y 2
+
+ if ($Cn != 2)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 1e-5)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 1e-5)
+   $PASS = 0
+ end
+ if (abs($C2 + 4) > 1e-5)
+   $PASS = 0
+ end
+end
+
+# fit a quadratic with errors
+macro test6
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x - 4*x^2 + dy
+ fit -q x y 2
+
+ if ($Cn != 2)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C2 + 4) > 0.05)
+   $PASS = 0
+ end
+end
+
+# fit a quadratic with errors and weights
+macro test7
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x - 4*x^2 + dy
+ set dy = 0.1 + zero(x)
+ fit -q x y 2 -dy dy
+
+ if ($Cn != 2)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C2 + 4) > 0.05)
+   $PASS = 0
+ end
+end
+
+# fit a quadratic with errors, weights, and outliers 
+macro test8
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x - 4*x^2 + dy
+ set dy = 0.1 + zero(x)
+ y[5] = 23
+ y[20] = -10
+ y[50] = 0.0
+
+ # it takes 4 iterations to successfully reject the outliers above...
+ fit -q x y 2 -dy dy -clip 3 4
+
+ if ($Cn != 2)
+   $PASS = 0
+ end
+ if ($Cnv != 97)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C2 + 4) > 0.05)
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/fit2d.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/fit2d.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/fit2d.sh	(revision 15879)
@@ -0,0 +1,208 @@
+
+list tests
+ test1
+ test2
+ test3
+ test4
+ test5
+ test6
+ test7
+ test8
+end
+
+# fit a line without errors
+macro test1
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ create y 0 100
+ set z = 3 + 5*x + 3*y
+ fit -q x y z 1
+
+ if ($Cn != 1)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 1e-5)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 1e-5)
+   $PASS = 0
+ end
+end
+
+# fit a line with errors
+macro test2
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x + dy
+ fit -q x y 1
+
+ if ($Cn != 1)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.01)
+   $PASS = 0
+ end
+end
+
+# fit a line with errors and weights
+macro test3
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x + dy
+ set dy = 0.1 + zero(x)
+ fit -q x y 1 -dy dy
+
+ if ($Cn != 1)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.02)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.02)
+   $PASS = 0
+ end
+end
+
+# fit a line with errors, weights, and outliers 
+macro test4
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x + dy
+ set dy = 0.1 + zero(x)
+ y[5] = 23
+ y[20] = -10
+ y[50] = 0.0
+ fit -q x y 1 -dy dy -clip 3 3
+
+ if ($Cn != 1)
+   $PASS = 0
+ end
+ if ($Cnv != 97)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.02)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.02)
+   $PASS = 0
+ end
+end
+
+# fit a quadratic without errors
+macro test5
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set y = 3 + 5*x - 4*x^2
+ fit -q x y 2
+
+ if ($Cn != 2)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 1e-5)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 1e-5)
+   $PASS = 0
+ end
+ if (abs($C2 + 4) > 1e-5)
+   $PASS = 0
+ end
+end
+
+# fit a quadratic with errors
+macro test6
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x - 4*x^2 + dy
+ fit -q x y 2
+
+ if ($Cn != 2)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C2 + 4) > 0.05)
+   $PASS = 0
+ end
+end
+
+# fit a quadratic with errors and weights
+macro test7
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x - 4*x^2 + dy
+ set dy = 0.1 + zero(x)
+ fit -q x y 2 -dy dy
+
+ if ($Cn != 2)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C2 + 4) > 0.05)
+   $PASS = 0
+ end
+end
+
+# fit a quadratic with errors, weights, and outliers 
+macro test8
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set dy = 0.1*rnd(x) - 0.05
+ set y = 3 + 5*x - 4*x^2 + dy
+ set dy = 0.1 + zero(x)
+ y[5] = 23
+ y[20] = -10
+ y[50] = 0.0
+
+ # it takes 4 iterations to successfully reject the outliers above...
+ fit -q x y 2 -dy dy -clip 3 4
+
+ if ($Cn != 2)
+   $PASS = 0
+ end
+ if ($Cnv != 97)
+   $PASS = 0
+ end
+ if (abs($C0 - 3) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C1 - 5) > 0.05)
+   $PASS = 0
+ end
+ if (abs($C2 + 4) > 0.05)
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/integrate.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/integrate.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/integrate.sh	(revision 15879)
@@ -0,0 +1,47 @@
+
+list tests
+ test1
+ memtest1
+end
+
+# Test if integrate works
+macro test1
+
+ $PASS = 1
+
+ create x 0 10 0.01
+ set y = 1+2*x+3*x^2
+
+ integrate x y 1 5
+
+ if (($sum-152) > 0.5)
+  $PASS = 0
+  echo "Inaccurate result (should be 152): $sum"
+ end
+
+end
+
+
+# Memory test
+macro memtest1
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  integrate x y 1 5
+ end
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/interpolate.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/interpolate.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/interpolate.sh	(revision 15879)
@@ -0,0 +1,48 @@
+
+list tests
+ test1
+ memtest1
+end
+
+# Test if interpolate works
+macro test1
+
+ $PASS = 1
+
+ create x0 0 10 0.1
+ set y0 = 1+2*x0+3*x0^2
+ create x1 0 10 0.001
+ interpolate x0 y0 x1 y1
+ integrate x1 y1 1 5
+
+ if (($sum-152) > 0.08)
+  $PASS = 0
+  echo "Inaccurate result (should be 152): $sum"
+ end
+
+end
+
+
+# Memory test
+macro memtest1
+
+ local i
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 1000
+  interpolate x0 y0 x1 y1
+ end
+  
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ $PASS = 1
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/1000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/peak.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/peak.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/peak.sh	(revision 15879)
@@ -0,0 +1,103 @@
+
+list tests
+ test1
+ test2
+ test3
+ testmem1
+end
+
+# test using full range
+macro test1
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set y = zero (x)
+ y[50] = 1
+
+ peak -q x y 0 100
+
+ if ($peakpos != 50)
+   $PASS = 0
+ end
+ if ($peaknum != 51)
+   $PASS = 0
+ end
+ if ($peakval != 1)
+   $PASS = 0
+ end
+end
+
+# test using auto range
+macro test2
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set y = zero (x)
+ y[50] = 1
+
+ peak -q x y 
+
+ if ($peakpos != 50)
+   $PASS = 0
+ end
+ if ($peaknum != 51)
+   $PASS = 0
+ end
+ if ($peakval != 1)
+   $PASS = 0
+ end
+end
+
+# test using constrained range
+macro test3
+ $PASS = 1
+ break -auto off
+
+ create x 0 100
+ set y = zero (x)
+ y[60] = 2
+ y[50] = 1
+ y[40] = 2
+
+ peak -q x y 45 55
+
+ if ($peakpos != 50)
+   $PASS = 0
+ end
+ if ($peaknum != 51)
+   $PASS = 0
+ end
+ if ($peakval != 1)
+   $PASS = 0
+ end
+end
+
+# test memory usage
+macro testmem1
+ break -auto off
+
+ create x 0 1000
+ set y = zero (x)
+ y[500] = 100
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ for i 0 10000
+   peak -q x y 400 600
+ end
+ 
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} < 10)
+   $PASS = 1
+ else
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/periodogram.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/periodogram.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/periodogram.sh	(revision 15879)
@@ -0,0 +1,101 @@
+
+list tests
+ test1
+ test2
+ test3
+end
+
+# test using even samples
+macro test1
+ $PASS = 1
+ break -auto off
+
+ local P PI
+ $PI = 3.14159265359
+ $P  = 15.0
+
+ create t 0 100
+ set f = sin(2*$PI*t/$P)
+ periodogram t f 5 50 period power
+
+ peak -q period power
+
+ if (abs ($peakpos - $P) > 0.5)
+   $PASS = 0
+   echo "OFFSET: {$peakpos - $P}"
+ end
+end
+
+# test using random samples
+macro test2
+ $PASS = 1
+ break -auto off
+
+ local P PI
+ $PI = 3.14159265359
+ $P  = 15.0
+
+ create x 0 100
+ set t = 100 * rnd(x) 
+ set f = sin(2*$PI*t/$P)
+ periodogram t f 5 50 period power
+
+ # lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f
+ # lim -n 1 period power; clear; box; plot period power
+
+ peak -q period power
+
+ if (abs ($peakpos - $P) > 0.5)
+   $PASS = 0
+ end
+end
+
+# test using random samples, higher frequency
+macro test3
+ $PASS = 1
+ break -auto off
+
+ local P PI
+ $PI = 3.14159265359
+ $P  = 2.0
+
+ create x 0 100
+ set t = 100 * rnd(x) 
+ set f = sin(2*$PI*t/$P)
+
+ periodogram t f 1 10 period power
+
+ # lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f
+ # lim -n 1 period power; clear; box; plot period power
+
+ peak -q period power
+
+ if (abs ($peakpos - $P) > 0.05)
+   $PASS = 0
+ end
+end
+
+# test using random samples, offset start
+macro test4
+ $PASS = 1
+ break -auto off
+
+ local P PI
+ $PI = 3.14159265359
+ $P  = 15.0
+
+ create x 500 800
+ set t = 300 * rnd(x) + 500
+ set f = sin(2*$PI*t/$P)
+
+ periodogram t f 2 30 period power
+
+#  lim -n 0 t f; clear; box; plot -x 2 -pt 2 t f
+#  lim -n 1 period power; clear; box; plot period power
+
+ peak -q period power
+
+ if (abs ($peakpos - $P) > 0.05)
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/queues.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/queues.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/queues.sh	(revision 15879)
@@ -0,0 +1,347 @@
+
+list tests
+ test1
+ test2
+ test3
+ test4
+ test4.1
+ test5
+ test5.1
+ testmem1
+ testmem2
+ testmem3
+ testmem4.0
+ testmem4.1
+ testmem4.2
+ testmem4.3
+ testmem5.0
+ testmem5.1
+end
+
+# test queueinit
+macro test1
+ $PASS = 1
+ queueinit dummy
+ queuesize dummy -var N
+
+ if ($N != 0)
+   $PASS = 0
+ end
+end
+
+# test queueinit memory
+macro testmem1
+ $PASS = 1
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   queueinit dummy
+ end
+ output stdout
+
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# test queuesize
+macro test2
+ $PASS = 1
+ queueinit dummy
+ queuepush dummy foobar
+ queuesize dummy -var N
+
+ if ($N != 1)
+   $PASS = 0
+ end
+end
+
+# test queuesize memory
+macro testmem2
+ $PASS = 1
+ queueinit dummy
+ queuepush dummy foobar
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   queuesize dummy -var N
+ end
+ output stdout
+
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# test queuedelete
+macro test3
+ $PASS = 1
+ queueinit dummy
+ queuepush dummy foobar
+ queuepush dummy foobar
+ queuepush dummy foobar
+
+ queuedelete dummy
+ queuepush dummy foobar
+ queuesize dummy -var N
+
+ if ($N != 1)
+   $PASS = 0
+ end
+end
+
+# test queuedelete memory
+macro testmem3
+ $PASS = 1
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   queueinit dummy
+   queuepush dummy foobar
+   queuedelete dummy
+ end
+ output stdout
+
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# test queuepush / queuepop
+macro test4
+ $PASS = 1
+ queueinit dummy
+ queuepush dummy foobar
+ queuepop  dummy -var N
+
+ if ("$N" != "foobar")
+   $PASS = 0
+ end
+end
+
+# test queuepush / queuepop
+macro test4.1
+ $PASS = 1
+ queueinit dummy
+ queuepush dummy foo1
+ queuepush dummy foo2
+ queuepush dummy foo3
+
+ queuepop  dummy -var N
+ if ("$N" != "foo1")
+   $PASS = 0
+ end
+ queuepop  dummy -var N
+ if ("$N" != "foo2")
+   $PASS = 0
+ end
+ queuepop  dummy -var N
+ if ("$N" != "foo3")
+   $PASS = 0
+ end
+ queuesize dummy -var N
+ if ($N != 0)
+   $PASS = 0
+ end
+end
+
+# test queuepush / queuepop memory
+macro testmem4.0
+ $PASS = 1
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   queueinit dummy
+   queuepush dummy foobar
+   queuepop dummy -var N
+ end
+ output stdout
+
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# test queuepush / queuepop memory
+macro testmem4.1
+ $PASS = 1
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   queueinit dummy
+   queuepush dummy foobar
+   queuepop dummy
+ end
+ output stdout
+
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# test queuepush / queuepop memory
+macro testmem4.2
+ $PASS = 1
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   queueinit dummy
+   queuepush dummy foobar
+ end
+ output stdout
+
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# test queuepush / queuepop memory
+macro testmem4.3
+ $PASS = 1
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ queueinit dummy
+
+ output /dev/null
+ for i 0 10000
+   queuepush dummy foobar
+   queuepop dummy
+ end
+ output stdout
+
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+# test queuepush / queuepop with keys
+macro test5
+ $PASS = 1
+ queueinit dummy
+ queuepush dummy "test 1 word"
+ queuepush dummy "test 2 word"
+ queuepush dummy "test 3 word"
+ queuepop  dummy -var N -key 1 2
+
+ if ("$N" != "test 2 word")
+   $PASS = 0
+ end
+end
+
+# test queuepush / queuepop with keys
+macro test5.1
+ $PASS = 1
+ queueinit dummy
+ queuepush dummy "test 1 word"
+ queuepush dummy "test 2 word"
+ queuepush dummy "bird 2 word"
+ queuepop  dummy -var N -key 0:1 test:2
+
+ if ("$N" != "test 2 word")
+   $PASS = 0
+ end
+end
+
+# memory test for queuepush / queuepop with keys
+macro testmem5.0
+ $PASS = 1
+ queueinit dummy
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   queuepush dummy "test 1 word"
+   queuepush dummy "test 2 word"
+   queuepush dummy "test 3 word"
+   queuepop dummy -var N -key 1 2
+   queuepop dummy -var N -key 1 1
+   queuepop dummy -var N -key 1 3
+ end
+ output stdout
+
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+   queuelist
+ end
+end
+
+# memory test for queuepush / queuepop with keys
+macro testmem5.1
+ $PASS = 1
+ queueinit dummy
+
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+
+ output /dev/null
+ for i 0 10000
+   queuepush dummy "test 1 word"
+   queuepop dummy -var N -key 1 1
+ end
+ output stdout
+
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+
+ if ({$endmem - $startmem} > 10)
+   $PASS = 0
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/stats.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/stats.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/stats.sh	(revision 15879)
@@ -0,0 +1,156 @@
+
+$skip = 0
+
+list tests
+ test1
+ test2
+ test3
+end
+
+# test using full range
+macro test1
+ $PASS = 1
+ break -auto off
+
+ gaussdev dev {100*100} 0.0 1.0
+ dimenup dev buf 100 100
+ stats -q buf 
+ $npix = 100*100
+
+ if ($STATUS == 0)
+   echo "failed command"
+   $PASS = 0
+ end
+ if ($NPIX != $npix) 
+   echo "failed npix"
+   $PASS = 0
+ end
+ if (abs($MEAN - 0.0) > (2.0/sqrt($npix))) 
+   echo "failed mean"
+   $PASS = 0
+ end
+ if (abs($MEDIAN - 0.0) > (2.0/sqrt($npix))) 
+   echo "failed median"
+   $PASS = 0
+ end
+ if (abs($SIGMA - 1.0) > (2.0/sqrt($npix))) 
+   echo "failed sigma"
+   $PASS = 0
+ end
+ if ($MIN < -4.0) 
+   echo "failed min"
+   $PASS = 0
+ end
+ if ($MAX > +4.0)
+   echo "failed max"
+   $PASS = 0
+ end
+# I don't this MODE is being correctly calculated.
+ if ($skip && (abs($MODE - 0.0) > (2.0/sqrt($npix))))
+   echo "MODE fails: known problem with mode"
+   $PASS = 0
+ end
+ if (abs($TOTAL - $MEAN*$npix) > (2.0/sqrt($npix))) 
+   echo "failed total"
+   $PASS = 0
+ end
+end
+
+# test using full range
+macro test2
+ $PASS = 1
+ break -auto off
+
+ gaussdev dev {100*100} 0.0 1.0
+ dimenup dev buf 100 100
+ stats -q buf  - - - -
+ $npix = 100*100
+
+ if ($STATUS == 0)
+   echo "failed command"
+   $PASS = 0
+ end
+ if ($NPIX != $npix) 
+   echo "failed npix"
+   $PASS = 0
+ end
+ if (abs($MEAN - 0.0) > (2.0/sqrt($npix))) 
+   echo "failed mean"
+   $PASS = 0
+ end
+ if (abs($MEDIAN - 0.0) > (2.0/sqrt($npix))) 
+   echo "failed median"
+   $PASS = 0
+ end
+ if (abs($SIGMA - 1.0) > (2.0/sqrt($npix))) 
+   echo "failed sigma"
+   $PASS = 0
+ end
+ if ($MIN < -4.0) 
+   echo "failed min"
+   $PASS = 0
+ end
+ if ($MAX > +4.0)
+   echo "failed max"
+   $PASS = 0
+ end
+# I don't this MODE is being correctly calculated.
+ if ($skip && (abs($MODE - 0.0) > (2.0/sqrt($npix))))
+   echo "MODE fails: known problem with mode"
+   $PASS = 0
+ end
+ if (abs($TOTAL - $MEAN*$npix) > (2.0/sqrt($npix))) 
+   echo $TOTAL {$MEAN*$npix} {abs($TOTAL - $MEAN*$npix) > (2.0/sqrt($npix))) 
+   echo "failed total"
+   $PASS = 0
+ end
+end
+
+# test using full range
+macro test3
+ $PASS = 1
+ break -auto off
+
+ gaussdev dev {100*100} 0.0 1.0
+ dimenup dev buf 100 100
+ stats -q buf 10 10 10 10
+ $npix = 10*10
+
+ if ($STATUS == 0)
+   echo "failed command"
+   $PASS = 0
+ end
+ if ($NPIX != $npix) 
+   echo "failed npix"
+   $PASS = 0
+ end
+ if (abs($MEAN - 0.0) > (2.0/sqrt($npix))) 
+   echo "failed mean"
+   $PASS = 0
+ end
+ if (abs($MEDIAN - 0.0) > (2.0/sqrt($npix))) 
+   echo "failed median"
+   $PASS = 0
+ end
+ if (abs($SIGMA - 1.0) > (2.0/sqrt($npix))) 
+   echo "failed sigma"
+   $PASS = 0
+ end
+ if ($MIN < -4.0) 
+   echo "failed min"
+   $PASS = 0
+ end
+ if ($MAX > +4.0)
+   echo "failed max"
+   $PASS = 0
+ end
+# I don't this MODE is being correctly calculated.
+ if ($skip && (abs($MODE - 0.0) > (2.0/sqrt($npix))))
+   echo "MODE fails: known problem with mode"
+   $PASS = 0
+ end
+ if (abs($TOTAL - $MEAN*$npix) > (2.0/sqrt($npix))) 
+   echo "failed total"
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/vgauss.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/vgauss.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/vgauss.sh	(revision 15879)
@@ -0,0 +1,99 @@
+
+list tests
+ test1
+ test2
+ test3
+end
+
+macro test1
+ $PASS = 1
+ break -auto off
+
+ create x -10 10 0.1
+ set y = 5 * exp(-0.5*x^2/3^2)
+
+ $C0 = 0.5
+ $C1 = 2
+ $C2 = 10
+ $C3 = 1
+ set dy = sqrt(y)
+
+ vgauss -q x y dy yfit
+
+ if (abs($C0 - 0.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C1 - 3.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C2 - 5.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C3 - 0.0) > 0.01)
+   $PASS = 0
+ end
+end
+
+# noise of 0.1
+macro test2
+ $PASS = 1
+ break -auto off
+
+ create x -10 10 0.1
+ set y = 1000 * exp(-0.5*x^2/3^2)
+ set dy = (rnd(y) - 0.5)/0.5
+ set y = y + dy
+
+ $C0 = 0.5
+ $C1 = 2
+ $C2 = 900
+ $C3 = 1
+
+ vgauss -q x y dy yfit
+
+ if (abs($C0 - 0.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C1 - 3.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C2 - 1000.0) > 0.1)
+   $PASS = 0
+ end
+ if (abs($C3 - 0.0) > 0.1)
+   $PASS = 0
+ end
+end
+
+# poisson-distributed noise
+macro test3
+ $PASS = 1
+ break -auto off
+
+ create x -10 10 0.1
+ set y = 1000 * exp(-0.5*x^2/3^2)
+
+ gaussdev dY y[] 0.0 1.0
+ set dy = dY * sqrt(y)
+ set y = y + dy
+
+ $C0 = 0.5
+ $C1 = 2
+ $C2 = 900
+ $C3 = 1
+
+ vgauss -q x y dy yfit
+
+ if (abs($C0 - 0.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C1 - 3.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C2 - 1000.0) > 1)
+   $PASS = 0
+ end
+ if (abs($C3 - 0.0) > 0.2)
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/vmaxwell.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/vmaxwell.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/test/vmaxwell.sh	(revision 15879)
@@ -0,0 +1,103 @@
+
+list tests
+# test1
+ test2
+# test3
+end
+
+macro test1
+ $PASS = 1
+ break -auto off
+
+ create x -10 10 0.1
+ set y = 5 * exp(-0.5*x^2/3^2)
+
+ $C0 = 0.5
+ $C1 = 2
+ $C2 = 10
+ $C3 = 1
+ set dy = sqrt(y)
+
+ vgauss -q x y dy yfit
+
+ if (abs($C0 - 0.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C1 - 3.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C2 - 5.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C3 - 0.0) > 0.01)
+   $PASS = 0
+ end
+end
+
+# noise of 0.1
+macro test2
+ $PASS = 1
+ break -auto off
+
+ create x 0 1000 1
+ set y = 1000 * (x-200)^2 * exp(-0.5*(x-300)^2/30^2)
+ set dy = (rnd(y) - 0.5)/0.5
+ set y = y + dy
+
+ lim x y; clear; box; plot -x 1 -c black x y
+
+ $C0 = 250
+ $C1 = 25
+ $C2 = 900
+ $C3 = 1
+ $C4 = 190
+
+ vmaxwell x y dy yfit
+ plot x yfit -c red
+
+ if (abs($C0 - 0.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C1 - 3.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C2 - 1000.0) > 0.1)
+   $PASS = 0
+ end
+ if (abs($C3 - 0.0) > 0.1)
+   $PASS = 0
+ end
+end
+
+# poisson-distributed noise
+macro test3
+ $PASS = 1
+ break -auto off
+
+ create x -10 10 0.1
+ set y = 1000 * exp(-0.5*x^2/3^2)
+
+ gaussdev dY y[] 0.0 1.0
+ set dy = dY * sqrt(y)
+ set y = y + dy
+
+ $C0 = 0.5
+ $C1 = 2
+ $C2 = 900
+ $C3 = 1
+
+ vgauss -q x y dy yfit
+
+ if (abs($C0 - 0.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C1 - 3.0) > 0.01)
+   $PASS = 0
+ end
+ if (abs($C2 - 1000.0) > 1)
+   $PASS = 0
+ end
+ if (abs($C3 - 0.0) > 0.2)
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/teststats.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/teststats.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/teststats.c	(revision 15879)
@@ -0,0 +1,117 @@
+# include "data.h"
+
+int teststats (int argc, char **argv) {
+  
+  int i, N;
+  double max, min, sum, var, dvar, mean, stdev;
+  float *X, IgnoreValue;
+  int Ignore, Quiet;
+
+  int *Nval, bin, Nmode, Nmed;
+  double dx, mode, median;
+  Vector *vec;
+
+  Ignore = FALSE;
+  if (N = get_argument (argc, argv, "-ignore")) {
+    Ignore = TRUE;
+    remove_argument (N, &argc, argv);
+    IgnoreValue = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  Quiet = FALSE;
+  if (N = get_argument (argc, argv, "-q")) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if (N = get_argument (argc, argv, "-quiet")) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: teststats (vector)\n");
+    return (FALSE);
+  }
+
+  if ((vec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  Mean = Stdev = 0; 
+  /* first pass: measure the sample statistics */
+  for (j = 0; j < 3; j++) {
+    /* calculate mean, npix */
+    X = vec[0].elements;
+    max = min = *X;
+    sum = N = 0;
+    for (i = 0; i < vec[0].Nelements; i++, X++) {
+      if (!finite (*X)) continue;
+      if (Ignore && (*X == IgnoreValue)) continue;
+      if ((j > 0) && (fabs (*X - Mean) > 3*stdev)) continue;
+      sum += *X;
+      N++;
+    }      
+    mean = sum / N;
+    /* calculate stdev */
+    X = vec[0].elements;
+    var = 0;
+    for (i = 0; i < vec[0].Nelements; i++, X++) {
+      if (!finite (*X)) continue;
+      if (Ignore && (*X == IgnoreValue)) continue;
+      if ((j > 0) && (fabs (*X - mean) > 3*stdev)) continue;
+      dvar = (*X - mean);
+      var += dvar*dvar;
+    }      
+    stdev = sqrt (var / N);
+    Mean = mean;
+  }
+  mean = Mean;
+  set_variable ("MEAN_C",     mean);
+  set_variable ("SIGMA_C",    stdev);
+
+  /* construct histogram with resolution of 0.1*stdev and range -1000*dx : 1000*dx centered on mean */
+  dx = 0.1*stdev;
+  min = mean - 1000*dx;
+  max = mean + 1000*dx;
+  NVAL = 1 + (int)((max - min) / dx);
+  ALLOCATE (Nval, int, NVAL);
+  bzero (Nval, NVAL*sizeof(int));
+  X = vec[0].elements;
+  for (i = 0; i < vec[0].Nelements; i++, X++) {
+    if (!finite (*X)) continue;
+    if (Ignore && (*X == IgnoreValue)) continue;
+    bin = MAX (0, MIN (NVAL, (*X - min) / dx));
+    Nval[bin] ++;
+  }      
+
+  /* find mode */
+  Nmode = 0;
+  mode = Nval[Nmode];
+  for (i = 0; i < NVAL; i++) {
+    if (mode < Nval[i]) {
+      Nmode = i;
+      mode = Nval[Nmode];
+    }
+  }
+  mode = Nmode * dx + min;
+
+  
+
+  if (!Quiet) {
+    gprint (GP_ERR, "mean: %f, stdev: %f, min: %f, max: %f, median: %f, mode: %f, Npts: %d\n", 
+	     mean, stdev, min, max, median, mode, N);
+  }
+
+  set_variable ("MIN",      min);
+  set_variable ("MAX",      max);
+  set_variable ("MEDIAN",   median);
+  set_variable ("MODE",     mode);
+  set_variable ("TOTAL",    sum);
+  set_variable ("MEAN",     mean);
+  set_variable ("SIGMA",    stdev);
+
+  set_int_variable ("NPIX", N);
+
+  free (Nval);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/textline.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/textline.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/textline.c	(revision 15879)
@@ -0,0 +1,56 @@
+# include "data.h"
+
+int textline (int argc, char **argv) {
+
+  int N, size, FracPositions;
+  char name[64];
+  double x, y, angle;
+  int kapa;
+  Graphdata graphmode;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return (FALSE);
+
+  if ((N = get_argument (argc, argv, "-fn"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (name, argv[N]);
+    remove_argument (N, &argc, argv);
+    size = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    KapaSetFont (kapa, name, size);
+  } 
+
+  /* FracPositions uses coordinates of 0-1 relative to axis range */
+  FracPositions = FALSE;
+  if ((N = get_argument (argc, argv, "-frac"))) {
+    remove_argument (N, &argc, argv);
+    FracPositions = TRUE;
+  } 
+
+  angle = 0.0;
+  if ((N = get_argument (argc, argv, "-rot"))) {
+    remove_argument (N, &argc, argv);
+    angle = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  } 
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: text x y (line) [-fn (font) size] [-rot angle]\n");
+    return (FALSE);
+  }
+
+  if (strlen (argv[3]) > 127) {
+    gprint (GP_ERR, "labels currently limited to 127 chars\n");
+    return (FALSE);
+  }
+
+  x = atof (argv[1]);
+  y = atof (argv[2]);
+  
+  if (FracPositions) {
+    x =  x * (graphmode.xmax - graphmode.xmin) + graphmode.xmin;
+    y =  y * (graphmode.ymax - graphmode.ymin) + graphmode.ymin;
+  }    
+
+  KapaSendTextline (kapa, argv[3], x, y, angle);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/tv.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/tv.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/tv.c	(revision 15879)
@@ -0,0 +1,63 @@
+# include "data.h"
+
+int tv (int argc, char **argv) {
+  
+  int N, kapa;
+  char *name, *file;
+  Coords coords;
+  Buffer *buf;
+  KiiImage image;
+  KapaImageData data;
+
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImage (&data, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  /* shell exits on pipe close, FIX */
+  if ((N = get_argument (argc, argv, "-kill"))) {
+    KiiClose (kapa);
+    return (TRUE);
+  }
+
+  data.logflux = FALSE;
+  if ((N = get_argument (argc, argv, "-log"))) {
+    remove_argument (N, &argc, argv);
+    data.logflux = TRUE;
+  }
+
+  // use the currently-set zero,range values if not supplied
+  if ((argc != 2) && (argc != 4)) {
+    gprint (GP_ERR, "USAGE: tv <buffer> [zero range] [-n Nimage] [-log] [-kill]\n");
+    return (FALSE);
+  }
+
+  if (argc == 4) {
+    data.zero = atof (argv[2]);
+    data.range = atof (argv[3]);
+    if (data.range == 0.0) data.range = 0.001;
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  GetCoords (&coords, &buf[0].header);
+  
+  image.data1d = (float *) buf[0].matrix.buffer;
+  image.Nx = buf[0].matrix.Naxis[0];
+  image.Ny = buf[0].matrix.Naxis[1];
+
+  // send only the root of the file, not the full path
+  file = filerootname (buf[0].file);
+  strcpy (data.file, file);
+  free (file);
+
+  strcpy (data.name, argv[1]);
+  
+  KiiNewPicture1D (kapa, &image, &data, &coords);
+
+  set_str_variable ("TV", argv[1]);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/tvcontour.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/tvcontour.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/tvcontour.c	(revision 15879)
@@ -0,0 +1,287 @@
+# include "data.h"
+# define LL { \
+ dx =  d00 / (*v01 - *v00); \
+ dy = -d00 / (*v10 - *v00); \
+ x = i - 0.5; \
+ y = j - dy - 0.5; }
+
+# define UL { \
+ tmp = d00 / (*v10 - *v00); \
+ dy = 1 - tmp; \
+ dx =  d10 / (*v11 - *v10); \
+ x = i - 0.5; \
+ y = j + tmp - 0.5; }
+      
+# define LR { \
+ tmp = d00 / (*v01 - *v00); \
+ dx = 1 - tmp; \
+ dy = d01 / (*v11 - *v01); \
+ x = i + tmp - 0.5; \
+ y = j - 0.5; }
+
+# define UR { \
+ tmp = d10 / (*v11 - *v10); \
+ dx = 1 - tmp; \
+ dy = -d11 / (*v01 - *v11); \
+ x = i + tmp - 0.5; \
+ y = j + 1 - 0.5; }
+      
+# define HZ { \
+ tmp = d00 / (*v10 - *v00); \
+ dy = d01 / (*v11 - *v01) - tmp; \
+ dx = 1; \
+ x = i - 0.5; \
+ y = j + tmp - 0.5; }
+
+# define VT { \
+ tmp = d00 / (*v01 - *v00); \
+ dx = d10 / (*v11 - *v10) - tmp; \
+ x = i + tmp - 0.5; \
+ dy = 1; \
+ y = j - 0.5; }
+
+# define DUMP { \
+overlay[Noverlay].type = KII_OVERLAY_LINE; \
+overlay[Noverlay].x = Npix*x; \
+overlay[Noverlay].y = Npix*y; \
+overlay[Noverlay].dx = Npix*dx; \
+overlay[Noverlay].dy = Npix*dy; \
+Noverlay ++; \
+CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000); \
+}
+
+int tvcontour (int argc, char **argv) {
+
+  int i, j, ii, jj, Npix, Nx, Ny;
+  float level, d00, d01, d10, d11, tmp;
+  float x, y, dx, dy;
+  float *v00, *v01, *v10, *v11;
+  float *Vout, *Vin, *matrix;
+  char *name;
+  int kapa, N, Noverlay, NOVERLAY;
+  Buffer *buf;
+  KiiOverlay *overlay;
+  
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImage (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  if ((argc != 4) && (argc != 5)) {
+    gprint (GP_ERR, "USAGE: contour <buffer> (overlay) level [Npix]\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  level = atof (argv[3]);
+  if (argc == 5) 
+    Npix = (int) MAX (atof (argv[4]), 1); 
+  else 
+    Npix = 1;
+  level *= Npix*Npix;
+
+  /*** make rebinned image ***/
+  Nx = buf[0].header.Naxis[0]/Npix;
+  Ny = buf[0].header.Naxis[1]/Npix;
+  if (Npix != 1) {
+    gprint (GP_LOG, "rebin by a factor of %d (%d,%d)\n", Npix, Nx, Ny);
+    ALLOCATE (matrix, float, Nx*Ny);
+    bzero (matrix, Nx*Ny*sizeof(float));
+	
+    for (j = 0; j < Ny; j++) {
+      for (jj = 0; jj < Npix; jj++) {
+	Vout = matrix + j*Nx;
+	Vin  = (float *)(buf[0].matrix.buffer) + (j*Npix + jj)*buf[0].header.Naxis[0];
+	for (i = 0; i < Nx; i++, Vout++) {
+	  for (ii = 0; ii < Npix; ii++, Vin++) {
+	    *Vout += *Vin;
+	  }
+	}
+      }
+    }
+  } else {
+    gprint (GP_ERR, "using scale of 1\n");
+    matrix = (float *)(buf[0].matrix.buffer);
+  }
+
+  Noverlay = 0;
+  NOVERLAY = 1000;
+  ALLOCATE (overlay, KiiOverlay, NOVERLAY);
+
+  v00 = matrix;
+  v01 = matrix + 1;
+  v10 = matrix + Nx;
+  v11 = matrix + Nx + 1;
+  d01 = (level - *v00);
+  d11 = (level - *v10);
+  for (j = 1; j < Ny; j++) {
+    if (!(j%10)) gprint (GP_ERR, ".");
+    for (i = 1; i < Nx; i++, v00++, v01++, v10++, v11++) {
+
+      d00 = d01;
+      d10 = d11;
+      d01 = (level - *v01);
+      d11 = (level - *v11);
+
+      if (((d00 > 0) && (d01 > 0) && (d10 > 0) && (d11 > 0)) ||
+	  ((d00 < 0) && (d01 < 0) && (d10 < 0) && (d11 < 0)))
+	continue;
+
+      if ((d00 > 0) && (d10 <= 0)) { 
+	if ((d01 <= 0) && (d11 <= 0)) { /* \  */
+	  LL;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 > 0) && (d11 <= 0)) { /* -  */
+	  HZ;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 > 0) && (d11 > 0)) { /* /  */
+	  UL;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 > 0)) { /* \\  */
+	  LL;
+	  DUMP;
+	  UR;
+	  DUMP;
+	  continue;
+	}
+      }
+
+      if ((d00 <= 0) && (d10 > 0)) {
+	if ((d01 > 0) && (d11 > 0)) { /* \  */
+	  LL;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 > 0)) { /* -  */
+	  HZ;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 <= 0)) { /* /  */
+	  UL;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 > 0) && (d11 <= 0)) { /* //  */
+	  UL;
+	  DUMP;
+	  LR;
+	  DUMP;
+	  continue;
+	}
+      }
+      
+
+      if ((d00 <= 0) && (d10 <= 0)) { 
+	if ((d01 > 0) && (d11 <= 0)) {
+	  LR;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 > 0)) {
+	  UR;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 > 0) && (d11 > 0)) {
+	  VT;
+	  DUMP;
+	  continue;
+	}
+      }
+
+      if ((d00 > 0) && (d10 > 0)) { 
+	if ((d01 <= 0) && (d11 > 0)) {
+	  LR;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 > 0) && (d11 <= 0)) {
+	  UR;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 <= 0)) {
+	  VT;
+	  DUMP;
+	  continue;
+	}
+      }
+
+    }
+    /* skip left-hand edge */
+    v00++; v01++; v10++; v11++;
+    d01 = (level - *v00);
+    d11 = (level - *v10);
+  }
+
+  /****** bottom line *******/
+  v00 = matrix;  
+  v01 = matrix + 1;  
+  y = 0;
+  dx = 0;
+  dy = -0.5;
+  for (i = 1; i < Nx; i++, v00++, v01++) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      x = i + (level - *v01)/(*v01 - *v00);
+      DUMP;
+    }
+  }
+
+  /********** top line *******/
+  v00 = matrix + Nx*(Ny - 1);  
+  v01 = v00 + 1;
+  y = Ny - 1;
+  dx = 0;
+  dy = 0.5;
+  for (i = 1; i < Nx; i++, v00++, v01++) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      x = i + (level - *v01)/(*v01 - *v00);
+      DUMP;
+    }
+  }
+
+  /******** left line *********/
+  v00 = matrix; 
+  v01 = matrix + Nx;
+  x = 0;
+  dx = -0.5;
+  dy = 0;
+  for (j = 1; j < Ny; j++, v00+=Nx, v01+=Nx) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      y = j + (level - *v01)/(*v01 - *v00);
+      DUMP;
+    }
+  }
+
+  /******** right line *********/
+  v00 = matrix + Nx - 1; 
+  v01 = v00 + Nx;
+  x = Nx - 1;
+  dx = 0.5;
+  dy = 0;
+  for (j = 1; j < Ny; j++, v00+=Nx, v01+=Nx) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      y = j + (level - *v01)/(*v01 - *v00);
+      DUMP;
+    }
+  }
+  
+  KiiLoadOverlay (kapa, overlay, Noverlay, argv[2]);
+  free (overlay);
+
+  if (Npix != 1) free (matrix);
+  gprint (GP_ERR, "\n");
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/tvgrid.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/tvgrid.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/tvgrid.c	(revision 15879)
@@ -0,0 +1,152 @@
+# include "data.h"
+# define TEN(X) (pow(10.0, (double)(X)))
+
+int tvgrid (int argc, char **argv) {
+  
+  int ndig1, ndig2, NX, NY, connect;
+  int tDEC, tRA;
+  double ra, dec, ra0, dec0, ra1, dec1;
+  double x0, y0, x1, y1;
+  double dDEC, fDEC, dRA, fRA;
+  char format[16];
+  Coords coords;
+  int kapa, N, Noverlay, NOVERLAY;
+  char *name;
+  Buffer *buf;
+  KiiOverlay *overlay;
+
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImage (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: tvgrid (overlay) (buffer)\n");
+    gprint (GP_ERR, " (overlay) may be: red, green, blue, yellow\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  GetCoords (&coords, &buf[0].header);
+
+  XY_to_RD (&ra0, &dec0, 0.0, 0.0, &coords);
+  XY_to_RD (&ra1, &dec1, (double)buf[0].header.Naxis[0], (double)buf[0].header.Naxis[1], &coords);
+  gprint (GP_ERR, "%f %f  %f %f\n", ra0, dec0, ra1, dec1);
+  
+  Noverlay = 0;
+  NOVERLAY = 1000;
+  ALLOCATE (overlay, KiiOverlay, NOVERLAY);
+
+  dDEC = fabs(dec1 - dec0);
+  tDEC = log10(dDEC) - log10(5.0);
+  fDEC = log10(dDEC) - tDEC;
+  if ((fDEC > log10(0.5)) && (fDEC < log10(1.0))) {
+    dDEC = TEN (tDEC + log10(0.1));
+  }
+  if ((fDEC > log10(1.0)) && (fDEC < log10(2.0))) {
+    dDEC = TEN (tDEC + log10(0.2));
+  }
+  if ((fDEC > log10(2.0)) && (fDEC < log10(5.0))) {
+    dDEC = TEN (tDEC + log10(0.5));
+  }
+  if ((fDEC > log10(5.0)) && (fDEC < log10(10.0))) {
+    dDEC = TEN (tDEC + log10(1.0));
+  }
+  if ((fDEC > log10(10.0)) && (fDEC < log10(20.0))) {
+    dDEC = TEN (tDEC + log10(2.0));
+  }
+  if ((fDEC > log10(20.0)) && (fDEC < log10(50.0))) {
+    dDEC = TEN (tDEC + log10(5.0));
+  }
+  ndig2 = ((log10(dDEC) < 0) ? fabs(log10(dDEC)) : 0);
+  ndig1 = 3 + log10(MAX(dec0, dec1)) + ndig2;
+  sprintf (format, "%%%d.%df", ndig1, ndig2);
+  gprint (GP_ERR, "format: %s..\n", format);
+
+  NX = buf[0].header.Naxis[0];
+  NY = buf[0].header.Naxis[1];
+
+  x0 = y0 = 0;
+  dRA = MAX (fabs(ra1 - ra0) / 100.0, 0.1);
+  connect = FALSE;
+  for (dec = dDEC * ((int)(MIN(dec0,dec1)/dDEC) + 1); dec < MAX(dec0,dec1); dec += dDEC) {
+    for (ra = 0; ra < 361; ra += dRA) {
+      RD_to_XY (&x1, &y1, ra, dec, &coords);
+      if ((x1 >= 0) && (x1 < NX) && (y1 >= 0) && (y1 < NY)) {
+	if (connect) {
+	  overlay[Noverlay].type = KII_OVERLAY_LINE;
+	  overlay[Noverlay].x = x0;
+	  overlay[Noverlay].y = y0;
+	  overlay[Noverlay].dx = x1 - x0;
+	  overlay[Noverlay].dy = y1 - y0;
+	  Noverlay ++;
+	  CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000);
+	}
+	x0 = x1;
+	y0 = y1;
+	connect = TRUE;
+      } else {
+	connect = FALSE;
+      }
+    }
+  }
+
+  dRA = fabs(ra1 - ra0);
+  tRA = log10(dRA) - log10(5.0);
+  fRA = log10(dRA) - tRA;
+  if ((fRA > log10(0.5)) && (fRA < log10(1.0))) {
+    dRA = TEN (tRA + log10(0.1));
+  }
+  if ((fRA > log10(1.0)) && (fRA < log10(2.0))) {
+    dRA = TEN (tRA + log10(0.2));
+  }
+  if ((fRA > log10(2.0)) && (fRA < log10(5.0))) {
+    dRA = TEN (tRA + log10(0.5));
+  }
+  if ((fRA > log10(5.0)) && (fRA < log10(10.0))) {
+    dRA = TEN (tRA + log10(1.0));
+  }
+  if ((fRA > log10(10.0)) && (fRA < log10(20.0))) {
+    dRA = TEN (tRA + log10(2.0));
+  }
+  if ((fRA > log10(20.0)) && (fRA < log10(50.0))) {
+    dRA = TEN (tRA + log10(5.0));
+  }
+  ndig2 = ((log10(dRA) < 0) ? fabs(log10(dRA)) : 0);
+  ndig1 = 3 + log10(MAX(ra0, ra1)) + ndig2;
+  sprintf (format, "%%%d.%df", ndig1, ndig2);
+  gprint (GP_ERR, "format: %s..\n", format);
+
+  dDEC = MAX (fabs(dec1 - dec0) / 100.0, 0.1);
+  connect = FALSE;
+  for (ra = dRA * ((int)(MIN(ra0,ra1)/dRA) + 1); ra < MAX(ra0,ra1); ra += dRA) {
+    for (dec = -90; dec < 90; dec += dDEC) {
+      RD_to_XY (&x1, &y1, ra, dec, &coords);
+      if ((x1 >= 0) && (x1 < NX) && (y1 >= 0) && (y1 < NY)) {
+	if (connect) {
+	  overlay[Noverlay].type = KII_OVERLAY_LINE;
+	  overlay[Noverlay].x = x0;
+	  overlay[Noverlay].y = y0;
+	  overlay[Noverlay].dx = x1 - x0;
+	  overlay[Noverlay].dy = y1 - y0;
+	  Noverlay ++;
+	  CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000);
+	}
+	x0 = x1;
+	y0 = y1;
+	connect = TRUE;
+      } else {
+	connect = FALSE;
+      }
+    }
+  }
+
+  KiiLoadOverlay (kapa, overlay, Noverlay, argv[1]);
+  free (overlay);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/ungridify.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/ungridify.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/ungridify.c	(revision 15879)
@@ -0,0 +1,56 @@
+# include "data.h"
+
+int ungridify (int argc, char **argv) {
+
+  int i, j, n;
+  int Nx, Ny, NX, NY;
+  int Xmin, Xmax, Ymin, Ymax;
+  float *v, *x, *y, *z;
+  Buffer *bf;
+  Vector *vx, *vy, *vz;
+
+  if (argc != 9) {
+    gprint (GP_ERR, "USAGE: ungridify buffer Xmin Xmax Ymin Ymax x y z\n");
+    return (FALSE);
+  }
+  
+  if ((bf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  Xmin = atof (argv[2]);
+  Xmax = atof (argv[3]);
+  Ymin = atof (argv[4]);
+  Ymax = atof (argv[5]);
+  Nx = Xmax - Xmin;
+  Ny = Ymax - Ymin;
+  
+  NX = bf[0].matrix.Naxis[0];
+  NY = bf[0].matrix.Naxis[1];
+
+  if ((vx = SelectVector (argv[6], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vy = SelectVector (argv[7], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vz = SelectVector (argv[8], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  REALLOCATE (vx[0].elements, float, Nx*Ny);
+  REALLOCATE (vy[0].elements, float, Nx*Ny);
+  REALLOCATE (vz[0].elements, float, Nx*Ny);
+
+  x = vx[0].elements;
+  y = vy[0].elements;
+  z = vz[0].elements;
+  n = 0;
+  v = (float *)bf[0].matrix.buffer;
+  for (j = Ymin; j < Ymax; j++) {
+    for (i = Xmin; i < Xmax; i++, x++, y++, z++, n++) {
+      vx[0].elements[n] = i;
+      vy[0].elements[n] = j;
+      if (i < 0) continue;
+      if (i >= NX) continue;
+      if (j < 0) continue;
+      if (j >= NY) continue;
+      vz[0].elements[n] = v[i+j*NX];
+    }
+  }
+  if (n != Nx*Ny) {
+    gprint (GP_ERR, "error in ungrid: %d vs %d (%d x %d)\n", n, Nx*Ny, Nx, Ny);
+  }
+  vx[0].Nelements = vy[0].Nelements = vz[0].Nelements = n;
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/uniq.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/uniq.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/uniq.c	(revision 15879)
@@ -0,0 +1,39 @@
+# include "data.h"
+
+int uniq (int argc, char **argv) {
+  
+  int Nnew, i, j, found;
+  float *v1, *v2;
+  Vector *ivec, *ovec;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: uniq (in) (out)\n");
+    return (FALSE);
+  }
+
+  if ((ivec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((ovec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  /* allocate the maximum possible needed */
+  ALLOCATE (ovec[0].elements, float, ivec[0].Nelements);
+
+  Nnew = 0;
+  v1 = ivec[0].elements;
+  for (i = 0; i < ivec[0].Nelements; i++, v1++) {
+    v2 = ovec[0].elements;
+    found = FALSE;
+    for (j = 0; !found && (j < Nnew); j++, v2++) {
+      if (*v1 == *v2) found = TRUE;
+    }
+    if (!found) {
+      ovec[0].elements[Nnew] = *v1;
+      Nnew ++;
+    }
+  }
+
+  ovec[0].Nelements = Nnew;
+  REALLOCATE (ovec[0].elements, float, ovec[0].Nelements);
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/unsign.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/unsign.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/unsign.c	(revision 15879)
@@ -0,0 +1,28 @@
+# include "data.h"
+
+int unsign (int argc, char **argv) {
+  
+  if (argc == 1) {
+    if (gfits_get_unsign_mode()) 
+      gprint (GP_ERR, "mode is now UNSIGNED int \n");
+    else
+      gprint (GP_ERR, "mode is now SIGNED int \n");
+    return (TRUE);
+  }
+
+  if (argc == 2) {
+    if (!strcmp (argv[1], "1")) {
+      gfits_set_unsign_mode (TRUE);
+      set_int_variable ("UNSIGN", 1);
+      return (TRUE);
+    }
+    if (!strcmp (argv[1], "0")) {
+      gfits_set_unsign_mode (FALSE);
+      set_int_variable ("UNSIGN", 0);
+      return (TRUE);
+    }
+  }
+
+  gprint (GP_ERR, "USAGE: unsign [0/1]\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vbin.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vbin.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vbin.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "data.h"
+
+int vbin (int argc, char **argv) {
+  
+  int i, j, n, N, Nin, Nout;
+  int Normalize, Ignore;
+  float *Vout, *Vin, IgnoreValue;
+  double scale;
+  Vector *in, *out;
+
+  Normalize = FALSE;
+  if ((N = get_argument (argc, argv, "-norm"))) {
+    remove_argument (N, &argc, argv);
+    Normalize = TRUE;
+  }
+
+  Ignore = FALSE;
+  IgnoreValue = 0.0;
+  if ((N = get_argument (argc, argv, "-ignore"))) {
+    Ignore = TRUE;
+    remove_argument (N, &argc, argv);
+    IgnoreValue = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: vbin <input> <output> scale \n");
+    gprint (GP_ERR, "  (use interpolate to expand)\n");
+    return (FALSE);
+  }
+
+  if ((in  = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((out = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  scale  = atof (argv[3]);
+  if ((int)(scale) != scale) {
+    gprint (GP_ERR, "integer binning only, please\n");
+    return (FALSE);
+  }
+
+  Nin  = in[0].Nelements;
+  Nout = Nin / scale;
+
+  REALLOCATE (out[0].elements, float, Nout);
+  out[0].Nelements = Nout;
+
+  Vin  = in[0].elements;
+  Vout = out[0].elements;
+  for (n = j = 0; j < Nout; j++, Vout++) {
+    *Vout = 0;
+    for (N = i = 0; (i < scale) && (n < Nin); n++, i++, Vin++) {
+      if (!finite (*Vin)) continue;
+      if (Ignore && (*Vin == IgnoreValue)) continue;
+      *Vout += *Vin;
+      N ++;
+    } 
+    if (Normalize) {
+      if (N > 0) { 
+	*Vout /= (float) N; 
+      } else {
+	*Vout = 0;
+      }
+    }
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vclip.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vclip.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vclip.c	(revision 15879)
@@ -0,0 +1,73 @@
+# include "data.h"
+
+int vclip (int argc, char **argv) {
+
+  int i, Npix, DO_NAN, DO_INF, N;
+  double min, Vmin, max, Vmax, nan_val, inf_val;
+  float *in;
+  Vector *vec;
+
+  inf_val = nan_val = min = Vmin = max = Vmax = 0;
+
+  DO_NAN = FALSE;
+  if ((N = get_argument (argc, argv, "-nan"))) {
+    remove_argument (N, &argc, argv);
+    nan_val  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    DO_NAN = TRUE;
+  }
+
+  DO_INF = FALSE;
+  if ((N = get_argument (argc, argv, "-inf"))) {
+    remove_argument (N, &argc, argv);
+    inf_val  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    DO_INF = TRUE;
+  }
+
+  if ((argc != 6) && (!(DO_INF || DO_NAN))) {
+    gprint (GP_ERR, "USAGE: vclip (vector) [min Vmin max Vmax] [-inf val] [-nan val]\n");
+    return (FALSE);
+  }
+
+  if ((vec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (argc == 6) {
+    min = atof (argv[2]);
+    Vmin = atof (argv[3]);
+    max = atof (argv[4]);
+    Vmax = atof (argv[5]);
+  }
+
+  Npix = vec[0].Nelements;
+  in =   vec[0].elements;
+
+  if (argc == 6) {
+    for (i = 0; i < Npix; i++, in++) {
+      if (*in < min) 
+	*in = Vmin;
+      if (*in > max)
+	*in = Vmax;
+    }
+  }
+  in = vec[0].elements;
+  if (DO_NAN) {
+    for (i = 0; i < Npix; i++, in++) {
+      if (isnan (*in)) {
+	*in = nan_val;
+      }
+    }
+  }
+  in = vec[0].elements;
+  if (DO_INF) {
+    for (i = 0; i < Npix; i++, in++) {
+      if (!finite (*in)) {
+	*in = inf_val;
+      }
+    }
+  }
+  return (TRUE);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vcontour.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vcontour.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vcontour.c	(revision 15879)
@@ -0,0 +1,278 @@
+# include "data.h"
+# define LL { \
+ dx =  d00 / (*v01 - *v00); \
+ dy = -d00 / (*v10 - *v00); \
+ x = i - 0.5; \
+ y = j - dy - 0.5; }
+
+# define UL { \
+ tmp = d00 / (*v10 - *v00); \
+ dy = 1 - tmp; \
+ dx =  d10 / (*v11 - *v10); \
+ x = i - 0.5; \
+ y = j + tmp - 0.5; }
+      
+# define LR { \
+ tmp = d00 / (*v01 - *v00); \
+ dx = 1 - tmp; \
+ dy = d01 / (*v11 - *v01); \
+ x = i + tmp - 0.5; \
+ y = j - 0.5; }
+
+# define UR { \
+ tmp = d10 / (*v11 - *v10); \
+ dx = 1 - tmp; \
+ dy = -d11 / (*v01 - *v11); \
+ x = i + tmp - 0.5; \
+ y = j + 1 - 0.5; }
+      
+# define HZ { \
+ tmp = d00 / (*v10 - *v00); \
+ dy = d01 / (*v11 - *v01) - tmp; \
+ dx = 1; \
+ x = i - 0.5; \
+ y = j + tmp - 0.5; }
+
+# define VT { \
+ tmp = d00 / (*v01 - *v00); \
+ dx = d10 / (*v11 - *v10) - tmp; \
+ x = i + tmp - 0.5; \
+ dy = 1; \
+ y = j - 0.5; }
+
+# define DUMP { \
+overlay[Noverlay].type = KII_OVERLAY_LINE; \
+overlay[Noverlay].x = Npix*x; \
+overlay[Noverlay].y = Npix*y; \
+overlay[Noverlay].dx = Npix*dx; \
+overlay[Noverlay].dy = Npix*dy; \
+Noverlay ++; \
+CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000); \
+}
+
+int vcontour (int argc, char **argv) {
+
+  int i, j, ii, jj, n, Nbuf, Npix, Nx, Ny, Nline;
+  float level, d00, d01, d10, d11, tmp;
+  float x, y, dx, dy;
+  float *v00, *v01, *v10, *v11;
+  float *Vout, *Vin, *matrix;
+  char *buffer, line[17];
+  int Ximage, Nimage, N;
+  Vector *xvec, *yvec, *zvec;
+
+  gprint (GP_ERR, "vcontour not working yet\n");
+  return (FALSE);
+
+  if (argc != 7) {
+    gprint (GP_ERR, "USAGE: vcontour x y z Xc Yc (level)\n");
+    return (FALSE);
+  }
+  
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((zvec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((foo = SelectVector (argv[4], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((foo = SelectVector (argv[5], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  level = atof (argv[6]);
+
+  /* convert the x,y,z vectors to a matrix */
+  *V = xvec[0].elements;
+  max = min = *V;
+  for (i = 0; i < xvec[0].Nelements; i++, V++) {
+    if (!finite (*V)) continue;
+    max = MAX (*V, max);
+    min = MIN (*V, min);
+  }      
+  Xmax = max; Xmin = min;
+
+  *V = yvec[0].elements;
+  max = min = *V;
+  for (i = 0; i < yvec[0].Nelements; i++, V++) {
+    if (!finite (*V)) continue;
+    max = MAX (*V, max);
+    min = MIN (*V, min);
+  }      
+  Ymax = max; Ymin = min;
+
+  /* not really finished */
+
+  Noverlay = 0;
+  NOVERLAY = 1000;
+  ALLOCATE (overlay, KiiOverlay, NOVERLAY);
+
+  v01 = matrix + 1;
+  v10 = matrix + Nx;
+  v11 = matrix + Nx + 1;
+  d01 = (level - *v00);
+  d11 = (level - *v10);
+  for (j = 1; j < Ny; j++) {
+    if (!(j%10)) gprint (GP_ERR, ".");
+    for (i = 1; i < Nx; i++, v00++, v01++, v10++, v11++) {
+
+      d00 = d01;
+      d10 = d11;
+      d01 = (level - *v01);
+      d11 = (level - *v11);
+
+      if (((d00 > 0) && (d01 > 0) && (d10 > 0) && (d11 > 0)) ||
+	  ((d00 < 0) && (d01 < 0) && (d10 < 0) && (d11 < 0)))
+	continue;
+
+      if ((d00 > 0) && (d10 <= 0)) { 
+	if ((d01 <= 0) && (d11 <= 0)) { /* \  */
+	  LL;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 > 0) && (d11 <= 0)) { /* -  */
+	  HZ;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 > 0) && (d11 > 0)) { /* /  */
+	  UL;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 > 0)) { /* \\  */
+	  LL;
+	  DUMP;
+	  UR;
+	  DUMP;
+	  continue;
+	}
+      }
+
+      if ((d00 <= 0) && (d10 > 0)) {
+	if ((d01 > 0) && (d11 > 0)) { /* \  */
+	  LL;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 > 0)) { /* -  */
+	  HZ;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 <= 0)) { /* /  */
+	  UL;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 > 0) && (d11 <= 0)) { /* //  */
+	  UL;
+	  DUMP;
+	  LR;
+	  DUMP;
+	  continue;
+	}
+      }
+      
+
+      if ((d00 <= 0) && (d10 <= 0)) { 
+	if ((d01 > 0) && (d11 <= 0)) {
+	  LR;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 > 0)) {
+	  UR;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 > 0) && (d11 > 0)) {
+	  VT;
+	  DUMP;
+	  continue;
+	}
+      }
+
+      if ((d00 > 0) && (d10 > 0)) { 
+	if ((d01 <= 0) && (d11 > 0)) {
+	  LR;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 > 0) && (d11 <= 0)) {
+	  UR;
+	  DUMP;
+	  continue;
+	}
+	if ((d01 <= 0) && (d11 <= 0)) {
+	  VT;
+	  DUMP;
+	  continue;
+	}
+      }
+
+    }
+    /* skip left-hand edge */
+    v00++; v01++; v10++; v11++;
+    d01 = (level - *v00);
+    d11 = (level - *v10);
+  }
+
+  /****** bottom line *******/
+  v00 = matrix;  
+  v01 = matrix + 1;  
+  y = 0;
+  dx = 0;
+  dy = -0.5;
+  for (i = 1; i < Nx; i++, v00++, v01++) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      x = i + (level - *v01)/(*v01 - *v00);
+      DUMP;
+      continue;
+    }
+  }
+
+  /********** top line *******/
+  v00 = matrix + Nx*(Ny - 1);  
+  v01 = v00 + 1;
+  y = Ny - 1;
+  dx = 0;
+  dy = 0.5;
+  for (i = 1; i < Nx; i++, v00++, v01++) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      x = i + (level - *v01)/(*v01 - *v00);
+      DUMP;
+      continue;
+    }
+  }
+
+  /******** left line *********/
+  v00 = matrix; 
+  v01 = matrix + Nx;
+  x = 0;
+  dx = -0.5;
+  dy = 0;
+  for (j = 1; j < Ny; j++, v00+=Nx, v01+=Nx) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      y = j + (level - *v01)/(*v01 - *v00);
+      DUMP;
+      continue;
+    }
+  }
+
+  /******** right line *********/
+  v00 = matrix + Nx - 1; 
+  v01 = v00 + Nx;
+  x = Nx - 1;
+  dx = 0.5;
+  dy = 0;
+  for (j = 1; j < Ny; j++, v00+=Nx, v01+=Nx) { /* do the edges */
+    if (((*v00 > level) && (*v01 <= level)) || ((*v00 <= level) && (*v01 > level))) {
+      y = j + (level - *v01)/(*v01 - *v00);
+      DUMP;
+      continue;
+    }
+  }
+  
+  KiiLoadOverlay (Ximage, overlay, Noverlay, argv[2]);
+  free (overlay);
+
+  if (Npix != 1) free (matrix);
+  gprint (GP_ERR, "\n");
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vgauss.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vgauss.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vgauss.c	(revision 15879)
@@ -0,0 +1,104 @@
+# include "data.h"
+
+/* local private functions */
+float fgaussOD (float, float *, int, float *);
+
+# define GET_VAR(V,A) \
+  c = get_variable (A); \
+  if (c == NULL) { \
+    gprint (GP_ERR, "missing fit parameter A\n"); \
+    return (FALSE); \
+  } \
+  V = atof (c);
+
+int vgauss (int argc, char **argv) {
+
+  int i, N, Npts, Npar, Quiet;
+  float par[4], *v1, *v2, *dy, **covar;
+  float chisq, ochisq, dchisq;
+  Vector *xvec, *yvec, *svec, *ovec;
+  char *c, name[16];
+
+  Quiet = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: vgauss <x> <y> <dy> (out)\n");
+    gprint (GP_ERR, " uses guesses: C0 (mean), C1 (sigma), C2 (norm), C3 (sky)\n");
+    return (FALSE);
+  }
+  
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((svec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((ovec = SelectVector (argv[4], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  Npts = xvec[0].Nelements;
+  ALLOCATE (dy, float, Npts);
+  REALLOCATE (ovec[0].elements, float, Npts);
+
+  GET_VAR (par[0], "C0");
+  GET_VAR (par[1], "C1");
+  GET_VAR (par[2], "C2");
+  GET_VAR (par[3], "C3");
+  Npar = 4;
+
+  v1 = svec[0].elements;
+  v2 = dy;
+  for (i = 0; i < Npts; i++, v1++, v2++) {
+      *v2 = (*v1 == 0.0) ? 0.0 : 1.0 / (*v1 * *v1);
+  } 
+  
+  ochisq = mrqinit (xvec[0].elements, yvec[0].elements, dy, Npts, par, Npar, fgaussOD, !Quiet);
+  dchisq = ochisq + 2*Npts;
+
+  for (i = 0; (i < 20) && ((dchisq > 0.1*(Npts - Npar)) || (dchisq <= 0.0)); i++) {
+    chisq = mrqmin (xvec[0].elements, yvec[0].elements, dy, Npts, par, Npar, fgaussOD, !Quiet);
+    dchisq = ochisq - chisq;
+    ochisq = chisq;
+    if (!Quiet) gprint (GP_ERR, "dchisq: %f, Ndof: %d\n", dchisq, Npts - Npar);
+  }  
+  if (!Quiet) gprint (GP_ERR, "%d iterations\n", i); 
+
+  for (i = 0; i < Npts; i++) {
+    ovec[0].elements[i] = fgaussOD (xvec[0].elements[i], par, Npar, dy);
+  }
+  ovec[0].Nelements = Npts;
+  /* set output *before* variable renomalization */
+
+  covar = mrqcovar (Npar);
+  for (i = 0; i < Npar; i++) {
+    sprintf (name, "C%d", i);
+    set_variable (name, par[i]);
+    if (!Quiet) gprint (GP_ERR, "%d  %f  %f\n", i, par[i], sqrt(covar[i][i]));
+    sprintf (name, "dC%d", i);
+    set_variable (name, sqrt(covar[i][i]));
+  }
+
+  mrqfree (Npar);
+  return (TRUE);
+}
+
+/* pars: x_o, sigma, I, back */
+float fgaussOD (float x, float *par, int Npar, float *dpar) {
+
+  float z, r, f;
+
+  z = (x - par[0])/par[1];
+  r = exp (-0.5*SQ(z));
+  f = par[2]*r + par[3];
+
+  dpar[0] = par[2]*r*z/par[1];
+  dpar[1] = par[2]*r*z*z/par[1];
+  dpar[2] = r;
+  dpar[3] = 1;
+  
+  return (f);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vgrid.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vgrid.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vgrid.c	(revision 15879)
@@ -0,0 +1,72 @@
+# include "data.h"
+
+int vgrid (int argc, char **argv) {
+
+  int i, Nx, Ny, Xb, Yb;
+  float Xmin, Xmax, dX, Ymin, Ymax, dY;
+  float *buf, *val, *x, *y, *z;
+  int *Nval;
+  Buffer *bf;
+  Vector *vx, *vy, *vz;
+
+  if (argc != 11) {
+    gprint (GP_ERR, "USAGE: vgrid x y z buffer Xmin Xmax dX Ymin Ymax dY\n");
+    return (FALSE);
+  }
+  
+  if ((vx = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vy = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vz = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((bf = SelectBuffer (argv[4], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+
+  if (vx[0].Nelements != vy[0].Nelements) return (FALSE);
+  if (vx[0].Nelements != vz[0].Nelements) return (FALSE);
+
+  Xmin = atof (argv[5]);
+  Xmax = atof (argv[6]);
+  dX   = atof (argv[7]);
+
+  Ymin = atof (argv[8]);
+  Ymax = atof (argv[9]);
+  dY   = atof (argv[10]);
+
+  Nx = (Xmax - Xmin) / dX + 1;
+  Ny = (Ymax - Ymin) / dY + 1;
+  
+  gfits_free_matrix (&bf[0].matrix);
+  gfits_free_header (&bf[0].header);
+  CreateBuffer (bf, Nx, Ny, -32, 0.0, 1.0);
+  strcpy (bf[0].file, "(empty)");
+
+  ALLOCATE (val, float, Nx*Ny);
+  bzero (val, Nx*Ny*sizeof(float));
+  ALLOCATE (Nval, int, Nx*Ny);
+  bzero (Nval, Nx*Ny*sizeof(int));
+
+  x = vx[0].elements;
+  y = vy[0].elements;
+  z = vz[0].elements;
+  for (i = 0; i < vx[0].Nelements; i++, x++, y++, z++) {
+    Xb = (*x - Xmin) / dX;
+    Yb = (*y - Ymin) / dY;
+    if (Xb >= Nx) continue;
+    if (Yb >= Ny) continue;
+    val[Xb + Yb*Nx] = *z;
+    Nval[Xb + Yb*Nx]++;
+  }
+
+  buf = (float *) bf[0].matrix.buffer;
+  for (i = 0; i < Nx*Ny; i++) {
+    if (Nval[i] == 0) {
+      buf[i] = 0;
+      continue;
+    }
+    buf[i] = val[i] / Nval[i];
+  }
+
+  free (val);
+  free (Nval);
+
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vload.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vload.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vload.c	(revision 15879)
@@ -0,0 +1,73 @@
+# include "data.h"
+
+int vload (int argc, char **argv) {
+  
+  int i, N, Noverlay;
+  int kapa, type;
+  char *name;
+  double dx, dy, size;
+  KiiOverlay *overlay;
+  Vector *vecx, *vecy;
+  
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImage (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  type = KII_OVERLAY_BOX;
+  if ((N = get_argument (argc, argv, "-type"))) {
+    remove_argument (N, &argc, argv);
+    type = KiiOverlayTypeByName (argv[N]);
+    remove_argument (N, &argc, argv);
+    if (!type) {
+      gprint (GP_ERR, "unknown Kii point type %s\n", argv[N]);
+      return (FALSE);
+    }
+  }
+
+  size = 1.0;
+  if ((N = get_argument (argc, argv, "-size"))) {
+    remove_argument (N, &argc, argv);
+    size = fabs(atof (argv[N]));
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: vload (overlay) (xvec) (yvec) [-n]\n");
+    return (FALSE);
+  }
+  
+  if (type == KII_OVERLAY_CIRCLE) {
+    dx = dy = size / 2;
+  } else {
+    dx = dy = size;
+  }    
+
+  if ((vecx = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vecy = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if (vecx[0].Nelements != vecy[0].Nelements) {
+    gprint (GP_ERR, "mismatched vector lengths\n");
+    return (FALSE);
+  }
+
+  Noverlay = vecx[0].Nelements;
+  ALLOCATE (overlay, KiiOverlay, Noverlay);
+
+  for (i = 0; i < Noverlay; i++) {
+    overlay[i].type = type;
+    overlay[i].text = NULL;
+    overlay[i].x = vecx[0].elements[i]+0.5;
+    overlay[i].y = vecy[0].elements[i]+0.5;
+    overlay[i].dx = dx;
+    overlay[i].dy = dy;
+  }
+
+  KiiLoadOverlay (kapa, overlay, Noverlay, argv[1]);
+  free (overlay);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vmaxwell.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vmaxwell.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vmaxwell.c	(revision 15879)
@@ -0,0 +1,106 @@
+# include "data.h"
+
+/* local private functions */
+float fmaxwellOD (float, float *, int, float *);
+
+# define GET_VAR(V,A) \
+  c = get_variable (A); \
+  if (c == NULL) { \
+    gprint (GP_ERR, "missing fit parameter A\n"); \
+    return (FALSE); \
+  } \
+  V = atof (c);
+
+int vmaxwell (int argc, char **argv) {
+
+  int i, N, Npts, Npar, Quiet;
+  float par[5], *v1, *v2, *dy, **covar;
+  float chisq, ochisq, dchisq;
+  Vector *xvec, *yvec, *svec, *ovec;
+  char *c, name[16];
+
+  Quiet = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: vmaxwell <x> <y> <dy> (out)\n");
+    gprint (GP_ERR, " uses guesses: C0 (mean), C1 (sigma), C2 (norm), C3 (sky), C4 (ref)\n");
+    return (FALSE);
+  }
+  
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((svec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((ovec = SelectVector (argv[4], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  Npts = xvec[0].Nelements;
+  ALLOCATE (dy, float, Npts);
+  REALLOCATE (ovec[0].elements, float, Npts);
+
+  GET_VAR (par[0], "C0");
+  GET_VAR (par[1], "C1");
+  GET_VAR (par[2], "C2");
+  GET_VAR (par[3], "C3");
+  GET_VAR (par[4], "C4");
+  Npar = 5;
+  /* careful of variable renomalization */
+
+  v1 = svec[0].elements;
+  v2 = dy;
+  for (i = 0; i < Npts; i++, v1++, v2++) *v2 = 1.0 / (*v1 * *v1);
+  
+  ochisq = mrqinit (xvec[0].elements, yvec[0].elements, dy, Npts, par, Npar, fmaxwellOD, !Quiet);
+  dchisq = ochisq + 2*Npts;
+
+  for (i = 0; (i < 20) && ((dchisq > 0.1*(Npts - Npar)) || (dchisq <= 0.0)); i++) {
+    chisq = mrqmin (xvec[0].elements, yvec[0].elements, dy, Npts, par, Npar, fmaxwellOD, !Quiet);
+    dchisq = ochisq - chisq;
+    ochisq = chisq;
+    if (!Quiet) gprint (GP_ERR, "dchisq: %f, Ndof: %d\n", dchisq, Npts - Npar);
+  }  
+  if (!Quiet) gprint (GP_ERR, "%d iterations\n", i); 
+
+  for (i = 0; i < Npts; i++) {
+    ovec[0].elements[i] = fmaxwellOD (xvec[0].elements[i], par, Npar, dy);
+  }
+  ovec[0].Nelements = Npts;
+  /* set output *before* variable renomalization */
+
+  covar = mrqcovar (Npar);
+  for (i = 0; i < Npar; i++) {
+    sprintf (name, "C%d", i);
+    set_variable (name, par[i]);
+    if (!Quiet) gprint (GP_ERR, "%d  %f  %f\n", i, par[i], sqrt(covar[i][i]));
+    sprintf (name, "dC%d", i);
+    set_variable (name, sqrt(covar[i][i]));
+  }
+
+  mrqfree (Npar);
+  return (TRUE);
+}
+
+/* pars: x_o, -0.5/sigma^2, I, back, ref */
+float fmaxwellOD (float x, float *par, int Npar, float *dpar) {
+
+  float z, r, f;
+
+  z = (x - par[0])/par[1];
+  r = SQ(x - par[4])*exp (-0.5*SQ(z));
+  f = par[2]*r + par[3];
+
+  dpar[0] = par[2]*r*z/par[1];
+  dpar[1] = par[2]*r*z*z/par[1];
+  dpar[2] = r;
+  dpar[3] = 1;
+  dpar[4] = -par[2]*(x - par[4])*exp(-0.5*SQ(z));
+  
+  return (f);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vpop.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vpop.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vpop.c	(revision 15879)
@@ -0,0 +1,23 @@
+# include "data.h"
+
+int vpop (int argc, char **argv) {
+
+  int Npix;
+  Vector *vec;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: vpop (vector)\n");
+    gprint (GP_ERR, "  remove first element of vector\n");
+    return (FALSE);
+  }
+
+  if ((vec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  Npix = vec[0].Nelements;
+  if (Npix < 1) return (TRUE);
+
+  if (Npix > 1) {
+    memmove (&vec[0].elements[0], &vec[0].elements[1], Npix*sizeof(float));
+  }
+  vec[0].Nelements = Npix - 1;
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vroll.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vroll.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vroll.c	(revision 15879)
@@ -0,0 +1,23 @@
+# include "data.h"
+
+int vroll (int argc, char **argv) {
+
+  int Npix;
+  float first;
+  Vector *vec;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: vroll (vector)\n");
+    gprint (GP_ERR, "  roll vector elements (first goes to end)\n");
+    return (FALSE);
+  }
+
+  if ((vec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  Npix = vec[0].Nelements;
+  if (Npix < 2) return (TRUE);
+
+  first = vec[0].elements[0];
+  memmove (&vec[0].elements[0], &vec[0].elements[1], Npix*sizeof(float));
+  vec[0].elements[Npix-1] = first;
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vsmooth.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vsmooth.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vsmooth.c	(revision 15879)
@@ -0,0 +1,55 @@
+# include "data.h"
+
+int vsmooth (int argc, char **argv) {
+  
+  int i, n, N, Nx, Ns, Ngauss;
+  float *vi, *vo, *gauss, *gaussnorm;
+  float g, s, sigma, Nsigma;
+  Vector *in;
+
+  Nsigma = 3;
+  if ((N = get_argument (argc, argv, "-Nsigma"))) {
+    remove_argument (N, &argc, argv);
+    Nsigma = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: vsmooth (input) sigma\n");
+    return (FALSE);
+  }
+  
+  if ((in  = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  sigma = atof (argv[2]);
+  Nx = in[0].Nelements;
+  vi = in[0].elements;
+
+  /* build a 1D gaussian */
+  Ns = (int) (Nsigma*sigma + 0.5);
+  Ngauss = 2*Ns + 1;
+  ALLOCATE (gaussnorm, float, Ngauss);
+  gauss = &gaussnorm[Ns];
+  for (i = -Ns; i < Ns + 1; i++) {
+    gauss[i] = exp ((i*i)/(-2*sigma*sigma));
+  }
+
+  ALLOCATE (vo, float, Nx);
+
+  for (i = 0; i < Nx; i++) {
+    g = s = 0;
+    for (n = -Ns; n < Ns + 1; n++) {
+      if (i+n < 0) continue;
+      if (i+n >= Nx) continue;
+      s += gauss[n]*vi[i+n];
+      g += gauss[n];
+    }
+    vo[i] = s / g;
+  }
+
+  free (in[0].elements);
+  free (gaussnorm);
+
+  in[0].elements = vo;
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vstat.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vstat.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/vstat.c	(revision 15879)
@@ -0,0 +1,115 @@
+# include "data.h"
+
+int vstat (int argc, char **argv) {
+  
+  int i, N;
+  double max, min, sum, var, dvar, mean, stdev;
+  float *X, IgnoreValue;
+  int Ignore, Quiet;
+
+  int *Nval, bin, Nmode, Nmed;
+  double dx, mode, median;
+  Vector *vec;
+
+  IgnoreValue = 0;
+  Ignore = FALSE;
+  if ((N = get_argument (argc, argv, "-ignore"))) {
+    Ignore = TRUE;
+    remove_argument (N, &argc, argv);
+    IgnoreValue = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  Quiet = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-quiet"))) {
+    Quiet = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: vstat (vector)\n");
+    return (FALSE);
+  }
+
+  if ((vec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+
+  /* we need two passes, one for max, min, mean, sum, one for median, stdev, etc */
+
+  /* calculate max, min, mean, sum, npix */
+  X = vec[0].elements;
+  max = -HUGE_VAL;
+  min = HUGE_VAL;
+  sum = N = 0;
+  for (i = 0; i < vec[0].Nelements; i++, X++) {
+    if (!finite (*X)) continue;
+    if (Ignore && (*X == IgnoreValue)) continue;
+    max = MAX (*X, max);
+    min = MIN (*X, min);
+    sum += *X;
+    N++;
+  }      
+  mean = sum / N;
+
+  /* calculate median and mode with resolution of (max - min) / 1000 */ 
+  dx = (max - min) / 1000;
+  if (dx == 0) {
+    median = mode = min;
+    stdev = 0.0;
+    goto skip;
+  }
+
+  ALLOCATE (Nval, int, 1002);
+  bzero (Nval, 1000*sizeof(int));
+  X = vec[0].elements;
+  var = 0;
+  for (i = 0; i < vec[0].Nelements; i++, X++) {
+    if (!finite (*X)) continue;
+    if (Ignore && (*X == IgnoreValue)) continue;
+    bin = MAX (0, MIN (1000, (*X - min) / dx));
+    Nval[bin] ++;
+    dvar = (*X - mean);
+    var += dvar*dvar;
+  }      
+  stdev = sqrt (var / N);
+
+  Nmode = 0;
+  mode = Nval[Nmode];
+  median = 0;
+  Nmed = -1;
+  for (i = 0; i < 1001; i++) {
+    if (Nmed == -1) {
+      median += Nval[i];
+      if (median >= N / 2.0) {
+	Nmed = i;
+	median = i * dx + min;
+      }
+    }
+    if (mode < Nval[i]) {
+      Nmode = i;
+      mode = Nval[Nmode];
+    }
+  }
+  mode = Nmode * dx + min;
+  free (Nval);
+
+skip:
+  if (!Quiet) {
+    gprint (GP_ERR, "mean: %g, stdev: %g, min: %g, max: %g, median: %g, mode: %g, Npts: %d\n", 
+	     mean, stdev, min, max, median, mode, N);
+  }
+
+  set_variable ("MIN",      min);
+  set_variable ("MAX",      max);
+  set_variable ("MEDIAN",   median);
+  set_variable ("MEAN",     mean);
+  set_variable ("MODE",     mode);
+  set_variable ("TOTAL",    sum);
+  set_int_variable ("NPIX", N);
+  set_variable ("SIGMA",    stdev);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/wd.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/wd.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/wd.c	(revision 15879)
@@ -0,0 +1,179 @@
+# include "data.h"
+
+int wd (int argc, char **argv) {
+  
+  int N, Extend;
+  int newUnsign, newBitpix, newScale, newZero;
+  int outUnsign, outBitpix;
+  double outScale, outZero;
+  Header temp_header;
+  Matrix temp_matrix;
+  Buffer *buf;
+
+  /* XXX I must have dropped the old 'newplane' option */
+  Extend  = FALSE;
+  if ((N = get_argument (argc, argv, "-extend"))) {
+    remove_argument (N, &argc, argv);
+    Extend  = TRUE;
+  }
+
+  outZero = 0;
+  newZero = FALSE;
+  if ((N = get_argument (argc, argv, "-bzero"))) {
+    remove_argument (N, &argc, argv);
+    outZero  = atof(argv[N]);
+    newZero  = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  outScale = 1;
+  newScale = FALSE;
+  if ((N = get_argument (argc, argv, "-bscale"))) {
+    remove_argument (N, &argc, argv);
+    outScale = atof(argv[N]);
+    newScale = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  outBitpix = 16;
+  newBitpix = FALSE;
+  if ((N = get_argument (argc, argv, "-bitpix"))) {
+    remove_argument (N, &argc, argv);
+    outBitpix = atof(argv[N]);
+    newBitpix = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  outUnsign = FALSE;
+  newUnsign = FALSE;
+  if ((N = get_argument (argc, argv, "-unsign"))) {
+    remove_argument (N, &argc, argv);
+    outUnsign = -1;
+    if (!strcasecmp (argv[N], "t") || !strcasecmp (argv[N], "true")) outUnsign = TRUE;
+    if (!strcasecmp (argv[N], "f") || !strcasecmp (argv[N], "false")) outUnsign = FALSE;
+    if (outUnsign == -1) {
+      gprint (GP_ERR, "-unsign options: t, f, true, false\n");
+      return (FALSE);
+    }
+    newUnsign = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: wd <buffer> <filename> [-bitpix N] [-bscale X] [-bzero X] [-extend] [-newplane]\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  if (!newBitpix) outBitpix = buf[0].bitpix;
+  if (!newScale) outScale = buf[0].bscale;
+  if (!newZero) outZero = buf[0].bzero;
+  if (!newUnsign) outUnsign = buf[0].unsign;
+
+  /* Convert the buffer from (float) to correct format */
+  /* save the (float) version, write out a temporary buffer */
+  temp_matrix = buf[0].matrix;
+  ALLOCATE (temp_matrix.buffer, char, MAX(1, temp_matrix.size));
+  memcpy (temp_matrix.buffer, buf[0].matrix.buffer, temp_matrix.size);
+  temp_header = buf[0].header;
+  ALLOCATE (temp_header.buffer, char, MAX(1, temp_header.size));
+  memcpy (temp_header.buffer, buf[0].header.buffer, temp_header.size);
+
+  if (temp_header.Naxes) gfits_convert_format (&temp_header, &temp_matrix, outBitpix, outScale, outZero, outUnsign);
+
+  if (Extend) {
+    Header Xhead;
+    FILE *f;
+    int status, Nextend;
+
+    /* assume failure means non-existent file */
+    if (!gfits_read_header (argv[2], &Xhead)) {
+
+      gfits_init_header (&Xhead);
+      Xhead.bitpix = 16;
+      Xhead.extend = TRUE;
+      gfits_create_header (&Xhead);
+
+      gfits_modify (&Xhead, "NEXTEND", "%d", 1, 0);
+      f = fopen (argv[2], "w");
+      fclose (f);
+    }
+
+    gfits_modify (&Xhead, "EXTEND", "%t", 1, TRUE);
+
+    Nextend = 0;
+    gfits_scan (&Xhead, "NEXTEND", "%d", 1, &Nextend);
+    Nextend ++;
+    gfits_modify (&Xhead, "NEXTEND", "%d", 1, Nextend);
+
+    /* write the main header to the start of the file */
+    f = fopen (argv[2], "r+");
+    if (f == NULL) {
+      gprint (GP_ERR, "failed to write file\n");
+      status = FALSE;
+      goto done1;
+    }
+    
+    /* position to begining of file to write header */
+    fseek (f, 0, SEEK_SET);
+    status = fwrite (Xhead.buffer, 1, Xhead.size, f);
+    if (status != Xhead.size) {
+      gprint (GP_ERR, "ERROR: failed writing data to image header\n");
+      status = FALSE;
+      goto done1;
+    }
+    
+    /* fix up header */
+    {
+      static char simple[] = "XTENSION= 'IMAGE  '            / Image extension";
+      int Ns, No;
+      Ns = strlen (simple);
+      No = 80 - Ns;
+      strncpy (temp_header.buffer, simple, Ns);
+      memset (&temp_header.buffer[Ns], ' ', No);
+    }
+
+    /* position to end of file to write new extend */
+    fseek (f, 0, SEEK_END);
+    status = fwrite (temp_header.buffer, 1, temp_header.size, f);
+    fclose (f);
+    if (status != temp_header.size) {
+      gprint (GP_ERR, "failed to write file\n");
+      status = FALSE;
+      goto done1;
+    }
+    /* write the matrix buffer (automatically goes to end of file */
+    if (!gfits_write_matrix (argv[2], &temp_matrix)) {
+      gprint (GP_ERR, "failed to write file\n");
+      status = FALSE;
+      goto done1;
+    }
+    status = TRUE;
+  done1:
+    gfits_free_header (&Xhead);
+    gfits_free_header (&temp_header);
+    gfits_free_matrix (&temp_matrix);
+    return (status);
+  }
+  
+  /* the actual write-to-disk goes here */
+  if (!gfits_write_header (argv[2], &temp_header)) {
+    gprint (GP_ERR, "failed to write header\n");
+    gfits_free_header (&temp_header);
+    gfits_free_matrix (&temp_matrix);
+    return (FALSE);
+  }
+  
+  if (!gfits_write_matrix (argv[2], &temp_matrix)) {
+    gprint (GP_ERR, "failed to write matrix\n");
+    gfits_free_header (&temp_header);
+    gfits_free_matrix (&temp_matrix);
+    return (FALSE);
+  }
+
+  gfits_free_header (&temp_header);
+  gfits_free_matrix (&temp_matrix);
+  
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/write_vectors.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/write_vectors.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/write_vectors.c	(revision 15879)
@@ -0,0 +1,151 @@
+# include "data.h"
+
+int write_vectors (int argc, char **argv) {
+  
+  int append;
+  int i, j, Nvec, Ne, N;
+  FILE *f;
+  char **fmtlist, *fmttype;
+  char *p0, *p1, *p2, *format;
+  Vector **vec;
+
+  /* look for format option */
+  format = (char *) NULL;
+  if ((N = get_argument (argc, argv, "-f"))) {
+    remove_argument (N, &argc, argv);
+    format = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  append = FALSE;
+  if ((N = get_argument (argc, argv, "-append"))) {
+    remove_argument (N, &argc, argv);
+    append = TRUE;
+  }
+
+  if (argc < 3) {
+    gprint (GP_ERR, "USAGE: write [-append] [-f \"format\"] file vector vector ...\n");
+    return (FALSE);
+  }
+
+  /* open file for outuput */
+  if (append) {
+      f = fopen (argv[1], "a");
+  } else {
+      f = fopen (argv[1], "w");
+  }
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "can't open file for write\n");
+    return (FALSE);
+  }
+
+  /* find number of output vectors */
+  Nvec = (argc - 2);
+  if (Nvec < 1) {
+      gprint (GP_ERR, "USAGE: write (file) vector vector ...\n");
+      fclose (f);
+      return (FALSE);
+  }
+  ALLOCATE (vec, Vector *, Nvec);
+
+  /* select/check vectors from list */
+  for (i = 0; i < Nvec; i++) {
+    if ((vec[i] = SelectVector (argv[i + 2], OLDVECTOR, FALSE)) == NULL) {
+      gprint (GP_ERR, "unknown vector %s\n", argv[i+2]);
+      gprint (GP_ERR, "USAGE: write (file) vector vector ...\n");
+      free (vec);
+      fclose (f);
+      return (FALSE);    
+    }
+  }
+  
+  /* select vector lengths */
+  Ne = vec[0][0].Nelements;
+  for (i = 0; i < Nvec; i++) {
+    if (vec[0][0].Nelements != Ne) {
+      gprint (GP_ERR, "error: vectors must all be the same size\n");
+      free (vec);
+      fclose (f);
+      return (FALSE);    
+    }
+  }
+
+  /* default output format */
+  if (format == (char *) NULL) {
+    for (i = 0; i < vec[0][0].Nelements; i++) {
+      for (j = 0; j < Nvec; j++) {
+	fprintf (f, "%.10g ", vec[j][0].elements[i]);
+      }
+      fprintf (f, "\n");
+    } 
+    fclose (f);
+    free (vec);
+    return (TRUE);
+  }
+
+  /* construct an array of format strings */
+  ALLOCATE (fmttype, char, Nvec);
+  ALLOCATE (fmtlist, char *, Nvec);
+  for (i = 0; i < Nvec; i++) {
+    ALLOCATE (fmtlist[i], char, 1024);
+    bzero (fmtlist[i], 1024);
+  }
+
+  p0 = format;
+  for (j = 0; j < Nvec; j++) {
+    /* find this format character */
+    p1 = strchr (p0, '%');
+    if (p1 == (char *) NULL) {
+      gprint (GP_ERR, "mismatch between format and values\n");
+      free (fmttype);
+      for (i = 0; i < Nvec; i++) free (fmtlist[i]);
+      free (fmtlist);
+      free (format);
+      fclose (f);
+      return (FALSE);
+    }
+    
+    /* identify type (%NNNNd %NNNNf) */
+    for (p2 = p1 + 1; (*p2 == '.') || (*p2 == '-') || (*p2 == '+') || (*p2 == ' ') || isdigit(*p2); p2++);
+    strncpy (fmtlist[j], p0, p2 - p0 + 1);
+    switch (*p2) {
+      case 'e':
+      case 'f':
+	fmttype[j] = 'f';
+	break;
+      case 'd':
+      case 'c':
+      case 'x':
+	fmttype[j] = 'd';
+	break;
+      default:
+	gprint (GP_ERR, "syntax error in format (only e,f,d,c,x allowed)\n");
+	return (FALSE);
+    }
+    p0 = p2 + 1;
+  }
+  strcat (fmtlist[Nvec-1], p0);
+  
+  for (i = 0; i < vec[0][0].Nelements; i++) {
+    for (j = 0; j < Nvec; j++) {
+      if (fmttype[j] == 'd') {
+	fprintf (f, fmtlist[j], (int)(vec[j][0].elements[i]));
+      } 
+      if (fmttype[j] == 'f') {
+	fprintf (f, fmtlist[j], (float)(vec[j][0].elements[i]));
+      } 
+    }
+    fprintf (f, "\n");
+  }
+  fclose (f);
+
+  free (fmttype);
+  for (i = 0; i < Nvec; i++) free (fmtlist[i]);
+  free (fmtlist);
+  free (format);
+  
+  return (TRUE);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/zap.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/zap.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/zap.c	(revision 15879)
@@ -0,0 +1,43 @@
+# include "data.h"
+
+int zap (int argc, char **argv) {
+
+  int i, j, N;
+  int sx, sy, nx, ny;
+  float *V, value;
+  Buffer *buf;
+
+  value = 0;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    remove_argument (N, &argc, argv);
+    value  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: zap <buffer> sx sy nx ny [-v value]\n");
+    return (FALSE);
+  }
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+
+  sx = atof (argv[2]);
+  sy = atof (argv[3]);
+  nx = atof (argv[4]);
+  ny = atof (argv[5]);
+
+  if (sx < 0) goto error;
+  if (sy < 0) goto error;
+  if (sx + nx > buf[0].matrix.Naxis[0]) goto error;
+  if (sy + ny > buf[0].matrix.Naxis[1]) goto error;
+
+  for (j = sy; j < sy + ny; j++) {
+    V = (float *)(buf[0].matrix.buffer) + j*buf[0].matrix.Naxis[0] + sx; 
+    for (i = 0; i < nx; i++, V++) *V = value;
+  }
+  return (TRUE);
+
+ error:
+  gprint (GP_ERR, "region out of range\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/zplot.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/zplot.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/cmd.data/zplot.c	(revision 15879)
@@ -0,0 +1,55 @@
+# include "data.h"
+
+int zplot (int argc, char **argv) {
+  
+  int i, kapa, Npts;
+  float *in, *out;
+  double min, range;
+  Graphdata graphmode;
+  Vector *xvec, *yvec, *zvec, Zvec;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return (FALSE);
+
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: zplot <x> <y> <z> min max\n");
+    return (FALSE);
+  }
+
+  min = atof(argv[4]);
+  range = atof(argv[5]) - min;
+
+  /* find vectors */
+  if ((xvec = SelectVector (argv[1], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yvec = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((zvec = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if (xvec[0].Nelements != yvec[0].Nelements) {
+    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[1], argv[2]);
+    return (FALSE);
+  }
+  if (xvec[0].Nelements != zvec[0].Nelements) {
+    gprint (GP_ERR, "vectors %s and %s not the same length\n", argv[1], argv[3]);
+    return (FALSE);
+  }
+  Zvec.Nelements = zvec[0].Nelements;
+  ALLOCATE (Zvec.elements, float, Zvec.Nelements);
+ 
+  in = zvec[0].elements;
+  out = Zvec.elements;
+  for (i = 0; i < Zvec.Nelements; i++, in++, out++) {
+    *out = MIN (1.0, MAX (0.01, (*in - min) / range));
+  }
+
+  /* point size determined by Zvec */
+  graphmode.style = 2; /* plot points */
+  graphmode.size = -1; /* point size determined by Zvec */
+  graphmode.etype = 0; /* no errorbars */
+  Npts = xvec[0].Nelements;
+  PlotVectorTriplet (kapa, Npts, xvec[0].elements, yvec[0].elements, Zvec.elements, &graphmode);
+
+  free (Zvec.elements);
+
+  return (TRUE);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Analysis.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Analysis.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Analysis.c	(revision 15879)
@@ -0,0 +1,112 @@
+# include "dimm.h"
+
+/* should this all be wrapped within an opihi implementation? */
+
+int subtractImage (Image *a, Image *b) {
+
+  if (a[0].Nx != b[0].Nx) return (FALSE);
+  if (a[0].Ny != b[0].Ny) return (FALSE);
+
+  Npix = a[0].Nx*a[0].Ny;
+  ap = (float *) a[0].buffer;
+  bp = (float *) b[0].buffer;
+  for (i = 0; i < Npix; i++, ap++, bp++) {
+    *ap -= *bp;
+  }
+  return (FALSE);
+}
+
+void statsImage (Image *image, Stats *stats) {
+
+  val = (float *)image[0].buffer;
+  max = min = val[0];
+  Npix = image[0].Nx*image[0].Ny;
+  for (i = 0; i < Npix; i++, val++) {
+    N1 += *val;
+    N2 += (*val)*(*val);
+    max = MAX (max, *val);
+    min = MIN (min, *val);
+  }
+  stats[0].mean  = N1 / Npix;
+  stats[0].sigma = sqrt (N2 / Npix - SQ(stats[0].mean));
+  stats[0].min = min;
+  stats[0].max = max;
+
+  stats[0].median = stats[0].mean;
+  range = MAX (0.5, 0xffff / (max - min));
+  if (range == 0) return;
+
+  ALLOCATE (hist, int, 0x10000);
+  bzero (hist, 0x10000*sizeof(int));
+
+  val = (float *)image[0].buffer;
+  for (i = 0; i < Npix; i++) {
+    bin = MIN (MAX (0, (*val - min) * range), 0xffff);
+    hist[bin] ++;
+  }
+
+  Nhist = 0;
+  for (i = 0; (i < 0xffff) && (Nhist < 0.5*Npix); i++) 
+    Nhist += hist[i];
+  stats[0].median = i / range + min;
+  free (hist);
+
+  return;
+}
+
+# if (0)
+void findStars (Image *image, Stars **stars, int *Nstars, double threshold) {
+
+  /* binarize @ threshold */
+
+  binimage = createImage (image[0].Nx, image[0].Ny);
+
+  Npix = image[0].Nx*image[0].Ny;
+  ap = image[0].buffer;
+  bp = binimage[0].buffer;
+  bzero (bp, Npix*sizeof (short));
+
+  for (i = 0; i < Npix; i++, ap++, bp++) {
+    if (*ap > threshold) * bp = 1;
+  }
+
+  clearpix ();
+
+  for (i = 0; i < Ny; i++) {
+    for (j = 0; j < Nx; j++) {
+      pix = j + i*Ny;
+      if (binimage.buffer[pix]) {
+	addpix (pix);
+	binimage.buffer[pix] = 0;
+	/* continue in row to end */
+	for (k = j + 1; k < Nx; k++) {
+	  pix = k + i*Nx;
+	  if (!binimage.buffer[pix]) { 
+	  }
+	}
+
+# endif
+
+/* find stars: 
+   - binarize @ threshold
+   - find all contiguous blobs
+   - find geom center of each blob
+*/
+
+
+
+/*
+
+.....................
+....x................
+...xxx...............
+....x...xxx..........
+.........xx..........
+.....................
+.....................
+.....................
+.....................
+.....................
+
+
+ */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Camera.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Camera.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Camera.c	(revision 15879)
@@ -0,0 +1,223 @@
+# include "dimm.h"
+
+static struct sbig_init info;
+
+int InitCamera (int port) {
+  
+  int i, state;
+
+  for (i = 0; i < 10; i++) {
+    state = sbig_init (port, SBIG_IMAGING_CCD, &info);
+    if (state == -6) state = 0;
+    if (state ==  0) {
+      DumpCameraInfo ();
+      return (TRUE);
+    }
+    gprint (GP_ERR, "retry...\n");
+  }
+  
+  gprint (GP_ERR, "failed to init sbig camera on %d\n", port);
+  gprint (GP_ERR, "%s\n", sbig_show_error (state));
+  return (FALSE);
+}
+
+void DumpCameraInfo () {
+
+      gprint (GP_ERR, "opened sbig camera:\n");
+      gprint (GP_ERR, "linux_version: %f\n",      info.linux_version);
+      gprint (GP_ERR, "nmbr_bad_columns: %d\n",   info.nmbr_bad_columns);
+      gprint (GP_ERR, "imaging_abg_type: %d\n",   info.imaging_abg_type);
+      gprint (GP_ERR, "serial_number: %s\n",      info.serial_number);
+      gprint (GP_ERR, "firmware_version: %d\n",   info.firmware_version);
+      gprint (GP_ERR, "camera_name: %s\n",        info.camera_name);
+      gprint (GP_ERR, "nmbr_readout_modes: %d\n", info.camera_info[0].nmbr_readout_modes);
+      gprint (GP_ERR, "mode: %d\n",               info.camera_info[0].readout_mode[0].mode);
+      gprint (GP_ERR, "width: %d\n",              info.camera_info[0].readout_mode[0].width);
+      gprint (GP_ERR, "height: %d\n",             info.camera_info[0].readout_mode[0].height);
+      gprint (GP_ERR, "gain: %d\n",               info.camera_info[0].readout_mode[0].gain);
+      gprint (GP_ERR, "pixel_width: %d\n",        info.camera_info[0].readout_mode[0].pixel_width);
+      gprint (GP_ERR, "pixel_height: %d\n",       info.camera_info[0].readout_mode[0].pixel_height);
+
+      gprint (GP_ERR, "ST5_AD_size: %d\n", info.ST5_AD_size);
+      gprint (GP_ERR, "ST5_filter_type: %d\n", info.ST5_filter_type);
+}      
+
+void CameraFullSize (int *x, int *y) {
+  *x = info.camera_info[0].readout_mode[0].width;
+  *y = info.camera_info[0].readout_mode[0].height;
+}
+
+int SetTemperature (double temp) {
+
+  int state;
+  struct sbig_cool cool;
+
+  if (temp < -50) return (FALSE);
+  if (temp > +20) return (FALSE);
+
+  cool.regulation = SBIG_TEMP_REGULATION_ON;
+  cool.temperature = (int) (10.0*temp + 0.5);
+  cool.direct_drive = 0;
+
+  state = sbig_set_cooling (&cool);
+  if (state < 0) {
+    gprint (GP_ERR, "sbig error: %s\n", sbig_show_error (state));
+    return (FALSE);
+  }
+  return (TRUE);
+}
+
+double GetTemperature () {
+
+  int state;
+  double temp;
+  struct sbig_status status;
+
+  state = sbig_get_status (&status);
+  if (state < 0) {
+    gprint (GP_ERR, "sbig error: %s\n", sbig_show_error (state));
+    return (-200.0);
+  }
+  temp = (status.ccd_temperature - 0.5) / 10.0;
+  return (temp);
+}
+
+int DumpCameraStatus () {
+
+  int state;
+  double temp;
+  struct sbig_status status;
+
+  state = sbig_get_status (&status);
+  if (state < 0) {
+    gprint (GP_ERR, "sbig error: %s\n", sbig_show_error (state));
+    return (FALSE);
+  }
+
+  gprint (GP_ERR, "imaging_ccd_status: %d\n", status.imaging_ccd_status);
+  gprint (GP_ERR, "tracking_ccd_status: %d\n", status.tracking_ccd_status);
+  gprint (GP_ERR, "fan_on: %d\n", status.fan_on);
+  gprint (GP_ERR, "shutter_state: %d\n", status.shutter_state);
+  gprint (GP_ERR, "led_state: %d\n", status.led_state);
+  gprint (GP_ERR, "shutter_edge: %d\n", status.shutter_edge);
+  gprint (GP_ERR, "plus_x_relay: %d\n", status.plus_x_relay);
+  gprint (GP_ERR, "minus_x_relay: %d\n", status.minus_x_relay);
+  gprint (GP_ERR, "plus_y_relay: %d\n", status.plus_y_relay);
+  gprint (GP_ERR, "minus_y_relay: %d\n", status.minus_y_relay);
+  gprint (GP_ERR, "pulse_active: %d\n", status.pulse_active);
+  gprint (GP_ERR, "temperature_regulation: %d\n", status.temperature_regulation);
+  gprint (GP_ERR, "temperature_setpoint: %d\n", status.temperature_setpoint);
+  gprint (GP_ERR, "cooling_power: %d\n", status.cooling_power);
+  gprint (GP_ERR, "air_temperature: %d\n", status.air_temperature);
+  gprint (GP_ERR, "ccd_temperature: %d\n", status.ccd_temperature);
+
+  return (TRUE);
+}
+
+/* block until exposure is complete */
+int Exposure (double exptime) {
+
+  int i, state;
+  struct sbig_expose expose;
+  struct sbig_status status;
+
+  expose.ccd = SBIG_IMAGING_CCD;
+  expose.exposure_time = (int)(100.0*exptime);
+  expose.abg_state = SBIG_ABG_OFF;
+  expose.shutter = SBIG_EXPOSE_SHUTTER_NORMAL;  /* shuttermode = ? */
+
+  /* drop this ? */
+  /* usleep ((int)(exptime*1000000)); */
+  state = sbig_expose (&expose);
+  if (state < 0) {
+    gprint (GP_ERR, "exposure error\n");
+    gprint (GP_ERR, "%s\n", sbig_show_error (state));
+    return (FALSE);
+  }
+  
+  for (i = 0; i < expose.exposure_time + 10; ++i) {
+    state = sbig_get_status (&status);
+    /* gprint (GP_ERR, "%d\n", state); */
+    /* gprint (GP_ERR, "%d  %d\n", status.imaging_ccd_status, status.shutter_state); */
+    /*    if (state == 0) return (TRUE); */
+    if (status.imaging_ccd_status == -SBIG_NO_EXPOSURE_IN_PROGRESS) return (TRUE);
+    if (status.imaging_ccd_status == -SBIG_EXPOSURE_IN_PROGRESS) {
+      usleep (10000);
+      continue;
+    }
+    gprint (GP_ERR, "exposure error\n");
+    gprint (GP_ERR, "%s\n", sbig_show_error (state));
+    return (FALSE);
+  }
+  gprint (GP_ERR, "exposure timeout\n");
+  return (FALSE);
+}
+
+int   readout_abort;
+float readout_percent;
+static int readout_callback (float percent) {
+  /* return 1 to continue, 0 to abort */
+  if (((int)(percent) % 10) == 0) { gprint (GP_ERR, "."); }
+  readout_percent = percent;
+  if (readout_abort) return 0;
+  return 1;
+}
+
+int ReadOut (int x, int y, int dx, int dy, int binning, unsigned short *buffer) {
+
+  int state, Nbytes;
+  static struct sbig_readout readout;
+
+  readout.x = x;
+  readout.y = y;
+  readout.width  = dx;
+  readout.height = dy;
+
+  Nbytes = readout.width*readout.height*sizeof(short);
+
+  /* for bin 2x2 or 3x3, need to adjust dx, dy above */
+  readout.ccd = SBIG_IMAGING_CCD;
+  readout.binning = SBIG_BIN_1X1;
+  readout.data = buffer;
+  readout.data_size_in_bytes = Nbytes;
+  readout.callback = readout_callback;
+    
+  gprint (GP_ERR, "%d, %d : %d x %d\n", readout.x, readout.y, readout.width, readout.height);
+  sync (); 
+  readout_abort = FALSE;
+  state = sbig_readout (&readout);
+  gprint (GP_ERR, "\n");
+  if (state < 0) {
+    gprint (GP_ERR, "sbig error: %s\n", sbig_show_error (state));
+    return (FALSE);
+  }
+  return (TRUE);
+}
+
+int OpenShutter () {
+
+  int state;
+  struct sbig_control control;
+
+  control.shutter = SBIG_OPEN_SHUTTER;
+  state = sbig_control (&control);
+  if (state < 0) {
+    gprint (GP_ERR, "sbig error: %s\n", sbig_show_error (state));
+    return (FALSE);
+  }
+  return (TRUE);
+}
+
+int CloseShutter () {
+
+  int state;
+  struct sbig_control control;
+
+  control.shutter = SBIG_CLOSE_SHUTTER;
+  state = sbig_control (&control);
+  if (state < 0) {
+    gprint (GP_ERR, "sbig error: %s\n", sbig_show_error (state));
+    return (FALSE);
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Image.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Image.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Image.c	(revision 15879)
@@ -0,0 +1,85 @@
+# include "dimm.h"
+
+/*** this uses an Image structure from DIMM which 
+     is different from the Image structure in DVO ***/
+
+static Image *images = (Image *) NULL;
+static int   Nimages = 0;
+
+Image *createImage (int Nx, int Ny) {
+
+  int N;
+
+  if (Nx*Ny <= 0) return ((Image *) NULL);
+
+  N = Nimages;
+  Nimages ++;
+  if (images == (Image *) NULL) {
+    ALLOCATE (images, Image, MAX (1, Nimages));
+  } else {
+    REALLOCATE (images, Image, MAX (1, Nimages));
+  }
+
+  images[N].Nx = Nx;
+  images[N].Ny = Ny;
+  images[N].Nbytes = Nx*Ny*sizeof (short);
+  ALLOCATE (images[N].buffer, char, images[N].Nbytes);
+
+  return (&images[N]);
+}
+
+int freeImage (Image *entry) {
+
+  int i, j, N;
+
+  N = -1;
+  for (i = 0; (i < Nimages) && (N == -1) ; i++) {
+    if (&images[i] == entry) N = i;
+  }
+  if (N == -1) return (FALSE);
+
+  free (images[N].buffer);
+
+  for (j = N; j < Nimages - 1; j++) {
+    images[j] = images[j+1];
+  }
+
+  Nimages --;
+  REALLOCATE (images, Image, MAX (1, Nimages));
+  return (TRUE);
+}
+
+int writeImage (char *filename, Image *image) {
+
+  Header header;
+  Matrix matrix;
+
+  gfits_init_header (&header);
+
+  header.Naxes = 2;
+  header.Naxis[0] = image[0].Nx;
+  header.Naxis[1] = image[0].Ny;
+  header.bitpix = 16;
+
+  gfits_create_header (&header);
+  gfits_create_matrix (&header, &matrix);
+  free (matrix.buffer);
+
+  matrix.buffer = image[0].buffer;
+  
+  /* write meta-data to header */
+  gfits_print (&header, "RA", "%lf", 1, image[0].ra);
+  gfits_print (&header, "DEC", "%lf", 1, image[0].dec);
+  gfits_print (&header, "EQUINOX", "%lf", 1, 2000.0);
+
+  gfits_print (&header, "AIRMASS", "%lf", 1, image[0].airmass);
+  gfits_print (&header, "CCDTEMP", "%lf", 1, image[0].ccdtemp);
+  gfits_print (&header, "AIRTEMP", "%lf", 1, image[0].airtemp);
+  gfits_print (&header, "EXPTIME", "%lf", 1, image[0].exptime);
+
+  gfits_write_header (filename, &header);
+  gfits_write_matrix (filename, &matrix);
+  
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Makefile	(revision 15879)
@@ -0,0 +1,70 @@
+default: dimm
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+SRC     =       $(HOME)/dimm
+DATA    =       $(DESTDATA)/dimm
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+LIBS1   =       -lbasiccmd -ldatacmd -lastrocmd -lshell -ldata -lsbig
+LIBS2   =       -ldvo -lkapa -lFITS -lohana
+FULL_CFLAGS   = $(BASE_CFLAGS)
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(LIBS1) $(LIBS2) $(BASE_LDFLAGS)
+
+# dimm user commands and support functions #####################
+funcs = \
+$(SRC)/Camera.$(ARCH).o		\
+$(SRC)/Serial.$(ARCH).o		\
+$(SRC)/Telescope.$(ARCH).o             
+
+cmds = \
+$(SRC)/init.$(ARCH).o		  	\
+$(SRC)/dimm.$(ARCH).o		  	\
+$(SRC)/altaz.$(ARCH).o		  	\
+$(SRC)/camera.$(ARCH).o	  	\
+$(SRC)/findstars.$(ARCH).o	  	\
+$(SRC)/telescope.$(ARCH).o   \
+$(SRC)/version.$(ARCH).o
+
+libs = \
+$(DESTLIB)/libshell.a \
+$(DESTLIB)/libdata.a \
+$(DESTLIB)/libbasiccmd.a \
+$(DESTLIB)/libastrocmd.a \
+$(DESTLIB)/libdatacmd.a \
+$(DESTLIB)/libsbig.a
+
+dimm: sbig $(BIN)/dimm.$(ARCH)
+$(SRC)/dimm.$(ARCH).o : $(libs)
+$(BIN)/dimm.$(ARCH)   : $(funcs) $(cmds)
+
+install: $(DESTBIN)/dimm help modules
+
+help: cmd.basic.help cmd.data.help cmd.astro.help dimm.help
+
+modules: dimm.modules
+
+# SBIG install functions
+sbig: $(DESTINC)/sbig.h $(DESTLIB)/libsbig.a
+	@echo sbig code installed
+
+$(DESTINC)/sbig.h:	$(SRC)/sbig/sbig.h
+	cp $(SRC)/sbig/sbig.h $(DESTINC)/sbig.h
+
+$(DESTLIB)/libsbig.a:	$(SRC)/sbig/sbig.a
+	cp $(SRC)/sbig/sbig.a $(DESTLIB)/libsbig.a
+
+$(SRC)/sbig/sbig.a: $(SRC)/sbig/sbig.a.src
+	cp $(SRC)/sbig/sbig.a.src $(SRC)/sbig/sbig.a
+
+.PHONY: dimm
+
+# are these used or replaced?
+# $(SRC)/analysis.$(ARCH).o	  	\
+# $(SRC)/Analysis.$(ARCH).o            \
+# $(SRC)/Image.$(ARCH).o		\
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Serial.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Serial.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Serial.c	(revision 15879)
@@ -0,0 +1,388 @@
+# include "dimm.h"
+# include <termios.h>
+
+# define CR   0x0D
+# define LF   0x0A
+# define BEEP 0x07
+# define OPENERR    -1   /* Port could not be opened */
+# define PORTERR    -2   /* Opened port is not a serial (tty) port */
+# define BADCMDERR  -3   /* Command sent to camera is not understood */
+# define TIMEOUTERR -4   /* No response */
+ 
+# define SER_VERBOSE 0
+# define SER_DEBUG   0
+
+# ifndef SER_VERBOSE
+# define SER_VERBOSE 1           /* Be verbose? */
+# endif
+# ifndef SER_DEBUG 
+# define SER_DEBUG 1
+# endif
+
+/* Defines for Serial Port  */
+typedef struct {
+  int f;
+  int rate;
+  int parity;
+  int bits;
+  int stpbit;
+  char port[64];
+} Serial;
+
+static Serial serial = {0, 0, 0, 0, 0};
+static int SER_ECHO = 0;
+
+int SerialOpen (char *);
+
+int SerialVerbose (int mode) {
+
+  SER_ECHO = mode;
+  return (TRUE);
+
+}
+
+int SerialInit (char *port) {
+  
+  strcpy (serial.port, port);
+  serial.rate = 2400;
+  serial.rate = 9600;
+  serial.parity = 0;
+  serial.bits = 8;
+  serial.stpbit = 1;
+  
+  serial.f = SerialOpen (serial.port);
+  if (serial.f <= 0) {
+    gprint (GP_ERR, "Error opening serial port %s - error %d.\n", serial.port, serial.f);
+    return (FALSE);
+  }
+  if (SerialBaudRate (serial.f, serial.rate))   return (FALSE);
+  if (SerialParity   (serial.f, serial.parity)) return (FALSE);
+  if (SerialDataBits (serial.f, serial.bits))   return (FALSE);
+  if (SerialStopBit  (serial.f, serial.stpbit)) return (FALSE);
+  return (TRUE);
+}
+
+/********************************** Open *********************************/
+int SerialOpen (char *port) {
+  
+  int err = 0;
+  struct termios term;
+  char prefix[100];
+  int fdesc = -1;
+  int locked;
+  struct flock lock;
+   
+  /* open serial line */
+   if (SER_VERBOSE) printf ("Opening the serial port %s for read/write.\n", port);
+   fdesc = open (port, O_RDWR);
+   if (fdesc == -1) {
+     if (SER_VERBOSE) gprint (GP_ERR, "Cannot open %s for read/write.\n", port);
+     return OPENERR;
+   }
+   /* lock serial line */
+   lock.l_type = F_WRLCK;
+   lock.l_len = 0;
+   lock.l_start = 0;
+   lock.l_whence = 0;
+   locked = fcntl (fdesc, F_SETLK, &lock);
+   if (locked == -1) {
+     gprint (GP_ERR, "can't lock serial line\n");
+     close (fdesc);
+     return OPENERR;
+   }
+
+   /* Get the serial port's attributes... */
+   if (tcgetattr (fdesc, &term) == -1) {
+      if (SER_VERBOSE) gprint (GP_ERR, "Port is not a tty\n");
+      return PORTERR;
+   }
+
+   /* cfmakeraw (&term); */
+   term.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+   term.c_oflag &= ~OPOST;
+   term.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+   term.c_cflag &= ~(CSIZE|PARENB);
+   term.c_cflag |= CS8;
+   term.c_cc[VMIN] = 0;     /* MIN setting...if 0, wait only for timeout */
+   term.c_cc[VTIME] = 2;    /* TIME setting...wait at most 1 sec for response 
+		              (ignored if c_cc[VMIN]>0) */
+   tcsetattr (fdesc, TCSAFLUSH, &term);
+
+# if (0)   
+   term.c_lflag &= ~ICANON; /* Turn OFF canonical input 
+ 	                      (so it does it character by character) */
+   term.c_cc[VMIN] = 0;     /* MIN setting...if 0, wait only for timeout */
+   term.c_cc[VTIME] = 10;    /* TIME setting...wait at most 1 sec for response 
+		              (ignored if c_cc[VMIN]>0) */
+   term.c_lflag &= ~ECHO;   /* Turn OFF echoing... */
+   term.c_iflag &= ~ICRNL;   /* Don't map CR to NL on input */
+
+   /* Set port (terminal) to reflect the change...(flush first) */
+   tcsetattr (fdesc, TCSAFLUSH, &term);
+# endif
+
+   return fdesc;
+}
+
+/******************************* Baud Rate *******************************/
+int SerialBaudRate (int fdesc, int rate) {
+   int err = 0;
+   struct termios term;
+
+  /* Get the serial port's attributes... */
+   if (SER_VERBOSE) printf("Setting the serial port's baud rate.\n");
+   if (tcgetattr (fdesc, &term) == -1) {
+      if (SER_VERBOSE) gprint (GP_ERR, "Port is not a tty\n");
+      return PORTERR;
+   }
+ 
+   /* Set the input and output baud rates to 'rate'... */
+   switch (rate) { 
+   case 1200:         /* Set speed to 1200 */ 
+      if (cfgetospeed(&term) != B1200) cfsetospeed(&term, B1200);
+      if (cfgetispeed(&term) != B1200) cfsetispeed(&term, B1200);
+      break;
+   case 2400:         /* Set speed to 2400 */ 
+      if (cfgetospeed(&term) != B2400) cfsetospeed(&term, B2400);
+      if (cfgetispeed(&term) != B2400) cfsetispeed(&term, B2400);
+      break;
+   case 9600:         /* Set speed to 9600 */
+      if (cfgetospeed(&term) != B9600) cfsetospeed(&term, B9600);
+      if (cfgetispeed(&term) != B9600) cfsetispeed(&term, B9600);
+      break;
+   case 19200:        /* Set speed to 19200 */ 
+      if (cfgetospeed(&term) != B19200) cfsetospeed(&term, B19200);
+      if (cfgetispeed(&term) != B19200) cfsetispeed(&term, B19200);
+      break;
+   default:
+      printf ("ERROR:  Unknown Baud Rate\n"); 
+      break;
+   }	
+
+   /* Set port (terminal) to reflect the change...(flush first) */
+   tcsetattr(fdesc, TCSAFLUSH, &term);
+   return (FALSE);
+}
+
+/****************************** Parity ********************************/
+int SerialParity (int fdesc, int parity) { 
+   int err=0;
+   struct termios term;
+   char *prefix = "/dev/term/";
+
+   /* Get the serial port's attributes... */
+   if (SER_VERBOSE) printf("Setting the serial port's parity.\n");
+   if (tcgetattr(fdesc, &term) == -1) {
+      if (SER_VERBOSE) gprint (GP_ERR, "Port is not a tty\n");
+      return PORTERR;
+   }
+
+   if (parity == 0)              /* Turn off parity generation... */
+      term.c_cflag &= ~PARENB;     
+   else if (parity == 1) {            
+      term.c_cflag |= PARENB;     /* Turn on parity generation... */
+      term.c_cflag |= PARODD;     /* Sets parity to odd */ 
+   }	 
+   else if (parity == 2)         /* Turn on parity generation... */
+      term.c_cflag |= PARENB;     /* Defaults parity to even */ 
+   else 
+      printf ("ERROR:  Unknown parity specification\n");
+ 
+   /* Set port (terminal) to reflect the change...(flush first) */
+   tcsetattr(fdesc, TCSAFLUSH, &term);
+   return (FALSE);
+}
+
+/****************************Data Bit Size ***************************/
+int SerialDataBits(int fdesc, int bits) { 
+   int err=0;
+   struct termios term;
+
+   /* Get the serial port's attributes... */
+   if (SER_VERBOSE) printf("Setting the serial port's data bit size.\n");
+   if (tcgetattr(fdesc, &term) == -1) {
+      if (SER_VERBOSE) gprint (GP_ERR, "Port is not a tty\n");
+      return PORTERR;
+   }
+
+   switch (bits) {
+   case 5:  			/* Sets data bits to 5 */
+      term.c_cflag &= ~CSIZE; 
+      term.c_cflag |= CS5;
+      break; 
+   case 6:   			/* Sets data bits to 6 */ 
+      term.c_cflag &= ~CSIZE; 
+      term.c_cflag |= CS6;
+      break; 
+   case 7:     		/* Sets data bits to 7 */ 
+      term.c_cflag &= ~CSIZE; 
+      term.c_cflag |= CS7;
+      break; 
+   case 8:  			/* Sets data bits to 8 */
+      term.c_cflag &= ~CSIZE; 
+      term.c_cflag |= CS8;
+      break; 
+   default:
+      printf ("ERROR:  Illegal data bit size\n");
+      break; 
+   }
+
+   /* Set port (terminal) to reflect the change...(flush first) */
+   tcsetattr(fdesc, TCSAFLUSH, &term);
+   return (FALSE);
+}
+
+/****************************** Stop Bit ****************************/
+int SerialStopBit(int fdesc, int stpbit) { 
+   int err=0;
+   struct termios term;
+
+   /* Get the serial port's attributes... */
+   if (SER_VERBOSE) printf("Setting the serial port's stop bit.\n");
+   if (tcgetattr(fdesc, &term) == -1) {
+      if (SER_VERBOSE) gprint (GP_ERR, "Port is not a tty\n");
+      return PORTERR;
+   }
+
+   if (stpbit == 1) {     		/* Sets stop bit to 1 */  
+      if (term.c_cflag & CSTOPB) term.c_cflag |= CSTOPB;
+   } else { 				/* Else stop bit to 2 */ 
+      term.c_cflag & CSTOPB;
+   }
+
+   /* Set port (terminal) to reflect the change...(flush first) */
+   tcsetattr(fdesc, TCSAFLUSH, &term);
+   return (FALSE);
+}
+
+/**************************** Stop ***********************************/
+void SerialStop (int fdesc) {
+   if (SER_VERBOSE) printf("Closing the serial port.\n");
+   close(fdesc); /* Close up shop... */
+}
+
+# define D_NREAD 1024
+
+/* send a string to the serial port, wait for an answer */
+/* answer is returned on the pointer provided */
+
+/**************************** Command ***********************************/
+int SerialCommand (char *in, char **out, int wait) {
+  
+  int i, j;
+  char *line;
+  int done, Nread, Nin, NREAD;
+  
+  if (SER_ECHO) gprint (GP_ERR, "command: %s\n", in); 
+
+  if (serial.f <= 0) {
+    gprint (GP_ERR, "serial line closed\n"); 
+    if (out != (char **) NULL) {
+      *out = strcreate ("SERIAL OFF");
+      /* return (char *) NULL instead? */
+    }
+    return (FALSE);
+  }
+
+  /* flush out the line */
+  tcflush (serial.f, TCIOFLUSH);
+
+# if (0)
+  for (i = 0; i < strlen(in); i++) {
+    gprint (GP_ERR, "%d %x\n", i, in[i]);
+  }
+# endif
+
+  /* send command to serial line */
+  Nin = write (serial.f, in, strlen(in));
+  if (Nin != strlen(in)) {
+    gprint (GP_ERR, "Serial Command not sent\n");
+    return (FALSE);
+   }
+  usleep (20000);
+  /* LX200 GPS requires some lead time (10msec) to check ready state */
+  
+  /* create space to store answer */
+  NREAD = D_NREAD;
+  ALLOCATE (line, char, NREAD);
+  bzero (line, NREAD);
+  Nread = Nin = 0;
+
+  /* read data back from serial line until no response (Nin == 0) 
+     or timeout (Nin == -1) && (i == wait) */
+
+  done = FALSE;
+  for (i = 0; !done && (i < wait); i++) {
+    Nin = read (serial.f, &line[Nread], 256);
+# if (SER_DEBUG)
+    gprint (GP_ERR, "%d ", Nin);
+# endif
+    if (Nin < 0) { /* error, check value */
+      gprint (GP_ERR, "error?");
+      continue;
+    }
+    if (Nin > 0) {
+      Nread += Nin;
+      line[Nread] = 0;
+      i = 0;
+    }
+    if (Nread > D_NREAD - 257) {
+      NREAD += D_NREAD;
+      REALLOCATE (line, char, NREAD);
+    }
+    if ((i > 0) && (Nin == 0)) done = TRUE;
+    usleep (2000);
+  }
+
+  if (SER_ECHO) gprint (GP_ERR, "answer: %s\n", line);
+
+  if (out == (char **) NULL) {
+    free (line);
+  } else {
+    *out = line;
+  }
+  return (TRUE);
+}
+
+
+/* raw:
+   cfmakeraw sets the terminal attributes as follows:
+   termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
+   termios_p->c_oflag &= ~OPOST;
+   termios_p->c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
+   termios_p->c_cflag &= ~(CSIZE|PARENB);
+   termios_p->c_cflag |= CS8;
+
+   there conditions are turned off:
+   c_iflag:
+       IGNBRK ignore BREAK condition on input
+       BRKINT If IGNBRK is not set, generate SIGINT on BREAK condition, else read BREAK as
+              character \0.
+       PARMRK if  IGNPAR  is  not  set,  prefix a character with a parity error or framing
+              error with \377 \0.  If neither IGNPAR nor PARMRK is set, read  a  character
+              with a parity error or framing error as \0.
+       (IGNPAR ignore framing errors and parity errors.)
+
+       ISTRIP strip off eighth bit
+       INLCR  translate NL to CR on input
+       IGNCR  ignore carriage return on input
+       ICRNL  translate carriage return to newline on input (unless IGNCR is set)
+       IXON   enable XON/XOFF flow control on output
+
+   c_oflag:
+       OPOST  enable implementation-defined output processing
+
+   c_lflag:
+       ECHO   echo input characters.
+       ECHONL if ICANON is also set, echo the NL character even if ECHO is not set.
+       ICANON enable canonical mode.  This enables the special characters EOF, EOL,  EOL2,
+              ERASE, KILL, REPRINT, STATUS, and WERASE, and buffers by lines.
+       ISIG   when any of the characters INTR, QUIT, SUSP, or DSUSP are received, generate
+              the corresponding signal.
+       IEXTEN enable implementation-defined input processing.
+
+   c_cflag:
+       CSIZE  character size mask.  Values are CS5, CS6, CS7, or CS8. (CS8 set).
+       PARENB enable parity generation on output and parity checking for input.
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Telescope.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Telescope.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/Telescope.c	(revision 15879)
@@ -0,0 +1,361 @@
+# include "dimm.h"
+
+# define SER_TIMEOUT 10
+# define SLEW_TIMEOUT 30
+# define dCOS(A)   ((double) cos ((double)RAD_DEG*A))
+# define dSIN(A)   ((double) sin ((double)RAD_DEG*A))
+
+double distSky (double r1, double r2, double d1, double d2) {
+
+  double x1, y1, z1;
+  double x2, y2, z2;
+  double cosT, dist;
+
+  x1 = dCOS (r1) * dCOS (d1);
+  y1 = dSIN (r1) * dCOS (d1);
+  z1 = dSIN (d1);
+
+  x2 = dCOS (r2) * dCOS (d2);
+  y2 = dSIN (r2) * dCOS (d2);
+  z2 = dSIN (d2);
+
+  cosT = x1*x2 + y1*y2 + z1*z2;
+  dist = DEG_RAD * acos (cosT);
+
+  return (dist);
+}
+
+int getRD (double *r, double *d) { 
+
+  int status;
+  char *rastr, *decstr;
+
+  status = SerialCommand (":GR#", &rastr, SER_TIMEOUT);
+  if (!status) return (FALSE);
+
+  status = SerialCommand (":GD#", &decstr, SER_TIMEOUT); 
+  if (!status) return (FALSE);
+
+  status = ohana_str_to_radec (r, d, rastr, decstr);
+  if (!status) return (FALSE);
+
+  free (rastr);
+  free (decstr);
+
+  return (TRUE);
+}
+
+int gotoRD (double r, double d) {
+
+  double R, D, dist;
+  int Ntry, status;
+  char *str, *answer, cmd[64];
+
+  /* error on ra, dec means coords out of range */
+
+  /* set telescope coords, send */
+  str = meade_ra_to_str (r);
+  sprintf (cmd, ":Sr%s#", str);   free (str);
+  status = SerialCommand (cmd, &answer, SER_TIMEOUT);
+  if (!status) return (FALSE); 
+  if (answer == (char *) NULL) return (FALSE); 
+  if (strcmp (answer, "1")) return (FALSE); 
+  free (answer);
+
+  str = meade_dec_to_str (d);
+  sprintf (cmd, ":Sd%s#", str);  free (str);
+  status = SerialCommand (cmd, &answer, SER_TIMEOUT);   
+  if (!status) return (FALSE); 
+  if (answer == (char *) NULL) return (FALSE); 
+  if (strcmp (answer, "1")) return (FALSE); 
+  free (answer);
+
+  Ntry = 0;
+  status = SerialCommand (":MS#", &answer, SER_TIMEOUT);   
+  if (!status) return (FALSE); 
+  if (answer == (char *) NULL) return (FALSE); 
+  if (strcmp (answer, "0")) {
+    gprint (GP_ERR, "error: %s\n", answer);
+    return (FALSE); 
+  }
+  free (answer);
+
+  /* watch for response? */
+  status = FALSE;
+  while (!status) {
+    getRD (&R, &D);
+    dist = distSky (R, r, D, d);
+    if (dist < 0.1) return (TRUE);
+    usleep (100000);
+    Ntry ++;
+    if (Ntry > SLEW_TIMEOUT) return (FALSE);
+  }
+  return (status);
+}
+
+/* actual offsets are x,y, convert to arcmin */
+int offset (char *direction, double distance) {
+
+  /* Four rate choices: 
+     slew   (RS) -  8 degree / sec : rate 1
+     find   (RM) - 30 arcmin / sec : rate 2
+     center (RC) -  4 arcmin / sec : rate 3
+     guide  (RG) - 15 arcsec / sec : rate 4
+
+     communication requires ~1.0 sec:
+     offset should use rate which gives shortest time > 2.0 sec 
+  */
+
+# define NRATE 4
+  static double delay[NRATE]  = {0.1, 0.1, 0.1, 0.1};
+  static double rate[NRATE]   = {480.0, 30.0, 4.0, 0.25};
+  static char rcmd[NRATE][16] = {"RS", "RM", "RC", "RG"};
+
+  int i, status, rsel;
+  char dir, cmd[32];
+  double tsel, dt;
+
+  dir = 0;
+  if (!strcasecmp (direction, "y")) dir = (distance > 0) ? 'n' : 's';
+  if (!strcasecmp (direction, "x")) dir = (distance > 0) ? 'w' : 'e';
+  if (!dir) return (FALSE);
+
+  /* distance is in arcmin */
+  distance = fabs (distance);
+
+  /* logic is bad -- does not catch too small distances */  
+  rsel = -1;
+  tsel = SLEW_TIMEOUT;
+  for (i = 0; i < NRATE; i++) {
+    dt = distance / rate[i] - delay[i];
+    if ((dt > 0) && (dt < tsel)) {
+      rsel = i;
+      tsel = dt;
+    }
+  }
+  if (tsel < 0) {
+    gprint (GP_ERR, "offset %f arcmin below minimum\n", distance);
+    return (FALSE);
+  }
+  if (tsel > SLEW_TIMEOUT) {
+    gprint (GP_ERR, "offset %f arcmin above maximum\n", distance);
+    return (FALSE);
+  }
+  gprint (GP_ERR, "offsetting %c for %f seconds\n", dir, tsel);
+  
+  sprintf (cmd, ":%s#", rcmd[rsel]);
+  status = SerialCommand (cmd, (char **) NULL, SER_TIMEOUT);
+  if (!status) return (FALSE);
+
+  sprintf (cmd, ":M%c#", dir);
+  status = SerialCommand (cmd, (char **) NULL, SER_TIMEOUT);
+  if (!status) return (FALSE);
+
+  usleep ((int)(tsel*1000000));
+
+  sprintf (cmd, ":Q%c#", dir);
+  status = SerialCommand (cmd, (char **) NULL, SER_TIMEOUT);
+  if (!status) return (FALSE);
+
+  return (TRUE);
+}  
+
+/* actual offsets are x,y, convert to arcmin */
+int toffset (char *direction, char *rate, double duration) {
+
+# define NRATE 6
+  /* static char rcmd[NRATE][16] = {"RS", "RM", "RC", "RG"};*/
+  static char rcmd[NRATE][64] = {"RS", "RM", "RC", "RG", "RA0.0085", "RE0.0085"};
+
+  int i, status, rsel;
+  char dir, cmd[32];
+  double tsel, dt;
+
+  dir = 0;
+  if (!strcasecmp (direction, "x")) dir = (duration > 0) ? 'w' : 'e';
+  if (!strcasecmp (direction, "y")) dir = (duration > 0) ? 'n' : 's';
+  if (!dir) return (FALSE);
+  duration = fabs (duration);
+  
+  status = FALSE;
+  for (i = 0; i < NRATE; i++) if (!strcmp (rcmd[i], rate)) status = TRUE;
+  if (!status) {
+    gprint (GP_ERR, "bad rate: %s\n", rate);
+    return (FALSE);
+  }
+
+  sprintf (cmd, ":%s#", rate);
+  status = SerialCommand (cmd, (char **) NULL, SER_TIMEOUT);
+  if (!status) return (FALSE);
+
+  sprintf (cmd, ":M%c#", dir);
+  status = SerialCommand (cmd, (char **) NULL, SER_TIMEOUT);
+  if (!status) return (FALSE);
+
+  usleep ((int)(duration*1000000));
+
+  sprintf (cmd, ":Q%c#", dir);
+  status = SerialCommand (cmd, (char **) NULL, SER_TIMEOUT);
+  if (!status) return (FALSE);
+
+  return (TRUE);
+}  
+
+int getXY (double *x, double *y) {
+
+  char *answer;
+
+  SerialCommand (":GA#", &answer, SER_TIMEOUT);
+  ohana_dms_to_ddd (x, answer);
+  free (answer);
+
+  SerialCommand (":GZ#", &answer, SER_TIMEOUT);
+  ohana_dms_to_ddd (y, answer);
+  free (answer);
+
+  return (TRUE);
+}
+
+/* need error checking on these */
+int setRD (double r, double d) {
+
+  char *str, *answer, cmd[64];
+
+  /* set telescope coords, send */
+  str = meade_ra_to_str (r);
+  sprintf (cmd, ":Sr%s#", str);
+  SerialCommand (cmd, (char **) NULL, SER_TIMEOUT);
+  free (str);
+
+  str = meade_dec_to_str (d);
+  sprintf (cmd, ":Sd%s#", str);
+  SerialCommand (cmd, (char **) NULL, SER_TIMEOUT);
+  free (str);
+
+  SerialCommand (":CM#", &answer, SER_TIMEOUT);
+  gprint (GP_ERR, "result: %s\n", answer);
+  free (answer);
+  return (TRUE);
+}
+
+int setSite (char *sitename, double lon, double lat) {
+
+  struct tm *gmt;
+  struct timeval now;
+  char *str, line[32];
+
+  gprint (GP_ERR, "careful, this causes problems\n");
+  return (FALSE);
+
+  SerialCommand (":W1#", (char **) NULL, SER_TIMEOUT);
+
+  /* Set site name 1 */
+  sprintf (line, ":SM %s#", sitename); 
+  SerialCommand (line, (char **) NULL, SER_TIMEOUT);
+
+  /* Set site long */
+  str = meade_deg_to_str (lon);
+  str[6] = 0;
+  sprintf (line, ":Sg%s#", str); 
+  SerialCommand (line, (char **) NULL, SER_TIMEOUT);
+  free (str);
+
+  /* Set site lat */
+  str = meade_dec_to_str (lat);
+  sprintf (line, ":St%s#", str); 
+  SerialCommand (line, (char **) NULL, SER_TIMEOUT);
+  free (str);
+
+  /* set UTC offset to 0.0: offset + local = gmt */
+  sprintf (line, ":SG+00#");
+  SerialCommand (line, (char **) NULL, SER_TIMEOUT);
+
+  /* Set local */
+  gettimeofday (&now, (struct timezone *) NULL);
+  gmt = gmtime (&now.tv_sec);
+  sprintf (line, ":SL%02d:%02d:%02d#", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec); 
+  SerialCommand (line, (char **) NULL, SER_TIMEOUT);
+
+  return (TRUE);
+}
+
+int setTime (char *lst) {
+
+  struct tm *gmt;
+  struct timeval now;
+  char line[32], *answer;
+
+  /* set UTC offset to 0.0: offset + local = gmt */
+  sprintf (line, ":SG+10#");
+  SerialCommand (line, (char **) NULL, SER_TIMEOUT);
+
+  /* Set local */
+  gettimeofday (&now, (struct timezone *) NULL);
+  gmt = localtime (&now.tv_sec);
+  sprintf (line, ":SL%02d:%02d:%02d#", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec); 
+  SerialCommand (line, (char **) NULL, SER_TIMEOUT);
+
+  /*
+  sprintf (line, ":SS%s#", lst);
+  SerialCommand (line, (char **) NULL, SER_TIMEOUT);
+  */
+
+  return (TRUE);
+}
+
+int getSite (double *lon, double *lat, double *lst) {
+
+  struct tm *gmt;
+  struct timeval now;
+  char *str, *answer, line[32];
+
+  /* : get latitude */
+  SerialCommand (":Gt#", &answer, SER_TIMEOUT);
+  ohana_dms_to_ddd (lat, answer);
+  free (answer);
+
+  /* : get longitude */
+  SerialCommand (":Gg#", &answer, SER_TIMEOUT);
+  ohana_dms_to_ddd (lon, answer);
+  free (answer);
+
+  /* : get LST */
+  SerialCommand (":GS#", &answer, SER_TIMEOUT);
+  ohana_dms_to_ddd (lst, answer);
+  free (answer);
+
+  return (TRUE);
+}
+
+int ParkScope() {
+
+  char *str, *answer, line[32];
+
+  SerialCommand (":hP#", &answer, SER_TIMEOUT);
+  free (answer);
+
+  return (TRUE);
+
+}
+
+int SleepScope() {
+
+  char *str, *answer, line[32];
+  
+  SerialCommand (":hN#", &answer, SER_TIMEOUT);
+  free (answer);
+  
+  return (TRUE);
+
+}
+
+int WakeScope() {
+
+  char *str, *answer, line[32];
+
+  SerialCommand (":hW#", &answer, SER_TIMEOUT);
+  free (answer);
+
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/altaz.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/altaz.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/altaz.c	(revision 15879)
@@ -0,0 +1,88 @@
+# include "dimm.h"
+
+# define dCOS(A)   ((double) cos ((double)RAD_DEG*A))
+# define dSIN(A)   ((double) sin ((double)RAD_DEG*A))
+
+double atan2 (double y, double x);
+
+int altaz (int argc, char **argv) {
+  
+  double alt, az, lat, rot;
+  double ha, dec;
+  double sind, sinh, cosh;
+  char *latstr;
+
+  if (argc != 6) goto usage;
+
+  if (!strcmp (argv[1], "-h")) goto radec;
+  if (!strcmp (argv[1], "-c")) goto altaz;
+
+ radec:
+  /* ha/dec -> alt/az */
+  ha  = atof (argv[2]);
+  dec = atof (argv[3]);
+
+  latstr = get_variable ("LATITUDE");
+  if (latstr == (char *) NULL) {
+    gprint (GP_ERR, "please define $LATITUDE\n");
+    return (FALSE);
+  }
+  lat = atof (latstr);
+  free (latstr);
+ 
+  sind = dSIN (dec) * dSIN (lat) + dCOS (dec) * dCOS (ha) * dCOS (lat);
+  alt  = DEG_RAD * asin (sind);
+
+  sinh = - dCOS (dec) * dSIN (ha);
+  cosh =   dSIN (dec) * dCOS (lat) - dCOS (dec) * dCOS (ha) * dSIN (lat);
+
+  az = DEG_RAD * atan2 (sinh, cosh);
+  set_variable (argv[4], alt);
+  set_variable (argv[5], az);
+
+  sinh = -dCOS(az) * dSIN(alt) * dSIN(ha) * dSIN(lat) + dSIN(az) * dSIN(alt) * dCOS(ha) - dSIN(ha) * dCOS(alt) * dCOS(lat);
+  cosh = -dSIN(az) * dSIN(ha) * dSIN(lat) - dCOS(az) * dCOS(ha);
+  rot = -DEG_RAD * atan2 (sinh, cosh);
+  set_variable ("ROT", rot);
+
+  return (TRUE);
+  
+ altaz:
+  /* alt/az -> ha/dec */
+  alt = atof (argv[4]);
+  az  = atof (argv[5]);
+
+  latstr = get_variable ("LATITUDE");
+  if (latstr == (char *) NULL) {
+    gprint (GP_ERR, "please define $LATITUDE\n");
+    return (FALSE);
+  }
+  lat = atof (latstr);
+  free (latstr);
+
+  sind = dSIN (alt) * dSIN (lat) + dCOS (alt) * dCOS (az) * dCOS (lat);
+  dec  = DEG_RAD * asin (sind);
+
+  sinh = -dCOS (alt) * dSIN (az);
+  cosh =  dSIN (alt) * dCOS (lat) - dCOS (alt) * dCOS (az) * dSIN (lat);
+
+  ha = DEG_RAD * atan2 (sinh, cosh);
+  set_variable (argv[2], ha);
+  set_variable (argv[3], dec);
+
+  sinh = -dCOS(az) * dSIN(alt) * dSIN(ha) * dSIN(lat) + dSIN(az) * dSIN(alt) * dCOS(ha) - dSIN(ha) * dCOS(alt) * dCOS(lat);
+  cosh = -dSIN(az) * dSIN(ha) * dSIN(lat) - dCOS(az) * dCOS(ha);
+  rot = -DEG_RAD * atan2 (sinh, cosh);
+  set_variable ("ROT", rot);
+
+  return (TRUE);
+  
+ usage:
+  gprint (GP_ERR, "USAGE: altaz -h (ha) (dec) (alt) (az)\n");
+  gprint (GP_ERR, "USAGE: altaz -c (ha) (dec) (alt) (az)\n");
+  gprint (GP_ERR, "       -h alt/az to ha/dec, -c ha/dec to alt/az\n");
+  gprint (GP_ERR, "       returned values in variables provided\n");
+  return (FALSE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/analysis.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/analysis.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/analysis.c	(revision 15879)
@@ -0,0 +1,184 @@
+
+/* should this all be wrapped within an opihi implementation? */
+
+typedef struct {
+
+  /* image data area */
+  int Nx, Ny;
+  char *buffer;
+  int Nbytes;
+
+  /* image metadata */
+  double ccdtemp;
+  double airtemp;
+  double ra, dec, airmass;
+  double exptime;
+  int binning;
+} Image;
+
+subtractImage (Image *a, Image *b) {
+
+  if (a[0].Nx != b[0].Nx) return (FALSE);
+  if (a[0].Ny != b[0].Ny) return (FALSE);
+
+  Npix = a[0].Nx*a[0].Ny;
+  ap = (float *) a[0].buffer;
+  bp = (float *) b[0].buffer;
+  for (i = 0; i < Npix; i++, ap++, bp++) {
+    *ap -= *bp;
+  }
+  return (FALSE);
+}
+
+statsImage (Image *image, Stats *stats) {
+
+  val = (float *)image[0].buffer;
+  max = min = val[0];
+  Npix = image[0].Nx*image[0].Ny;
+  for (i = 0; i < Npix; i++, val++) {
+    N1 += *val;
+    N2 += (*val)*(*val);
+    max = MAX (max, *val);
+    min = MIN (min, *val);
+  }
+  stats[0].mean  = N1 / Npix;
+  stats[0].sigma = sqrt (N2 / Npix - SQ(stats[0].mean));
+  stats[0].min = min;
+  stats[0].max = max;
+
+  stats[0].median = stats[0].mean;
+  range = MAX (0.5, 0xffff / (max - min));
+  if (range == 0) return ();
+
+  ALLOCATE (hist, int, 0x10000);
+  bzero (hist, 0x10000*sizeof(int));
+
+  val = (float *)image[0].buffer;
+  for (i = 0; i < Npix; i++) {
+    bin = MIN (MAX (0, (*val - min) * range), 0xffff);
+    hist[bin] ++;
+  }
+
+  Nhist = 0;
+  for (i = 0; (i < 0xffff) && (Nhist < 0.5*Npix); i++) 
+    Nhist += hist[i];
+  stats[0].median = i / range + min;
+  free (hist);
+
+  return ();
+}
+
+findStars (Image *image, Stars **stars, int *Nstars, double threshold) {
+
+  /* binarize @ threshold */
+
+  binimage = createImage (image[0].Nx, image[0].Ny);
+
+  Npix = image[0].Nx*image[0].Ny;
+  ap = image[0].buffer;
+  bp = binimage[0].buffer;
+  bzero (bp, Npix*sizeof (short));
+
+  for (i = 0; i < Npix; i++, ap++, bp++) {
+    if (*ap > threshold) * bp = 1;
+  }
+
+  clearpix ();
+
+  for (j = 0; j < Ny; j++) {
+    for (i = 0; i < Nx; i++) {
+      if (binimage.buffer[j*Nx + i]) {
+	status = fillrow (binimage.buffer, Nx, j*Nx, i, &xs, &xe);
+	for (J = j + 1; (J < Ny) && status; J++) {
+	  for (I = xs; !binimage.buffer[J*Nx + I] && (I < xe); I++);
+	  if (binimage.buffer[J*Nx + I]) {
+	    status = fillrow (binimage.buffer, Nx, J*Nx, I, &xs, &xe);
+	  } 
+	}  
+	/* we now have a stack of pixels, convert to a single star */
+	statpix (&x, &y, image[0].buffer, Nx);
+	addstar (x, y);
+	clearpix ();
+      }
+    }
+  }
+}
+
+/* find contiguous trigger pixels in row from starting point */
+
+int fillrow (float *buffer, int Nx, int offset, int sx, int *xs, int *xe) {
+
+  trigger = FALSE;
+  for (i = sx, pix = offset + i; buffer[pix] && (i < Nx); i++, pix++) {
+    addpix (pix);
+    buffer[pix] = 0;
+    trigger = TRUE;
+    *xe = i;
+  }
+  for (i = sx - 1, pix = offset + i; (i >= 0) && buffer[pix]; i--, pix--) {
+    addpix (pix);
+    buffer[pix] = 0;
+    trigger = TRUE;
+    *xs = i;
+  }
+  return (trigger);
+}
+
+static int Npix = 0;
+static int *Pix = (int *) NULL;
+
+addpix (int pix) {
+  Npix ++;
+  if (Pix == (int *) NULL) {
+    ALLOCATE (Pix, int, MAX (1, Npix));
+  } else {
+    REALLOCATE (Pix, int, MAX (1, Npix));
+  }    
+  Pix[Npix - 1] = pix;
+}
+
+clearpix () {
+  Npix = 0;
+  REALLOCATE (Pix, int, 1);
+}
+
+statpix (double *x, double *y, float *buffer, int Nx) {
+
+  int X, Y;
+  double Sx, Sy, So;
+
+  So = Sx = Sy = 0;
+  for (i = 0; i < Npix; i++) {
+    Y = pix / Nx;
+    X = pix % Nx;
+    So += buffer[pix];
+    Sx += X * buffer[pix];
+    Sy += Y * buffer[pix];
+  }
+  *x = Sx / So;
+  *y = Sy / So;
+}
+
+/* find stars: 
+   - binarize @ threshold
+   - find all contiguous blobs
+   - find geom center of each blob
+*/
+
+
+
+/*
+
+.....................
+....x................
+...xxx...............
+..........xxx..........
+.........xx..........
+.....................
+.....................
+.....................
+.....................
+.....................
+
+
+ */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/camera.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/camera.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/camera.c	(revision 15879)
@@ -0,0 +1,130 @@
+# include "dimm.h"
+# define EXIT_STATUS(S) { seteuid (UID); return (S); }
+
+static uid_t UID, EUID;
+
+SetEUID () {
+
+  /* save the UID (ID of calling process) and EUID (should be root) */
+  UID = getuid ();
+  EUID = geteuid ();
+  seteuid (UID);
+}
+
+int camera (int argc, char **argv) {
+  
+  /* USAGE: 
+     camera init port
+     camera expose exptime
+     camera readout x y dx dy
+     camera temp set value
+     camera temp get var
+  */
+
+  if (argc < 2) goto usage;
+
+  seteuid (EUID);
+  
+  if (!strcasecmp (argv[1], "init")) {
+    int port, status;
+
+    if (argc != 3) {
+      gprint (GP_ERR, "USAGE: camera init (port)\n");
+      EXIT_STATUS (FALSE);
+    }
+    sscanf (argv[2], "%x", &port);
+    status = InitCamera (port);
+    EXIT_STATUS (status);
+  }
+
+  if (!strcasecmp (argv[1], "expose")) {
+
+    int status;
+    double exptime;
+
+    if (argc != 3) {
+      gprint (GP_ERR, "USAGE: camera expose (exptime)\n");
+      EXIT_STATUS (FALSE);
+    }
+    exptime = atof (argv[2]);
+    status = Exposure (exptime);
+    EXIT_STATUS (status);
+  }
+
+  if (!strcasecmp (argv[1], "temp")) {
+
+    int status;
+    double temp;
+
+    if (argc != 3) {
+      gprint (GP_ERR, "USAGE: camera temp (temperature)\n");
+      EXIT_STATUS (FALSE);
+    }
+    temp = atof (argv[2]);
+    status = SetTemperature (temp);
+    EXIT_STATUS (status);
+  }
+
+  if (!strcasecmp (argv[1], "status")) {
+
+    int status;
+    double temp;
+
+    if (argc != 2) {
+      gprint (GP_ERR, "USAGE: camera status\n");
+      EXIT_STATUS (FALSE);
+    }
+    DumpCameraStatus ();
+    EXIT_STATUS (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "readout")) {
+
+    int Nbuf, status;
+    double temp;
+    int x, y, dx, dy, NX, NY;
+    Buffer *buf;
+
+    if ((argc != 7) && (argc != 3)) {
+      gprint (GP_ERR, "USAGE: camera readout (buffer) x y dx dy\n");
+      EXIT_STATUS (FALSE);
+    }
+
+    if ((buf = SelectBuffer (argv[2], OLDBUFFER, TRUE)) == NULL) EXIT_STATUS (FALSE);
+
+    CameraFullSize (&NX, &NY);
+    x = y = 0;
+    dx = NX;
+    dy = NY;
+    if (argc == 7) {
+      x  = atof (argv[3]);
+      y  = atof (argv[4]);
+      dx = atof (argv[5]);
+      dy = atof (argv[6]);
+    } 
+
+    /* generate a buffer to store the image */
+    gfits_free_matrix (&buf[0].matrix);
+    gfits_free_header (&buf[0].header);
+    CreateBuffer (buf, dx, dy, -32, 0.0, 1.0);
+    strcpy (buf[0].file, "(empty)");
+
+    ReadOut (x, y, dx, dy, 1, buf[0].matrix.buffer);
+
+    gfits_convert_format (&buf[0].header, &buf[0].matrix, -32, 1.0, 0.0, gfits_get_unsign_mode());
+
+    EXIT_STATUS (TRUE);
+  }
+
+usage:
+  gprint (GP_ERR, "camera init port\n");
+  gprint (GP_ERR, "camera expose exptime\n");
+  gprint (GP_ERR, "camera readout x y dx dy\n");
+  gprint (GP_ERR, "camera temp set value\n");
+  gprint (GP_ERR, "camera temp get var\n");
+  seteuid (UID);
+  return (FALSE);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/dimm.c.in
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/dimm.c.in	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/dimm.c.in	(revision 15879)
@@ -0,0 +1,61 @@
+# include "opihi.h"
+
+# define opihi_name "DIMM"
+# define opihi_prompt "dimm: "
+# define opihi_description "DIMM telescope controller\n"
+# define opihi_history ".dimm"
+# define opihi_rcfile ".dimmrc"
+
+/* program-dependent initialization */
+void program_init (int *argc, char **argv) {
+  
+  auto_break = TRUE;
+
+  /* load the commands used by this implementation */
+  InitBasic ();
+  InitData ();
+  InitAstro ();
+  InitDIMM ();
+
+  rl_readline_name = opihi_name;
+  rl_attempted_completion_function = command_completer;
+
+  set_str_variable ("HISTORY", opihi_history);
+  set_str_variable ("PROMPT", opihi_prompt);
+  set_str_variable ("RCFILE", opihi_rcfile);
+
+  { 
+    char *helpdir;
+    char *modules;
+    static char *datadir = "@DATADIR@";
+    ALLOCATE (helpdir, char, strlen(datadir) + strlen("/help") + 2);
+    sprintf (helpdir, "%s/help", datadir);
+    set_str_variable ("HELPDIR", helpdir);
+    free (helpdir);
+    ALLOCATE (modules, char, strlen(datadir) + strlen("/modules") + 2);
+    sprintf (modules, "%s/modules", datadir);
+    set_str_variable ("MODULES:0", modules);
+    set_int_variable ("MODULES:n", 1);
+    free (modules);
+  }
+  return;
+}
+
+/* standard welcome message */
+void welcome () {
+  gprint (GP_ERR, "\n");
+  gprint (GP_ERR, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
+/* add program-dependent exit functions here */
+void cleanup () {
+  QuitKapa ();
+  return;
+}
+
+/* call to opihi shell */
+int main (int argc, char **argv) {
+  int status;
+  status = opihi (argc, argv);
+  exit (status);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/findstars.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/findstars.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/findstars.c	(revision 15879)
@@ -0,0 +1,152 @@
+# include "dimm.h"
+
+int fillrow (char *buffer, int Nx, int offset, int sx, int *xs, int *xe);
+int addpix (int pix);
+int clearpix ();
+int freepix ();
+int statpix (float *x, float *y, float *buffer, int Nx);
+int addstar (double x, double y);
+
+Vector *vecx, *vecy, *vecf, *vecn;
+
+int findstars (int argc, char **argv) {
+
+  int i, j, I, J, Npix, Nbuf, status;
+  int xs, xe, Nx, Ny;
+  char *binary, *bp;
+  float *ap, threshold, x, y;
+  Buffer *buf;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: findstars (buffer) (threshold)\n");
+    return (FALSE);
+  }
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  threshold = atof (argv[2]);
+
+  if ((vecx = SelectVector ("star_x", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vecy = SelectVector ("star_y", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vecf = SelectVector ("star_f", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vecn = SelectVector ("star_n", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  vecx[0].Nelements = vecy[0].Nelements = 0;
+  vecf[0].Nelements = vecn[0].Nelements = 0;
+
+  REALLOCATE (vecx[0].elements, float, 1);
+  REALLOCATE (vecy[0].elements, float, 1);
+  REALLOCATE (vecf[0].elements, float, 1);
+  REALLOCATE (vecn[0].elements, float, 1);
+
+  /* binarize @ threshold */
+  Nx = buf[0].header.Naxis[0];
+  Ny = buf[0].header.Naxis[1];
+  Npix = Nx*Ny;
+  ALLOCATE (binary, char, Npix);
+
+  ap = (float *) buf[0].matrix.buffer;
+  bp = binary;
+  bzero (bp, Npix);
+
+  for (i = 0; i < Npix; i++, ap++, bp++) {
+    if (*ap > threshold) *bp = 1;
+  }
+
+  for (j = 0; j < Ny; j++) {
+    for (i = 0; i < Nx; i++) {
+      if (binary[j*Nx + i]) {
+	clearpix ();
+	status = fillrow (binary, Nx, j*Nx, i, &xs, &xe);
+	for (J = j + 1; (J < Ny) && status; J++) {
+	  for (I = xs; !binary[J*Nx + I] && (I <= xe); I++);
+	  status = fillrow (binary, Nx, J*Nx, I, &xs, &xe);
+	}  
+	/* we now have a stack of pixels, find geometric center */
+	statpix (&x, &y, (float *)buf[0].matrix.buffer, Nx);
+      }
+    }
+  }
+  freepix ();
+  return (TRUE);
+}
+
+/* find contiguous trigger pixels in row from starting point */
+int fillrow (char *buffer, int Nx, int offset, int sx, int *xs, int *xe) {
+
+  int i, pix, trigger;
+
+  *xe = *xs = sx;
+  trigger = FALSE;
+  for (i = sx, pix = offset + i; buffer[pix] && (i < Nx); i++, pix++) {
+    addpix (pix);
+    buffer[pix] = 0;
+    trigger = TRUE;
+    *xe = i;
+  }
+  for (i = sx - 1, pix = offset + i; (i >= 0) && buffer[pix]; i--, pix--) {
+    addpix (pix);
+    buffer[pix] = 0;
+    trigger = TRUE;
+    *xs = i;
+  }
+  return (trigger);
+}
+
+static int Npixlist = 0;
+static int *pixlist = (int *) NULL;
+
+addpix (int pix) {
+  Npixlist ++;
+  if (pixlist == (int *) NULL) {
+    ALLOCATE (pixlist, int, MAX (1, Npixlist));
+  } else {
+    REALLOCATE (pixlist, int, MAX (1, Npixlist));
+  }    
+  pixlist[Npixlist - 1] = pix;
+}
+
+clearpix () {
+  Npixlist = 0;
+  REALLOCATE (pixlist, int, 1);
+}
+
+freepix () {
+  Npixlist = 0;
+  free (pixlist);
+  pixlist = (int *) NULL;
+}
+
+statpix (float *x, float *y, float *buffer, int Nx) {
+
+  int i, X, Y, pix, Nv, No;
+  double Sx, Sy, So;
+
+  So = Sx = Sy = 0;
+  for (i = 0; i < Npixlist; i++) {
+    pix = pixlist[i];
+    Y = pix / Nx;
+    X = pix % Nx;
+    So += buffer[pix];
+    Sx += X * buffer[pix];
+    Sy += Y * buffer[pix];
+  }
+  *x = Sx / So;
+  *y = Sy / So;
+  gprint (GP_ERR, "%f %f  %f %d\n", *x, *y, So, Npixlist);
+
+  No = vecx[0].Nelements;
+  Nv = No + 1;
+  vecx[0].Nelements = vecy[0].Nelements = Nv;
+  vecf[0].Nelements = vecn[0].Nelements = Nv;
+
+  REALLOCATE (vecx[0].elements, float, MAX (Nv, 1));
+  REALLOCATE (vecy[0].elements, float, MAX (Nv, 1));
+  REALLOCATE (vecf[0].elements, float, MAX (Nv, 1));
+  REALLOCATE (vecn[0].elements, float, MAX (Nv, 1));
+
+  vecx[0].elements[No] = *x;
+  vecy[0].elements[No] = *y;
+  vecf[0].elements[No] = So;
+  vecn[0].elements[No] = Npixlist;
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/init.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/init.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/init.c	(revision 15879)
@@ -0,0 +1,25 @@
+# include "dimm.h"
+
+int altaz           PROTO((int, char **));
+int camera          PROTO((int, char **));
+int findstars       PROTO((int, char **));
+int telescope       PROTO((int, char **));
+int version         PROTO((int, char **));
+
+static Command cmds[] = {  
+  {"altaz",            altaz,            "altaz / celestial coord conversions"},
+  {"camera",           camera,           "camera functions"},
+  {"findstars",        findstars,        "find objects on image"},
+  {"telescope",        telescope,        "telescope communications"},
+  {"version",     version,      "show version information"},
+}; 
+
+void InitDIMM () {
+  
+  int i;
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/sbig/sbig.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/sbig/sbig.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/sbig/sbig.h	(revision 15879)
@@ -0,0 +1,222 @@
+#ifndef _SBIG_H
+#define _SBIG_H
+
+#define VERSION  2.0
+
+struct sbig_init {
+    float linux_version;
+    int	 nmbr_bad_columns;	/* bad columns in imaging CCD */
+    int  bad_columns[4];
+    int  imaging_abg_type;	/* 0 no ABG, 1 ABG present */
+    char serial_number[10];
+    unsigned firmware_version;
+    char  camera_name[64];
+    struct camera_info {
+	int  nmbr_readout_modes;
+	struct readout_mode {
+	    int  mode;
+	    int  width;			/* pixels */
+	    int  height;		/* height */
+	    int  gain;			/* in 0.01 e-/ADU */
+	    unsigned pixel_width;	/* in nanometers */
+	    unsigned pixel_height;	/* in nanometers */
+	} readout_mode[12];
+    } camera_info[2];
+    int ST5_AD_size;
+    int ST5_filter_type;
+};
+extern int  sbig_init(int port, int options, struct sbig_init *);
+
+#define SBIG_IMAGING_CCD 0
+#define SBIG_TRACKING_CCD 1
+
+#define SBIG_CCD_STATUS_IDLE  0
+#define SBIG_CCD_STATUS_IN_PROGRESS  2
+#define SBIG_CCD_STATUS_COMPLETE  3
+
+#define SBIG_CCD_SHUTTER_OPENED  0
+#define SBIG_CCD_SHUTTER_CLOSED  1
+#define SBIG_CCD_SHUTTER_OPENING  2
+#define SBIG_CCD_SHUTTER_CLOSING  3
+
+struct sbig_status {
+    int  imaging_ccd_status;
+    int  tracking_ccd_status;
+    int  fan_on;
+    int  shutter_state;
+    int  led_state;
+    int  shutter_edge;
+    int  plus_x_relay;
+    int  minus_x_relay;
+    int  plus_y_relay;
+    int  minus_y_relay;
+    int  pulse_active;
+    int  temperature_regulation;
+    int  temperature_setpoint;
+    int  cooling_power;
+    int  air_temperature;
+    int  ccd_temperature;
+};
+extern int  sbig_get_status(struct sbig_status *);
+
+
+#define SBIG_LEAVE_SHUTTER  0
+#define SBIG_OPEN_SHUTTER  1
+#define SBIG_CLOSE_SHUTTER  2
+#define SBIG_INITIALIZE_SHUTTER  3
+
+#define SBIG_LED_OFF  0
+#define SBIG_LED_ON  1
+#define SBIG_LED_BLINK_SLOW 2
+#define SBIG_LED_BLINK_FAST 3
+
+struct sbig_control {
+    int  fan_on;
+    int  shutter;
+    int  led;
+};
+extern int  sbig_control(struct sbig_control *);
+
+struct sbig_pulse {
+    int nmbr_pulses;		/* 0 to 255 */
+    int pulse_width;		/* microsec, min 9 */
+    int pulse_interval;		/* microsec, min 27+pulse_width */
+};
+extern int  sbig_pulse(struct sbig_pulse *);
+
+struct sbig_relay {
+    int x_plus_time;
+    int x_minus_time;
+    int y_plus_time;
+    int y_minus_time;
+};
+extern int  sbig_activate_relay(struct sbig_relay *);
+
+
+/*
+ * Shutter control.  0 for no change in shutter (i.e. control of shutter
+ * using SBigControl class), 1 normal shutter (open during exposure,
+ * closed otherwise), 2 shutter closed (for taking dark frames).
+ */
+#define SBIG_EXPOSE_SHUTTER_UNCHANGED  0
+#define SBIG_EXPOSE_SHUTTER_NORMAL  1
+#define SBIG_EXPOSE_SHUTTER_CLOSED  2
+
+struct sbig_expose {
+    int ccd;
+    int exposure_time;
+    int abg_state;
+    int shutter;
+};
+extern int  sbig_expose(struct sbig_expose *);
+
+
+/*
+ *  Terminate the image and read it out.
+ *  Use width == 0 and height == 0 to abort an image with no readout (all
+ *   params other than ccd ignored)
+ */
+#define SBIG_BIN_1X1  0
+#define SBIG_BIN_2X2  1
+#define SBIG_BIN_3X3  2
+
+struct sbig_readout {
+    int ccd;
+    int binning;
+    int x, y;
+    int width, height;
+    unsigned short *data;
+    int data_size_in_bytes;
+    int (*callback)(float percent_complete);
+};
+extern int  sbig_readout(struct sbig_readout *);
+
+#define SBIG_NO_SHUTTER_DELAY  0x0001	/* don't wait for shutter to close */
+struct sbig_readout2 {
+    int flags;				/* see immediately above */
+    int ccd;
+    int binning;
+    int x, y;
+    int width, height;
+    unsigned short *data;
+    int data_size_in_bytes;
+    int (*callback)(float percent_complete);
+};
+extern int  sbig_readout2(struct sbig_readout2 *);
+
+
+#define SBIG_TEMP_REGULATION_OFF  0
+#define SBIG_TEMP_REGULATION_ON  1
+#define SBIG_TEMP_REGULATION_DIRECT_DRIVE  2
+
+/*
+ * Antiblooming gate control values
+ */
+#define SBIG_ABG_OFF  0
+#define SBIG_ABG_LOW  1
+#define SBIG_ABG_MEDIUM  2
+#define SBIG_ABG_HIGH  3
+
+struct sbig_cool {
+    int regulation;		/* 0 off, 1 on, 2 direct_drive */
+    int temperature;		/* in 0.1 deg C, if 'on' */
+    int direct_drive;		/* power [0..255], direct_drive */
+};
+extern int  sbig_set_cooling(struct sbig_cool *);
+
+extern int  sbig_set_ao7_deflection(int x_deflection, int y_deflection);
+
+extern int  sbig_set_ao7_focus(int type);
+
+#define SBIG_AO7_FOCUS_SOFT_CENTER 4
+#define SBIG_AO7_FOCUS_HARD_CENTER  3
+#define SBIG_AO7_FOCUS_STEP_TOWARD_SCOPE 2
+#define SBIG_AO7_FOCUS_STEP_FROM_SCOPE 1
+
+/*
+ *	Return Error Codes
+ *
+ *	These are the error codes returned by the driver
+ *	function.  They are prefixed with CE_ to designate
+ *	them as camera errors.
+ *
+ *      The return codes from the sbig_xxx() routines will
+ *      be the NEGATIVE of these on an error.
+ *
+ */
+#define SBIG_CAMERA_NOT_FOUND	-1
+#define SBIG_EXPOSURE_IN_PROGRESS -2
+#define SBIG_NO_EXPOSURE_IN_PROGRESS -3
+#define SBIG_UNKNOWN_COMMAND	-4
+#define SBIG_BAD_CAMERA_COMMAND	-5
+#define SBIG_BAD_PARAMETER	-6
+#define SBIG_TX_TIMEOUT		-7
+#define SBIG_RX_TIMEOUT		-8
+#define SBIG_NAK_RESBIGIVED	-9
+#define SBIG_CAN_RESBIGIVED	-10
+#define SBIG_UNKNOWN_RESPONSE	-11
+#define SBIG_BAD_LENGTH		-12
+#define SBIG_AD_TIMEOUT		-13
+#define SBIG_CHECKSUM_ERROR	-14
+#define SBIG_EEPROM_ERROR	-15
+#define SBIG_SHUTTER_ERROR	-16
+#define SBIG_UNKNOWN_CAMERA	-17
+#define SBIG_DRIVER_NOT_FOUND	-18
+#define SBIG_DRIVER_NOT_OPEN	-19
+#define SBIG_DRIVER_NOT_CLOSED	-20
+#define SBIG_SHARE_ERROR	-21
+#define SBIG_TSBIG_NOT_FOUND	-22
+#define SBIG_NEXT_ERROR		-23
+#define SBIG_NOT_ROOT		-24
+char *sbig_show_error(int);
+
+/*
+ * IO strategy flags
+ */
+#define SBIG_DISABLE_INTERRUPTS 0x001
+#define SBIG_LOCK_ALL	0x002
+#define SBIG_SHORT_DELAYS 0x004
+#define SBIG_DEFAULT_STRATEGY (SBIG_DISABLE_INTERRUPTS|SBIG_LOCK_ALL)
+void sbig_set_linux_strategy(int);
+
+#endif /* S_BIG_H */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/sbig/sp_ccdcontrol.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/sbig/sp_ccdcontrol.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/sbig/sp_ccdcontrol.c	(revision 15879)
@@ -0,0 +1,472 @@
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <math.h>
+#include <time.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include "sbig.h"
+#include "fh/fh.h" /* CFHT FITS Handling library */
+
+// XXX RHL claims this is not needed
+// #include <values.h>
+
+#define N_FITS_ENTRIES 33
+
+/*
+ * The following hack is needed if you want to use sbig.a w/ libc5
+ */
+#ifndef __bzero
+void __bzero(void* s, int n)
+{
+  memset(s, 0, n);
+}
+#endif
+
+static struct sbig_init info;
+
+static int write_fits(int width, int height, double etime, int binmode, unsigned short *data);
+
+static struct sbig_readout readout;
+
+/*
+ * This is the 'progress' callback
+ * passed to sbig_readout()
+ */
+static int readout_callback(float percent)
+{
+  gprint (GP_ERR, "progress: Reading %d x %d pixels (%d%%)\r",
+	  readout.width, readout.height, (int)percent);
+  /* return 1 to continue, 0 to abort */
+  return 1;
+}
+
+/*
+ *  Start an exposure, wait for it, then download from the camera
+ *  in bands.  This is somewhat complex, since it handles any size
+ *  subimage of the CCD, and bands too.
+ */
+static void take_picture(double etime, int binmode, int shuttermode, int x, int y, int w, int h)
+{
+  int  ret, i, needed;
+  static unsigned short  *buffer;
+  static int  buffer_size;
+  struct sbig_expose  expose;
+  struct sbig_status  status;
+  double  f;
+  
+  expose.ccd = 0; /* Always in imaging mode, not tracking 
+		    since CFHT PF does the tracking*/
+
+  if(binmode<0 || binmode>3){
+    gprint (GP_ERR, "Imaging binmode options: [0=1x1, *1=2x2, 2=3x3]\n");
+    exit(EXIT_FAILURE);
+  }
+  readout.binning=binmode;
+  
+  readout.x=x;
+  readout.y=y;
+  readout.width=w;
+  readout.height=h;
+  if (readout.width == 0) {
+    readout.width =
+      info.camera_info[expose.ccd].readout_mode[readout.binning].width - x;
+  } else
+    if (readout.width + x >
+	info.camera_info[expose.ccd].readout_mode[readout.binning].width) {
+    gprint (GP_ERR, "Raster X or Width parameter out of range.\n");
+    exit(EXIT_FAILURE);
+  }
+
+  if (readout.height == 0) {
+    readout.height =
+      info.camera_info[expose.ccd].readout_mode[readout.binning].height - y;
+  } else
+    if (readout.height + y >
+	info.camera_info[expose.ccd].readout_mode[readout.binning].height) {
+    gprint (GP_ERR, "Raster Y or Height parameter out of range.\n");
+    exit(EXIT_FAILURE);
+  }
+
+  f = etime;
+  expose.exposure_time = (int)(100.0*f);
+  expose.abg_state = SBIG_ABG_OFF; /* SBIG_ABG_MEDIUM */
+
+  expose.shutter = shuttermode;  /* No shutter present */
+
+  sync();
+  ret = sbig_expose(&expose);
+  if (ret < 0)
+    gprint (GP_ERR, "sbig error: %s\n", sbig_show_error(ret));
+  
+  gprint (GP_ERR, "progress: Sleeping for %g seconds\r", 0.01*expose.exposure_time);
+
+  if (expose.exposure_time > 100) {
+    for (i = 0; i < expose.exposure_time; i += 100) {
+      sbig_get_status(&status);
+      gprint (GP_ERR, "progress: Exposure in progress; ccd_status=%d, shutter=%d (%d%%)\r",
+	      status.imaging_ccd_status, status.shutter_state,
+	      i * 100 / expose.exposure_time);
+      sleep(1);
+    }
+  } else
+    usleep(expose.exposure_time*10000);
+  
+  /* wait for exposure to complete */
+  gprint (GP_ERR, "progress: Waiting for controller                             (100%%)\r");
+
+  for (i = 0; i < 1000; ++i) {
+    ret = sbig_get_status(&status);
+    if (ret < 0) {
+      gprint (GP_ERR, "sbig error: %s\n", sbig_show_error(ret));
+      break;
+    }
+    if (status.imaging_ccd_status != 3)
+      gprint (GP_ERR, "logonly: ccd_status=%d\n", status.imaging_ccd_status);
+
+    if (readout.ccd == 0) {
+      if (status.imaging_ccd_status != 2)
+	break;
+    } else {
+      if (status.tracking_ccd_status != 2)
+	break;
+    }
+    usleep(50000);
+  }
+  if (i)
+    gprint (GP_ERR, "warning: Exposure took an extra %g seconds\n", 0.050*i);
+
+  if (i == 1000)
+    gprint (GP_ERR, "error: EXPOSURE DIDN'T FINISH!\n");
+  else
+    gprint (GP_ERR, "progress: Exposure complete                                  (100%%)\n");
+
+  readout.ccd = expose.ccd;
+  readout.binning = readout.binning;
+  needed = readout.height*readout.width*sizeof(short);
+  if (buffer_size < needed) {
+    if (buffer != NULL)
+      free(buffer);
+    buffer = malloc(buffer_size = needed);
+  }
+  readout.data = buffer;
+  readout.data_size_in_bytes = buffer_size;
+  readout.callback = readout_callback;
+    
+  sync();
+  if ((ret = sbig_readout(&readout)) < 0) {
+    gprint (GP_ERR, "sbig error: %s\n", sbig_show_error(ret));
+    return;
+  }
+
+  gprint (GP_ERR, "progress: Writing FITS data to stdout\n");
+
+  if(write_fits(readout.width, readout.height, etime, binmode, buffer)==-1)
+    gprint (GP_ERR, "error: Could not write FITS file to stdout.\n");
+  gprint (GP_ERR, "progress: sp_ccdcontrol done.\n");
+}
+
+static int write_fits(int w, int h, double etime, int binmode, unsigned short *data)
+{
+  HeaderUnit hu;
+  register int i;
+  double datamin = DBL_MAX, datamax = DBL_MIN;
+  unsigned short u;
+  char str[80]; /* For building string FITS headers */
+  time_t date;
+
+  int ret; /* Return value for sbig_status */
+  struct sbig_status sbstat; /* Status structure */
+  
+  /* Get status to add to FITS header */
+  sync();
+  ret = sbig_get_status(&sbstat);
+
+  if (ret < 0) {
+    gprint (GP_ERR, "error: sbig_get_status failed: %s\n", sbig_show_error(ret));
+    exit(EXIT_FAILURE);
+  }
+
+  /* shouldn't we scale this to fit, first? */
+  for (i = w*h; --i >= 0; )
+    {
+      u = data[i];
+      if (u > datamax) datamax = u;
+      if (u < datamin) datamin = u;
+      data[i] = ((u<<8)|(u>>8)) ^ 0x0080; /* -32768 */
+    }
+
+  time(&date);
+
+  hu = fh_create();
+  fh_reserve(hu, 50); /* Reserve space for 50 cards (TCS, Elixir?, etc.) */
+  fh_set_bool(hu, 0., "SIMPLE", 1, "Standard FITS");
+  fh_set_int(hu, 1.0, "BITPIX", 16,"16-bit data");
+  fh_set_int(hu, 2.0, "NAXIS", 2,  "Number of axes");
+  fh_set_int(hu, 2.1, "NAXIS1", w, "Number of pixel columns");
+  fh_set_int(hu, 2.2, "NAXIS2", h, "Number of pixel rows");
+  fh_set_int(hu, 5.0, "PCOUNT",	0, "No 'random' parameters");
+  fh_set_int(hu, 6.0, "GCOUNT",	1, "Only one group");
+
+  strftime(str, sizeof(str)-1, "%Y-%m-%dT%T", gmtime(&date));
+  fh_set_str(hu, 104, "DATE", str, "UTC Date of file creation");
+  strftime(str, sizeof(str)-1, "%a %b %d %H:%M:%S %Z %Y", localtime(&date));
+  fh_set_str(hu, 104.1, "HSTTIME", str, "Local time in Hawaii");
+
+  fh_set_str(hu, 105, "ORIGIN", "CFHT", "Canada-France-Hawaii Telescope");
+
+  fh_set_flt(hu, 141.,"BZERO",	32768.0, 6,	"Zero factor");
+  fh_set_flt(hu, 142.,"BSCALE",	1.0, 2, "Scale factor");
+  fh_set_flt(hu, 150, "DATAMIN", datamin, 6, "Minimum value of the data");
+  fh_set_flt(hu, 151, "DATAMAX", datamax, 6, "Maximum value of the data");
+  fh_set_flt(hu, 160, "SATURATE", 4016.0, 6, "Saturation value");
+
+  fh_set_flt(hu, 220, "EXPTIME", etime, 5, "Integration time (seconds)");
+  sprintf(str, "%d %d", binmode + 1, binmode + 1);
+  fh_set_str(hu, 230, "CCDSUM", str, "Binning factors");
+  fh_set_int(hu, 231, "CCDBIN1", binmode + 1, "Binning factor along first axis");
+  fh_set_int(hu, 232, "CCDBIN2", binmode + 1, "Binning factor along second axis");
+
+  fh_set_com(hu, 1400.0, "COMMENT", "");
+  fh_set_com(hu, 1400.1, "COMMENT", " SBIG status record:");
+  fh_set_com(hu, 1400.2, "COMMENT", "");
+  if (sbstat.imaging_ccd_status==0)
+    fh_set_str(hu, 1500, "DETSTAT", "ok", "(SBIG imaging_ccd_status is 0)");
+  else
+    fh_set_int(hu, 1500, "DETSTAT", sbstat.imaging_ccd_status, "SBIG error!");
+  fh_set_flt(hu, 1500.1, "DETTEM", sbstat.ccd_temperature/10., 3, "Detector temperature");
+  fh_set_int(hu, 1500.2, "DETTEMRG", sbstat.temperature_regulation, "1=set temp 0=set power");
+  fh_set_int(hu, 1500.3, "DETTEMSP", sbstat.temperature_setpoint, "Temperature setpoint");
+  fh_set_int(hu, 1500.4, "DETTEMCP", sbstat.cooling_power, "Cooling power");
+  fh_set_flt(hu, 1510,  "CAMTEM", sbstat.air_temperature/10., 3, "Outside air temperature");
+  fh_set_com(hu, 1600.0, "COMMENT", "");
+  fh_set_com(hu, 1600.1, "COMMENT", " SBIG info record:");
+  fh_set_com(hu, 1600.2, "COMMENT", "");
+  sprintf(str, "%u", info.firmware_version);
+  fh_set_str(hu, 1600.9, "CONSWV", str, "SBIG firmware version");
+  fh_set_str(hu, 1601,"DETECTOR", info.camera_name, info.serial_number);
+  fh_set_bool(hu, 1700, "ABGON", info.imaging_abg_type, "Antiblooming gate present");
+  fh_set_int(hu, 1701, "ABGMODE", info.imaging_abg_type, "Antiblooming gate control value");
+  fh_set_int(hu, 1800, "BADCOL", info.nmbr_bad_columns, "Number of bad columns");
+  for (i = 0; i < info.nmbr_bad_columns; ++i){
+    sprintf(str, "BADCOL%d", i);
+    fh_set_int(hu, 1800 + 0.1 + 0.1 * i, str, info.bad_columns[i], "Bad column");
+  }
+  fh_set_int(hu, 1901, "ST5ADSIZ", info.ST5_AD_size, "");
+  fh_set_int(hu, 1902, "ST5FLTYP", info.ST5_filter_type, "");
+
+  if (fh_write(hu, STDOUT_FILENO) != FH_SUCCESS)
+    exit(EXIT_FAILURE);
+
+  if (fh_write_padded_image(hu, STDOUT_FILENO, data, w*h*sizeof(unsigned short), FH_TYPESIZE_RAW) != FH_SUCCESS)
+    exit(EXIT_FAILURE);
+
+  gprint (GP_ERR, "logonly: Wrote %d pixels, min=%g, max=%g\n", w*h, datamin, datamax);
+  sync();
+  return 0;
+}
+
+static void show_format(void){
+  gprint (GP_ERR, "Format for sp_ccdcontrol, SkyProbe CCD controller:\n"
+	  "Writes FITS file to stdout, status messages to stderr.\n"
+	  "NOTE: -port {hex} is an option for all forms of sp_ccdcontrol,\n"
+	  "  to specify a hex adress for the parallel port.\n"
+	  "sp_ccdcontrol expose -etime {Exp time}\n"
+          "   [-binmode {Binning mode}]\n"
+          "   [-shuttermode {Shutter mode}]\n"
+          "   [-raster X Y W H]\n"
+	  "Exp time: Exposure time given in seconds.\n"
+	  "Binning mode: 0=1x1, 1=2x2, 2=3x3.  Note, 3x3 not allowed in -track mode.\n"
+	  "   OR \n"
+	  "sp_ccdcontrol cool {coolmode} [temp|power]\n"
+	  "coolmode: 0=OFF, 1=ON, 2=Direct Drive\n"
+	  "For coolmode=0: Do not specify temp or power\n"
+	  "For coolmode=1: Specify temp in deg C\n"
+	  "For coolmode=2: Specify power (0-255)\n");
+  exit(EXIT_FAILURE);
+}
+
+
+int main(int argc, char *argv[])
+{
+  /*    char buffer[80], last_command[80]; */
+  int  ret = -1, i, port;
+  int  is_small_camera;
+    
+  /* Simon Kras--command line variables */
+  char cmd[80];
+  double etime;
+  int binmode;
+  int shuttermode;
+  int coolmode;
+  int raster_x, raster_y, raster_h, raster_w;
+  double cooltemp, coolpwr;
+
+  if(argc>1) strcpy(cmd, argv[1]);
+  else show_format();
+
+  port = 1; /* 0x378 */
+  for (i = 1; i < argc; ++i) {
+    if (!strcmp(argv[i], "-port")) {
+      sscanf(argv[++i], "%x", &port);
+      gprint (GP_ERR, "port override to 0x%x\n", port);
+    }
+  }
+
+  for (i = 0; i < 4; ++i) {
+    sync();
+    /* set our verbosity to 0 (range is 0 to 5) */
+    ret = sbig_init(port, 0, &info);
+    if (ret == -6) ret = 0; /* %%% It always returns this error, but actually it worked.
+			     * Since the library is binary only, we can't fix it.
+			     */
+    if (ret == 0) break;
+    gprint (GP_ERR,"logonly: sbig_init() failed: %s\n", sbig_show_error(ret));
+    usleep(100000);
+  }
+  if (ret < 0) {
+    gprint (GP_ERR, "error: cannot open camera, giving up\n");
+    exit(EXIT_FAILURE);
+  }
+
+  is_small_camera = (strstr(info.camera_name, "237") != NULL ||
+		     index(info.camera_name, '5') != NULL);
+  for (i = 0; i < info.camera_info[0].nmbr_readout_modes; ++i) {
+    struct readout_mode  *rmp;
+    rmp = &info.camera_info[0].readout_mode[i];
+#ifdef DEBUG
+    gprint (GP_ERR, "debug: ImagingCCD mode %d: w=%d h=%d "
+	    "gain=%f "
+	    "pw=%g ph=%g\n", rmp->mode, rmp->width,
+	    rmp->height,  0.01*rmp->gain, 0.001*rmp->pixel_width, 
+	    0.001*rmp->pixel_height);
+#endif
+  }
+
+  for (i = 0; i < info.camera_info[1].nmbr_readout_modes; ++i) {
+    struct readout_mode  *rmp;
+
+    rmp = &info.camera_info[1].readout_mode[i];
+#ifdef DEBUG
+    gprint (GP_ERR, "debug: TrackingCCD mode %d: w=%d h=%d "
+	    "gain=%f "
+	    "pw=%g ph=%g\n"
+	    , rmp->mode, rmp->width, rmp->height,
+	    0.01*rmp->gain,
+	    0.001*rmp->pixel_width, 0.001*rmp->pixel_height);
+#endif
+  }
+  if(!strcmp(cmd, "expose")){
+    etime=-999.;
+    for(i=1;i<argc;++i){
+      if(!strcmp(argv[i], "-etime")){
+	if(argc>(i+1)) etime = atof(argv[++i]);
+	else
+	  gprint (GP_ERR, "No argument given to -etime\n");
+      }
+    }
+    if(etime==-999.){
+	gprint (GP_ERR, "Must specify exposure time.\n");
+	exit(EXIT_FAILURE);
+      }
+      
+      binmode=-999;
+      for(i=1;i<argc;++i){
+	if(!strcmp(argv[i], "-binmode")){
+	  if(argc>(i+1)) binmode = atoi(argv[++i]);
+	  else{
+	    gprint (GP_ERR, "No argument given for -binmode\n");
+	    exit(EXIT_FAILURE);
+	  }
+	}
+      }
+      if(binmode==-999) binmode=0;
+
+      shuttermode=0;
+      for (i=1; i<argc;++i){
+	if (!strcmp(argv[i], "-shuttermode")){
+	  if (argc>(i+1)) shuttermode = atoi(argv[++i]);
+	  else{
+	    gprint (GP_ERR, "No argument given for -shuttermode\n");
+	    exit(EXIT_FAILURE);
+	  }
+	}
+      }
+
+      raster_x=0;
+      raster_y=0;
+      raster_w=0;
+      raster_h=0;
+      for (i=1; i<argc;++i){
+	if (!strcmp(argv[i], "-raster")){
+	  if (argc>(i+4)) {
+	    raster_x = atoi(argv[++i]);
+	    raster_y = atoi(argv[++i]);
+	    raster_w = atoi(argv[++i]);
+	    raster_h = atoi(argv[++i]);
+	  }
+	  else{
+	    gprint (GP_ERR, "-raster requires 4 arguments: x y w h\n");
+	    exit(EXIT_FAILURE);
+	  }
+	}
+      }
+      
+      take_picture(etime, binmode, shuttermode, raster_x, raster_y, raster_w, raster_h);
+
+  } else if(!strcmp(cmd, "cool")){
+    double  f;
+    struct sbig_cool  cool;
+    
+    if(argc<3){
+      gprint (GP_ERR, "Too few arguments for cool mode\n");
+      exit(EXIT_FAILURE);
+    } 
+    coolmode = atoi(argv[2]);
+    
+    if(coolmode<0 || coolmode>2){
+      gprint (GP_ERR, "Cooling mode values allowed: [0 Off, 1 *On, 2 DirectDrive]\n");
+      exit(EXIT_FAILURE);
+    }
+    cool.regulation = coolmode;
+    cool.direct_drive = 0;
+    if (cool.regulation == 2){
+      if(argc<4){
+	gprint (GP_ERR, "Must specify cooling power (0-255)\n");
+	exit(EXIT_FAILURE);
+      }
+      coolpwr=atof(argv[3]);
+      if(coolpwr<0 || coolpwr>255){
+	gprint (GP_ERR, "Cooling power must be 0-255.\n");
+	exit(EXIT_FAILURE);
+      }
+      cool.direct_drive = coolpwr;
+    }
+    else if (cool.regulation == 1) {
+      if(argc<4){
+	gprint (GP_ERR, "Must specify temperature in deg C\n");
+	exit(EXIT_FAILURE);
+      }
+      cooltemp=atof(argv[3]);
+      if(cooltemp<-50 || cooltemp>20){
+	gprint (GP_ERR, "Cooling temperature must be -50 to 20 deg C.\n");
+	exit(EXIT_FAILURE);
+      }
+      f = cooltemp;
+      i = 10.0*f + 0.5;
+      cool.temperature = i;
+    }
+    sync();
+    ret = sbig_set_cooling(&cool);
+    if (ret < 0){
+      gprint (GP_ERR, "sbig error: %s\n", sbig_show_error(ret));
+    }
+  }else{
+    gprint (GP_ERR, "Illegal command: '%s'\n", cmd);
+    show_format();
+  }
+  exit(EXIT_SUCCESS);
+}
+ 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/telescope.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/telescope.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/telescope.c	(revision 15879)
@@ -0,0 +1,236 @@
+# include "dimm.h"
+
+double distSky (double r1, double r2, double d1, double d2);
+
+int telescope (int argc, char **argv) {
+  
+  if (argc < 2) goto usage;
+
+  if (!strcasecmp (argv[1], "init")) {
+    if (argc != 3) {
+      gprint (GP_ERR, "USAGE: telescope init (port)\n");
+      return (FALSE);
+    }
+    if (!SerialInit (argv[2])) return (FALSE);
+    gprint (GP_ERR, "telescope on port %s\n", argv[2]);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "cmd")) {
+
+    int status;
+    char *answer = (char *) NULL;
+
+    if (argc != 3) {
+      gprint (GP_ERR, "USAGE: telescope cmd (string)\n");
+      return (FALSE);
+    }
+    status = SerialCommand (argv[2], &answer, 10);
+    gprint (GP_ERR, "status: %d\n", status);
+    if (answer != (char *) NULL) {
+      gprint (GP_ERR, "answer: ..%s..\n", answer);
+    }
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "ack")) {
+
+    int status;
+    char line[32], *answer;
+
+    if (argc != 3) {
+      gprint (GP_ERR, "USAGE: telescope cmd (string)\n");
+      return (FALSE);
+    }
+    line[0] = 0x06;
+    line[1] = 0;
+    status = SerialCommand (line, &answer, 10);
+    gprint (GP_ERR, "status: %d\n", status);
+    if (answer != (char *) NULL) {
+      gprint (GP_ERR, "answer: ..%s..\n", answer);
+    }
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "slew")) {
+
+    double ra, dec;
+    int status;
+
+    if (argc != 4) {
+      gprint (GP_ERR, "USAGE: telescope slew (ra) (dec)\n");
+      return (FALSE);
+    }
+
+    ra  = atof (argv[2]);
+    dec = atof (argv[3]);
+    while (ra  < 360.0) ra += 360.0;   
+    while (ra  > 360.0) ra -= 360.0;   
+
+    status = gotoRD (ra, dec);
+
+    if (!status) return (FALSE);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "coords")) {
+
+    int status;
+    double ra, dec;
+    char line[64];
+
+    if (argc != 2) {
+      gprint (GP_ERR, "USAGE: telescope coords\n");
+      return (FALSE);
+    }
+
+    if (!getRD (&ra, &dec)) return (FALSE);
+    gprint (GP_ERR, "%f %f\n", ra, dec);
+    set_variable ("RA", ra);
+    set_variable ("DEC", dec);
+    dms_format (line, (ra/15.0));
+    set_str_variable ("Rs", line);
+    dms_format (line, dec);
+    set_str_variable ("Ds", line);
+
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "altaz")) {
+
+    int status;
+    double x, y;
+
+    if (argc != 2) {
+      gprint (GP_ERR, "USAGE: telescope altaz\n");
+      return (FALSE);
+    }
+
+    if (!getXY (&x, &y)) return (FALSE);
+    gprint (GP_ERR, "%f %f\n", x, y);
+    set_variable ("ALT", x);
+    set_variable ("AZ", y);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "site")) {
+
+    int status;
+    double lon, lat, LST;
+
+    if (argc != 2) {
+      gprint (GP_ERR, "USAGE: telescope site\n");
+      return (FALSE);
+    }
+
+    if (!getSite (&lon, &lat, &LST)) return (FALSE);
+    gprint (GP_ERR, "%f %f  %f\n", lon, lat, LST);
+    set_variable ("LON", lon);
+    set_variable ("LAT", lat);
+    set_variable ("LST", LST);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "setsite")) {
+
+    double lon, lat;
+
+    if (argc != 5) {
+      gprint (GP_ERR, "USAGE: telescope setsite (name) (longitude) (latitude)\n");
+      return (FALSE);
+    }
+
+    lon = atof (argv[3]);
+    lat = atof (argv[4]);
+    if (!setSite (argv[2], lon, lat)) return (FALSE);
+    set_variable ("LON", lon);
+    set_variable ("LAT", lat);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "settime")) {
+
+    if (argc != 3) {
+      gprint (GP_ERR, "USAGE: telescope settime (lst)\n");
+      return (FALSE);
+    }
+
+    if (!setTime (argv[2])) return (FALSE);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "verbose")) {
+
+    int mode;
+
+    if (argc != 3) {
+      gprint (GP_ERR, "USAGE: telescope verbose (mode)\n");
+      return (FALSE);
+    }
+
+    mode = atoi (argv[2]);
+    SerialVerbose (mode);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "setcoords")) {
+
+    int status;
+    double ra, dec;
+
+    if (argc != 4) {
+      gprint (GP_ERR, "USAGE: telescope setcoords (ra) (dec)\n");
+      return (FALSE);
+    }
+
+    ra  = atof (argv[2]);
+    dec = atof (argv[3]);
+
+    if (!setRD (ra, dec)) return (FALSE);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "offset")) {
+
+    int status;
+
+    if (argc != 4) {
+      gprint (GP_ERR, "USAGE: telescope offset (direction) (distance)\n");
+      gprint (GP_ERR, "  direction : x or y\n");
+      gprint (GP_ERR, "  distance  : +arcmin or -arcmin\n");
+      return (FALSE);
+    }
+    status = offset (argv[2], atof (argv[3]));
+
+    if (!status) return (FALSE);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "toffset")) {
+
+    int status;
+
+    if (argc != 5) {
+      gprint (GP_ERR, "USAGE: telescope toffset (direction) (rate) (duration)\n");
+      gprint (GP_ERR, "example: telescope toffset x RC 1.5\n");
+      return (FALSE);
+    }
+    status = toffset (argv[2], argv[3], atof(argv[4]));
+
+    if (!status) return (FALSE);
+    return (TRUE);
+  }
+
+ usage:
+  gprint (GP_ERR, "telescope init port - set serial port (eg, /dev/ttyS0)\n");
+  gprint (GP_ERR, "telescope site - get site information\n");
+  gprint (GP_ERR, "telescope altaz - g\n");
+  gprint (GP_ERR, "telescope setcoords (ra) (dec)\n");
+  gprint (GP_ERR, "telescope setsite (name) (longitute) (latitude)\n");
+  gprint (GP_ERR, "telescope coords\n");
+  gprint (GP_ERR, "telescope slew (ra) (dec)\n");
+  gprint (GP_ERR, "telescope offset (direction) (duration)\n");
+  gprint (GP_ERR, "telescope toffset (direction) (rate) (duration)\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dimm/version.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dimm/version.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dimm/version.c	(revision 15879)
@@ -0,0 +1,17 @@
+# include "dimm.h"
+static char *name = "$Name: not supported by cvs2svn $";
+
+int version (int argc, char **argv) {
+
+  char *tmp;
+
+  gprint (GP_LOG, "\n");
+  gprint (GP_LOG, "pclient version: %s\n", (tmp = strip_version (name))); free (tmp);
+
+  gprint (GP_LOG, "opihi version: %s\n", (tmp = strip_version (opihi_version()))); free (tmp);
+  gprint (GP_LOG, "ohana version: %s\n", (tmp = strip_version (ohana_version()))); free (tmp);
+  gprint (GP_LOG, "gfits version: %s\n", (tmp = strip_version (gfits_version()))); free (tmp);
+
+  gprint (GP_LOG, "compiled on %s %s\n", __DATE__, __TIME__);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/ChangeLog.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/ChangeLog.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/ChangeLog.txt	(revision 15879)
@@ -0,0 +1,207 @@
+
+2006.10.04:
+  opihi-2-8    added output names, gprintGetName, '-current' to 'output'
+	       removed prototypes from old 'output' code
+	       fixed memory leak in evaluate_stack
+	       added global PID variable
+	       added quiet mode to coords
+	       added various memleak tests, other tests
+	       fixed error in buffer/vector selection for dimenup
+	       fixed counting error in fit2d (missing 1 row of matrix!)
+	       added normalization to kern
+	       cleaned CreateBuffer function, usage
+	       
+  mana-1-6     removed prototypes from old 'output' code
+	       cleaned CreateBuffer function, usage
+
+  pantasks-0-6 added TASK_STDOUT, TASK_STDERR to pantasks.h
+	       added stdout, stderr output targets for tasks/jobs
+	       cleaned CreateBuffer function, usage
+
+  dvo-0-6      cleaned CreateBuffer function, usage
+
+2006.08.23:
+  opihi-2-7    converted to gfits APIs (forces libfits 1.6)
+	       consolidated style argument parsing
+	       added style arguments to astro plotting
+	       added support for pantasks_client, pantasks_server
+	       added more complex keys to queue operations
+	       added gprint to allow buffered printing in threads
+	       updates to test framework for more flexibility
+	       added time conversions sec_to_hms, sec_to_day
+	       added SetLimitsRaw
+	       added isort_pair
+	       added VarConfigEntry
+	       added strip_version to clean version output
+	       moved gaussj to libohana
+	       moved main out of opihi to mana.c, etc
+
+  mana-1-5     converted to gfits APIs (forces libfits 1.6)
+	       added option for threaded shell/backend (not used)
+
+  dvo-0-5      converted to gfits APIs (forces libfits 1.6)
+      	       consolidated style argument parsing
+	       converted to new DVO APIs (dvo_catalog_xxx)
+	       added fitsed
+	       improvements to fitcolors
+	      
+  pantasks-0-5 converted to gfits APIs (forces libfits 1.6)
+	       added 'option' task command
+	       added limits on Njobs for time ranges
+	       fixed time ranges
+	       created client/server version
+	       added controller run/stop commands
+	       added controller help
+	       added server help
+
+  pcontrol-0-5 converted to gfits APIs (forces libfits 1.6)
+	       code re-org to make thread safe
+	       added multithread option (user/client threads)
+	       liberal use of ASSERTs
+
+  pclient-0-5  converted to gfits APIs (forces libfits 1.6)
+  dimm-0-4     converted to gfits APIs (forces libfits 1.6)
+
+2006.03.26:
+  opihi-2-6 : added 'close' function for devices
+	      added test framework  
+	      added tests to cmd.basic, cmd.data
+	      added $?var syntax (variable existence test)
+	      fixed broken a[3] = 5 assignment
+	      added PopQueueMatch function
+	      added periodogram.c
+	      improvements to dimendown, peak
+	      added fixwrap for roll-over on saturation
+
+  dvo-0-4     added proper-motion, parallax
+	      dropped _PS from Stars.R,D
+	      fixed configuration flags for readline/curses
+
+  mana-1-4     fixed configuration flags for readline/curses
+  pcontrol-0-4 fixed configuration flags for readline/curses
+  pclient-0-4  fixed configuration flags for readline/curses
+
+  pantasks-0-4 fixed configuration flags for readline/curses
+	       changed name from psched
+
+
+
+- opihi-2-5
+  * major work to switch to libkapa
+  * revised init sequence (general_init, program_init, startup)
+
+- mana 1.3
+  * changes to support new init sequence
+
+- dvo 0.3
+  * major changes to support SkyRegions
+  * changes to support libkapa
+  * changes to support new init sequence
+
+- psched 0.3
+  * changes to support new init sequence
+  * changes to support libkapa
+
+- pcontrol 0.3
+  * changes to support new init sequence
+  * changes to support libkapa
+
+- pclient 0.3
+  * changes to support new init sequence
+  * changes to support libkapa
+
+- dimm 0.2
+  * changes to support new init sequence
+  * changes to support libkapa
+
+dimm-0-1: release 2005.10.20
+  first tagged dimm release
+
+pclient-0-2: release 2005.10.20
+  minor cleanups
+  minor changes to use new libohana (v1.5) / libfits (v1.4)
+
+pcontrol-0-2: release 2005.10.20
+  added run/stop commands
+  minor changes to use new libohana (v1.5) / libfits (v1.4)
+
+psched-0-2: release 2005.10.20
+  work to improve / test throughput
+  minor cleanups
+  minor changes to use new libohana (v1.5) / libfits (v1.4)
+
+dvo-0-2:  release 2005.10.20
+  substantial changes to work with new dvo load functions
+  support for mode/format changes
+  minor changes to use new libohana (v1.5) / libfits (v1.4)
+
+mana-1-2:  release 2005.10.20
+  minor changes to use new libohana (v1.5) / libfits (v1.4)
+
+opihi-2-4: release 2005.10.20
+  minor changes to use new libohana (v1.5) / libfits (v1.4)
+  kapa/kii cursor interaction modified (needs kapa v1.3, kii v1.3)
+
+opihi-2-3: release 2005.08.15
+  first tagged release tarball
+  fixed up versions commands
+  added list types for psched 
+  moved to Makefile.Common method.
+
+opihi-2-2:
+  fixed up inclusion of dvo.h (conflicted names)
+  added Graph commands functions
+  added mosaic astrometry support
+  a variety of memory alloc bugfixes
+  added support for ohana_allocate functions
+  added real multicommand support (correct parsing of variables)
+  added some object modelling functions
+  added clipping to fits and stats
+  added gaussdeviate
+  added extrapolation to minterp
+  default of EXTNAME for extension keyword
+  added -cpt to various dvo functions
+  better help in dvo functions
+  fixed up lockfile APIs
+  added fitcolors
+  added lightcurve
+  some cleanups in dvo/photometry.c
+  added typefrac tests is photometry.c
+  added gain test for mrqmin
+  fixed up precedence in math
+  macro-ized binary/unary math ops
+  added modulo, erf
+
+opihi-2-1:
+  major reorg of imfit / added imfit functions
+  cleaned up get_argument calls so -Wall does not give errors
+  moved the 'elixir' command to dvo
+  tag added only to elixir implementations (mana + dvo)
+  dimm - need to coordinate with Olivier and Bernt
+  dvo2, pcontrol, pclient, sched - all under development
+
+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.  
+
+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.
+	
+opihi-2-0:
+  import to CVS 2004.12.03
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/changes.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/changes.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/changes.txt	(revision 15879)
@@ -0,0 +1,54 @@
+Oct 19  2003 misc/startup.c              . minor changes, DONE
+Oct 19  2003 misc/conversions.c		 . minor changes, DONE
+Oct 19  2003 misc/match_image.c		 . copied to dvo
+Apr 19 17:41 misc/ConfigInit.c		 . minor changes, kept dvo version
+May  6 16:13 misc/ImageOps.c		 . minor changes, DONE
+May 12 09:00 misc/photometry.c           . major changes : DONE
+
+Oct 15  2003 user/badimages.c            . no change
+Oct 15  2003 user/imlist.c		 . no change
+Oct 15  2003 user/precess.c		 . dvo version ok
+Oct 15  2003 user/delete.c		 . dvo version ok
+
+May  6 15:25 user/extract.c		 . mostly deprecated (transfer USNO/HST/etc versions)
+May 10 21:13 user/mextract.c		 . used status version + vectors
+May 11 12:06 user/avextract.c		 . used status version + vectors
+Oct 27  2003 user/imextract.c		 . used status version + vectors
+
+May 12 09:06 user/dmags.c		 . used status version + vectors
+May 12 09:12 user/dmagmeas.c		 . used status version + vectors
+May 12 09:13 user/dmagaves.c		 . used status version + vectors
+May 11 16:18 user/ddmags.c		 . used status version + vectors
+
+May  2 11:14 user/calextract.c		 . used status version + vectors 
+May  3 20:08 user/calmextract.c		 . used status version + vectors
+Oct 19  2003 user/cmd.c			 . fixed (photcodes vs vectors)
+Oct 19  2003 user/ccd.c			 . used status version + vectors
+
+Apr 19 19:48 user/gimages.c		 . minor changes, fixed
+Nov 14  2003 user/gstar.c		 . minor changes, fixed
+May  3 20:49 user/gtypes.c		 . dvo version ok
+May  6 09:37 user/images.c		 . copied to dvo
+May  3 20:49 user/imdata.c		 . dvo version ok
+May  3 20:50 user/imphot.c		 . dvo version ok
+May  3 20:51 user/imrough.c		 . dvo version ok
+May  3 20:51 user/imsearch.c		 . dvo version ok
+Nov  5  2003 user/photcodes.c		 . copied to dvo
+Nov  1  2003 user/pmeasure.c		 . dvo version ok
+Mar  3 11:25 user/showtile.c		 . copied to dvo
+Nov  1  2003 user/subpix.c		 . copied to dvo
+Oct 30  2003 user/dmt.c			 . minor changes & photcodes
+Nov  1  2003 user/lcurve.c		 . minor changes & photcodes
+
+May 18 09:50 user/cgrid.c		 . copied to dvo
+
+Nov  1  2003 user/abszero.c		 . deprecated
+May  3 20:51 user/zeropts.c		 . deprecated
+Nov 13  2003 user/resid.c		 . deprecated
+Nov 13  2003 user/photresid.c		 . deprecated
+
+May  2 11:20 user/cals.c		 . deprecated?
+May  3 20:37 user/ddmagextract.c	 . deprecated?
+May  3 20:11 user/dmagextract.c		 . deprecated?
+Oct 19  2003 user/ccdextract.c		 . deprecated?
+Oct 19  2003 user/cmdextract.c		 . deprecated?
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/command.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/command.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/command.txt	(revision 15879)
@@ -0,0 +1,24 @@
+
+readline: allocates a line and returns it; empty lines return NULL
+
+expand_vars: (recursively) expand expressions of the form $X
+	     frees the input line, allocates a new one.
+	     returns NULL on error (including NULL input)
+
+expand_vectors: expand expressions of the form $X
+	     frees the input line, allocates a new one.
+	     returns NULL on error (including NULL input)
+
+parse performs math expansion on the line, returning a new line (old one is freed)
+
+
+in newmath:
+
+isolate_elements converts argc,argv to cstack,Ncstack (argc,argv NOT freed)
+convert_to_RPN takes cstack,Nstack and converts to stack,Nstack; input cstack,Ncstack are freed
+check_stack puts pointers to data types on stack, no data allocated
+evaluate_stack 
+
+
+command parses a single input line (line) and expands
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/coords.list
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/coords.list	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/coords.list	(revision 15879)
@@ -0,0 +1,47 @@
+./cmd.astro/cgrid.c - OK (graph only)
+./cmd.astro/cplot.c  - OK (graph only)
+./cmd.astro/czplot.c - OK (graph only)
+./cmd.data/cursor.c - OK (graph only)
+./dvo/catalog.c - OK (graph only)
+./dvo/pcat.c - OK (graph)
+./dvo/pmeasure.c - OK (graph)
+./dvo/procks.c - OK (graph)
+./dvo/showtile.c - OK (graph)
+./cmd.astro/coords.c - fixed
+./dvo/gimages.c - fixed
+./dvo/ImageOps.c - fixed
+./dvo/images.c - fixed
+./dvo/imdense.c - fixed
+./dvo/imextract.c - fixed
+./dvo/imlist.c - fixed
+./dvo/imstats.c - fixed
+./dvo/photometry.c - fixed
+./dvo/subpix.c - fixed
+./dvo/get_regions.c - fixed
+
+./cmd.astro/drizzle.c - needs work
+./cmd.astro/transform.c - needs work
+./cmd.data/load.c - needs work
+./cmd.data/point.c - needs work
+./cmd.data/tvgrid.c - needs work
+./dvo/cmpread.c - needs work (single image)
+./dvo/imbox.c - needs work (single image)
+./dvo/simage.c - needs work (single image)
+
+dvo commands / functions affected by WRP / DIS astrometry
+
+LoadImage - no
+badimages.c - yes : also, use LoadImages
+get_regions.c - ? : OK if we register DIS image
+gimages.c
+ImageOps.c        : need to make association with DIS
+images.c
+imbox.c
+imdense.c
+imextract.c
+imlist.c
+imstats.c
+photometry.c
+showtile.c
+simage.c
+subpix.c
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/dmagoptions.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/dmagoptions.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/dmagoptions.txt	(revision 15879)
@@ -0,0 +1,143 @@
+
+mextract from value [options]
+avextract from value [options]
+
+imextract value [options]
+
+dmags F1 - F2 : F3 [options]
+dmagmeas F1 - F2 : value [options]
+dmagaves F1 - F2 : value [options]
+
+cmd F1 - F2 : F3 [options]
+ccd F1 - F2 : F3 - F4 [options]
+
+calextract F1 - F2 [options]
+calmextract F1 - F2 [options]
+
+options:
+
+ -photcode value
+  for avextract and dmagaves, -photcode defines the which code is used
+  to calculate certain values (mag, dmag, etc).  objects which lack a 
+  photcode return a logical NaN for that value.
+
+ -magrange min max
+
+this can apply to any photcode
+
+ -imaglim min 
+ -flag value
+ -time start stop
+ -fwhm (value)
+ -type (value)
+
+these naturally apply to the REF and DEP photcodes, but cannot apply to 
+to PRI and SEC.  (note that -type is interpretted a bit differently here
+from below. 
+
+ -chisq max
+ -errorlim max
+ -type (value)
+ -typefrac (type) (frac)
+ -nphot (value)
+ -ncode (value)
+ -fwhmfrac (value) (frac)
+
+these naturally apply to PRI and SEC photcodes, but cannot apply to
+REF.  For DEP, they could apply to the equivalent photcode.  eg
+
+  ccd I - 2MASS_J : 2MASS_J - 2MASS_K -chisq 2.0
+
+  this will exclude on chisq for the I value, and ignore the limit
+  for the 2MASS values
+
+  ccd I - CFH12K.R.00 : 2MASS_J - 2MASS_K -chisq 2.0
+
+  this will exclude on chisq for the I value, and ignore the limit
+  for the 2MASS values, and exclude on R (equiv to CFH12K.R.00).
+
+  ccd I - CFH12K.R.00 : 2MASS_J - 2MASS_K -time start stop
+
+  by default, this will filter the CFH12K.R.00 and 2MASS measurements 
+  based on
+
+we need to be able to restrict the selections to a subset of the
+extraction values.  We can use a flag like: -apply YYNN:
+
+  ccd I - CFH12K.R.00 : 2MASS_J - 2MASS_K -time start stop -apply NYNN
+
+to restrict the application to only the CFH12K.R.00 entry.
+
+measure values:
+  ra
+  dec
+  mag
+  dmag
+  airmass
+  exptime
+  photcode
+  time
+  dR
+  dD
+  fwhm
+  dophot
+  FLAGS
+  XCCD
+  YCCD
+  XMOSAIC
+  YMOSAIC
+
+average values:
+  ra
+  dec
+  dmag
+  Nmeas
+  Nmiss
+  Xp
+  Xm
+  flag
+  type
+  typefrac
+  Nphot
+  Ncode
+
+
+
+- ExtractDMag
+  - ExtractMeasuresDMag
+    - TestAverage
+  - ExtractMagnitudes
+    - ExtractAverages
+    - ExtractMeasures
+
+mextract
+ - ExtractMeasures
+avextract
+ - ExtractAverages
+dmags
+ - ExtractDMag
+ - ExtractMagnitudes
+ddmags
+ - ExtractDMag
+ - ExtractDMag
+dmagmeas
+ - ExtractDMag
+ - ExtractMeasures
+dmagaves
+ - ExtractDMag
+ - ExtractAverages
+cmd
+ - ExtractDMag
+ - ExtractMagnitudes
+ccd
+ - ExtractDMag
+calextract
+ - ExtractAverages
+calmextract
+ - ExtractMeasures
+
+
+cmd B - V : B
+dmagmeas B - V : ra
+dmagmeas B - V : time
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/dvo-2.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/dvo-2.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/dvo-2.txt	(revision 15879)
@@ -0,0 +1,28 @@
+
+Region APIs
+
+Region table is a FITS table
+
+- load region data from FITS table
+- save region data to FITS table
+
+/* find region which overlaps c at given depth (-1 : max depth) */
+SkyRegion *SkyFindPoint (SkyRegion *db, SkyCoord c, int depth);
+
+/* find regions at all levels which overlap c */
+SkyRegion **SkyFindLevels (SkyRegion *db, SkyCoord c, int *Nregion);
+
+/* find regions contained within rectangular region  c1 - c2 */
+SkyRegion **SkyFindArea (SkyRegion *db, SkyCoord c1, SkyCoord c2, *nlist);
+
+- I have created table generation functions which construct a
+  collection of table entries starting with the full sky and iterating
+  down N levels.  The function also fills out the names at the
+  appropriate levels.  This is currently ok up to level 6, but runs
+  out of memory at level 7.  This should not be the case, so I suspect
+  I'm not free'ing some memory.  
+
+- I need to create a function to take the GSC table list and construct
+  a set of SkyRegions that match the layout, starting with the full
+  sky and iterating down to and past the GSC tables.  
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/dvo-apis.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/dvo-apis.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/dvo-apis.txt	(revision 15879)
@@ -0,0 +1,89 @@
+
+skyregion APIs:
+
+// a single patch on the sky
+typedef struct {
+  float            Rmin;                 // 
+  float            Rmax;                 // 
+  float            Dmin;                 // 
+  float            Dmax;                 // 
+  int              childS;               // sequence number in full table of first child
+  int              childE;               // sequence number in full table of last child + 1
+  int              parent;               // sequence number in full table of parent
+  int              index;                // sequence number in full table of this entry
+  char             depth;                // depth of this entry
+  char             child;                // does this entry have children?
+  char             table;                // does this entry have a table?
+  char             name[21];             // name / filename
+} SkyRegion;
+
+/* SkyRegion : better implementation than GSCRegion */
+typedef struct {
+  int Nregions;
+  char **filename;
+  SkyRegion *regions;
+} SkyTable;
+
+typedef struct {
+  int Nregions;
+  char **filename;
+  SkyRegion **regions;
+} SkyList;
+
+SkyList *SkyRegionByPoint (SkyTable *table, int depth, double ra, double dec);
+SkyList *SkyListByName (SkyTable *table, char *name);
+SkyList *SkyListByPoint (SkyTable *table, double ra, double dec);
+SkyList *SkyListByRadius (SkyTable *table, int depth, double RA, double DEC, double radius);
+SkyList *SkyListByPatch (SkyTable *table, int depth, SkyRegion *patch);
+SkyList *SkyListByImage (SkyTable *table, int depth, Image *image);
+SkyList *SkyListByBounds (SkyTable *table, int depth, double Rmin, double Rmax, double Dmin, double Dmax);
+SkyList *SkyListChildrenByBounds (SkyTable *table, int No, int depth, double Rmin, double Rmax, double Dmin, double Dmax);
+void SetImageCorners (double *X, double *Y, Image *image);
+int SkyTableSetDepth (SkyTable *sky, int depth);
+int SkyListFree (SkyList *list, int ELEMENTS);
+int SkyTableFree (SkyTable *table);
+int SkyListMerge (SkyList **outlist, SkyList *newlist);
+
+--- db query sky region ---
+
+// options for selecting the ra,dec limits of the db selections
+typedef struct {
+  char *name;
+  char *list;
+  int useDisplay;
+  int useSkyregion;
+} SkyRegionSelection;
+
+int get_skyregion (double *Rs, double *Re, double *Ds, double *De);
+int set_skyregion (double Rs, double Re, double Ds, double De);
+
+void FreeSkyRegionSelection (SkyRegionSelection *selection);
+SkyRegionSelection *SetRegionSelection (int *argc, char **argv);
+
+
+--- photometry.c api ---
+
+* int GetTimeSelection (time_t *tz, time_t *te) {
+int GetPhotcodeInfo (char *string, PhotCode **Code, int *Mode) {
+int SetSelectionParam (int param) {
+int GetSelectionParam () {
+int GetMeasureParam (char *parname) {
+int GetAverageParam (char *parname) {
+int TestPhotSelections (PhotCode **code, int *mode, int param) {
+void GetAverageParamHelp () {
+int InitPhotcodes () {
+int ListPhotSelections () {
+int SetPhotSelections (int *argc, char **argv, int Nparams) {
+double *ExtractMeasures (PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param) {
+double ExtractAverages (PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int param) {
+double DetermineTypefrac (Average *average, Measure *measure, PhotCode *code) {
+int DetermineTypeCode (Average *average, Measure *measure, int code) {
+int GetMeasureTypeCode (Measure *measure) {
+int Quality (Measure *measure, int IsDophot) {
+int TestAverage (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure) {
+double *ExtractMagnitudes (PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int *n) {
+double *ExtractDMag (PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist) {
+double *ExtractMeasuresDMag (PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist) {
+double *ExtractByDMag (PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param) {
+double *ExtractMeasuresByDMag (PhotCode **code, int *mode, int use_first, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param) {
+double GetMeasure (int param, Average *average, Measure *measure, double mag) {
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/dvo.html
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/dvo.html	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/dvo.html	(revision 15879)
@@ -0,0 +1,288 @@
+
+<h2> PA data requirements </h2>
+
+Counting the total size of the PA database for the PA survey, with
+roughly 20 pointings per location and 30 second exposures.  The depth
+for PA survey in P2 @ 20 \sigma is 21.3 (r).  Each detection uses 100
+bytes (<b>we need to flesh this out with more realistic numbers from
+our table of parameters</b>).  The access speed to a RAID disk is 100
+MB/sec.  The number density of stars in i' in the plane may be higher,
+but we reach saturation at ~1.4e6 detections per deg^2 (one object per
+100 pixels).  This is a factor of 5 higher than the raw numbers.
+
+<h3> stellar counts for PS-1 </h3>
+latitude                 90          30         0
+density (deg^{-2})      5e3         3e4       3e5
+N_det (FPA^{-1})        4e4         2e5       2e6
+Sum N_det (FPA^{-1})    8e5         4e6       4e7
+Sum Nbyte (FPA^{-1})  80 MB      400 MB      4 GB
+Nsec for 1 channel      0.8           4        40
+Nchannel for 2 sec        1           2        20
+
+The total number of bytes for the PA survey for P2 detections is ~12
+TB (30000 x 400MB).  The density of detections per FPA from P4 delta
+is roughly the same as P2 at 0 deg (2e5 vs 3e5 det deg^{-2}).  The
+total number of bytes needed to store the P4 Delta detections from all
+of PS-1 is 
+
+Fields in the plane will take longer to process
+
+<h2> addstar interactions for a distributed db </h2>
+
+addstar.client <---> addstar.daemon
+
+The sky is divided into hierarchical regions, each broken into smaller
+subregions.  Both the image and object tables are divided into
+subtables by region on the sky.  The density of image tables is
+smaller than the density of object tables.  A top-level table defines
+the distribution of the lower-level tables by defining the hierarchy
+of regions and subregions.  Each entry in this table contains:
+
+region ID  - an identifier for the subregion
+RAs, RAe   - RA range of region
+DECs, DECe - DEC range of region
+parent ID  - ID of the region which contains this region (NULL for allsky)
+Nchild     - number of children
+offset     - starting entry of first child
+images     - is this region used for images? (if FALSE, down one layer)
+objects    - is this region used for objects? (if FALSE, down one layer)
+
+use the machine name / file name as the indicator in the images and
+objects entries?
+
+The table defines the relationship between the subregions and provides
+a mechanism to find the subregions appropriate to a given sky
+location.  It also specified for a given depth if that depth is used
+for the image and/or the object table.  The image tables contain
+images whose reference coordinate is located in the given region.
+Other regions which the image overlaps contain entries in the image
+reference table which specify the primary image table in which they
+are stored.  
+
+The details of the sky region definitions do not matter for the
+structure of the region table.  The data structures can handle any
+arrangement of tables which meets the basic requirements that the
+boundaries be lines of constant RA & DEC and that each level defines
+all regions which cover the entire sky.  One implementation is as
+follows and is easy to generate:  
+
+Start with the complete sky as a single region (RAs = 0, RAe = 360;
+DECs = -90, DECe = 90).  To create a new region, always subdivide the
+region with the largest area (roughly (RAe - RAs)*(DECe -
+DECs)*cos((DECs + DECe)/2)).  To subdivide a region, define two
+possible subdivisions: RA = 0.5*(RAs + RAe) (which becomes RAs and RAe
+for the two new regions) or DEC = 0.5*(DECs + DECe).  Determine the
+length of these dividing lines (S1 = (DECe - DECs); S2 = (RAe - RAs) /
+cos (DEC)).  Choose the shorter of these two lines, and subdivide the
+region on that basis.  
+
+The number of subregions increases by a factor of 8 for
+each new level.  Approximate table size: Need at least 200,000
+lowest-level regions, leads to 2^18 regions (256k) in lowest-level.
+Total table size is roughly 300k rows.  Each row is roughly 32 bytes,
+for a table size of 10MB.
+
+There is one addstar.daemon per DVO server.  The addstar.daemons are
+responsible for serving the objects and images from the tables they
+contain.  
+
+addstar.client steps to load a new set of objects:
+- load region table (defined in config db)
+- find overlapping object regions
+- find overlapping image regions
+- identify primary image region
+- send image data to node for primary image region 
+- send image reference to nodes for secondary image regions
+- send detection data (with image ID) to corresponding object region nodes
+
+addstar.daemon responsibilities:
+- receive image data -> add to primary image table
+- receive detection data -> add to local region file
+- request objects in overlap regions from neighbor daemons
+- send detections to neighbor daemons if associated with object over
+  border
+- construct / update objects on basis of detections
+
+in DVO 1.0, addstar updates objects on every upload of the
+detections.  In fact, the construction of the objects need not be
+performed every time detections are added.  Do we need to construct
+objects for all single detections?  The current process is:
+
+- get list of new detections (from incoming image)
+- match each detection with each object
+- update object parameters
+
+another option:
+
+step 1:
+ - get list of new detections
+ - add to new.detection table
+
+step 2:
+ - match detections to object table
+ - update object parameters
+
+third option
+step 1:
+ - add new detections to new table
+
+step 2:
+ - compare detections to orphans 
+ - if found, promote to object
+ - if not, test against objects
+ - if found update object
+ - if not add to orphans
+
+<h2> DVO image organization </h2>
+
+DVO 1.0 uses a single image table to store all image data.  In this
+table, each image is a chip; that is, each entry represents a single
+astrometric system.  In principal, there is no reason this could not
+be an entire mosaic or (in the case of Pan-STARRS) an individual
+Cell. It is usually necessary to be able to define the relationship
+between the different detector / focal plane / etc coordinate
+systems.  If the data entity is a full mosaic, then it will be
+necessary to look up the chip (and cell) transformations.  If the data
+entity is the cell, the reverse conversions will be needed.  
+
+The image table should be distributed to multiple files to speed up
+the access.  One option is to do this by coordinate region.  In the
+plan for DVO 2.0, there will be a table of the region hierarchy for
+the object tables, and the image tables could be distibuted similarly,
+though with a different density.  In PS-1, for example, there will be
+around 250,000 images (FPAs).  If we store OTAs (chips) as the data
+entity in the image table, then we will have in the vicinity of 16M
+rows.  If each contains 256 bytes, the total data volume in the image
+table will be about 4 GB.  If we want to have typical access times to
+any image of 1 second, and we need to scan through the entire table to
+get to the image, then we will need to distribute the data across 40
+tables (note that they need not be distributed by machine).  If each
+table represents a region on the sky, this translates to 1000 - 500
+square degrees per table.  
+
+Some additional aspects are interesting.  First, the
+spatially-distributed tables correspond to specific regions on the
+sky, likely to be bounded by lines of constant RA and DEC, or
+something equivalent.  However, an image cannot be guaranteed to land
+in only one of these regions.  To mitigate this, each image (chip or
+FPA or whatever the data unit is) should have a single defined
+position with which the general location is identified and the choice
+of region is made.  In addition, there should be a table associated
+with each region which defines images in other tables (regions) which
+overlap the given region.  In general, these overlap tables will
+contain only a small fraction of the image entries (regions are much
+large than images) and they need only identify the image ID and the
+corresponding table.
+
+An additional accelerator table would include all images, their
+reference time and their reference coordinate, sorted by time, with an
+index for the name.
+
+The end result is three types of tables: images.db, overlaps.db,
+imagetimes.db.  images.db contains the bulk of the information (256
+byte / row).  overlaps.db contains only the image ID and the the RA
+and DEC of the reference position (not the actual table because that
+may change). imagetimes.db contains only image ID (8 byte? 16 byte?),
+time, RA, DEC, and and index.  This is a total of about 40 bytes per
+image, for a total of roughly 700 MB at the end of PS-1.
+
+<h3> Examples queries </h3>
+
+<h4> find a single, specific image by ID </h4>
+<ul>
+<li> open imagetimes.db
+<li> load block marker (ID,block; every 10000 blocks)
+<li> find appropriate block
+<li> load block
+<li> find appropriate image entry
+<li> determine appropriate image.db table (region)
+<li> open image.db 
+<li> load block marker (ra,block; every 10000 blocks)
+<li> find appropriate block
+<li> load block
+<li> find appropriate image entry
+</ul>
+
+<h4> find a single, specific image by ID </h4>
+<ul>
+<li> open imagetimes.db
+<li> load block marker (ID,block; every 10000 blocks)
+<li> find appropriate block
+<li> load block
+<li> find appropriate image entry
+<li> determine appropriate image.db table (region)
+<li> open image.db 
+<li> load block marker (ra,block; every 10000 blocks)
+<li> find appropriate block
+<li> load block
+<li> find appropriate image entry
+</ul>
+
+<h3> dvo / object catalog scaling to massive collections </h3>
+
+DVO divides the sky into tables which represent specific areas on the
+sky.  Currently, these are pre-defined to match the HST GSC regions,
+roughly 1 - 4 square degree patches with fixed RA and DEC boundaries.
+A future extension will provide a mechanism to increaese or decrease
+the table density on the fly.
+
+The likely data rate under Pan-STARRS PS-1 is in the vicinity of 5 x
+10<sup>5</sup> stars per square degree.  The density is likely to vary
+by a factor of 30 for the bulk of the sky.  The Pan-STARRS camera
+consists of 1.44 x 10<sup>8</sup> pixels.  The confusion limit will
+likely be reached when each object encompases 25 pixels, resulting in
+a saturation of 6 x 10<sup>6</sup> stars per square degree.  The
+Pan-STARRS camera covers a total of 7.45 square degrees, and the
+expected exposure rate is roughly 1 per minute on average.  This
+amounts to a total of 3000 square degrees covered per night of
+observation, or a total of 1.5 x 10<sup>9</sup>detections per night,
+or a total of 5 x 10<sup>11</sup> over the course of one year.  Given
+this total number of detections, and the total sky coverage of 30,000
+square degrees, the average number of detections per square degree
+will be in the vicinity of 1.7 x 10<sup>7</sup>
+
+There are two main limitations to the DVO object storage model.
+First, the large data volume translates to a finite time to read the
+data from the disk.  Second, the large number of objects limits the
+rate at which new detections may be associated with the existing
+objects.  The first of these has generally proven to be the more
+significant limitation in applications to date.  We can easily
+calculate the time needed to load the data relevant to a random image
+pointing, as well as the maximum time based on the range of data
+volumes.  A necessary assumption in this calculation is the number of
+bytes used per detection.  We generously assume 100 bytes per
+detection, 3 times the existing data structures used by DVO.  
+
+Based on the numbers above, the total data volume represented by a
+year of observations is 50 TB, assuming the detection component
+dominates the total.  The average camera footprint translates to
+roughly 13 GB worth of detections.  Since each footprint is performed
+once per minute, it will be necessary to perform the read and write in
+each 10 seconds.  This in turn corresponds to 1.3 GB per second for
+the read and write portions.  With typical local hard-drive access
+speeds for RAIDs of 100 MB/sec, the data will need to be distributed
+across more than the machines in order to achieve these average
+rates.  
+
+The existing DVO system expects only one object table to be open at a
+time.  In addition, access to the tables is not controlled through
+separate machines.  Rather, a single collection of tables is expected
+and all queries are performed independently.  In order to handle the
+above load with the DVO software, the following changes will be
+needed:
+
+<ul>
+<li> tables must be distributed across multiple machines.  This is
+mandatory regardless of the underlying database engine based on the
+data I/O analysis above.
+
+<li> the 'addstar' front end needs to send the data for each table to
+the database backends on each of the corresponding machines.  
+
+<li> the addstar update for a single image can be done in series as is
+currently done.
+
+<li> write locking should be done on the tables rather than on the
+database as a whole (currently using the image table). 
+</ul>
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/ippc_commandserver.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/ippc_commandserver.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/ippc_commandserver.c	(revision 15879)
@@ -0,0 +1,166 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/file.h>
+#include <unistd.h>
+#include <string.h>
+#include <libxml/xmlmemory.h>
+#include <libxml/parser.h>
+#include "ippc.h"
+#include "ippc_messages.h"
+#include <arpa/inet.h>
+#include <netinet/in.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/wait.h>
+#include <signal.h>
+#include "ippc_command.h"
+
+#define MAX_KIDS    256
+#define WAIT_FOR_KIDS    5
+
+/** \file ippc_commandserver.c
+ * \brief This is basically a big fat security problem.
+ */
+
+/* global variables */
+int    kids = 0;
+
+void  decrement_kids(int sig_num);
+
+int main(int argc, char *argv[])
+{
+  int    server_sockfd, client_sockfd, server_len, client_len;
+  int    result;
+  char    buffer[STRLEN], *portString;
+  uint16_t  netSafe;
+  uint32_t  auth_token;
+  unsigned short  status;
+  struct  sockaddr_in server_address;
+  struct  sockaddr_in client_address;
+
+  if (IPPC_DEFAULT_VERBOSITY > 1) {
+    gprint (GP_ERR, "%s : THIS PROGRAM _IS_ A REMOTE EXPLOIT!!!\n", argv[0]);
+  }
+
+  if (!(portString = getenv("IPPC_COMMANDSERVER_PORT"))) {
+    portString = "1035";
+  }
+
+  server_sockfd = socket(AF_INET, SOCK_STREAM, 0);
+        if (server_sockfd == 0) {
+                perror("socket");
+                exit(EXIT_FAILURE);
+        }
+
+  server_address.sin_family = AF_INET;
+  server_address.sin_addr.s_addr = htonl(INADDR_ANY);
+  server_address.sin_port = htons(atoi(portString));
+  server_len = sizeof(server_address);
+
+  result = bind(server_sockfd, (struct sockaddr *)&server_address, server_len); 
+        if(result == -1) {
+                perror("bind");
+                exit(EXIT_FAILURE);
+        }
+
+  result = listen(server_sockfd, 10);
+        if(result == -1) {
+                perror("listen");
+                exit(EXIT_FAILURE);
+        }
+  
+  /* decrement the kiddie count after a child exits */
+  signal(SIGCHLD, decrement_kids);
+
+  /* flush dem pesky chars outa my buffer */
+  memset(buffer, 0, sizeof(buffer));
+
+  while(1) {
+    if (IPPC_DEFAULT_VERBOSITY > 1) {
+      gprint (GP_ERR, "%s : pid: %d - waiting for connection...\n", argv[0], getpid());
+    }
+
+    if (kids < MAX_KIDS) {
+      client_len = sizeof(client_address);
+      client_sockfd = accept(server_sockfd, (struct sockaddr *)&client_address, &client_len);
+    } else {
+      if (IPPC_DEFAULT_VERBOSITY > 1) {
+        gprint (GP_ERR, "%s : pid: %d - kids: %d - child limit already reached, sleeping %ds...\n",
+          argv[0], getpid(), kids, WAIT_FOR_KIDS);
+      }
+      sleep(WAIT_FOR_KIDS);
+      continue;
+    }
+
+    /* increment kiddie count before forking */
+    kids++;
+
+    if (fork() == 0) {
+      if (IPPC_DEFAULT_VERBOSITY > 1) {
+        gprint (GP_ERR, "%s : pid: %d - new kid number: %d\n", argv[0], getpid(), kids);
+      }
+
+      /* a non-zero result doesn't always mean an error occured
+       * I need to find out more about how to handle error checking here
+       */
+
+      /* receive and check authentication key */
+      recv(client_sockfd, &auth_token, sizeof(auth_token), 0);
+
+      if (ntohl(auth_token) != COMMAND_KEY) {
+        if (IPPC_DEFAULT_VERBOSITY > 1) {
+          gprint (GP_ERR, "%s : pid: %d - invalid authentication key\n", argv[0], getpid());
+        }
+
+        netSafe = htons(-1);
+        send(client_sockfd, &netSafe, sizeof(status), 0);
+
+        close(client_sockfd);
+        exit(EXIT_FAILURE);
+      }
+
+      /* receive command */
+      recv(client_sockfd, buffer, STRLEN, 0);
+  
+      if (IPPC_DEFAULT_VERBOSITY > 1) {
+        gprint (GP_ERR, "%s : pid: %d - recieved: %s\n", argv[0], getpid(), buffer);
+      }
+  
+      /* oh man is this dangerous */
+      status = system(buffer);
+      if (status != 0) {
+        if (IPPC_DEFAULT_VERBOSITY > 1) {
+          gprint (GP_ERR, "%s : pid: %d - command failed - code: %d\n", argv[0], getpid(), status);
+        }
+        netSafe = htons(status);
+        send(client_sockfd, &netSafe, sizeof(netSafe), 0);
+      } else {
+        if (IPPC_DEFAULT_VERBOSITY > 1) {
+          gprint (GP_ERR, "%s : pid: %d - command successful\n", argv[0], getpid());
+        }
+        netSafe = htons(status);
+        send(client_sockfd, &netSafe, sizeof(status), 0);
+      }
+
+      status = shutdown(client_sockfd, SHUT_RDWR);
+      if (status) {
+        perror("shutdown");
+        exit(EXIT_FAILURE);
+      }
+  
+      close(client_sockfd);
+      exit(EXIT_SUCCESS);
+    } else {
+      close(client_sockfd);
+    }
+  }
+}
+
+void  decrement_kids(int sig_num)
+{
+  /* sysv requires the handler to be reinstalled */
+  signal(SIGCHLD, decrement_kids);
+
+  /* reap child exit value */
+  while (waitpid(-1, NULL, WNOHANG) > 0) { kids--; }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/libs.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/libs.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/libs.txt	(revision 15879)
@@ -0,0 +1,17 @@
+
+I have divided the (non-user) functions into classes. 
+
+- conversions can be placed in a single library
+
+- graph and image (tv) functions can be placed in a library
+
+- the opihi shell functions can go into a third library
+
+- the dvo-related functions can go into a fourth
+
+- i need to clean up the mana and dimm misc functions, and put them in libraries 
+
+- the user functions also need to go into some libraries.
+
+- how do I have the library add its functions to the command list?
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/mana.updates.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/mana.updates.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/mana.updates.txt	(revision 15879)
@@ -0,0 +1,135 @@
+
+mana functions which existed in DVO from status:
+
+applyfit2d.c         : OK - vector changes only
+applyfit.c	     : OK - vector changes only
+box.c		     : OK - no diff
+center.c	     : OK - no diff
+clear.c		     : OK - no diff
+concat.c	     : OK - vector changes only
+contour.c	     : mana version writes to Ximage, dvo version writes to vectors.  mana/contour -> tvcontour.c
+create.c	     : OK - buffer changes only
+cursor.c	     : OK - buffer & minor changes only
+delete.c	     : OK - buffer & minor changes only
+device.c	     : OK - no diff
+extract.c	     : mana extract operates on buffers / status extract is db operation
+file.c		     : OK - no diff
+fit2d.c		     : OK - vector changes only
+fit.c		     : OK - added weights and parameter errors from mana version
+gaussj.c	     : OK - buffer changes only
+grid.c		     : mana version write to Ximage, dvo version writes to Xgraph. mana/grid -> tvgrid
+histogram.c	     : OK - vector changes only
+interpolate.c	     : OK - vector changes only
+jpeg.c		     : OK - no diff
+labels.c	     : OK - no diff
+limits.c	     : OK - vector & minor changes only
+list_buffers.c	     : OK - buffer changes only
+list_vectors.c	     : OK - vector & minor changes only
+mcreate.c	     : OK - buffer changes only
+mget.c		     : OK - buffer changes only
+mset.c		     : OK - buffer changes only
+ps.c		     : OK - no diff
+rd.c		     : OK - buffer changes only
+read_vectors.c	     : OK - included reading vectors from fits tables
+region.c	     : OK - no diff
+resize.c	     : OK - no diff
+section.c	     : OK - no diff
+set.c		     : OK - mana version out of date
+sprintf.c	     : OK - no diff
+stats.c		     : OK - included threshold comparison for IgnoreValue and min == max test
+style.c		     : OK - mana version out of date
+subset.c	     : OK - mana version out of date
+textline.c	     : OK - no diff
+tv.c		     : OK - buffer changes only
+uniq.c		     : OK - vector changes only
+vcontour.c	     : mana/vcontour equiv to dvo/contour
+vstat.c		     : OK - vector changes only
+wd.c		     : OK - buffer changes only
+write_vectors.c	     : OK - vector changes only
+zap.c		     : OK - buffer changes only
+zplot.c		     : OK - vector changes only
+
+mana functions not previously in DVO from status:
+
+accum.c			: fix vectors
+adc.c			: keep - specialized
+biassub.c		: fix buffers and vectors
+clip.c			: fix buffers and vectors
+cmpload.c		: keep
+coords.c		: fix buffers and vectors
+cut.c			: fix buffers and vectors
+cval.c			: ? superceeded by 'star'?
+demux.c			: keep - specialized
+dimendown.c		: fix buffers and vectors
+dimenup.c		: fix buffers and vectors
+drawline.c		: keep - unused
+drizzle.c		: fix buffers and vectors
+erase.c			: keep
+fft1d.c			: fix buffers and vectors
+fft2d.c			: fix buffers and vectors
+flux.c			: fix buffers and vectors
+gauss.c			: fix buffers and vectors
+gaussfit.c		: ? to correct?
+getchr.c		: keep
+getvel.c		: 
+imfit.c			: 
+imhist.c		: 
+integrate.c		: 
+kern.c			: 
+keyword.c		: 
+line.c			: 
+list_header.c		: 
+load.c			: 
+medacc.c		: 
+medianmap.c		: 
+memory.c		: 
+minterpolate.c		: 
+mkgauss.c		: 
+multifit.c		: 
+nextract.c		: 
+objload.c		: 
+outline2.c		: ??
+outline.c		: ??
+pause.c			: 
+peak.c			: 
+point.c			: 
+polar.c			: 
+profile.c		: 
+rdseg.c			: 
+rebin.c			: 
+roll.c			: 
+rotate.c		: 
+rotcurve.c		: 
+save.c			: 
+scale.c			: 
+select.c		: 
+sexigesimal.c		: 
+shape.c			: 
+shift.c			: 
+simsignal.c		: 
+sort_vectors.c		: 
+spec.c			: 
+spline_apply.c		: 
+spline_construct.c	: 
+star.c			: 
+strchr.c		: 
+strlen.c		: 
+substr.c		: 
+svd.c			: 
+swapbytes.c		: 
+testfit.c		: 
+transform.c		: 
+unsign.c		: 
+usleep.c		: 
+vbin.c			: 
+vclip.c			: 
+
+outdated or unneeded functions:
+
+dummy.c
+downdimen.c
+buftovec.c
+kernel.c
+updimen.c		: 
+stupidtest.c		: 
+plot2.c			: fixed GetColor in dvo/plot.c
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/notes.dvo-data.html
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/notes.dvo-data.html	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/notes.dvo-data.html	(revision 15879)
@@ -0,0 +1,166 @@
+
+<h2> data structures in DVO </h2>
+
+DVO uses several data structures, defined in <tt>loneos.h</tt> to
+represent data in the database tables.  This document attempts to
+describe the actual usage, some of which may disagree with the comment
+entries in <tt>loneos.h</tt>.
+
+<b> Image </b>
+<table> 
+<tr><th> name               </th><th> type           </th><th> value                     </th><th> units              </th>
+<tr><td> coords             </td><td> Coords         </td><td> astrometry                </td><td>                    </td>
+<tr><td> tzero              </td><td> unsigned int   </td><td> readout time row 0        </td><td> unix time          </td>
+<tr><td> nstar              </td><td> unsigned int   </td><td> number of stars on image  </td><td>                    </td>
+<tr><td> secz               </td><td> short int      </td><td> airmass                   </td><td> 1000*airmass       </td>
+<tr><td> NX                 </td><td> short int      </td><td> image size                </td><td> pixels             </td>
+<tr><td> NY                 </td><td> short int      </td><td> image size                </td><td> pixels             </td>
+<tr><td> apmifit            </td><td> short int      </td><td> aperture correction       </td><td> 1000*mag           </td>
+<tr><td> dapmifit           </td><td> short int      </td><td> error                     </td><td> 1000*mag           </td>
+<tr><td> source             </td><td> short int      </td><td> photcode                  </td><td>                    </td>
+<tr><td> Mcal               </td><td> short int      </td><td> relphot correciton        </td><td> 1000*mag           </td>
+<tr><td> dMcal              </td><td> short int      </td><td> error                     </td><td> 1000*mag           </td>
+<tr><td> Xm                 </td><td> short int      </td><td> image chi-square          </td><td> 100*log(chisq)     </td>
+<tr><td> name[32]           </td><td> char           </td><td> image name                </td><td>                    </td>
+<tr><td> detection_limit    </td><td> unsigned char  </td><td>                           </td><td> 10*mag             </td>
+<tr><td> saturation_limit   </td><td> unsigned char  </td><td>                           </td><td> 10*mag             </td>
+<tr><td> cerror             </td><td> unsigned char  </td><td> astrometric error         </td><td> 50*arcsec          </td>
+<tr><td> fwhm_x             </td><td> unsigned char  </td><td> average FWHM X            </td><td> 25*arcsec          </td>
+<tr><td> fwhm_y             </td><td> unsigned char  </td><td> average FWHM Y            </td><td> 25*arcsec          </td>
+<tr><td> trate              </td><td> unsigned char  </td><td> drift rate                </td><td> 10000*sec/pix      </td>
+<tr><td> exptime            </td><td> float          </td><td> exposure time             </td><td> seconds            </td>
+<tr><td> code               </td><td> char           </td><td> data flags                </td><td>                    </td>
+<tr><td> ccdnum             </td><td> unsigned char  </td><td> mosaic CCD ID number      </td><td>                    </td>
+<tr><td> dummy[20]          </td><td> char           </td><td> extra                     </td><td>                    </td>
+<tr><td> order              </td><td> short int      </td><td> order of Mcal function    </td><td>                    </td>
+<tr><td> Mx                 </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> My                 </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Mxx                </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Mxy                </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Myy                </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Mxxx               </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Mxxy               </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Mxyy               </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Myyy               </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Mxxxx              </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Mxxxy              </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Mxxyy              </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Mxyyy              </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+<tr><td> Myyyy              </td><td> short int      </td><td> Mcal polynomial term      </td><td>                    </td>
+</table>
+
+<em> apmifit, dapmifit are needed for dophot data, but not sextractor data.  are these correctly handled? </em>
+<em> skyprobe used Mxxxx for Ncal and Myyyy for sky - can this be reconciled? </em>
+
+<h3> codes in Image</h3>
+<ul>
+<li> ID_IMAGE_NOCAL = 0x04 - internal to relphot 
+<li> ID_IMAGE_POOR  = 0x02 - set by relphot
+<li> ID_IMAGE_SKIP  = 0x04 - use by relphot (!!!)
+</ul>
+
+<b> Average </b>
+<table> 
+<tr><th> name       </th><th> type           </th><th> value               </th><th> units                 </th></tr>
+<tr><td> R          </td><td> float          </td><td> RA                  </td><td> decimal degrees J2000 </td></tr>
+<tr><td> D          </td><td> float          </td><td> DEC                 </td><td> decimal degrees J2000 </td></tr>
+<tr><td> M          </td><td> short int      </td><td>                     </td><td> 1000*mag		    </td></tr>
+<tr><td> Nm         </td><td> unsigned short </td><td> N measure	    </td><td> 			    </td></tr>
+<tr><td> Nn         </td><td> unsigned short </td><td> N missing	    </td><td> 			    </td></tr>
+<tr><td> Xp         </td><td> short int      </td><td> position scatter    </td><td> 100*arcsec	    </td></tr>
+<tr><td> Xm         </td><td> short int      </td><td> mag chisq           </td><td> 100*log(chisq)	    </td></tr>
+<tr><td> code       </td><td> unsigned short </td><td> data flags	    </td><td> 			    </td></tr>
+<tr><td> offset     </td><td> signed int     </td><td> measure offset	    </td><td> 			    </td></tr>
+<tr><td> missing    </td><td> signed int     </td><td> missing offset	    </td><td> 			    </td></tr>
+<tr><td> dM         </td><td> short int      </td><td> error on M          </td><td> 1000*log(value)	    </td></tr>
+<tr><td> Xg         </td><td> short int      </td><td> best chisq value    </td><td> ??		    </td></tr>
+</table>		  
+
+<h3> codes in Average</h3>
+<li> set to 0 by addstar, etc
+<li> ID_STAR_NOCAL        = 0x0001 - set by relphot
+<li> ID_PROPER            = 0x0400 - set by addusno, used by markrock
+<li> ID_BAD_DATE          = 0x0800 - deprecate (not currently set)
+<li> ID_TRANSIENT         = 0x1000 - not currently set? 
+<li> ID_VARIABLE          = 0x2000 - not currently set? 
+<li> ID_ROCK              = 0xa000 - set by markrock
+<li> ID_GHOST             = 0xc001 - set by fixcat, markstar
+<li> ID_TRAIL             = 0xc002 - set by fixcat, markstar
+<li> ID_BLEED             = 0xc003 - set by fixcat, markstar, markrock
+<li> ID_COSMIC            = 0xc004 - set by markrock
+</ul>
+
+<b> Measure </b>
+<table> 
+<tr><th> name       </th><th> type           </th><th> value               </th><th> units             </th>
+<tr><td> dR         </td><td> short int      </td><td> RA offset           </td><td> 100*arcsec        </td>
+<tr><td> dD         </td><td> short int      </td><td> DEC offset          </td><td> 100*arcsec        </td>
+<tr><td> M          </td><td> short int      </td><td> catalog mag         </td><td> 1000*mag          </td>
+<tr><td> Mcal       </td><td> short int      </td><td> image cal mag       </td><td> 1000*mag          </td>
+<tr><td> Mgal       </td><td> short int      </td><td> 'galaxy' mag,       </td><td> 1000*mag          </td>
+<tr><td> airmass    </td><td> short int      </td><td> (airmass - 1),      </td><td> 1000*airmass      </td>
+<tr><td> FWx        </td><td> short int      </td><td> fwhm major axis     </td><td> 100*arcsec        </td>
+<tr><td> dM         </td><td> unsigned char  </td><td> mag error           </td><td> 1000*mag          </td>
+<tr><td> fwy        </td><td> unsigned char  </td><td> minor/major ratio   </td><td>                   </td>
+<tr><td> theta      </td><td> unsigned char  </td><td> angle wrt ccd X dir </td><td> degree*(256/360)  </td>
+<tr><td> dophot     </td><td> char           </td><td> dophot type         </td><td>                   </td>
+<tr><td> source     </td><td> unsigned short </td><td> photcode            </td><td>                   </td>
+<tr><td> t          </td><td> unsigned int   </td><td> time                </td><td> unix time         </td>
+<tr><td> averef     </td><td> unsigned int   </td><td> average entry       </td><td>                   </td>
+<tr><td> dt         </td><td> short int      </td><td> exposure time       </td><td> 2500*log(exptime) </td>
+<tr><td> flags      </td><td> unsigned short </td><td> data flags          </td><td>                   </td>
+</table>
+
+<h3> flags in Measure</h3>
+<ul>
+<li> ID_MEAS_POOR         = 0x0001 - set by relphot, unset?
+<li> ID_MEAS_NOCAL        = 0x0002 - set by relphot, unset?
+<li> BLEND_IMAGE          = 0x0100 - set by addstar, etc
+<li> BLEND_CATALOG        = 0x0200 - set by addstar, etc
+<li> BLEND_IMAGE_NEIGHBOR = 0x1000 - set by addstar, etc
+<li> PART_OF_TRAIL        = 0x2000 - set by markstar, fixcat, used by markrock
+<li> GHOST_DATA           = 0x4000 - set by markstar, fixcat, used by markrock
+</ul>
+
+<em> relphot flag meanings: </em>
+<b> ID_IMAGE_NOCAL </b> : completely ignore image (internal only)
+<b> ID_IMAGE_SKIP  </b> : externally marked, don't include in Mrel, calculate Mcal (?)
+<b> ID_IMAGE_POOR  </b> : internally marked, don't include in Mrel, calculate Mcal (?)
+
+<b> ID_STAR_NOCAL  </b> : poor star, don't include in Mcal, calculate Mrel
+STAR_BAD == (average.Xm > STAR_CHISQ) || (average.dM > STAR_SCATTER) || (NVALID < MEAS_TOOFEW)
+
+<b> ID_MEAS_NOCAL  </b> : skip this measurement (temporary, internal)
+<b> ID_MEAS_POOR   </b> : poor star, don't include in Mcal, calculate Mrel
+MEAS_POOR == (3 sigma outlier) || (out of detector area)
+<em> currently NOT sticky!! </em>
+
+--
+
+uniphot.h:
+# define MEAS_POOR     0x0001
+# define MEAS_NOCAL    0x0002
+# define ID_IMAGE_SKIP 0x0004
+
+relphot.h:
+# define ID_VARIABLE   0x2000
+# define ID_TRANSIENT  0x1000 /* is this mutually exclusive with USNO?  */
+# define ID_BAD_DATA   0x0800 /* stationary object with some bad data points */
+# define ID_PROPER     0x0400 /* star with large proper motion */
+
+# define MEAS_POOR     0x0001
+# define MEAS_NOCAL    0x0002
+# define ID_IMAGE_SKIP 0x0004
+
+<em> things to update, cleanup </em>
+<d> finish fix of photcode in imregister-3.0, etc </d>
+<d> move flag constants from relphot/uniphot/photdbc include -> loneos.h </d>
+<d> watch for use of Xp, Xg, code in photdbc & status.extract, status.gstar</d>
+<b> status.extract.NVALID : count !(measure.flag & MEAS_POOR) </b>
+<d> fix error with ID_IMAGE_NOCAL == ID_IMAGE_SKIP </d>
+<d> make sure ID_IMAGE_POOR is saved and ID_IMAGE_SKIP is kept, including with -mosaic </d>
+<d> should STAR_BAD be saved or not?  probably not: there is not one per photcode </d>
+<d> MEAS_POOR should be saved, MEAS_NOCAL should not </d>
+<b> recompile all dvo programs, test </b>
+
+<b> photdbc </b> <em> check on the use of flags, etc; consistent with relphot, uniphot? </em>
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/notes.photcode.html
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/notes.photcode.html	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/notes.photcode.html	(revision 15879)
@@ -0,0 +1,221 @@
+
+<h2> A Primer on DVO Photcodes and Magnitude Representation </h2>
+
+<p>
+There are two types of DVO table which store magnitude data.  The
+Average table stores magnitudes which represent averages of multiple
+measurements.  The Measure table stores magnitudes which represent
+single measurements.  
+
+<p>
+Each type of entry is defined by a Photcode.  The individual Measure
+entries have their photcodes stored as part of the structure.  The
+Average entries have photcodes which are determined externally by
+their sequence.  For historical reasons, the Average photcode are
+divided into the Primary photcode (of which there may only be one) and
+Secondary (of which there may be several).  The average magnitude
+associated with the Primary photcode is stored with the Average
+structure while the Secondary photcodes are stored in a separate,
+associated table called Secfilt.  The layout of the Average and
+Secfilt tables, and the photcodes assigned to them, are defined when
+the database is created based on the layout of the photcode table.
+This table is defined with a single Primary and a number of Secondary
+photcodes.  When the database tables are created, primary photcode is
+automatically associated with the Average entry while the sequence of
+Secondary photcodes defines the sequence of the entries in the Secfilt
+table.  This is very fragile, but very fast for making the
+association.  Thus, changing the number or sequence of secondary
+photcodes would cause an existing database table to be
+mis-interpretted.  
+
+<p>
+The Measure entries are broken into two photcode types as well:
+internal and external measurements.  Internal measurements are those
+for which the data source is well understood; the instrumental
+magnitudes are available and the instrumental parameters which are
+required to determine a calibrated magnitude.  External measurements
+are provided by external sources: published catalogs, reference
+sources, etc.  For these measurements, there is no control over the
+instrumental parameters which determined the measurement, and in many
+cases the measurement represents an average of an ensemble.
+
+<p>
+The photcode table defines relationships between photcodes,
+representing different photometry systems.  Each photcode entry
+defines the target of the calibration (the equivalence), and it may
+potentially define the zero-point (Co), the airmass slope (Ko), the
+appropriate color terms (C1, C2), the reference color term (Color),
+and the polynomial coefficients of the color equation (starting with
+the 1st order term).  
+
+<p>
+I need to include operations to handle varying color terms between
+CCDs.  I have measured color terms between CCDs in the range +/- 0.1
+mag/mag.  This is an appropriate time to clean up some of the code
+that handles the photcodes, etc.  In particular, the photcode table
+should provide the relationship beween relate between filter systems.
+
+For all of the functions below, a REF photcode simply returns the
+stored magnitude without transformation.  
+
+PhotInst (measure)
+  returns the instrumental magnitude of the given Measure
+  Minst = measure[0].M - measure[0].dt - iZERO_POINT;
+
+PhotCat (measure)
+  returns the 'catalog' magnitude of the given Measure (best guess
+  given no other information like color):
+  Mcat = measure[0].M - iZERO_POINT + Klam*(measure[0].airmass - 1000) + photcodes[0].code[Np].C;
+
+PhotSys (measure, average, secfilt)
+  returns the 'system' magnitude of the given Measure (best guess
+  using existing color information, but without application of
+  relative photometry offsets):
+  Msys = Mcat + f(color)
+  color is derived from measure.photcode.c1,c2  (measure.source.c1,c2)
+
+PhotRel (measure, average, secfilt)
+  returns the 'relative' magnitude of the given Measure (best guess
+  using existing color information and current relative photometry
+  measurment for this image).  This is the same photometry system as
+  the Average (PRI/SEC) measurement equivalent to this measurement
+  photcode:
+  Mrel = Msys + measure[0].Mcal;
+  color is derived from measure.photcode.c1,c2  (measure.source.c1,c2)
+
+PhotCal (measure, average, secfilt, allmeasures, code)
+  returns the 'calibrated' magnitude of the given Measure (best guess
+  using existing color information and current relative photometry
+  measurment for this image transformed to the appropriate reference
+  photometry system):
+  Mcal = Mref + f(color)
+  color is derived from code.c1,c2
+  the provided code must be either the measure.photcode.equiv or an
+  alternate for that code.
+
+<p>
+consider two filters, B & V, and two CCDs 00 & 01.  also, reference
+data in B_L92, V_L92
+
+<pre>
+    N  photcode     type  Co      Ko       X    C1    C2    Ao     Color  Equivalent
+  100  CFH12K.B.00  dep   26.000 -0.15     -    B     V     0.1    -      B
+  101  CFH12K.B.01  dep   26.000 -0.15     -    B     V     0.0    -      B
+
+  200  CFH12K.V.00  dep   26.100 -0.15     -    B     V     0.0    -      V
+  201  CFH12K.V.01  dep   26.100 -0.15     -    B     V     0.1    -      V
+
+    1  B            pri    0.000  -        -    B_L92 V_L92 0.016  -      B_L92
+    2  V            sec    0.000  -        -    B_L92 V_L92 0.008  -      V_L92
+
+  1003 B_L92        ref    -      -        -    -     -     -      -      -
+  1004 V_L92        ref    -      -        -    -     -     -      -      -
+  
+  B = m + Co + Ko*(secz - 1) + Ao*(B - V)
+  B_L92 = B + Co + color*A0 + color^2*A1 + color^3*A2
+</pre>
+
+<b>changes I'd like to make related to photcodes</b>
+
+<li> use structure value 'photcode', not 'source' everywhere
+<li> better abstraction / conceptualization of PhotMode values (Inst, Rel, Abs, Sys)
+<li> N-order polynomial for color-fits
+
+<b> relevant programs </b>
+
+<table>
+<tr><td>* addrefs    </td><td> minor fixes, no conversions are used </td></tr> 
+<tr><td>* addspphot  </td><td> minor fixes, no conversions are used </td></tr> 
+<tr><td>* addstar    </td><td> minor fixes, no conversions are used </td></tr> 
+<tr><td>* delstar    </td><td> minor fixes, no conversions are used </td></tr> 
+<tr><td>* photcode   </td><td> probably ok, check is consistent with new (?) photcode structs </td></tr> 
+<tr><td>* photreg    </td><td> check consistency </td></tr> 
+<tr><td>* photsearch </td><td> check consistency, use photcode table to get Equivalent </td></tr> 
+<tr><td>* relphot    </td><td> signficant changes to handle new structures </td></tr>
+<tr><td>libohana     </td><td> update LoadPhotcodes funcs, check consistency, use photcode table to get Equivalent </td></tr> 
+<tr><td>photdbc      </td><td> signficant changes to handle new structures </td></tr>
+<tr><td>status       </td><td> signficant changes to handle new structures </td></tr>
+<tr><td>dvo          </td><td> repeat fixes in status </td></tr> 
+
+<tr><td>lightcurve </td><td> unused? </td></tr>
+</table>
+
+<b> basic photcode APIs </b>
+
+int LoadPhotcodes (char *filename);
+void SetZeroPoint (double ZP);
+
+PhotCode *GetPhotcodebyName (name);
+int       GetPhotcodeCodebyName (name);
+PhotCode *GetPhotEquivbyName (name);
+int       GetPhotEquivCodebyName (name);
+
+PhotCode *GetPhotcodebyCode (code);
+char     *GetPhotcodeNamebyCode (code);
+
+PhotCode *GetPhotEquivbyCode (code);
+int       GetPhotEquivCodebyCode (code);
+
+double PhotInst (Measure *measure);
+double PhotAbs (Measure *measure);
+double PhotCat (Measure *measure);
+double PhotSys (Measure *measure, Average *average, SecFilt *secfilt);
+double PhotRel (Measure *measure, Average *average, SecFilt *secfilt);
+double PhotAve (PhotCode *code, Average *average, SecFilt *secfilt);
+double PhotRef (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure);
+
+<b> examples </b>
+find measures which are of photcode equivalent to X
+if (GetPhotEquivCodebyCode (measure[0].source) == N1) { } 
+
+<b> code, entry, hashcode, hashNsec </b>
+entry = 1;
+photcode[entry].code = 100 
+photcode[entry].name = B
+hashcode[100] = 1;
+
+hashNsec is only valid for type PHOT_SEC:
+hashNsec[code] = Nsec entry in SecFilt table
+
+<b> note recursion relationships </b>
+hashcode[photcode[entry].code] = entry;
+photcode[hashcode[entry]].code = entry
+
+<b> outstanding questions / issues </b>
+
+<ul>
+<li> PhotSys needs to handle missing color values
+<li> define valid range for color?
+<li> double PhotFoo functions return what on NO_MAG?
+<li> PhotFoo functions need to check for valid input types:
+  <ul> 
+  <li> PhotInst - PHOT_DEP
+  <li> PhotAbs  - PHOT_DEP, PHOT_REF
+  <li> PhotCat  - PHOT_DEP, PHOT_REF
+  <li> PhotSys  - PHOT_DEP, PHOT_REF
+  <li> PhotRel  - PHOT_DEP, PHOT_REF
+  <li> PhotAve  - PHOT_PRI, PHOT_SEC
+  <li> PhotRef  - PHOT_PRI, PHOT_SEC
+  </ul>
+</ul>
+
+<b> phot definitions </b>
+PhotInst = Measure.M - dt - ZP 
+PhotCat  = Measure.M + K*(airmass-1) + C - ZP
+PhotSys  = Measure.M + K*(airmass-1) + C - ZP + X*color
+PhotRel  = Measure.M + K*(airmass-1) + C - ZP + X*color - Mcal  -> average.m
+PhotRef  = average.M + C + X*color 
+
+C: def ~ 26.0, pri ~ 0.0
+
+PhotAbs  = deprecate (measure.M + K*(airmass-1) + C - ZP
+
+<b> alt photcodes </b>
+
+photcodes of type ALT provide alternate calibration terms for a given
+photcode.  these codes are equivalent to primary/secondary codes, but
+no data is ever saved with this type.  There are only lookups between
+the photcode name and the photcode structure, never the photcode.code
+value, since that defines the photcode for which the given structure
+is an alternate relationship.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/notes.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/notes.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/notes.txt	(revision 15879)
@@ -0,0 +1,103 @@
+
+opihi improvements / fixes:
+
+* single math processing system : inline shell math used one set of
+  functions (shell/math.c), while the set = () used another set, and
+  logic used part of a third set.  This has been unified into a single
+  math handling function (newmath).  The new math expression handling
+  also returns temporary in-line vectors and matrix expressions.
+
+* global user variables (Buffers, Vectors) and other global variables
+  (outfile, tv parameters, graphic and image tool parameters) have
+  been encapsulated in fuctions to avoid the global data constructs.  
+
+* improved command exit status handling : in the past, a function
+  returning FALSE would halt all script executing, returning to the
+  top level of the command stack.  we now set the variable $STATUS
+  with the exit status and allow the the user to test the exit
+  status to choose an operation.  loops, macros, and input files can
+  use the 'break' and 'continue' functions to escape from the current
+  location.  calling break returns with an exit status of FALSE,
+  calling break returns immediately with an exit status of TRUE.
+
+* more extensive use of 'outfile' 
+
+* support for opihi scripts: there is now better interpretation of
+  command-line arguments to allow for embedded opihi scripts, ie
+  scripts with the dvo or mana interpretter named on the first line
+  with the prefix #! like a shell script.  The first command-line
+  argument is interpreted as a file to input while successive ones are
+  converted to variables $argv:0 - $argv:n  WARNING: in the past,
+  multiple input files could be specified on the command-line.  this
+  now must be specified with --load file arguments.
+
+* local variables: there is now support for local (vs global) opihi
+  variables.  any macro may have a variable declared as local with the
+  command 'local (var)', which may take a list of variables.  these
+  variables are stored internally in association with the macro name.
+  the command may include the option -static, in which case the
+  variable will retain its value on successive calls to the same
+  macro.
+
+- merge of all old opihi-type programs into a single code base 
+
+- group related functions into libraries
+
+- function names, etc, should come from a single function, now a
+  global include file.
+
+- update help files
+
+- update web pages
+
+--
+
+some notes: 
+
+- new vector interpretation is now somewhat slower, due to the multiple
+  assignments.
+
+- BinaryOp does not leak memory (tested)
+
+- 55 seconds for 1000 floating-pt operations on a 4Mpix (3 GHz) -> 0.2
+  seconds per FP OP on a 4k square image
+
+- loop / list functions:
+
+  opihi.c
+  run_loop.c
+  run_if.c
+  input.c
+  for_loop.c
+  macro_exec.c
+
+  I have added continue / break functionality to all loop operations:
+
+  * the variable $STATUS is set based on the exit status of each command
+  * each loop tests for break and continue
+  * in the case of break, the loop returns a status of FALSE
+  * in the case of continue, the loop returns a status of TRUE
+  * if break -auto is set to 'on', then any exit status of FALSE escapes to  
+    the top level.
+  * interrupts are carried up to the top level.
+
+- local variables
+
+  I have added local variables.  They have names of the form
+  MacroName.VarName, where MacroName is the macro in which they are
+  local.  They are declared local with the command 'local', which
+  takes a list of variables to declare local, and the optional -static
+  flag, which requires the shell to test for the existence of the
+  variable before creating it, and only create it if it does not
+  exist.  otherwise the existing value of the variable is maintained.
+
+- math
+
+  I have removed the last instances of math interpretation being
+  performed by math, not newmath, in expand_vectors (interpreting the
+  contents of the vector square brackets: x[5]), and in the two
+  locations where logic was used in the evaluation: run_in and
+  run_while.  there are still some error in the precedence of the
+  operators: logical operators >,<,==,!=, etc need to be lower
+  priority than other binary operators.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/pantasks.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/pantasks.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/pantasks.txt	(revision 15879)
@@ -0,0 +1,52 @@
+
+- task spawning speed
+
+  I have been examining things which affect the speed of the pantasks
+  processing. I have learned some interesting things:
+
+  * pcontrol was being slammed with requests for status by pantasks.
+    this may account for Paul's controller hang-ups.  I have added a
+    long (500ms) sleep to the controller thread to limit the rate at
+    which controller checks are run
+
+  * adding even a small usleep to the task_thread or job_thread puts
+    them to sleep for a long time (>> 10ms).  it seems longer than the
+    linux time slicer.  I have removed sleeps from the task and job
+    threads.
+
+  * the job submit rate is apparently limited by two things:
+
+    * when the job is submitted (SubmitJob) the interaction with
+      the controller seems to take ~30ms or more.
+
+    * some thread (controller thread? main readline thread?) seems to
+      introduce timeouts which are very long (up to 100ms).  These
+      introduce bit delays if when they happen during the task_thread
+      loop. 
+
+- updates for queues:
+
+  -key 1:2:4 (key is string with possibly multiple columns joined)
+  string function to drop first word
+
+
+- todo:
+
+  - create the processing threads:
+    - check tasks
+    - check jobs
+    - check controller  
+    - load inputs
+
+- additional issues:
+  - server input needs to place files for input on a stack which is 
+    actually loaded by the RunScheduler loop
+  - have the client run a special multicommand function which passes 
+    any unfound commands along to the server.  the server should not 
+    be running multicommand, but it probably does not hurt.
+    (the client is not allowed to send ';' to the server)
+
+  - pantasks input: this passes an 'input' command to the server, which
+    performs the input in a different thread.  is this the same thread
+    as the scheduler loop?  another option within the scheduler loop?
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/pcontrol.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/pcontrol.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/pcontrol.txt	(revision 15879)
@@ -0,0 +1,276 @@
+
+2006.08.18
+
+ Outstanding issues related to pcontrol:
+
+ * disposition of HUNG jobs?
+ * probably should not save the history for pcontrol or pclient
+   (these will be many lines long very quickly...)
+ * need to add options to run/stop for hosts and jobs independently
+
+2006.08.11
+
+I have nearly finished the conversion of pcontrol to use a background
+thread for monitoring the remote machines.  A few questions are still
+outstanding:  
+
+- currently, we are thread-safe for interactions with the stacks.  As
+  long as an operation is only working with a single job/host, and all
+  jobs/hosts are selected by pulling them from the stacks, there will
+  never be a contention between threads for the same job/host.
+  However, are there problems for commands which require a specific
+  job or host but are unable to find it because the job/host may be in
+  flight from one stack to another.  
+
+- The CheckIdleHost command needs to join a job and a host.  In this
+  case, it is necessary to lock the job PENDING stack while searching
+  for a job to give to a host.  The host is pulled off of the IDLE
+  stack before being past to CheckIdleHost.
+
+o CheckIdleHost currently does not have a way to send a WANTHOST job
+  to any host other than the WANTHOST.  What should the rule be by
+  which a job is run on an alternative machine? (partial fix)
+
+- we are not starting any of the job or host timers?
+
+2006.08.09
+
+working on pcontrol CheckSystem background thread.  One thread runs
+the readline interaction and performs all of the user commands.  The
+second thread runs the CheckSystem loop and tests the hosts and jobs.
+We need to be sure these two do not interfere with one another.  Here
+is a list of all of the user commands and the ways in which they
+interact with the Job / Host queues:
+
+
+
+2006.08.04
+
+pcontrol gets a large delay every time it tries to connect to a host.
+this is because the readline interrupt has to wait for the connection
+to complete.  I probably need to fix this by using a threaded model
+and running CheckSystem in a background thread.
+
+-----
+
+typedef struct {
+  char *buffer;
+  int   Nalloc;
+  int   Nmaxread;
+  int   Nextra;
+  int   Nlast;
+  int   Nbuffer;
+} Fifo;
+
+typedef struct {
+  int argc; char **argv; /* a list of words that define this object */
+  struct timeval start, accum, timer;
+  int   status;
+  char *logfile;
+  char *lastproc;
+} Object;
+
+typedef struct {
+  Object **object;
+  int    Nobject;
+  int    NOBJECT;
+} Queue;
+
+typedef struct {
+  char   *hostname;
+  int     rsock, wsock;
+  int     status; /* idle, busy, etc... */
+  struct  timeval start, accum, timer;
+  Fifo    fifo;
+  int     code;
+  Object *object;
+} Machine;
+
+
+currently, the transport is /usr/bin/rsh, defined in InitMachines.c 
+
+the shell on the remote machines is /bin/tcsh, defined by rconnect.c
+
+---
+
+pcontrol.client:
+
+ - remote process initiated by pcontrol
+
+ - accepts jobs, returns status, stdout and stderr
+
+ - valid commands:
+
+   - job (argv)
+     returns PID or -1 (0?) on failure
+
+   - status
+     returns current job status:
+     BUSY
+     EXIT n 
+     CRASH n
+     
+   - stderr
+     returns the current stderr buffer:
+     NBYTES n
+     (DATA)
+
+   - stdout
+     returns the current stdout buffer:
+     NBYTES n
+     (DATA)
+
+   
+---
+
+the client needs to accept commands from the server (via
+stdin/stdout), but it also needs to monitor its process.  I can use
+the opihi structure to implement the command-line interpretation with
+readline.  I can use the readline function rl_event_hook to set the
+background functions to check and rl_set_keyboard_input_timeout to set
+the polling period.
+
+this same method can be used with the scheduler:  the command 'run'
+can set the CheckTask function to this hook (& unset it).
+
+---
+
+rl_event_hook -> CheckChild
+
+  - needs to handle the case when no child process yet exists
+  - needs to examine the child status,
+  - needs to read from child stderr and store
+  - needs to read from child stdout and store
+
+  * no warnings (will not do anything clever if buffers get too large)
+
+---
+
+ pcontrol commands:
+
+ job [options] argv0 argv1 argv2 ...
+  -host name : run job on specified host, or any other if not available
+  +host name : run job on specified host, error if not available (error when attempted, not when submitted)
+  -timeout N : seconds before controller gives up on job (once started)
+  -stdout name : redirect job stdout to file directly
+  -stderr name : redirect job stderr to file directly
+
+  * priority information?
+  * returns JobID
+  * adds job to pending queue
+
+ host (hostname) [-delete]
+ (may have multiple entries to the same machine, these are not distinguished)
+
+ stdout ID [-file name]
+ stderr ID [-file name]
+ delete ID
+
+ status -job ID
+ status -machine hostname
+ status -queues
+
+pcontrol may be given a timeout for each job.  pcontrol will monitor a
+job and kill/crash it if the timeout expires.  the timeout only
+governs how long it is allowed to execute, not how long it can sit in
+the queue.  (the scheduler / operator should decide if a job has been
+on pcontrol for too long -- this probably means there are no
+appropriate machines ).
+
+pcontrol currently does not distinguish between multiple instances of
+a single host.  all have the same name.  if you want to bring down a
+host, you need to issue N host -down commands.  perhaps this is
+silly.  a simple alternative would be for the host [-on -off -start
+-stop] commands to apply to all defined entries which match the
+hostname.  In this case, a command like 'host foo -off' would find and
+halt all connections to the machine 'foo', while 'host foo -on' would
+restart them all (or rather, given the functionality of pcontrol,
+would allow pcontrol to attempt to bring them on).
+
+It is not clear why a user should be able to execute 'start' (down ->
+idle) or 'stop' (idle -> down).  The transition down -> idle is
+automatically performed by pcontrol for any machines which are
+currently down, while the transition idle -> down is immediately
+followed by an attempt by pcontrol to move the host from down -> idle.
+This functionality can be used with non-automatic calling of
+CheckSystem to test the pcontrol host interface operations.
+
+does it makes sense to kill all jobs on a host?  this would only have
+the effect of clearing the host for a moment until pcontrol decided to
+start another job on that host.  the desired effect is gained putting
+the host to 'off'.
+ 
+currently the command 'host (hostname)' puts the host in 'down'
+state.  pcontrol then immediately tries to connect to the host, moving
+it to 'idle' state (and then 'busy' if any jobs are available).  it
+might be useful to be able to add a host in 'off' state as a starting
+point.  
+
+it is not obvious that the user should be able to run 'CheckHost',
+unless this gets expanded to return state information on the host.
+
+---
+
+Job States:
+
+PENDING
+BUSY
+EXIT
+CRASH
+NEW *
+DEL *
+
+* - invisible states 
+
+Job State Transitions:
+
+NEW     -> PENDING : AddJob
+PENDING -> BUSY    : StartJob
+PENDING -> DEL     : DelJob
+BUSY    -> DONE    : CheckBusyJob | KillJob
+DONE    -> EXIT    : CheckDoneJob
+DONE    -> CRASH   : CheckDoneJob
+BUSY    -> PENDING : CheckJob | CheckHost
+EXIT    -> DEL     : DelJob
+CRASH   -> DEL     : DelJob
+
+Host States:
+
+IDLE
+BUSY
+DOWN
+OFF
+NEW *
+DEL *
+
+* - invisible states 
+
+Host State Transitions:
+
+NEW      -> OFF      : AddHost
+OFF      -> DEL      : DelHost
+OFF      -> DOWN     : OnHost
+DOWN     -> OFF      : OffHost
+IDLE     -> OFF      : OffHost
+DOWN     -> IDLE     : StartHost
+IDLE     -> BUSY     : StartJob
+BUSY     -> IDLE     : CheckJob | KillJob
+BUSY     -> BUSY-OFF : OffHost
+BUSY     -> DOWN     : CheckJob | CheckHost
+BUSY-OFF -> OFF      : CheckJob
+
+AddJob    - U
+DelJob    - U
+StartJob  - P
+CheckJob  - P
+KillJob   - U
+
+AddHost   - U
+DelHost   - U
+OnHost    - U
+OffHost   - U
+StartHost - P
+CheckHost - P
+
+U - operation performed by the user
+P - operation performed by the program
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/psched.htm
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/psched.htm	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/psched.htm	(revision 15879)
@@ -0,0 +1,161 @@
+
+This article describes the concept, design, and operation of
+<tt>psched</tt>, the Pan-STARRS IPP task scheduler.  
+
+<h2> Basic Concept </h2>
+
+  <p>
+  The purpose of <tt>psched</tt> is to manage the automatic construction
+  and execution of inter-related (often repetative) operations.
+  <tt>psched</tt> uses a set of rules to define UNIX commands, and
+  their corresponding command-line arguments, to be performed on some
+  regular, repeated basis.  The utility of <tt>psched</tt> is that it
+  can easily define an analysis system which is completely
+  state-based, as opposed to an event-driven system.  
+
+  <p>
+  Consider, for example, a telescope which obtains a collection of
+  images over the course of a night.  Every minute or two, it takes an
+  image and writes the image to some disk.  An event-driven analysis
+  system would involve having the telescope initiate a process at the
+  end of the exposure.  This process would perform an analysis, write
+  some output, then send trigger another process.  This type of
+  operation works very well for a simple set up with reliable
+  hardware.  Such a system becomes more difficult to maintain when
+  hardware failures occur or when multiple systems need to interact
+  with each other.  When failures occur, the triggering information
+  (the events) is easily lost, thus some mechanisms are needed to
+  detect these failures and either re-send the trigger or send an
+  alternative failure-mode trigger.  Or, if two systems need to
+  interact, one or the other system must block for results from the
+  first.  Stopping and restarting such an analysis system is very
+  delicate since the appropriate triggers must be set up some how, eg
+  by noticing which images have not succeeded and restarting them at
+  the appropriate stage.  All of these types of methods of handling
+  complexity and failures are essentially state-based rules.
+  <tt>psched</tt> allows the easy definition of a totally state-based
+  analysis system.
+
+  <p>
+  In a state-based system, some mechanism examines the state of the
+  system and decides which actions to perform based on the current
+  state.  In the illustration above, the mechanism could examine the
+  images available (either by examining the disk or by examining the
+  state of a data table) and decide to perform an operation based on
+  what images are available.  This makes it very easy to handle
+  complexity and errors.  If an analysis fails, the state either is
+  not successfully updated or the error state is recorded, both
+  situations being easy to detect and easy to handle.  Restarting the
+  system simply involves starting the state-monitoring mechanism.
+  Combining results from multiple input sources simply involves
+  watching for the multiple inputs to be available.  <tt>psched</tt>
+  provides a mechanism to define state monitors, and to define the
+  actions which are performed when those states occur.
+  <tt>psched</tt> action consist of initiating UNIX commands, where
+  the arguments of those commands may depend on the results of the
+  state tests.
+
+  <h3> Tasks vs Jobs </h3>
+
+  <p>
+  The primary function of <tt>psched</tt> is to repeatedly perform
+  <b>tasks</b>, and execute <b>jobs</b> on the basis of those tasks.
+  A task consists of a set of rules which describe system state tests
+  to perform on a regular time scale.  Based on the results of those
+  state tests, the task will then choose whether or not to construct a
+  job.  The task also defines actions to perform upon the completion
+  of a job, based upon the output and exit status of the job.  A task
+  thus defines the repeat period.  It may optionally define valid or
+  invalid time ranges (eg, Mon-Fri or 10:00-17:00, etc).  The task may
+  also specify that the job be run locally (ie, in the background on
+  the same computer as psched) or remotely by the parallel process
+  controller (<tt>pcontrol</tt>).  A job may even be restricted to a
+  specific computer managed by <tt>pcontrol</tt>.
+
+  An example of a simple tasks is given below.  
+
+<pre>
+  task datalist
+    command ls /data/foo
+    periods -exec 5.0
+    periods -timeout 50.0
+    periods -poll 1.0
+
+    task.exit 0
+      queueprint stdout
+      queuedelete stdout
+    end
+ 
+    task.exit 1
+      queuepush failure "task failed"
+    end
+  end
+</pre>
+
+  <p>
+  This task does not perform any system state tests; it is simply
+  constructs a new job every 5.0 seconds.  The job in this case is
+  always the same: <tt> ls /data/foo </tt>.  When the job finished,
+  if the job exit status is 0 (normal UNIX success status), the
+  resulting output is printed to the screen.  If the job returns an
+  exit status of 1 (a failure), the failure queue receives a single
+  entry.  Although they are not defined in this case, it is also
+  possible to specify the action to be taken if the job crashes (does
+  not exit normally) or if it times out (runs beyond the specified
+  timeout period).
+
+  A slightly more complex task which performs a state test and
+  constructs a command based on that test is shown below
+
+<pre>
+  task datalist
+    periods -exec 5.0
+    periods -timeout 50.0
+    periods -poll 1.0
+
+    task.exec 
+      $file = `next.file`
+      if ($file == "none")
+        break
+      end
+      command cp /data/foo/$file /data/bar
+    end
+
+    task.exit 0
+      queueprint stdout
+      queuedelete stdout
+      queuepush copied $file
+    end
+ 
+    task.exit 1
+      queuepush failure $file
+    end
+  end
+</pre>
+
+  The <tt>task.exec</tt> macro is executed by psched every 5.0
+  seconds.  This macro executes a (hypothetical user-defined) UNIX
+  command (<tt>next.file</tt>) which examines the system state, return
+  either a filename or the word "none".  If the result of this test is
+  "none", the task does nothing: no job is constructed.  Otherwise, a
+  job is constructed using the name of the file returned by the state
+  test.  Successful jobs have the filename added to the 'copied'
+  queue, while failed jobs add the filename to the 'failure' queue.
+
+  <h3> Parallel vs Local Job Processing </h3>
+
+  <h3> Task Restrictions </h3>
+
+  <h3> Inter-Task and Inter-Job Communications </h3>
+
+<h2> psched Design </h2>
+
+  <h3> The Opihi Shell </h3>
+
+  <h3> Task List </h3>
+
+  <h3> Job List </h3>
+
+  <h3> pcontrol Interface </h3>
+
+  <h3> 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/rd-upgrades.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/rd-upgrades.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/rd-upgrades.txt	(revision 15879)
@@ -0,0 +1,10 @@
+
+rd a file.fits : read from PHU
+rd a file.fits -x N : read from extension N (0 - N)
+rd a file.fits -n name : read from extension name
+
+-plane : read only slice N
+
+* this function needs to check for compressed data:
+
+  * if PHU has been compressed, 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/region-image.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/region-image.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/region-image.txt	(revision 15879)
@@ -0,0 +1,13 @@
+
+I have done some work on getting region to use the image projection
+for the dvo display.  The pieces are almost there, except:
+
+* there is apparently a small offset between the two systems?
+
+* SelectRegions relies on the values of xmax and ymax being degrees
+  from a 0,0 coordinate.  this is a little tricky: this should not
+  fail for large AITOFF projections.
+
+* kapa does not do non-linear projections
+* kapa does not do multi-level projections
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/sample.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/sample.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/sample.c	(revision 15879)
@@ -0,0 +1,18 @@
+# include <stdio.h>
+
+main (int argc, char **argv) {
+
+  int i;
+  char line[1024];
+
+  for (i = 0; i <= argc; i++) {
+    gprint (GP_ERR, "arg %2d: %s\n", i, argv[i]);
+  }
+  while (argv[i] != NULL) {
+    gprint (GP_ERR, "env %2d: %s\n", i, argv[i]);
+    i++;
+  } 
+  while (fscanf (stdin, "%s", line) != EOF) {
+    gprint (GP_ERR, "line: ...%s...\n", line);
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/scheduler.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/scheduler.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/scheduler.txt	(revision 15879)
@@ -0,0 +1,206 @@
+
+2005.07.15
+
+The controller sends messages to both stdout and stderr.  I can easily
+require the messages which are immediate responses to external
+commands (status, check, etc) go back on stdout.  other messages
+should go to stderr, or be suppressed.  I suppose i can regularly
+harvest the stderr messages?
+
+2005.07.14
+
+I am still exploring the scheduler / controller interactions.  the
+automatic interactions seem to work pretty well now.  The area of
+confusion is in the user interface, both in terms of checking on the
+status of things (both controller and scheduler) and in terms of
+having user control over aspects of the controller.
+
+I have defined user functions which execute the controller commands
+'status' and 'check'.  These are straightforeward since they simply
+send a command to the controller and echo the output (or give an error
+condition message).
+
+Should the user have the ability to define a job, independent of a
+task?  This could be implemented purely as a controller action: the
+controller commands 'job', 'kill', 'delete', 'stderr', 'stdout' would
+be available from the scheduler, and the commands simply passed
+along.  This adds a bit to the complexity: if the 'delete' command is
+passed along, nothing prevents the user from deleting a job scheduled
+by the scheduler from a task.  the scheduler may then get confused
+when it tries to interact with that job in the future from the
+automatic loop.
+
+Another option is to simply have these commands interact with the
+scheduler's job stack.  this has the advantage of limiting the
+scheduler / controller responsibility errors (scheduler, not user, is
+always responsible to sending/harvesting jobs to/from the
+controller, though we still need to handle the cases if a job is lost
+or dropped by the controller).  the diffficulty here is deciding how
+to handle the job completion.  we would need a way to define a set of
+exit macros, which could then do something useful with the output.  
+
+Another possibility is to define limits on how many times a task may
+spawn a job.  There would then be no 'job' function.  If we define
+this limitation, we will still need a way of killing and deleting a
+specific job.  Thus a 'kill' and 'delete' function would examine and
+modify the scheduler's job stack.  The stderr and stdout functions are
+then already part of the task commands.  
+
+Other task options might include: 
+
+- a list of allow / exclude time periods (which should be time-of-day
+  ranges and day-of-week ranges).
+
+- a function to delete an existing task (which would have to stop the
+  spawning of new jobs, at least until no more jobs for that task
+  remain).
+
+- allow the 'periods' command to define defaults when outside of a
+  task
+
+2005.07.05
+
+At this point, scheduler / pcontrol / pclient all work in a basic way.
+pclient is the most robust of the three, having the simplest
+responsibility.  pcontrol is generally pretty good, though I need to
+flesh out the user interface a bit and clean up the output warning / info
+messages.  scheduler will need the most attention, though it is
+already fairly reasonable.  I need to flesh out the user commands to
+check on the controller status (basically, these need to replicate the
+status commands available to the controller).  
+
+I also need to handle the case of timeout on the controller,
+independently of timeout for a local job on the scheduler.  currently,
+if a local job exceeds the timeout value, scheduler flags it.  but, it
+does not make sense to use the same timeout value for a controller
+job. I could pass the timeout to the controller when the job executes,
+in which case it has the same meaning, essentially, for the controller
+jobs as it does for the local jobs: once you start the function, it
+needs to complete within NN seconds.  However, I think I still need to
+have a scheduler concept of a job which the controller is unable to
+complete.  It should be possible to prevent a job from sitting pending
+on the controller forever.  What exactly you do if the controller is
+unwilling to execute a job is another story (possible reasons:
+controller overload, missing required host, missing any hosts,
+something hung somewhere?).  
+
+The scheduler does not do a good job of shutting down the controller
+when it (the scheduler) exits.  This works well for the
+pcontrol/pclient interface, so the solution lies there.  
+
+I need to decide how to behave if the scheduler asks for a job with a
+required host which the controller knows is currently down or
+non-existent.  Several options could be used.  The controller could
+simply hold the task until the scheduler notices it is not being
+executed (after all, the controller does not know if the machine is
+being serviced for a short time or a long time, but the scheduler
+could know).  The controller could immediately return a failure noting
+the current state of the machine (this would put the burden of
+deciding that the machine should be available on the scheduler).  The
+controller could try to execute the job a certain number of times, and
+then it could report the failure to the scheduler.  This is not so
+different from having a pending-timeout which the scheduler tracks
+(moves the timeout check to the controller, essentially).  
+
+There was some odd behavior with 'exec echo $stdout >> foo'.  This
+resulted in empty files 'foo'.  The following work fine, so something
+is just weird:
+exec echo foobar >> foo
+output foo
+echo $stdout
+output stdout
+
+Various error conditions should be checked
+
+What do we do if a task requests a host which is not available to the
+controller (ie, not defined)?  this is similar to the problem of
+requesting a host which is down.  I think the controller should either
+immediately refuse or accept in anticipation that such a host may
+eventually be defined.
+
+I need to be careful about jobs sent to the controller and not
+harvested before stopping the scheduler execution.
+
+---
+
+sched / pcontrol todo:
+
+- sched: validate task hosts with controller
+
+---
+
+scheduler commands:
+
+task (taskname)
+ - define a new task
+ - loads task-related commands from list / readline
+ - commands are parsed on load
+ - end with end (like if / for)
+
+task.exit (value)
+ - define a new task macro for this exit condition
+   (value) may be an exit status (number)
+   (value) may be 'timeout'
+   (value) may be 'crash' ?
+ - commands are parsed on execution (not on definition)
+
+task.exec
+ - define a task macro for exec condition
+ - commands are parsed on execution (not on definition)
+
+command (args) (args)
+ - defines command associated with task
+ - may be in task or in task.macro (exit/exec)
+   (in task, command line is static; in task.macro, command line is expanded for each instance)
+
+host (machine) [-required]
+ - defines preferred host
+ - may be in task or in task.macro (exit/exec)
+   (in task, value is static; in task.macro, value is defined for each instance)
+ - value of LOCAL runs job as local job (not on controller)
+ - value of NONE runs job on controller without specifying host
+
+stderr (file / variable)
+ - defines destination for stderr capture from task
+ - written to destination at end of execution?
+
+stdout (file / variable)
+ - defines destination for stdout capture from task
+ - written to destination at end of execution?
+
+periods -poll 1
+periods -exec 30
+periods -timeout 2
+ - defines relevant time-scale for the task
+
+run
+stop
+ - start or stop the scheduler loop, executing the various tasks
+
+---
+
+local jobs vs controller jobs
+
+a local job is run as background fork (ie, not on controller)
+a controller job is sent to the controller to run when it can
+
+---
+
+possible errors which the scheduler may encounter when executing a
+job:
+
+  - controller is not responding
+  - controller says machine is DOWN
+  - controller says command not found
+  - controller has too many processes
+  - controller takes to long to start job (pending timeout)
+  - controller says job timed out
+  - controller says job crashed
+  - controller says job exited with status
+
+---
+
+notes:
+
+ - watch for NFS lags / blocking.  if NFS has file visibility lags, we
+   may need to add blocking as an option to the job (-block filename)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/stds.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/stds.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/stds.txt	(revision 15879)
@@ -0,0 +1,40 @@
+
+notation:
+
+object : an astronomical source, may be observed multiple times
+measurement : a single observation of an object (one per object per exposure) 
+m_inst : instrumental magnitude measurement
+m_cat  : catalog magnitude measurement (m_inst + 25.0)
+m_sys  : nominal internal system magnitude measurement (m_inst + ZP(CCD,FILTER)
+m_rel  : transparency adjusted magnitude measurement (m_sys + offset)
+
+M_ave  : average (object) magnitude in internal system
+M_ref  : average (object) magnitude in reference system
+
+test for photometric consistency:
+
+for the output from dither.corr:
+
+M_ave - m_rel(ccd) vs x_ccd, y_ccd
+M_ave - m_rel vs x_mosaic, y_mosaic
+M_ave - m_rel vs airmass?
+
+
+
+  MEGACAM.g.00 Minst - MEGACAM.g.01 Mcal : time
+
+  MEGACAM.g.00 - g : time
+
+  MEGACAM.g.00,Mrel - MEGACAM.g.01,Mcal : MEGACAM.g.00 - MEGACAM.r.00
+
+- use relphot to flag stars in poor locations, etc
+
+- we can choose for entry if it is Minst, Mcat, Msys, Mvrel, Mcal, Mave, or Mref
+
+int GetMagnitudeType (char *name, PhotCode *code, int *MagMode);
+
+- should return photcode & value MEAS_MREL, AVE_MREF, or what ever
+- should provide an appropriate default for measures, etc
+- should check for consistency with photcode type:
+  PRI/SEC : AVE_MREF, AVE_MAVE
+  DEP     : MEAS_ETC
Index: /branches/eam_branch_20071222/Ohana/src/opihi/doc/todo.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/doc/todo.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/doc/todo.txt	(revision 15879)
@@ -0,0 +1,4 @@
+
+- convert and include all mana/dimm/status derived functions
+- local scalar variables
+- break / continue in: for, macro, 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ImageOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ImageOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ImageOps.c	(revision 15879)
@@ -0,0 +1,123 @@
+# include "dvoshell.h"
+
+void image_subset (Image *image, int Nimage, int **Subset, int *Nsubset,
+		   SkyRegionSelection *selection, 
+		   unsigned long int tzero, double trange, int TimeSelect) 
+{
+
+  int i, j, flipped, status, InPic;
+  int *subset;
+  int N, n, npts;
+  double r, d, X, Y, x[4], y[4], Rmin, Rmax, Rmid;
+  Graphdata graph;
+  SkyRegion patch;
+
+  Rmin = Rmax = Rmid = 0;
+
+  if (selection->useDisplay) {
+    if (!GetGraphData (&graph, NULL, NULL)) {
+      gprint (GP_ERR, "region display not available\n");
+      return;
+    }
+    Rmin = graph.coords.crval1 - 182.0;
+    Rmax = graph.coords.crval1 + 182.0;
+    Rmid = 0.5*(Rmin + Rmax);
+    BuildChipMatch (image, Nimage);
+  }
+
+  if (selection->useSkyregion) {
+    double Rs, Re, Ds, De;
+    get_skyregion (&Rs, &Re, &Ds, &De);
+    patch.Rmin = Rs;
+    patch.Rmax = Re;
+    patch.Dmin = Ds;
+    patch.Dmax = De;
+    Rmin = patch.Rmin - 182.0;
+    Rmax = patch.Rmax + 182.0;
+    Rmid = 0.5*(Rmin + Rmax);
+  }
+
+  if (trange < 0) {
+    tzero = tzero + trange;
+    trange = fabs (trange);
+  }
+
+  npts = 200;
+  ALLOCATE (subset, int, npts);
+  n = N = 0;
+  for (i = 0; i < Nimage; i++) {
+    if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue;
+    if (selection->useDisplay) {
+      if (!FindMosaicForImage (image, Nimage, i)) continue;
+      /* project this image to screen display coords */
+      x[0] = 0;           y[0] = 0;
+      x[1] = image[i].NX; y[1] = 0;
+      x[2] = image[i].NX; y[2] = image[i].NY;
+      x[3] = 0;           y[3] = image[i].NY;
+      InPic = flipped = FALSE;
+      for (j = 0; j < 4; j++) {
+	XY_to_RD (&r, &d, x[j], y[j], &image[i].coords);
+	/* use same side of 0,360 boundary for all corners */
+	if ((j == 0) && (r < Rmin)) flipped = TRUE; 
+	if ((j == 0) && (r > Rmax)) flipped = TRUE; 
+	while (flipped && (r < Rmid)) r+= 360.0;
+	while (flipped && (r > Rmid)) r-= 360.0;
+	status = RD_to_XY (&X, &Y, r, d, &graph.coords);
+	if (!status) continue;
+	if (X < graph.xmin) continue;
+	if (X > graph.xmax) continue;
+	if (Y < graph.ymin) continue;
+	if (Y > graph.ymax) continue;
+	goto in_region;
+	/** we miss any images which surround the region.  we are also
+	    missing the DIS images for which the corners don't touch
+	    the region, but which are needed for WRP images with
+	    corners touching the region **/
+      }
+      continue;
+    }
+    if (selection->useSkyregion) {
+      if (!FindMosaicForImage (image, Nimage, i)) continue;
+      /* project this image to screen display coords */
+      x[0] = 0;           y[0] = 0;
+      x[1] = image[i].NX; y[1] = 0;
+      x[2] = image[i].NX; y[2] = image[i].NY;
+      x[3] = 0;           y[3] = image[i].NY;
+      InPic = flipped = FALSE;
+      for (j = 0; j < 4; j++) {
+	XY_to_RD (&r, &d, x[j], y[j], &image[i].coords);
+	/* use same side of 0,360 boundary for all corners */
+	if ((j == 0) && (r < Rmin)) flipped = TRUE; 
+	if ((j == 0) && (r > Rmax)) flipped = TRUE; 
+	while (flipped && (r < Rmid)) r+= 360.0;
+	while (flipped && (r > Rmid)) r-= 360.0;
+	if (r < patch.Rmin) continue;
+	if (r > patch.Rmax) continue;
+	if (d < patch.Dmin) continue;
+	if (d > patch.Dmax) continue;
+	goto in_region;
+	/** we miss any images which surround the region.  we are also
+	    missing the DIS images for which the corners don't touch
+	    the region, but which are needed for WRP images with
+	    corners touching the region **/
+      }
+      continue;
+    }
+  in_region:
+    subset[n] = i;
+    n++;
+    if (n > npts - 1) {
+      npts += 200;
+      REALLOCATE (subset, int, npts);
+    }
+  }
+
+  REALLOCATE (subset, int, MAX (n, 1));
+  *Subset = subset;
+  *Nsubset = n;
+  return;
+}
+
+/* this routine fills the subset index with the list of selected images.
+   images may be selected on the basis of the region or on a time range 
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ImageSelection.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ImageSelection.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ImageSelection.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "dvoshell.h"
+
+/* db image table */
+static Image *image = NULL;
+static int *subset = NULL;
+static int Nimage = 0;
+static int Nsubset = 0;
+static Coords mosaic;
+
+/* load images based on parameters and region, etc */
+int SetImageSelection (int mosaicMode, SkyRegionSelection *selection) {
+
+  int TimeSelect;
+  time_t tzero, tend;
+
+  image = NULL;
+  subset = NULL;
+  
+  TimeSelect = GetTimeSelection (&tzero, &tend);
+
+  if (mosaicMode) {
+      /* mosaic defines a frame with 0,0 at the mosaic center, and 1 arcsec / pixel */
+      mosaic.crpix1 = mosaic.crpix2 = 0.0;
+      mosaic.cdelt1 = mosaic.cdelt2 = 1.0 / 3600;
+      mosaic.pc1_1  = mosaic.pc2_2  = 1.0;
+      mosaic.pc1_2  = mosaic.pc2_1  = 0.0;
+      mosaic.Npolyterms = 0;
+      strcpy (mosaic.ctype, "RA---SIN");
+  }
+
+  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
+  BuildChipMatch (image, Nimage);
+  image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, (double) tend - tzero, TimeSelect);
+  sort_image_subset (image, subset, Nsubset);
+  return (TRUE);
+}
+
+/* free loaded images */
+void FreeImageSelection () {
+  if (image != NULL) free (image);
+  if (subset != NULL) free (subset);
+  image = NULL;
+  subset = NULL;
+  return;
+}
+
+Image *MatchImage (unsigned int time, short int source) { 
+
+  int m;
+
+  m = match_image_subset (image, subset, Nsubset, time, source);
+  if (m == -1) return (NULL);
+  if (!FindMosaicForImage (image, Nimage, m)) return (NULL);
+  return (&image[m]);
+}
+
+Coords *MatchMosaic (unsigned int time, short int source) { 
+
+  int m;
+
+  m = match_image_subset (image, subset, Nsubset, time, source);
+  if (m == -1) return (NULL);
+  mosaic.crval1 = image[m].coords.crval1;
+  mosaic.crval2 = image[m].coords.crval2;
+  return (&mosaic);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/LoadImages.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/LoadImages.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/LoadImages.c	(revision 15879)
@@ -0,0 +1,41 @@
+# include "dvoshell.h"
+
+Image *LoadImages (int *nimage) {
+
+  int status;
+  char *catdir, filename[256];
+  Image *image;
+  FITS_DB db;
+  
+  /* VarConfig ("IMAGE_CATALOG", "%s", filename); */
+
+  catdir = GetCATDIR ();
+  sprintf (filename, "%s/Images.dat", catdir);
+
+  gfits_db_init (&db);
+  db.lockstate = LCK_SOFT;
+  db.timeout   = 120.0;
+
+  if (!gfits_db_lock (&db, filename)) {
+    gprint (GP_ERR, "error opening image catalog %s (1)\n", filename);
+    return (NULL);
+  }
+
+  if (db.dbstate == LCK_EMPTY) {
+    gprint (GP_ERR, "note: image catalog is empty\n");
+    ALLOCATE (image, Image, 1);
+    *nimage = 1;
+    return (image);
+  }
+
+  status = dvo_image_load (&db, TRUE, FALSE);
+  gfits_db_close (&db);
+
+  if (!status) {
+    gprint (GP_ERR, "problem loading image database table\n");
+    return (NULL);
+  }
+
+  image = gfits_table_get_Image (&db.ftable, nimage, &db.swapped);
+  return (image);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/Makefile	(revision 15879)
@@ -0,0 +1,137 @@
+default: dvo
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+SRC     =       $(HOME)/dvo
+DATA    =       $(DESTDATA)/dvo
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+LIBS1   =       -lbasiccmd -ldatacmd -lastrocmd -lshell -ldata 
+LIBS2   =       -ldvo -lkapa -lFITS -lohana
+FULL_CFLAGS   = $(BASE_CFLAGS)
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(LIBS1) $(LIBS2) $(BASE_LDFLAGS)
+
+# dvo user commands and support functions ########################
+funcs = \
+$(SRC)/init.$(ARCH).o            	\
+$(SRC)/ImageOps.$(ARCH).o		\
+$(SRC)/ImageSelection.$(ARCH).o	        \
+$(SRC)/LoadImages.$(ARCH).o		\
+$(SRC)/cmpReadFile.$(ARCH).o		\
+$(SRC)/compare.$(ARCH).o                \
+$(SRC)/match_image.$(ARCH).o		\
+$(SRC)/photometry.$(ARCH).o             \
+$(SRC)/dvomisc.$(ARCH).o		\
+$(SRC)/region_list.$(ARCH).o		\
+$(SRC)/dvomisc.$(ARCH).o		\
+$(SRC)/dbBooleanCond.$(ARCH).o		\
+$(SRC)/dbCheckStack.$(ARCH).o		\
+$(SRC)/dbCmdlineFields.$(ARCH).o	\
+$(SRC)/dbExtractAverages.$(ARCH).o	\
+$(SRC)/dbExtractMeasures.$(ARCH).o	\
+$(SRC)/dbFields.$(ARCH).o		\
+$(SRC)/dbRPN.$(ARCH).o			\
+$(SRC)/dbStackMath.$(ARCH).o		\
+$(SRC)/dbStackOps.$(ARCH).o		\
+$(SRC)/dvo.$(ARCH).o
+
+cmds = \
+$(SRC)/avextract.$(ARCH).o	  	\
+$(SRC)/badimages.$(ARCH).o	  	\
+$(SRC)/calextract.$(ARCH).o      	\
+$(SRC)/calmextract.$(ARCH).o     	\
+$(SRC)/catdir.$(ARCH).o             	\
+$(SRC)/ccd.$(ARCH).o             	\
+$(SRC)/cmatch.$(ARCH).o	  	\
+$(SRC)/cmd.$(ARCH).o             	\
+$(SRC)/cmpload.$(ARCH).o	  	\
+$(SRC)/cmpread.$(ARCH).o	  	\
+$(SRC)/ddmags.$(ARCH).o	  	\
+$(SRC)/detrend.$(ARCH).o	  	\
+$(SRC)/dmagaves.$(ARCH).o	  	\
+$(SRC)/dmagmeas.$(ARCH).o	  	\
+$(SRC)/dmags.$(ARCH).o		  	\
+$(SRC)/dmt.$(ARCH).o		  	\
+$(SRC)/elixir.$(ARCH).o                \
+$(SRC)/fitcolors.$(ARCH).o             \
+$(SRC)/fitsed.$(ARCH).o                \
+$(SRC)/gcat.$(ARCH).o		  	\
+$(SRC)/gimages.$(ARCH).o	  	\
+$(SRC)/gstar.$(ARCH).o		  	\
+$(SRC)/images.$(ARCH).o	  	\
+$(SRC)/imbox.$(ARCH).o		  	\
+$(SRC)/imdata.$(ARCH).o	  	\
+$(SRC)/imdense.$(ARCH).o	  	\
+$(SRC)/imextract.$(ARCH).o	  	\
+$(SRC)/imlist.$(ARCH).o	  	\
+$(SRC)/imphot.$(ARCH).o	  	\
+$(SRC)/imrough.$(ARCH).o	  	\
+$(SRC)/imsearch.$(ARCH).o	  	\
+$(SRC)/imstats.$(ARCH).o	  	\
+$(SRC)/lcat.$(ARCH).o		  	\
+$(SRC)/lcurve.$(ARCH).o	  	\
+$(SRC)/lightcurve.$(ARCH).o	  	\
+$(SRC)/mextract.$(ARCH).o	  	\
+$(SRC)/photcodes.$(ARCH).o	  	\
+$(SRC)/pmeasure.$(ARCH).o	  	\
+$(SRC)/paverage.$(ARCH).o	  	\
+$(SRC)/procks.$(ARCH).o	  	\
+$(SRC)/skycat.$(ARCH).o	  	\
+$(SRC)/skycoverage.$(ARCH).o	  	\
+$(SRC)/skyregion.$(ARCH).o	  	\
+$(SRC)/showtile.$(ARCH).o	  	\
+$(SRC)/simage.$(ARCH).o	  	\
+$(SRC)/subpix.$(ARCH).o  \
+$(SRC)/version.$(ARCH).o
+
+libs = \
+$(DESTLIB)/libshell.a \
+$(DESTLIB)/libdata.a \
+$(DESTLIB)/libbasiccmd.a \
+$(DESTLIB)/libastrocmd.a \
+$(DESTLIB)/libdatacmd.a
+
+dvo: $(BIN)/dvo.$(ARCH)
+$(SRC)/dvo.$(ARCH).o : $(libs)
+$(BIN)/dvo.$(ARCH)   : $(funcs) $(cmds)
+
+install: $(DESTBIN)/dvo help modules
+
+help: clean-help cmd.basic.help cmd.data.help cmd.astro.help dvo.help
+
+$(funcs) $(cmds) $(libs) : $(INC)/dvoshell.h
+
+modules: dvo.modules
+
+.PHONY: dvo
+
+# deprecated functions: verify & delete
+#$(SRC)/catalog.$(ARCH).o	  	\
+#$(SRC)/abszero.$(ARCH).o \
+#$(SRC)/cals.$(ARCH).o \
+#$(SRC)/dumpmags.$(ARCH).o \
+#$(SRC)/extract.$(ARCH).o \
+#$(SRC)/gtypes.$(ARCH).o \
+#$(SRC)/photresid.$(ARCH).o \
+#$(SRC)/resid.$(ARCH).o \
+#$(SRC)/zeropts.$(ARCH).o
+#$(SRC)/objload.$(ARCH).o \ - make sure we have vect to tv
+#$(SRC)/ccdextract.$(ARCH).o \
+#$(SRC)/cmdextract.$(ARCH).o \
+#$(SRC)/dmagextract.$(ARCH).o \
+#$(SRC)/ddmagextract.$(ARCH).o \
+#$(SRC)/pcat.$(ARCH).o		  	\
+
+# future functions, not fully implemented
+#$(SRC)/detrend.$(ARCH).o \
+#$(SRC)/getxtra.$(ARCH).o \
+#$(SRC)/addxtra.$(ARCH).o \
+
+# functions that need to be updated
+#$(SRC)/gregions.$(ARCH).o \
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/addxtra.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/addxtra.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/addxtra.c	(revision 15879)
@@ -0,0 +1,60 @@
+# include "dvoshell.h"
+
+typedef struct {
+  char type[64];
+  char name[64];
+  char source[256];
+  char mode[64];
+  char value[64];
+  char range[64];
+  double R, D;
+  int averef;
+} Xtras;
+
+int addxtra (int argc, char **argv) {
+  
+  Source = (char *) NULL;
+  if (N = get_argument (argc, argv, "-source")) {
+    remove_argument (N, &argc, argv);
+    Source = strcreate (atof[N]);
+    remove_argument (N, &argc, argv);
+  }
+  Name = (char *) NULL;
+  if (N = get_argument (argc, argv, "-name")) {
+    remove_argument (N, &argc, argv);
+    Name = strcreate (atof[N]);
+    remove_argument (N, &argc, argv);
+  }
+  Mode = (char *) NULL;
+  if (N = get_argument (argc, argv, "-mode")) {
+    remove_argument (N, &argc, argv);
+    Mode = strcreate (atof[N]);
+    remove_argument (N, &argc, argv);
+  }
+  Range = (char *) NULL;
+  if (N = get_argument (argc, argv, "-range")) {
+    remove_argument (N, &argc, argv);
+    Range = strcreate (atof[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: addxtra R D radius (type) (value)\n");
+    return (FALSE);
+  }
+  
+  /*
+
+  validate the input values (type, defines the needed options)
+  find catalog (based on r,d)
+  load catalog (need to load measures?)
+  find the object
+  find the xtra entry (sorted by ra/dec? sorted by averef?)
+  add new entry
+  save catalog 
+  */
+}
+
+/* 
+  addxtra R D dR type value -name (name) -source (source) -mode (mode) -range (range) 
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/aregion.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/aregion.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/aregion.c	(revision 15879)
@@ -0,0 +1,81 @@
+# include "dvoshell.h"
+# include "hstgsc.h"
+
+/* find region file which contains ra, dec */
+void aregion (GSCRegion *region, FILE *f, double ra, double dec, char *path) {
+  
+  char buffer[28800], temp[50], file[50];
+  double RA0, RA1, DEC0, DEC1;
+  int i, NBigDec, NLINES, done;
+  
+  while (ra < 0) { ra += 360.0; }
+  while (ra >= 360.0) { ra -= 360.0; }
+
+  if (dec >= 86.25) {
+    sprintf (file, "%s/n8230/pole.cpt", path);
+    region[0].DEC[0] = 86.25;
+    region[0].DEC[1] = 93.75;
+    region[0].RA[0] =  0.0;
+    region[0].RA[1] =  360.0;
+    strcpy (region[0].filename, file);
+    return;
+  }
+    
+  NBigDec = -1;
+  for (i = 0; i < 12; i++) {
+    if ((dec >= BigDecBounds[i]) && (dec < BigDecBounds[i+1])) {
+      NBigDec = i;
+      break;
+    }
+  }
+  if (NBigDec < 0) {
+    for (i = 13; i < 24; i++) {
+      if ((dec < BigDecBounds[i]) && (dec >= BigDecBounds[i+1])) {
+	NBigDec = i;
+	break;
+      }
+    }
+  }
+  if (NBigDec < 0) {
+    gprint (GP_ERR, "dec out of range: %f\n", dec);
+  }
+    
+  NLINES = 0;
+  for (i = 0; i < NBigDec; i++) {
+    NLINES += NDecLines[i];
+  }
+  fseek (f, 5*2880 + 48*NLINES, SEEK_SET);
+      
+  done = FALSE;
+  fread (buffer, 1, 48*NDecLines[NBigDec], f);
+  for (i = 0; !done && (i < NDecLines[NBigDec]); i++) {
+    strncpy (temp, &buffer[i*48], 48);
+    temp[49] = 0;
+    hstgsc_hms_to_deg (&RA0, &RA1, &DEC0, &DEC1, &temp[7]);
+    if (RA1 < RA0) RA1 += 360.0;
+    if ((dec >= 0) && (dec >= DEC0) && (dec < DEC1) && (ra >= RA0) && (ra < RA1)) {
+      done = TRUE;
+    }
+    if ((dec < 0) && (dec < DEC0) && (dec >= DEC1) && (ra >= RA0) && (ra < RA1)) {
+      done = TRUE;
+    }
+  }
+
+  if (!done) {
+    gprint (GP_ERR, "error in search: %f %f\n", ra, dec);
+    exit (0);
+  }
+  temp[5] = 0;
+  sprintf (file, "%s/%s/%s.cpt", path, Dec2Sections[NBigDec],&temp[1]);
+  if (DEC0 < DEC1) {
+    region[0].DEC[0] = DEC0;
+    region[0].DEC[1] = DEC1;
+  } else {
+    region[0].DEC[0] = DEC1;
+    region[0].DEC[1] = DEC0;
+  }     
+  region[0].RA[0] = RA0;
+  region[0].RA[1] = RA1;
+  strcpy (region[0].filename, file);
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/avextract.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/avextract.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/avextract.c	(revision 15879)
@@ -0,0 +1,182 @@
+# include "dvoshell.h"
+
+int avextract (int argc, char **argv) {
+  
+  int i, j, n, m, N, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
+  int Nsecfilt, mode, VERBOSE;
+  char **cstack, name[1024];
+  float *values;
+  void *Signal;
+
+  Catalog catalog;
+  SkyList *skylist;
+  SkyRegionSelection *selection;
+  PhotCode *code;
+  Vector **vec;
+  dbField *fields;
+  dbStack *stack;
+
+  /* defaults */
+  skylist = NULL;
+  selection = NULL;
+  code = NULL;
+  mode = MAG_AVE;
+  fields = NULL;
+  stack = NULL;
+
+  if ((N = get_argument (argc, argv, "-h"))) goto help;
+  if ((N = get_argument (argc, argv, "--help"))) goto help;
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    remove_argument (N, &argc, argv);
+    VERBOSE = TRUE;
+  }
+
+  dvo_catalog_init (&catalog, TRUE);
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  // parse skyregion options
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape;
+
+  // command-line is of the form: avextract field,field, field [where (field op value)...]
+
+  // parse the fields to be extracted and returned
+  fields = dbCmdlineFields (argc, argv, DVO_TABLE_AVERAGE, &last, &Nfields);
+  if (fields == NULL) return (FALSE);
+
+  // parse the remainder of the line as a boolean math expression
+  cstack = isolate_elements (argc-last, &argv[last], &Ncstack);
+  
+  // construct the db Boolean math stack (frees cstack)
+  stack = dbRPN (Ncstack, cstack, &Nstack);
+
+  // add the skyregion limits to the where statement (or create)
+  dbAstroRegionLimits (&stack, &Nstack, selection, DVO_TABLE_AVERAGE);
+
+  // parse stack elements into fields and scalars as needed
+  Nreturn = Nfields; 
+  dbCheckStack (stack, Nstack, DVO_TABLE_AVERAGE, &fields, &Nfields);
+  // XXX handle errors
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (selection)) == NULL) goto escape;
+
+  /* create output storage vectors */
+  ALLOCATE (values, float, Nfields);
+  ALLOCATE (vec, Vector *, Nreturn);
+  for (i = 0; i < Nreturn; i++) {
+    if (ISNUM(fields[i].name[0])) {
+      sprintf (name, "v_%s", fields[i].name);
+    } else {
+      sprintf (name, "%s", fields[i].name);
+    }
+    if ((vec[i] = SelectVector (name, ANYVECTOR, TRUE)) == NULL) goto escape;
+  }
+
+  Npts = 0;
+  NPTS = 1;
+
+  // grab data from all selected sky regions
+  Signal = signal (SIGINT, handle_interrupt);
+  interrupt = FALSE;
+  for (i = 0; (i < skylist[0].Nregions) && !interrupt; i++) {
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[i];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    if (VERBOSE) gprint (GP_ERR, "trying %s (%d of %d)\n", catalog.filename, i, skylist[0].Nregions);
+      
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      gprint (GP_ERR, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    for (j = 0; (j < catalog.Naverage) && !interrupt; j++) {
+      m = catalog.average[j].offset;
+      // extract the relevant values
+      // XXX for measure values, this could be optimized for one loop over measures...
+      for (n = 0; n < Nfields; n++) {
+	values[n] = dbExtractAverages (&catalog.average[j], &catalog.secfilt[j*Nsecfilt], &catalog.measure[m], &fields[n]);
+      }
+      // test the conditional statement
+      if (!dbBooleanCond (stack, Nstack, values)) continue;
+      for (n = 0; n < Nreturn; n++) {
+	vec[n][0].elements[Npts] = values[n];
+      }
+      Npts++;
+      if (Npts >= NPTS) {
+	NPTS += 2000;
+	for (n = 0; n < Nreturn; n++) {
+	  REALLOCATE (vec[n][0].elements, float, NPTS);
+	}
+      }
+    }
+    dvo_catalog_free (&catalog);
+  }
+  signal (SIGINT, Signal);
+  interrupt = FALSE;
+  for (n = 0; n < Nreturn; n++) {
+    vec[n][0].Nelements = Npts;
+    REALLOCATE (vec[n][0].elements, float, MAX(1,Npts));
+  }
+
+  dbFreeFields (fields, Nfields);
+  dbFreeStack (stack, Nstack);
+  free (stack);
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  return (TRUE);
+
+ escape:
+  dbFreeFields (fields, Nfields);
+  dbFreeStack (stack, Nstack);
+  free (stack);
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  dvo_catalog_free (&catalog);
+  return (FALSE);
+
+ help:
+  gprint (GP_ERR, "USAGE: avextract field[,field,field...] where (expression)\n");
+
+  if ((argc > N + 1) && !strcasecmp (argv[N+1], "fields")) {
+    gprint (GP_ERR, " USAGE: avextract field[,field,field...] where (expression)\n");
+    gprint (GP_ERR, "  RA : right ascension (J2000)\n");
+    gprint (GP_ERR, "  DEC : declination \n");
+    gprint (GP_ERR, "  dRA : ra scatter \n");
+    gprint (GP_ERR, "  dDEC : dec scatter\n");
+    gprint (GP_ERR, "  uRA : proper motion in ra\n");
+    gprint (GP_ERR, "  uDEC : proper motion in dec\n");
+    gprint (GP_ERR, "  duRA : proper motion error in ra\n");
+    gprint (GP_ERR, "  duDEC : proper motion error in dec\n");
+    gprint (GP_ERR, "  PAR : parallax\n");
+    gprint (GP_ERR, "  dPAR : parallax error \n");
+    gprint (GP_ERR, "  nmeas : number of measurements\n");
+    gprint (GP_ERR, "  nmiss : number of non-detections\n");
+    gprint (GP_ERR, "  xp : positional chi-square\n");
+    gprint (GP_ERR, "  flag : object flags\n");
+    gprint (GP_ERR, "  photocode:ave : average magnitude for photcode\n");
+    gprint (GP_ERR, "  photocode:ref : reference magnitude system for photcode\n");
+    gprint (GP_ERR, "  photocode:inst : first instrumental magnitude for photcode\n");
+    gprint (GP_ERR, "  photocode:cat : first catalog magnitude for photcode\n");
+    gprint (GP_ERR, "  photocode:sys : first system magnitude for photcode\n");
+    gprint (GP_ERR, "  photocode:rel : first relative magnitude for photcode\n");
+    gprint (GP_ERR, "  photocode:cal : first calibrated magnitude for photcode \n");
+    gprint (GP_ERR, "  photcode:err : magnitude error for photcode\n");
+    gprint (GP_ERR, "  photcode:chipsq : chi-square of magnitude fit\n");
+    gprint (GP_ERR, "  type : dophot type (unused)\n");
+    gprint (GP_ERR, "  typefrac : dophot type fraction (unused)\n");
+    gprint (GP_ERR, "  photcode:ncode : number of measurements in photcode \n");
+    gprint (GP_ERR, "  photcode:nphot : number of measurements used for photcode average\n");
+    return (FALSE);
+  }
+  gprint (GP_ERR, " avextract --help fields : for a complete listing of allowed fields\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/badimages.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/badimages.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/badimages.c	(revision 15879)
@@ -0,0 +1,73 @@
+# include "dvoshell.h"
+
+static int badim_int = FALSE;
+void badim_escape () {
+  badim_int = TRUE;
+}
+
+int badimages (int argc, char **argv) {
+  
+  int i, Nimage, entry, First, Cross;
+  float *ptr;
+  double nominal, big, small, value;
+  Image *image;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: badimages entry value\n");
+    gprint (GP_ERR, "   OR: badimages -image N\n");
+    return (FALSE);
+  }
+  
+  image = LoadImages (&Nimage);
+
+  Cross = FALSE;
+  First = FALSE;
+  nominal = 1;
+  if (!strcmp (argv[1], "-image")) {
+    First = TRUE;
+    entry = atof(argv[2]);
+  } else {
+    entry = atof(argv[1]);
+    nominal = atof(argv[2]);
+    if (!strcasecmp (argv[1], "x")) {
+      Cross = TRUE;
+    }
+  }
+  
+  if (First) {
+    ptr = &image[entry].coords.crpix1;
+    for (i = 0; i < 22; i++) {
+      gprint (GP_LOG, "%2d: %g\n", i, ptr[i]);
+    }
+    value = image[entry].coords.pc1_1*image[entry].coords.pc2_2 + image[entry].coords.pc1_2*image[entry].coords.pc2_1;
+    gprint (GP_LOG, " x: %g\n", value);
+    return (TRUE);
+  }
+  
+  big = nominal * 1.05;
+  small = nominal / 1.05;
+  if (big < small) {
+    double tmp;
+    tmp = big; big = small; small = tmp;
+  }
+  
+  badim_int = FALSE;
+  if (Cross) {
+    for (i = 0; (i < Nimage) && !badim_int; i++) {
+      value = image[i].coords.pc1_1*image[i].coords.pc2_2 + image[i].coords.pc1_2*image[i].coords.pc2_1;
+      if ((value > big) || (value < small)) {
+	gprint (GP_LOG, "%5d %s: %d %g\n", i, image[i].name, image[i].tzero, value);
+      }
+    }
+  } else {
+    for (i = 0; (i < Nimage) && !badim_int; i++) {
+      ptr = &image[i].coords.crpix1;
+      if ((ptr[entry] > big) || (ptr[entry] < small)) {
+	gprint (GP_LOG, "%5d %s: %d %g\n", i, image[i].name, image[i].tzero, ptr[entry]);
+      }
+    }
+  }
+  
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/calextract.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/calextract.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/calextract.c	(revision 15879)
@@ -0,0 +1,141 @@
+# include "dvoshell.h"
+
+enum {Nd, Nm, NC, NR, ND, Np, Nc, Nt, Nx, Nd1, Nd2, NVEC};
+
+int calextract (int argc, char **argv) {
+  
+  int i, N, Nr, mode[2];
+  int Nsecfilt, NSTAR;
+
+  PhotCode *code[2];
+  Catalog catalog;
+  Vector **vec;
+  SkyList *skylist;
+  SkyRegionSelection *selection;
+
+  /* these need to be freed in the end */
+  catalog.average = NULL; 
+  catalog.secfilt = NULL;
+  catalog.measure = NULL;
+  skylist = NULL;
+  selection = NULL;
+  vec = NULL;
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) return (FALSE);
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  /* command line arguments */
+  SetSelectionParam (0);
+
+  // parse skyregion options
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape;
+  if (!SetPhotSelections (&argc, argv, 2)) goto usage;
+
+  if (argc != 4) goto usage;
+  if (strcmp (argv[2], "-")) goto usage;
+  if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) goto usage;
+  if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) goto usage;
+  /* code.type must be PHOT_REF */
+
+  /* one unique value per star */
+  N = 0;
+  NSTAR = 1;
+  ALLOCATE (vec, Vector *, NVEC);
+  if ((vec[Nd] 	= SelectVector ("cal:dmag",     ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nm] 	= SelectVector ("cal:mag",      ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[NC] 	= SelectVector ("cal:color",    ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[NR] 	= SelectVector ("cal:ra",       ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[ND] 	= SelectVector ("cal:dec",      ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Np] 	= SelectVector ("cal:nphot",    ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nc] 	= SelectVector ("cal:ncode",    ANYVECTOR, TRUE)) == NULL) goto escape;
+  // if ((vec[Nt] 	= SelectVector ("cal:ncrit",    ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nx] 	= SelectVector ("cal:chisq",    ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nd1] = SelectVector ("cal:dm1",      ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nd2] = SelectVector ("cal:dm2",      ANYVECTOR, TRUE)) == NULL) goto escape;
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (selection)) == NULL) goto escape;
+
+  for (Nr = 0; Nr < skylist[0].Nregions; Nr++) {
+    if (Nr && !(Nr % 500)) { gprint (GP_ERR, "."); }
+
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[Nr];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    # if (0)
+    /* extract values, assign to vectors */
+    for (i = 0; i < catalog.Naverage; i++) {
+      if (i && !(i % 10000)) { gprint (GP_ERR, ","); }
+      m = catalog.average[i].offset;
+
+      if (code[0][0].c1 && code[0][0].c2 && !PhotColor (&catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], code[0][0].c1, code[0][0].c2, &color)) continue;
+
+      /* find data for filter 2 (PHOT_REF) */
+      M2 = NAN;
+      dM2 = NAN;
+      for (j = 0; j < catalog.average[i].Nm; j++) {
+	if (catalog.measure[m+j].photcode != code[1][0].code) continue;
+	M2 = PhotCat  (&catalog.measure[m+j]);
+	dM2 = catalog.measure[m+j].dM;
+      }	
+      if (isnan(M2)) continue;
+
+      /* find data for filter 1 */
+      M1 = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_MAG);
+      if (isnan(M1)) continue;
+
+      vec[Nd ][0].elements[N] = M1 - M2;
+      vec[Nm ][0].elements[N] = M2;
+      vec[NC ][0].elements[N] = color;
+      vec[NR ][0].elements[N] = catalog.average[i].R;
+      vec[ND ][0].elements[N] = catalog.average[i].D;
+      vec[Nd1][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_dMAG);
+      vec[Nd2][0].elements[N] = dM2;
+      vec[Nx ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_Xm);
+      vec[Nc ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NCODE);
+      vec[Np ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NPHOT);
+      // vec[Nt ][0].elements[N] = ExtractAverages (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], AVE_NCRIT);
+      N ++;
+      if (N == NSTAR) {
+	NSTAR += 100;
+	for (j = 0; j < NVEC; j++) {
+	  REALLOCATE (vec[j][0].elements, float, NSTAR);
+	}
+      }
+    }
+    # endif
+    dvo_catalog_free (&catalog);
+  }
+
+  for (i = 0; i < NVEC; i++) {
+    vec[i][0].Nelements = N;
+  }
+
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  return (TRUE);
+  
+usage:
+  gprint (GP_ERR, "USAGE: calextract F - F\n");
+  return (FALSE);
+
+escape:
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  for (i = 0; i < NVEC; i++) {
+    DeleteVector (vec[i]);
+  }
+  free (vec);
+
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/calmextract.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/calmextract.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/calmextract.c	(revision 15879)
@@ -0,0 +1,186 @@
+# include "dvoshell.h"
+
+enum {Nd, Nm1, Nm2, Nc, Ns, Nt, Nz, NR, ND, Nxc, Nyc, Nxm, Nym, NT, NP, Nd1, Nd2, NVEC};
+int ConcatMeasures (Vector *vec, PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int param, int Nin);
+
+int calmextract (int argc, char **argv) {
+  
+  int i, k, N, Nr, mode[2];
+  int NSTAR, Nstar, Nsecfilt;
+
+  Catalog catalog;
+  PhotCode *code[2];
+  SkyList *skylist;
+  SkyRegionSelection *selection;
+  Vector **vec;
+
+  /* these need to be freed in the end */
+  catalog.average = NULL; 
+  catalog.secfilt = NULL;
+  catalog.measure = NULL;
+  skylist = NULL;
+  selection = NULL;
+  vec = NULL;
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  /* command line arguments */
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape;
+  if (!SetPhotSelections (&argc, argv, 2)) goto usage;
+
+  /* interpret required command-line arguments: calmextract F1 - F2 */
+  if (argc != 4) goto usage;
+  if (strcmp (argv[2], "-")) goto usage;
+  if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) goto usage;
+  if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) goto usage;
+  if (!TestPhotSelections (&code[0], &mode[0], MEAS_ZERO)) goto escape;
+
+  /* returned vectors are dmag, mag, color, time, airmass, ra, dec, x, y, exptime */
+  N = 0;
+  Nstar = 0;
+  NSTAR = 100;
+  ALLOCATE (vec, Vector *, NVEC);
+  if ((vec[Nd ] = SelectVector ("cal:dmag",     ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nm1] = SelectVector ("cal:mag1",     ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nm2] = SelectVector ("cal:mag2",     ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nc ] = SelectVector ("cal:color",    ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Ns ] = SelectVector ("cal:star",     ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nt ] = SelectVector ("cal:time",     ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nz ] = SelectVector ("cal:airmass",  ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[NR ] = SelectVector ("cal:ra",       ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[ND ] = SelectVector ("cal:dec",      ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nxc] = SelectVector ("cal:xccd",     ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nyc] = SelectVector ("cal:yccd",     ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nxm] = SelectVector ("cal:xmosaic",  ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nym] = SelectVector ("cal:ymosaic",  ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[NT ] = SelectVector ("cal:exptime",  ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[NP ] = SelectVector ("cal:photcode", ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nd1] = SelectVector ("cal:dm1",      ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((vec[Nd2] = SelectVector ("cal:dm2",      ANYVECTOR, TRUE)) == NULL) goto escape;
+  for (k = 0; k < NVEC; k++) {
+    REALLOCATE (vec[k][0].elements, float, NSTAR);
+    vec[k][0].Nelements = 0;
+  }
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (selection)) == NULL) goto escape;
+  if (!SetImageSelection (TRUE, selection)) goto escape;
+
+  for (Nr = 0; Nr < skylist[0].Nregions; Nr++) {
+    if (Nr && !(Nr % 500)) { gprint (GP_ERR, "."); }
+
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[Nr];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    # if (0)
+    /* extract values, assign to vectors */
+    for (i = 0; i < catalog.Naverage; i++) {
+      m = catalog.average[i].offset;
+
+      /* PRI/SEC must have data for color term */
+      if (code[0][0].c1 && code[0][0].c2 && !PhotColor (&catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], code[0][0].c1, code[0][0].c2, &color)) continue;
+
+      /* find data for filter 2 (REF) */
+      M2 = NAN;
+      dM2 = NAN;
+      for (j = 0; j < catalog.average[i].Nm; j++) {
+	if (catalog.measure[m+j].photcode != code[1][0].code) continue;
+	M2 = PhotCat  (&catalog.measure[m+j]); 
+	dM2 = catalog.measure[m+j].dM;
+      }	
+      if (isnan(M2)) continue;
+      
+      /* find data for filter 1 */
+      M1 = ExtractMeasures (code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N1, MEAS_MAG);
+      if (N1 == 0) goto skip;
+
+      /* extend storage vectors to take new data, if needed */
+      if (N + N1 >= NSTAR) {
+	NSTAR += N1 + 100;
+	for (k = 0; k < NVEC; k++) {
+	  REALLOCATE (vec[k][0].elements, float, NSTAR);
+	}
+      }
+
+      ConcatMeasures (vec[Nt ], code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], N1, MEAS_TIME); 
+      ConcatMeasures (vec[Nz ], code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], N1, MEAS_AIRMASS); 
+      ConcatMeasures (vec[NT ], code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], N1, MEAS_EXPTIME); 
+      ConcatMeasures (vec[NP ], code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], N1, MEAS_PHOTCODE); 
+      // ConcatMeasures (vec[Nd1], code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], N1, MEAS_dMAG); 
+      ConcatMeasures (vec[Nxc], code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], N1, MEAS_XCCD); 
+      ConcatMeasures (vec[Nyc], code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], N1, MEAS_YCCD); 
+      ConcatMeasures (vec[Nxm], code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], N1, MEAS_XMOSAIC); 
+      ConcatMeasures (vec[Nym], code[0], mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], N1, MEAS_YMOSAIC); 
+
+      for (j = 0; j < N1; j++, N++) {
+	vec[Nd ][0].elements[N] = M1[j] - M2;
+	vec[Nm1][0].elements[N] = M1[j];
+	vec[Nm2][0].elements[N] = M2;
+	vec[Nd2][0].elements[N] = dM2;
+	vec[Nc ][0].elements[N] = color;
+	vec[Ns ][0].elements[N] = Nstar;
+	vec[NR ][0].elements[N] = catalog.average[i].R;
+	vec[ND ][0].elements[N] = catalog.average[i].D;
+      }
+      Nstar ++; 
+    skip:
+      if (M1 != NULL) free (M1);
+    }
+    # endif
+    dvo_catalog_free (&catalog);
+  }
+
+  for (i = 0; i < NVEC; i++) {
+    vec[i][0].Nelements = N;
+  }
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  FreeImageSelection ();
+  return (TRUE);
+  
+usage:
+  gprint (GP_ERR, "USAGE: dmags F - F : measure.param\n");
+  return (FALSE);
+
+escape:
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  FreeImageSelection ();
+  for (i = 0; i < NVEC; i++) {
+    DeleteVector (vec[i]);
+  }
+  free (vec);
+  return (FALSE);
+}
+
+int ConcatMeasures (Vector *vec, PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int Nin, int param) {
+
+  int i, Ns, N;
+  double *value;
+
+  value = ExtractMeasures (code, mode, average, secfilt, measure, &N, param); 
+  if (N != Nin) {
+    gprint (GP_ERR, "error!\n");
+    return (FALSE);
+  }
+
+  Ns = vec[0].Nelements;
+  for (i = 0; i < N; i++) {
+    vec[0].elements[Ns+i] = value[i];
+  }
+  vec[0].Nelements = Ns + N;
+
+  free (value);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/catalog.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/catalog.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/catalog.c	(revision 15879)
@@ -0,0 +1,407 @@
+# include "dvoshell.h"
+# define NBYTES 160000
+# define BYTES_STAR 23
+# define BLOCK 1000
+# define DNSTARS 1000
+
+# define MAGSCALE 0
+# define NUMSCALE 1
+# define MISSCALE 2
+
+// XXX EAM : should this function be dropped? 
+int catlog (int argc, char **argv) {
+  
+  FILE *f;
+  Catalog catalog;
+  Vector Xvec, Yvec, Zvec;
+  int i, N, Nm, Nn, NN, Nbytes, nbytes, Bytes_Star;
+  int Ar, Ad, Am, InRegion, GSC, ASCII, DVO, FIXED;
+  char filename[128];
+  double Mz, Mr, Nz, Nr;
+  int clip, mode, IDclip, IDchoice, LimExclude;
+  RegionFile *regions;
+  int j, Nregions;
+  double Radius, Rmin, Rmax;
+  Graphdata graphmode;
+  double epoch, current_epoch;
+  char gscdir[256], catdir[256];
+  int Ngraph;
+
+  if (!GetGraph (&graphmode, NULL, NULL)) return (FALSE);
+
+  VarConfig ("GSCDIR", "%s", gscdir);
+  VarConfig ("CATDIR", "%s", catdir);
+
+  Mz = 17.0;
+  Mr = -5.0;
+  mode = MAGSCALE;
+  clip = FALSE;
+  Rmin = graphmode.coords.crval1 - 182.0;
+  Rmax = graphmode.coords.crval1 + 182.0;
+
+  regions = (RegionFile *) NULL;
+  f = (FILE *) NULL;
+  Nz = Nr = Am = Ar = Ad = 0;
+  /* either MagScale or NumScale, whichever is first is scale */
+  Nm = get_argument (argc, argv, "-m");
+  Nn = get_argument (argc, argv, "+n");
+  NN = get_argument (argc, argv, "-n");
+  if (NN && Nn) {
+    gprint (GP_ERR, "can't mix meas and miss scaling\n");
+    return (FALSE);
+  }
+ 
+  if (Nm)
+    mode = MAGSCALE;
+  if (Nn)
+    mode = NUMSCALE;
+  if (NN)
+    mode = MISSCALE;
+    
+  if (Nm && Nn) {
+    clip = TRUE;
+    if (Nm < Nn) 
+      mode = MAGSCALE;
+    else 
+      mode = NUMSCALE;
+  }
+  if (Nm && NN) {
+    clip = TRUE;
+    if (Nm < NN) 
+      mode = MAGSCALE;
+    else 
+      mode = MISSCALE;
+  }
+   
+  current_epoch = 2000.0;
+  epoch = 2000.0;
+  if ((N = get_argument (argc, argv, "-e"))) {
+    remove_argument (N, &argc, argv);
+    epoch  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  IDchoice = 0;
+  IDclip = FALSE;
+  if ((N = get_argument (argc, argv, "-ID"))) {
+    remove_argument (N, &argc, argv);
+    IDchoice  = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    IDclip = TRUE;
+  }
+
+  LimExclude = FALSE;
+  if ((N = get_argument (argc, argv, "-x"))) {
+    remove_argument (N, &argc, argv);
+    LimExclude = TRUE;
+  }
+
+  if ((Nm = get_argument (argc, argv, "-m"))) {
+    remove_argument (Nm, &argc, argv);
+    Mr  = atof(argv[Nm]);
+    remove_argument (Nm, &argc, argv);
+    Mz = atof(argv[Nm]);
+    Mr = Mr - Mz;
+    remove_argument (Nm, &argc, argv);
+  }
+
+  if ((Nn = get_argument (argc, argv, "+n"))) {
+    remove_argument (Nn, &argc, argv);
+    Nz  = atof(argv[Nn]);
+    remove_argument (Nn, &argc, argv);
+    Nr = atof(argv[Nn]) - Nz;
+    remove_argument (Nn, &argc, argv);
+  }
+
+  if ((Nn = get_argument (argc, argv, "-n"))) {
+    remove_argument (Nn, &argc, argv);
+    Nz  = atof(argv[Nn]);
+    remove_argument (Nn, &argc, argv);
+    Nr = atof(argv[Nn]) - Nz;
+    remove_argument (Nn, &argc, argv);
+  }
+
+  InRegion = FALSE;
+  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"))) {
+    remove_argument (N, &argc, argv);
+    GSC = TRUE;
+    ASCII = FALSE;
+    DVO = FALSE;
+  }
+
+  if ((N = get_argument (argc, argv, "-a"))) {
+    remove_argument (N, &argc, argv);
+    ASCII = TRUE;
+    GSC = FALSE;
+    DVO = FALSE;
+    Ar = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    Ad = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    Am = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    if ((N = get_argument (argc, argv, "-f"))) {
+      remove_argument (N, &argc, argv);
+      FIXED = TRUE;
+      ASCII = FALSE;
+      Bytes_Star = atof(argv[N]);
+      remove_argument (N, &argc, argv);
+    }
+  }
+
+  
+  if ((InRegion || (argc != 2)) && (!InRegion || (argc != 1))) {
+    gprint (GP_ERR, "USAGE: catalog (filename / -all) [-m M M] [-n N N] [-g] [-a RA DEC MAG] \n");
+    return (FALSE);
+  }
+  
+  if (InRegion) {
+    Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax));
+    regions = find_regions (graphmode.coords.crval1, graphmode.coords.crval2, Radius, &Nregions);
+  } else {
+    Nregions = 1;
+  }
+  
+  for (j = 0; j < Nregions; j++) {
+    catalog.average = 0;
+    
+    /* Load in data from an ASCII file list of ra, dec, mag */
+    if (ASCII) {
+      char *tbuffer;
+      int nstar, NSTARS;
+      double R, D, M;
+      
+      f = fopen (argv[1], "r");
+      if (f == (FILE *) NULL) {
+	gprint (GP_ERR, "ERROR: can't open catalog file: %s\n", argv[1]);
+	return (FALSE);
+      }
+      
+      nstar = 0;
+      NSTARS = DNSTARS;
+      ALLOCATE (tbuffer, char, 1024);
+      ALLOCATE (catalog.average, Average, NSTARS);
+      while (scan_line (f, tbuffer) != EOF) {
+	dparse (&R, Ar, tbuffer);
+	dparse (&D, Ad, tbuffer);
+	dparse (&M, Am, tbuffer);
+	catalog.average[nstar].R = R;
+	catalog.average[nstar].D = D;
+	catalog.average[nstar].M = M;
+	nstar++;
+	if (nstar == NSTARS - 1) {
+	  NSTARS += DNSTARS;
+	  REALLOCATE (catalog.average, Average, NSTARS);
+	}
+      }
+      fclose (f);
+      free (tbuffer);
+      REALLOCATE (catalog.average, Average, nstar);
+      catalog.Naverage = nstar;
+
+      if (epoch != current_epoch) {
+	cprecess (catalog.average, catalog.Naverage, epoch, current_epoch);
+      }
+
+    }
+    
+    /* Load in data from an ASCII file list of ra, dec, mag */
+    if (FIXED) {
+      char *tbuffer;
+      int nstar, NSTARS;
+      double R, D, M;
+      
+      f = fopen (argv[1], "r");
+      if (f == (FILE *) NULL) {
+	gprint (GP_ERR, "ERROR: can't open catalog file: %s\n", argv[1]);
+	return (FALSE);
+      }
+      
+      nstar = 0;
+      NSTARS = DNSTARS;
+      ALLOCATE (tbuffer, char, (BLOCK*Bytes_Star));
+      ALLOCATE (catalog.average, Average, NSTARS);
+      Nbytes = BLOCK*Bytes_Star;
+      while ((nbytes = fread (tbuffer, 1, Nbytes, f)) > 0) {
+	for (i = 0; i < nbytes / Bytes_Star; i++) {
+	  dparse (&R, Ar, &tbuffer[i*Bytes_Star]);
+	  dparse (&D, Ad, &tbuffer[i*Bytes_Star]);
+	  dparse (&M, Am, &tbuffer[i*Bytes_Star]);
+	  catalog.average[nstar].R = R;
+	  catalog.average[nstar].D = D;
+	  catalog.average[nstar].M = M;
+	  nstar++;
+	  if (nstar == NSTARS - 1) {
+	    NSTARS += DNSTARS;
+	    REALLOCATE (catalog.average, Average, NSTARS);
+	  }
+	}
+      }
+      fclose (f);
+      free (tbuffer);
+      REALLOCATE (catalog.average, Average, nstar);
+      catalog.Naverage = nstar;
+
+      if (epoch != current_epoch) {
+	cprecess (catalog.average, catalog.Naverage, epoch, current_epoch);
+      }
+
+    }
+    
+    /* load data from the GSC files */
+    if (GSC) {
+      char *tbuffer;
+      int nstar, NSTARS;
+      double R, D, M;
+      
+      if (InRegion) {
+	sprintf (filename, "%s/%s", gscdir, regions[j].name);
+      } else {
+	sprintf (filename, "%s/%s", gscdir, argv[1]);
+      }
+      
+      f = fopen (filename, "r");
+      if (f == (FILE *) NULL) {
+	gprint (GP_ERR, "no stars in %s, skipping\n", filename);
+	continue;
+	/* return (FALSE); */
+      }
+      
+      nstar = 0;
+      NSTARS = DNSTARS;
+      ALLOCATE (tbuffer, char, (BLOCK*BYTES_STAR));
+      ALLOCATE (catalog.average, Average, NSTARS);
+      Nbytes = BLOCK*BYTES_STAR;
+      while ((nbytes = fread (tbuffer, 1, Nbytes, f)) > 0) {
+	for (i = 0; i < nbytes / BYTES_STAR; i++) {
+	  dparse (&R, 1, &tbuffer[i*BYTES_STAR]);
+	  dparse (&D, 2, &tbuffer[i*BYTES_STAR]);
+	  dparse (&M, 3, &tbuffer[i*BYTES_STAR]);
+	  catalog.average[nstar].R = R;
+	  catalog.average[nstar].D = D;
+	  catalog.average[nstar].M = M;
+	  nstar++;
+	  if (nstar == NSTARS - 1) {
+	    NSTARS += DNSTARS;
+	    REALLOCATE (catalog.average, Average, NSTARS);
+	  }
+	}
+      }
+      fclose (f);
+      free (tbuffer);
+      REALLOCATE (catalog.average, Average, nstar);
+      catalog.Naverage = nstar;
+    }
+  
+    /* load data from the photometry database files */
+    if (DVO) {
+      
+      if (InRegion) {
+	sprintf (filename, "%s/%s", catdir, regions[j].name);
+      } else {
+	sprintf (filename, "%s/%s", catdir, argv[1]);
+      }
+      
+      /* lock, load, unlock catalog */
+      catalog.filename = filename;
+      catalog.catflags = LOAD_AVES;
+
+      // an error exit status here is a significant error
+      if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+	  fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+	  exit (2);
+      }
+      dvo_catalog_unlock (&catalog);
+    }
+    
+    /* data has been loaded, get ready to plot it */
+    Xvec.Nelements = catalog.Naverage;
+    Yvec.Nelements = catalog.Naverage;
+    Zvec.Nelements = catalog.Naverage;
+    ALLOCATE (Xvec.elements, float, Xvec.Nelements);
+    ALLOCATE (Yvec.elements, float, Yvec.Nelements);
+    ALLOCATE (Zvec.elements, float, Zvec.Nelements);
+    /* project stars to screen display coords */
+    Xvec.Nelements = 0;
+    switch (mode) {
+    case (MAGSCALE):
+      for (N = i = 0; i < catalog.Naverage; i++) {
+	if (clip && ((catalog.average[i].Nm < Nz) || (catalog.average[i].Nm > Nr+Nz))) 
+	  continue;
+	if (IDclip && (catalog.average[i].code != IDchoice))
+	  continue;
+	Zvec.elements[N] = MIN (1.0, MAX (0.01, (catalog.average[i].M - Mz) / Mr));
+	if (LimExclude && (Zvec.elements[N] > 0.99)) continue;
+	if (Zvec.elements[N] < 0.011) continue;
+	while (catalog.average[i].R < Rmin) catalog.average[i].R += 360.0;
+	while (catalog.average[i].R > Rmax) catalog.average[i].R -= 360.0;
+	if (fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], catalog.average[i].R, catalog.average[i].D, &graphmode.coords)) N ++;
+      }
+      break;
+    case (NUMSCALE):
+      for (N = i = 0; i < catalog.Naverage; i++) {
+	if (clip && ((catalog.average[i].M > Mz) || (catalog.average[i].M < Mr+Mz))) 
+	  continue;
+	if (IDclip && (catalog.average[i].code != IDchoice))
+	  continue;
+	Zvec.elements[N] = MIN (1.0, MAX (0.01, (catalog.average[i].Nm - Nz) / Nr));
+	if (LimExclude && (Zvec.elements[N] == 1.0)) continue;
+	if (Zvec.elements[N] == 0.01) 
+	  continue;
+	while (catalog.average[i].R < Rmin) catalog.average[i].R += 360.0;
+	while (catalog.average[i].R > Rmax) catalog.average[i].R -= 360.0;
+	if (fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], catalog.average[i].R, catalog.average[i].D, &graphmode.coords)) N++;
+      }
+      break;
+    case (MISSCALE):
+      for (N = i = 0; i < catalog.Naverage; i++) {
+	if (clip && ((catalog.average[i].M > Mz) || (catalog.average[i].M < Mr+Mz))) 
+	  continue;
+	if (IDclip && (catalog.average[i].code != IDchoice))
+	  continue;
+	Zvec.elements[N] = MIN (1.0, MAX (0.01, (catalog.average[i].Nn - Nz) / Nr));
+	if (LimExclude && (Zvec.elements[N] == 1.0)) continue;
+	if (Zvec.elements[N] == 0.01) 
+	  continue;
+	while (catalog.average[i].R < Rmin) catalog.average[i].R += 360.0;
+	while (catalog.average[i].R > Rmax) catalog.average[i].R -= 360.0;
+	if (fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], catalog.average[i].R, catalog.average[i].D, &graphmode.coords)) N++;
+      }
+      break;
+    }
+
+    Zvec.Nelements = Yvec.Nelements = Xvec.Nelements = N;
+    REALLOCATE (Xvec.elements, float, MAX (Xvec.Nelements, 1));
+    REALLOCATE (Yvec.elements, float, MAX (Yvec.Nelements, 1));
+    REALLOCATE (Zvec.elements, float, MAX (Zvec.Nelements, 1));
+    
+    graphmode.style = 2; /* set style to points */
+    graphmode.size = -1; /* point size determined by Zvec */
+    graphmode.etype = 0; /* no errorbars */
+    PrepPlotting (N, &graphmode);
+    
+    PlotVector (N, Xvec.elements, "x");
+    PlotVector (N, Yvec.elements, "y");
+    PlotVector (N, Zvec.elements, "z");
+    
+    free (Xvec.elements);
+    free (Yvec.elements);
+    free (Zvec.elements);
+
+    if (catalog.average != 0) free (catalog.average);
+
+  }
+  return (TRUE);
+
+}
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/catdir.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/catdir.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/catdir.c	(revision 15879)
@@ -0,0 +1,38 @@
+# include "dvoshell.h"
+
+int catdir_define (int argc, char **argv) {
+  
+  char *current;
+  int status, N, VERBOSE;
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    VERBOSE = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: catdir (name)\n");
+    gprint (GP_ERR, "       (name) may be a path or 'default'\n");
+    current = GetCATDIR ();
+    if (current == NULL) {
+      gprint (GP_ERR, "catdir not defined\n");
+    } else {
+      gprint (GP_ERR, "current: %s\n", current);
+    }
+    return (FALSE);
+  }
+
+  if (!strcasecmp (argv[1], "default")) {
+    status = SetCATDIR (NULL, VERBOSE);
+  } else {
+    status = SetCATDIR (argv[1], VERBOSE);
+  }
+
+  if (!status) {
+    gprint (GP_ERR, "invalid / undefined CATDIR\n");
+    return (FALSE);
+  }
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ccd.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ccd.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ccd.c	(revision 15879)
@@ -0,0 +1,126 @@
+# include "dvoshell.h"
+
+int ccd (int argc, char **argv) {
+  
+  double *M1, *M2;
+  int i, m, k, Npts, NPTS, N;
+  int N1, N2, i1, i2, mode[4];
+  int Nsecfilt, KeepNulls;
+
+  Catalog catalog;
+  PhotCode *code[4];
+  SkyList *skylist;
+  SkyRegionSelection *selection;
+  Vector *xvec, *yvec;
+
+  /* defaults */
+  catalog.average = NULL; 
+  catalog.secfilt = NULL;
+  catalog.measure = NULL;
+  skylist = NULL;
+  selection = NULL;
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  /* interpret command-line options */
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape;
+  if (!SetPhotSelections (&argc, argv, 4)) goto usage;
+
+  KeepNulls = FALSE;
+  if ((N = get_argument (argc, argv, "-nulls"))) {
+    KeepNulls = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  /* interpret command-line options */
+  if (argc != 8) goto usage;
+  if (strcmp (argv[2], "-")) goto usage;
+  if (strcmp (argv[4], ":")) goto usage;
+  if (strcmp (argv[6], "-")) goto usage;
+  if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) return (FALSE);
+  if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) return (FALSE);
+  if (!GetPhotcodeInfo (argv[5], &code[2], &mode[2])) return (FALSE);
+  if (!GetPhotcodeInfo (argv[7], &code[3], &mode[3])) return (FALSE);
+  if (!TestPhotSelections (&code[0], &mode[0], MEAS_ZERO)) goto escape;
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (selection)) == NULL) goto escape;
+
+  /* init vectors to save data */
+  Npts = 0;
+  NPTS = 1;
+  if ((xvec = SelectVector ("xv", ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((yvec = SelectVector ("yv", ANYVECTOR, TRUE)) == NULL) goto escape;
+
+  /* loop over regions, extract data for each region */
+  for (k = 0; k < skylist[0].Nregions; k++) {
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[k];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    /* get correct mags, convert to X,Y */
+    for (i = 0; i < catalog.Naverage; i++) {
+      M1 = M2 = NULL;
+      m = catalog.average[i].offset;
+
+      SetSelectionParam (0);
+      M1 = ExtractDMag (&code[0], &mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N1);
+      if (N1 == 0) goto skip;
+
+      SetSelectionParam (2);
+      M2 = ExtractDMag (&code[2], &mode[2], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N2);
+      if (N2 == 0) {
+	if (KeepNulls) {
+	  ALLOCATE (M2, double, 1);
+	  N2 = 1;
+	  M2[0] = NAN;
+	} else {
+	  goto skip;
+	}
+      }
+
+      for (i1 = 0; i1 < N1; i1++) {
+	for (i2 = 0; i2 < N2; i2++) {
+	  xvec[0].elements[Npts] = M1[i1];
+	  yvec[0].elements[Npts] = M2[i2];
+	  Npts++;
+	  if (Npts >= NPTS) {
+	    NPTS += 2000;
+	    REALLOCATE (xvec[0].elements, float, NPTS);
+	    REALLOCATE (yvec[0].elements, float, NPTS);
+	  }
+	}
+      }
+    skip:
+      if (M1 != NULL) free (M1);
+      if (M2 != NULL) free (M2);
+    }
+    dvo_catalog_free (&catalog);
+  }
+
+  xvec[0].Nelements = yvec[0].Nelements = Npts;
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: ccd F - F : F - F\n");
+  return (FALSE);
+
+escape:
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  dvo_catalog_free (&catalog);
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmatch.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmatch.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmatch.c	(revision 15879)
@@ -0,0 +1,82 @@
+# include "dvoshell.h"
+
+int cmatch (int argc, char **argv) {
+  
+  Catalog catalog1, catalog2;
+  char filename[128];
+  double radius;
+  Vector *rvec, *dvec, *mvec, *drvec, *ddvec, *dmvec;
+
+  if (argc != 9) {
+    gprint (GP_ERR, "USAGE: cmatch file radius (RA) (DEC) (Mag) (dRA) (dDEC) (dMag)\n");
+    gprint (GP_ERR, "       match a set of object coordinates with a DVO db table\n");
+    return (FALSE);
+  }
+
+  /*** this function is not well-defined.  re-assess it and re-code it ***/
+  gprint (GP_ERR, "disabled for now\n");
+  return (FALSE);
+
+  radius = atof (argv[2]);
+
+  if ((rvec  = SelectVector (argv[3], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((dvec  = SelectVector (argv[4], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((mvec  = SelectVector (argv[5], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((drvec = SelectVector (argv[6], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((ddvec = SelectVector (argv[7], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((dmvec = SelectVector (argv[8], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  /* load data from the photometry database file */
+  catalog1.filename = filename;
+  catalog1.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+
+  // an error exit status here is a significant error
+  if (!dvo_catalog_open (&catalog1, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog1.filename);
+      exit (2);
+  }
+  dvo_catalog_unlock (&catalog1);
+  gprint (GP_ERR, "read %d stars from phot catalog file %s\n", catalog1.Naverage, filename);
+
+  /* this is for loading from a text file, presumably hstgsc or usno
+     replace this with references to the ra and dec vectors?
+  nstar = 0;
+  NSTARS = DNSTARS;
+  ALLOCATE (tbuffer, char, (BLOCK*BYTES_STAR));
+  ALLOCATE (catalog2.average, Average, NSTARS);
+  Nbytes = BLOCK*BYTES_STAR;
+  while ((nbytes = fread (tbuffer, 1, Nbytes, f)) > 0) {
+    for (i = 0; i < nbytes / BYTES_STAR; i++) {
+      dparse (&R, 1, &tbuffer[i*BYTES_STAR]);
+      dparse (&D, 2, &tbuffer[i*BYTES_STAR]);
+      dparse (&M, 3, &tbuffer[i*BYTES_STAR]);
+      catalog2.average[nstar].R = R;
+      catalog2.average[nstar].D = D;
+      catalog2.average[nstar].M = M * 1000.0;
+      nstar++;
+      if (nstar == NSTARS - 1) {
+	NSTARS += DNSTARS;
+	REALLOCATE (catalog2.average, Average, NSTARS);
+      }
+    }
+  }
+  free (tbuffer);
+  REALLOCATE (catalog2.average, Average, MAX (nstar, 1));
+  catalog2.Naverage = nstar;
+  fclose (f);
+  */
+
+  /* sort data in order of RA */
+  sortave (catalog1.average, catalog1.Naverage);
+  sortave (catalog2.average, catalog2.Naverage);
+
+  /* data has been loaded, use gcompare algorithm to match */
+  compare (&catalog1, &catalog2, rvec, dvec, mvec, drvec, ddvec, dmvec, radius);
+
+  dvo_catalog_free (&catalog1);
+  free (catalog2.average);
+
+  return (TRUE);
+
+}
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmd.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmd.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmd.c	(revision 15879)
@@ -0,0 +1,124 @@
+# include "dvoshell.h"
+
+int cmd (int argc, char **argv) { /* really need to think about upper limits & how to represent them */
+  
+  double *M1, *M3;
+  int i, j, m, i1, i3, N1, N3, N;
+  int Npts, NPTS, mode[3];
+  int Nsecfilt, KeepNulls;
+
+  PhotCode *code[3];
+  Catalog catalog;
+  SkyList *skylist;
+  SkyRegionSelection *selection;
+  Vector *xvec, *yvec;
+
+  /* defaults */
+  catalog.average = NULL; 
+  catalog.secfilt = NULL;
+  catalog.measure = NULL;
+  skylist = NULL;
+  selection = NULL;
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  /* interpret command-line options */
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape;
+  if (!SetPhotSelections (&argc, argv, 3)) goto usage;
+
+  KeepNulls = FALSE;
+  if ((N = get_argument (argc, argv, "-nulls"))) {
+    KeepNulls = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  /* interpret command-line options */
+  if (argc != 6) { goto usage; }
+  if (strcmp (argv[2], "-")) goto usage;
+  if (strcmp (argv[4], ":")) goto usage;
+  if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) return (FALSE);
+  if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) return (FALSE);
+  if (!GetPhotcodeInfo (argv[5], &code[2], &mode[2])) return (FALSE);
+  if (!TestPhotSelections (&code[0], &mode[0], MEAS_ZERO)) goto escape;
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (selection)) == NULL) goto escape;
+
+  /* init vectors to save data */
+  Npts = 0;
+  NPTS = 1;
+  if ((xvec = SelectVector ("xv", ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((yvec = SelectVector ("yv", ANYVECTOR, TRUE)) == NULL) goto escape;
+
+  /* loop over regions, extract data for each region */
+  for (j = 0; j < skylist[0].Nregions; j++) {
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[j];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+    
+    /* get correct mags, convert to X,Y */
+    for (i = 0; i < catalog.Naverage; i++) {
+      M1 = M3 = NULL;
+      m = catalog.average[i].offset;
+
+      SetSelectionParam (0);
+      M1 = ExtractDMag (code, mode, &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N1);
+      if (N1 == 0) goto skip;
+
+      SetSelectionParam (2);
+      M3 = ExtractMagnitudes (code[2], mode[2], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N3);
+      if (N3 == 0) {
+	if (KeepNulls) {
+	  ALLOCATE (M3, double, 1);
+	  N3 = 1;
+	  M3[0] = NAN;
+	} else {
+	  goto skip;
+	}
+      }
+
+      for (i1 = 0; i1 < N1; i1++) {
+	for (i3 = 0; i3 < N3; i3++) {
+	  xvec[0].elements[Npts] = M1[i1];
+	  yvec[0].elements[Npts] = M3[i3];
+	  Npts++;
+	  if (Npts >= NPTS) {
+	    NPTS += 2000;
+	    REALLOCATE (xvec[0].elements, float, NPTS);
+	    REALLOCATE (yvec[0].elements, float, NPTS);
+	  }
+	}
+      }
+    skip:
+      if (M1 != NULL) free (M1);
+      if (M3 != NULL) free (M3);
+    }
+    dvo_catalog_free (&catalog);
+  }
+
+  xvec[0].Nelements = yvec[0].Nelements = Npts;
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: cmd F - F : F\n");
+  return (FALSE);
+
+escape:
+  dvo_catalog_free (&catalog);
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  return (FALSE);
+}
+    
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmpReadFile.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmpReadFile.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmpReadFile.c	(revision 15879)
@@ -0,0 +1,125 @@
+# include "dvoshell.h"
+# define D_NSTARS 1000
+# define BYTES_STAR 66
+# define BLOCK 1000
+
+CMPstars *cmpReadFits (FILE *f, int *nstars) {
+
+  int i, Nstars;
+  Header theader;
+  FTable table;
+  CMPstars *stars;
+  SMPData *smpdata;
+
+  /* if no stars, no table */
+  if (*nstars == 0) return (NULL);
+
+  /* init & load in table data */
+  table.header   = &theader;
+  if (!gfits_fread_ftable (f, &table, "SMPFILE")) goto escape;
+
+  smpdata = gfits_table_get_SMPData (&table, &Nstars, NULL);
+
+  ALLOCATE (stars, CMPstars, Nstars);
+  for (i = 0; i < Nstars; i++) {
+    stars[i].X      = smpdata[i].X;
+    stars[i].Y      = smpdata[i].Y;
+    stars[i].M      = smpdata[i].M;
+    stars[i].dM     = smpdata[i].dM;
+    stars[i].dophot = smpdata[i].dophot;
+
+    stars[i].Mgal   = smpdata[i].M;
+    stars[i].Map    = smpdata[i].dM;
+    stars[i].fx     = smpdata[i].fx;
+    stars[i].fy     = smpdata[i].fy;
+    stars[i].df     = smpdata[i].df;
+  }    
+  *nstars = Nstars;
+  return (stars);
+
+escape:
+  gprint (GP_ERR, "error reading file\n");
+  *nstars = 0;
+  return (NULL);
+}
+
+CMPstars *cmpReadText (FILE *f, int *nstars) {
+
+  int j, N, Nextra, Ninstar, Nskip, Nbytes, nbytes;
+  int done;
+  char *buffer, *c, *c2;
+  double tmp;
+  CMPstars *stars;
+  
+  /* load in stars by blocks of 1000 */
+  N = 0;
+  ALLOCATE (buffer, char, (BLOCK*BYTES_STAR) + 1);
+  buffer[BLOCK*BYTES_STAR] = 0;
+  Nextra = 0;
+
+  ALLOCATE (stars, CMPstars, *nstars);
+
+  while (N < *nstars) {
+    /* load next data block */
+    Nbytes = BYTES_STAR * BLOCK - Nextra;
+    nbytes = fread (&buffer[Nextra], 1, Nbytes, f);
+    if (nbytes == 0) {
+      *nstars = N;
+      return (stars);
+    }
+    nbytes += Nextra;
+
+    /* check line-by-line integrity */
+    c = buffer;
+    done = FALSE;
+    while ((c < buffer + nbytes) && (!done)) { 
+      for (c2 = c; *c2 == '\n'; c2++);
+      if (c2 > c) { /* extra return chars */
+	memmove (c, c2, (int)(buffer + nbytes - c2));
+	Nskip = c2 - c;
+	nbytes -= Nskip;
+	bzero (buffer + nbytes, Nskip);
+	/* if (VERBOSE) gprint (GP_ERR, "deleted %d extra return chars\n", Nskip); */
+      }
+      c2 = strchr (c, '\n');
+      if (c2 == (char *) NULL) {
+	done = TRUE;	
+	continue;
+      }
+      c2++;
+      if ((c2 - c) != BYTES_STAR) { /* bad line, delete it */
+	memmove (c, c2, (int)(buffer + nbytes - c2));
+	Nskip = c2 - c;
+	nbytes -= Nskip;
+	bzero (buffer + nbytes, Nskip);
+	/* if (VERBOSE) gprint (GP_ERR, "deleted line, %d extra chars\n", Nskip); */
+      } else {
+	c = c2;
+      }
+    }
+
+    /* extract data for stars */
+    Ninstar = nbytes / BYTES_STAR;
+    Nextra = nbytes % BYTES_STAR;
+    for (j = 0; (j < Ninstar) && (N < *nstars); j++, N++) {
+      dparse (&stars[N].X,  1, &buffer[j*BYTES_STAR]);
+      dparse (&stars[N].Y,  2, &buffer[j*BYTES_STAR]);
+      dparse (&stars[N].M,  3, &buffer[j*BYTES_STAR]);
+
+      /* cmp files carry dM in millimags */
+      dparse (&tmp, 4, &buffer[j*BYTES_STAR]);
+      stars[N].dM = 0.001*tmp;
+
+      dparse (&tmp,         5, &buffer[j*BYTES_STAR]);
+      stars[N].dophot = tmp;
+
+      dparse (&stars[N].Mgal, 7, &buffer[j*BYTES_STAR]);
+      dparse (&stars[N].Map,  8, &buffer[j*BYTES_STAR]);
+      dparse (&stars[N].fx,   9, &buffer[j*BYTES_STAR]);
+      dparse (&stars[N].fy,  10, &buffer[j*BYTES_STAR]);
+      dparse (&stars[N].df,  11, &buffer[j*BYTES_STAR]);
+    }
+  }
+  *nstars = N;
+  return (stars);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmpload.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmpload.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmpload.c	(revision 15879)
@@ -0,0 +1,143 @@
+# include "dvoshell.h"
+# define D_NSTARS 1000
+# define BYTES_STAR 66
+# define BLOCK 1000
+
+int cmpload (int argc, char **argv) {
+  
+  int i, Noverlay, NOVERLAY, Nstar, N, Nin, Nextra, Objtype, type;
+  int doneread, done, Nskip, Nbytes, nbytes, Ninstar;
+  char *c, *c2, *name;
+  double dtmp;
+  FILE *f;
+  char *buffer;
+  int kapa;
+  Header header;
+  KiiOverlay *overlay;
+  
+  name = NULL;
+  if ((N = get_argument (argc, argv, "-n"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if (!GetImage (NULL, &kapa, name)) return (FALSE);
+  FREE (name);
+
+  Objtype = 0;
+  if ((N = get_argument (argc, argv, "-t"))) {
+    remove_argument (N, &argc, argv);
+    Objtype = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: cmpload (overlay) <filename>\n");
+    return (FALSE);
+  }
+
+  if (!gfits_read_header (argv[2], &header)) {
+    gprint (GP_ERR, "ERROR: can't read header for %s\n", argv[2]);
+    return (FALSE);
+  }
+
+  /* find expected number of stars */
+  gfits_scan (&header, "NSTARS", "%d", 1, &Nstar);
+  if (Nstar == 0) {
+    gprint (GP_ERR, "ERROR: can't get NSTARS from header\n");
+    gfits_free_header (&header);
+    return (FALSE);
+  }
+
+  f = fopen (argv[2], "r");
+  if (f == NULL) {
+    gprint (GP_ERR, "ERROR: can't read data from %s\n", argv[2]);
+    gfits_free_header (&header);
+    return (FALSE);
+  }
+  fseek (f, header.size, SEEK_SET); 
+
+  Noverlay = 0;
+  NOVERLAY = 1000;
+  ALLOCATE (overlay, KiiOverlay, Noverlay);
+  
+  /* load in stars by blocks of 1000 */
+  Nin = 0;
+  ALLOCATE (buffer, char, (BLOCK*BYTES_STAR) + 1);
+  buffer[BLOCK*BYTES_STAR] = 0;
+  Nextra = 0;
+  doneread = FALSE;
+  while (!doneread) {
+    Nbytes = BYTES_STAR * BLOCK - Nextra;
+    nbytes = fread (&buffer[Nextra], 1, Nbytes, f);
+    if (nbytes == 0) {
+      doneread = TRUE;
+      continue;
+    }
+    nbytes += Nextra;
+    /* check line-by-line integrity */
+    c = buffer;
+    done = FALSE;
+    while ((c < buffer + nbytes) && (!done)) { 
+      for (c2 = c; *c2 == '\n'; c2++);
+      if (c2 > c) { /* extra return chars */
+	memmove (c, c2, (int)(buffer + nbytes - c2));
+	Nskip = c2 - c;
+	nbytes -= Nskip;
+	bzero (buffer + nbytes, Nskip);
+      }
+      c2 = strchr (c, '\n');
+      if (c2 == (char *) NULL) {
+	done = TRUE;	
+	continue;
+      }
+      c2++;
+      if ((c2 - c) != BYTES_STAR) { /* bad line, delete it */
+	memmove (c, c2, (int)(buffer + nbytes - c2));
+	Nskip = c2 - c;
+	nbytes -= Nskip;
+	bzero (buffer + nbytes, Nskip);
+      } else {
+	c = c2;
+      }
+    }
+    Ninstar = nbytes / BYTES_STAR;
+    Nextra = nbytes % BYTES_STAR;
+    for (i = 0; i < Ninstar; i++) {
+      if (Objtype) {
+	dparse (&dtmp, 5, &buffer[i*BYTES_STAR]);
+	type = dtmp;
+	if (type != Objtype) continue;
+      }
+      # if (0)
+      if (scale) {
+	dparse (&mag,  3, &buffer[i*BYTES_STAR]);
+	overlay[Noverlay].dx = mzero + mscale * mag;
+	overlay[Noverlay].dy = mzero + mscale * mag;
+      } else {
+	overlay[Noverlay].dx = 5.0;
+	overlay[Noverlay].dy = 5.0;
+      }      
+      # endif 
+
+      fparse (&overlay[Noverlay].x,  1, &buffer[i*BYTES_STAR]);
+      fparse (&overlay[Noverlay].y,  2, &buffer[i*BYTES_STAR]);
+      overlay[Noverlay].type = KII_OVERLAY_BOX;
+      overlay[Noverlay].dx = 5.0;
+      overlay[Noverlay].dy = 5.0;
+      Noverlay ++;
+      CHECK_REALLOCATE (overlay, KiiOverlay, NOVERLAY, Noverlay, 1000);
+    }
+  }
+  fclose (f);
+
+  KiiLoadOverlay (kapa, overlay, Noverlay, argv[1]);
+  free (overlay);
+
+  gfits_free_header (&header);
+  free (buffer);
+
+  gprint (GP_ERR, "loaded %d objects\n", Noverlay);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmpread.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmpread.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/cmpread.c	(revision 15879)
@@ -0,0 +1,143 @@
+# include "dvoshell.h"
+
+/* add others as needed */
+enum {F_NONE, F_RA, F_DEC, F_X, F_Y, F_MAG, F_DMAG, F_TYPE, F_SKY, F_FX, F_FY, F_APMAG, F_GALMAG};
+
+int cmpread (int argc, char **argv) {
+  
+  int i, field, Naxis, Nbytes, Nstars;
+  double tR, tD;
+  float value;
+  FILE *f;
+  Vector *vec;
+  Header header;
+  Coords coords;
+  CMPstars *stars;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: cmpread field <filename>\n");
+    return (FALSE);
+  }
+
+  field = F_NONE;
+  if (!strcasecmp (argv[1], "ra"))   field = F_RA;
+  if (!strcasecmp (argv[1], "dec"))  field = F_DEC;
+  if (!strcasecmp (argv[1], "mag"))  field = F_MAG;
+  if (!strcasecmp (argv[1], "dmag")) field = F_DMAG;
+  if (!strcasecmp (argv[1], "x"))    field = F_X;
+  if (!strcasecmp (argv[1], "y"))    field = F_Y;
+  if (!strcasecmp (argv[1], "type")) field = F_TYPE;
+  if (!strcasecmp (argv[1], "sky"))  field = F_SKY;
+  if (!strcasecmp (argv[1], "fx"))   field = F_FX;
+  if (!strcasecmp (argv[1], "fy"))   field = F_FY;
+  if (!strcasecmp (argv[1], "apmag"))  field = F_APMAG;
+  if (!strcasecmp (argv[1], "galmag"))  field = F_GALMAG;
+  if (field == F_NONE) {
+    gprint (GP_ERR, "invalid cmp field: %s\n", argv[1]);
+    return (FALSE);
+  }
+
+  if ((vec = SelectVector (argv[1],  ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  /* load FITS header */
+  if (!gfits_read_header (argv[2], &header)) {
+    gprint (GP_ERR, "ERROR: can't read header for %s\n", argv[2]);
+    return (FALSE);
+  }
+
+  if ((field == F_RA) || (field == F_DEC)) {
+    if (!GetCoords (&coords, &header)) {
+      gprint (GP_ERR, "can't get WCS info from header\n");
+      gfits_free_header (&header);
+      return (FALSE);
+    }
+  }
+
+  /* re-open file to load data */
+  f = fopen (argv[2], "r");
+  if (f == NULL) {
+    gprint (GP_ERR, "ERROR: can't read data from %s\n", argv[2]);
+    gfits_free_header (&header);
+    return (FALSE);
+  }
+  fseek (f, header.size, SEEK_SET); 
+
+  /* find expected number of stars */
+  if (!gfits_scan (&header, "NSTARS", "%d", 1, &Nstars)) {
+    gprint (GP_ERR, "ERROR: can't get NSTARS from header\n");
+    gfits_free_header (&header);
+    return (FALSE);
+  }
+
+  /* read from FITS table or from text table */
+  Naxis = 0;
+  gfits_scan (&header, "NAXIS",  "%d", 1, &Naxis);
+  if (Naxis == 2) {
+    /* allocate space for stars */
+    gprint (GP_ERR, "reading from TEXT cmp file %s\n", argv[2]);
+    if (!gfits_scan (&header, "NSTARS", "%d", 1, &Nstars)) {
+      gprint (GP_ERR, "ERROR: failed to find NSTARS\n");
+      exit (1);
+    }
+    stars = cmpReadText (f, &Nstars);
+  } else {
+    gprint (GP_ERR, "reading from FITS cmp file %s\n", argv[2]);
+    Nbytes = gfits_data_size (&header);
+    fseek (f, Nbytes, SEEK_CUR); 
+    stars = cmpReadFits (f, &Nstars);
+  }
+  fclose (f);
+
+  REALLOCATE (vec[0].elements, float, Nstars);
+  vec[0].Nelements = Nstars;
+  bzero (vec[0].elements, Nstars*sizeof(float));
+
+  value = 0;
+  for (i = 0; i < Nstars; i++) {
+    switch (field) {
+      case F_RA:
+	XY_to_RD (&tR, &tD, stars[i].X, stars[i].Y, &coords);
+	value = tR;
+	break;
+      case F_DEC:
+	XY_to_RD (&tR, &tD, stars[i].X, stars[i].Y, &coords);
+	value = tD;
+	break;
+      case F_X:
+	value = stars[i].X;
+	break;
+      case F_Y:
+	value = stars[i].Y;
+	break;
+      case F_MAG:
+	value = stars[i].M;
+	break;
+      case F_APMAG:
+	value = stars[i].Map;
+	break;
+      case F_GALMAG:
+	value = stars[i].Mgal;
+	break;
+      case F_DMAG:
+	value = stars[i].dM;
+	break;
+      case F_TYPE:
+	value = stars[i].dophot;
+	break;
+      case F_SKY:
+	value = stars[i].sky;
+	break;
+      case F_FX:
+	value = stars[i].fx;
+	break;
+      case F_FY:
+	value = stars[i].fy;
+	break;
+    }
+    vec[0].elements[i] = value;
+  }      
+  free (stars);
+  gfits_free_header (&header);
+  gprint (GP_ERR, "loaded %d objects\n", Nstars);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/compare.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/compare.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/compare.c	(revision 15879)
@@ -0,0 +1,76 @@
+# include "dvoshell.h"
+# define D_NMATCH 500;
+
+void compare (Catalog *catlog1, Catalog *catlog2, 
+	      Vector *rvec,  Vector *dvec,  Vector *mvec, Vector *drvec, Vector *ddvec, Vector *dmvec, double radius) {
+
+  int i, j, first_j, Nmatch, NMATCH;
+  double dX, dY, dR;
+
+  Nmatch = 0;
+  NMATCH = D_NMATCH;
+  REALLOCATE (rvec[0].elements, float, NMATCH);
+  REALLOCATE (dvec[0].elements, float, NMATCH);
+  REALLOCATE (mvec[0].elements, float, NMATCH);
+  REALLOCATE (drvec[0].elements, float, NMATCH);
+  REALLOCATE (ddvec[0].elements, float, NMATCH);
+  REALLOCATE (dmvec[0].elements, float, NMATCH);
+
+  for (i = j = 0; (i < catlog1[0].Naverage) && (j < catlog2[0].Naverage);) {
+    
+    dX = catlog1[0].average[i].R - catlog2[0].average[j].R;
+
+    if (!(i % 100))
+      gprint (GP_ERR, ".");
+    
+    if (dX <= -radius)
+      i++;
+    if (dX >= radius)
+      j++;
+
+    if (fabs (dX) < radius) {
+      first_j = j;
+      for (j = first_j; (fabs (dX) < radius) && (j < catlog2[0].Naverage); j++) {
+	dX = catlog1[0].average[i].R - catlog2[0].average[j].R;
+	dY = catlog1[0].average[i].D - catlog2[0].average[j].D;
+	dR = hypot (dX, dY);
+	if (dR < radius) {
+	  rvec[0].elements[Nmatch] = catlog1[0].average[i].R;
+	  dvec[0].elements[Nmatch] = catlog1[0].average[i].D;
+	  // mvec[0].elements[Nmatch] = catlog1[0].average[i].M;
+	  drvec[0].elements[Nmatch] = dX;
+	  ddvec[0].elements[Nmatch] = dY;
+	  // dmvec[0].elements[Nmatch] = catlog1[0].average[i].M - catlog2[0].average[j].M;
+	  Nmatch ++;
+	  if (Nmatch == NMATCH - 1) {
+	    NMATCH += D_NMATCH;
+	    REALLOCATE ( rvec[0].elements, float, NMATCH);
+	    REALLOCATE ( dvec[0].elements, float, NMATCH);
+	    REALLOCATE ( mvec[0].elements, float, NMATCH);
+	    REALLOCATE (drvec[0].elements, float, NMATCH);
+	    REALLOCATE (ddvec[0].elements, float, NMATCH);
+	    REALLOCATE (dmvec[0].elements, float, NMATCH);
+	  }
+	}
+      }
+      j = first_j;
+      i++;
+    }
+  }
+
+  REALLOCATE ( rvec[0].elements, float, Nmatch);
+  REALLOCATE ( dvec[0].elements, float, Nmatch);
+  REALLOCATE ( mvec[0].elements, float, Nmatch);
+  REALLOCATE (drvec[0].elements, float, Nmatch);
+  REALLOCATE (ddvec[0].elements, float, Nmatch);
+  REALLOCATE (dmvec[0].elements, float, Nmatch);
+  
+  rvec[0].Nelements = Nmatch;
+  dvec[0].Nelements = Nmatch;
+  mvec[0].Nelements = Nmatch;
+  drvec[0].Nelements = Nmatch;
+  ddvec[0].Nelements = Nmatch;
+  dmvec[0].Nelements = Nmatch;
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbBooleanCond.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbBooleanCond.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbBooleanCond.c	(revision 15879)
@@ -0,0 +1,84 @@
+# include "dvoshell.h"
+
+// evaluate the expression in inStack as a boolean; necessary db field values are
+// supplied by fields, in order 0 - Nfields (validate before calling)
+int dbBooleanCond (dbStack *inStack, int NinStack, float *fields) {
+  
+  float value;
+  int i, j, N, Nstack;
+  dbStack **stack, *output;
+
+  // 'no stack' means 'no where statement'
+  if (NinStack == 0) return (TRUE);
+
+  Nstack = NinStack;
+  ALLOCATE (stack, dbStack *, NinStack);
+  for (i = 0; i < NinStack; i++) {
+    stack[i] = &inStack[i];
+  }
+
+  for (i = 0; i < Nstack; i++) {
+
+    /***** binary operators *****/
+    if ((stack[i][0].type >= 3) && (stack[i][0].type <= 8)) {
+
+      // pre-test that op and entries match
+      output = dbBinary (stack[i-2], stack[i-1], stack[i][0].name, fields); 
+
+      // free temporary stack items, drop external items
+      dbFreeTempEntry (stack[i-2]);
+      dbFreeTempEntry (stack[i-1]);
+
+      stack[i-2] = output;
+      for (j = i + 1; j < Nstack; j++) {
+	stack[j-2] = stack[j];
+      }
+
+      Nstack -= 2;
+      i -= 2;
+      continue;
+    }
+
+    /***** unary operators **/
+    if (stack[i][0].type == 9) {
+
+      // pre-test that op and entries match
+      output = dbUnary (stack[i-1], stack[i][0].name, fields); 
+
+      // free temporary stack items, drop external items
+      dbFreeTempEntry (stack[i-1]);
+
+      stack[i-1] = output;
+      for (j = i + 1; j < Nstack; j++) {
+	stack[j-1] = stack[j];
+      }
+
+      Nstack -= 1;
+      i -= 1;
+      continue;
+    } 
+  }
+
+  // the result here is a single stack entry with a value:
+  if (stack[0][0].type == 'F') {
+    N = stack[0][0].field;
+    value = fields[N];
+  } else {
+    value = stack[0][0].Float;
+  }
+    
+  for (i = 0; i < Nstack; i++) {
+    dbFreeEntry (stack[i]);
+  }
+  free (stack);
+
+  // XXX fix this limit
+  if (fabs(value) > 1e-7) {
+    return (TRUE);
+  } else {
+    return (FALSE);
+  }
+
+  // pre-test that op and entries match
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbCheckStack.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbCheckStack.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbCheckStack.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "dvoshell.h"
+
+int dbCheckStack (dbStack *stack, int Nstack, int table, dbField **inFields, int *inNfields) {
+
+  int i, j, status, NFIELDS, Nfields;
+  char *c;
+  dbField *fields;
+
+  fields = *inFields;
+  Nfields = *inNfields;
+
+  NFIELDS = Nfields + 10;
+  REALLOCATE (fields, dbField, NFIELDS);
+
+  for (i = 0; i < Nstack; i++) {
+    if (stack[i].type == 'X') {
+
+      /** if this is a number, put it on the list of scalers and move on **/
+      stack[i].Float = strtod (stack[i].name, &c);
+      if (c == stack[i].name + strlen (stack[i].name)) {
+	stack[i].type  = 'S';
+	continue;
+      } 
+
+      // this must be a field : is it already in the list?
+      for (j = 0; (j < Nfields) && strcasecmp (stack[i].name, fields[j].name); j++);
+      if (j < Nfields) {
+	stack[i].field = j;
+	stack[i].type  = 'F';
+	stack[i].name  = NULL;
+	stack[i].Float = 0.0;
+	continue;
+      }
+
+      // this must be a field : is it a valid name?
+      if (table == DVO_TABLE_MEASURE) {
+	status = ParseMeasureField (&fields[Nfields], stack[i].name);
+      } 
+      if (table == DVO_TABLE_AVERAGE) {
+	status = ParseAverageField (&fields[Nfields], stack[i].name);
+      } 
+      if (!status) {
+	gprint (GP_ERR, "unknown database field %s\n", stack[i].name);
+	return (FALSE);
+      }
+      stack[i].field = Nfields;
+      stack[i].type  = 'F';
+      stack[i].name  = NULL;
+      stack[i].Float = 0.0;
+
+      Nfields ++;
+      CHECK_REALLOCATE (fields, dbField, NFIELDS, Nfields, 10);
+    }
+  }
+
+  *inNfields = Nfields;
+  *inFields = fields;
+
+  return (TRUE);
+}
+
+/* check stack identifies the data elements as plain scalars or table fields
+   operators have already been identified.  
+   check stack returns the total stack dimensionality (0,1,2)
+   on error, check stack returns FALSE
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbCmdlineFields.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbCmdlineFields.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbCmdlineFields.c	(revision 15879)
@@ -0,0 +1,180 @@
+# include "dvoshell.h"
+
+// identify the fields to be extracted (test for where, check syntax)
+dbField *dbCmdlineFields (int argc, char **argv, int table, int *last, int *nfields) {
+
+  int i, status, Nfields, NFIELDS;
+  char *p, *q, *field;
+  dbField *fields;
+
+  *nfields = 0;
+  Nfields = 0;
+  NFIELDS = 10;
+  ALLOCATE (fields, dbField, NFIELDS);
+  dbInitField (&fields[0]);
+
+  // examine each argv[i] entry until we reach a where 
+  for (i = 1; (i < argc) && strcasecmp (argv[i], "where"); i++) {
+    // split the word by ","
+    p = argv[i];
+    while (*p) {
+      q = strchr (p, ',');
+      if (q == NULL) {
+	field = strcreate (p);
+	p = p + strlen(p);
+      } else {
+	field = strncreate (p, q-p);
+	p = q + 1;
+      }
+      // identify field for word
+      // need to know which type of fields to look for...
+      // xxx extend this more generally later
+      if (table == DVO_TABLE_MEASURE) {
+	status = ParseMeasureField (&fields[Nfields], field);
+      } 
+      if (table == DVO_TABLE_AVERAGE) {
+	status = ParseAverageField (&fields[Nfields], field);
+      } 
+      if (!status) {
+	gprint (GP_ERR, "unknown database field %s\n", field);
+	free (field);
+	dbFreeFields (fields, Nfields);
+	return (NULL);
+      }
+      free (field);
+
+      Nfields ++;
+      CHECK_REALLOCATE (fields, dbField, NFIELDS, Nfields, 10);
+      dbInitField (&fields[Nfields]);
+    }
+  }
+
+  // require 'where' before boolean math
+  if (i != argc) {
+    if (strcasecmp(argv[i], "where")) {
+      gprint (GP_ERR, "syntax error\n");
+      free (fields);
+      return (NULL);
+    }
+    if (i > argc - 2) {
+      gprint (GP_ERR, "missing boolean expression\n");
+      free (fields);
+      return (NULL);
+    }
+    i++; // skip over the 'where'
+  }
+
+  *last = i;
+  *nfields = Nfields;
+
+  return (fields);
+}
+
+char *strfloat (float value) {
+
+  int Nbyte;
+  char *output;
+  char tmp;
+
+  Nbyte = snprintf (&tmp, 0, "%f", value);
+  ALLOCATE (output, char, Nbyte + 1);
+  snprintf (output, Nbyte + 1, "%f", value);
+  return output;
+}
+
+// identify the fields to be extracted (test for where, check syntax)
+int dbAstroRegionLimits (dbStack **stack, int *nstack, SkyRegionSelection *selection, int table) {
+  
+  int N;
+  double Rmin, Rmax, Dmin, Dmax;
+  char *Rname, *Dname;
+
+  if (!selection->useDisplay && !selection->useSkyregion) return (TRUE);
+
+  // get the ra,dec limits...
+  if (selection->useDisplay) {
+    return (TRUE);
+    // XXX fix this: be more careful with the projection & limits
+
+    Graphdata graphsky;
+    if (!GetGraphData (&graphsky, NULL, NULL)) {
+      gprint (GP_ERR, "region display not available\n");
+      return (FALSE);
+    }
+    
+    // XXX the ra and dec range depend on the projection. 
+    // XXX this is wrong...
+    int status;
+    status = XY_to_RD (&Rmin, &Dmin, graphsky.xmin, graphsky.ymin, &graphsky.coords);
+    status = XY_to_RD (&Rmax, &Dmax, graphsky.xmax, graphsky.ymax, &graphsky.coords);
+  }
+
+  if (selection->useSkyregion) {
+    get_skyregion (&Rmin, &Rmax, &Dmin, &Dmax);
+  }    
+
+  N = *nstack;
+  REALLOCATE (*stack, dbStack, N + 20);
+
+  if (table == DVO_TABLE_AVERAGE) {
+    Rname = strcreate ("RA");
+    Dname = strcreate ("DEC");
+  } else {
+    Rname = strcreate ("RA:AVE");
+    Dname = strcreate ("DEC:AVE");
+  }
+
+  // add: ((ra > rmin) && (ra < rmax) && (dec > dmin) && (dec < dmax))
+  // prepend with && if *nstack > 0
+
+  stack[0][N +  0].name = strcreate (Rname);
+  stack[0][N +  0].type = 'X';
+  stack[0][N +  1].name = strfloat (Rmin);
+  stack[0][N +  1].type = 'X';
+  stack[0][N +  2].name = strcreate (">");
+  stack[0][N +  2].type = 4;
+  // stack[0][N +  3].name = strcreate ("A");
+  // stack[0][N +  3].type = 3;
+
+  stack[0][N +  3].name = strcreate (Rname);
+  stack[0][N +  3].type = 'X';
+  stack[0][N +  4].name = strfloat (Rmax);
+  stack[0][N +  4].type = 'X';
+  stack[0][N +  5].name = strcreate ("<");
+  stack[0][N +  5].type = 4;
+  stack[0][N +  6].name = strcreate ("A");
+  stack[0][N +  6].type = 3;
+
+  stack[0][N +  7].name = strcreate (Dname);
+  stack[0][N +  7].type = 'X';
+  stack[0][N +  8].name = strfloat (Dmin);
+  stack[0][N +  8].type = 'X';
+  stack[0][N +  9].name = strcreate (">");
+  stack[0][N +  9].type = 4;
+  stack[0][N + 10].name = strcreate ("A");
+  stack[0][N + 10].type = 3;
+
+  stack[0][N + 11].name = strcreate (Dname);
+  stack[0][N + 11].type = 'X';
+  stack[0][N + 12].name = strfloat (Dmax);
+  stack[0][N + 12].type = 'X';
+  stack[0][N + 13].name = strcreate ("<");
+  stack[0][N + 13].type = 4;
+  stack[0][N + 14].name = strcreate ("A");
+  stack[0][N + 14].type = 3;
+
+  if (N == 0) {
+    N += 15;
+  } else {
+    stack[0][N + 15].name = strcreate ("A");
+    stack[0][N + 15].type = 3;
+    N += 16;
+  }    
+
+  free (Rname);
+  free (Dname);
+
+  *nstack = N;
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbExtractAverages.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbExtractAverages.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbExtractAverages.c	(revision 15879)
@@ -0,0 +1,135 @@
+# include "dvoshell.h"
+
+/* return average.field based on the selection */
+double dbExtractAverages (Average *average, SecFilt *secfilt, Measure *measure, dbField *field) {
+
+  int i, Nsec;
+  double value;
+
+  value = NAN;
+
+  /* assign vector values */
+  switch (field->ID) {
+    case AVE_RA:
+      value = average[0].R;
+      break;
+    case AVE_DEC:
+      value = average[0].D;
+      break;
+    case AVE_RA_ERR:
+      value = average[0].dR;
+      break;
+    case AVE_DEC_ERR:
+      value = average[0].dD;
+      break;
+
+    case AVE_U_RA:
+      value = average[0].uR;
+      break;
+    case AVE_U_DEC:
+      value = average[0].uD;
+      break;
+    case AVE_U_RA_ERR:
+      value = average[0].duR;
+      break;
+    case AVE_U_DEC_ERR:
+      value = average[0].duD;
+      break;
+
+    case AVE_PAR:
+      value = average[0].P;
+      break;
+    case AVE_PAR_ERR:
+      value = average[0].dP;
+      break;
+
+    case AVE_NMEAS:
+      value = average[0].Nm;
+      break;
+    case AVE_NMISS:
+      value = average[0].Nn;
+      break;
+    case AVE_Xp:
+      value = 0.01*average[0].Xp;
+      break;
+    case AVE_FLAG:
+      value = average[0].code;
+      break;
+
+    case AVE_MAG:
+      switch (field->magMode) {
+	case MAG_AVE:
+	  value = PhotAve  (field->photcode, average, secfilt);
+	  break;
+	case MAG_REF:
+	  value = PhotRef  (field->photcode, average, secfilt, measure);
+	  break;
+	case MAG_INST:
+	case MAG_CAT:
+	case MAG_SYS:
+	case MAG_REL:
+	case MAG_CAL:
+	  // XXX need to code this correctly: this returns just the first matching value
+	  value = NAN;
+	  for (i = 0; i < average[0].Nm; i++) {
+	    if (field->photcode->code != measure[i].photcode) continue;
+	    value = measure[i].M;
+	    break;
+	  }
+	  break;
+	case MAG_CHISQ:
+	  // GetPhotcodeEquivCodebyCode (field->photcode)
+	  value = PhotXm (field->photcode, average, secfilt);
+	  break;
+	case MAG_ERR:
+	  // GetPhotcodeEquivCodebyCode (field->photcode)
+	  value = PhotdM (field->photcode, average, secfilt);
+	  break;
+	case MAG_NCODE:
+	  // XXX push these into dvo_photcode_ops APIs
+	  // XXX do I need to allow for conversion to equiv?
+	  Nsec = GetPhotcodeNsec (field->photcode->code);
+	  if (Nsec == -1) break;
+	  value = secfilt[Nsec].Ncode;
+	  break;
+	case MAG_NPHOT:
+	  Nsec = GetPhotcodeNsec (field->photcode->code);
+	  if (Nsec == -1) break;
+	  value = secfilt[Nsec].Nused;
+	  break;
+
+      }
+      break;
+    case AVE_dMAG:
+      value = PhotdM (field->photcode, average, secfilt);
+      break;
+    case AVE_Xm:
+      value = PhotXm (field->photcode, average, secfilt);
+      break;
+    case AVE_TYPE:
+      break;
+    case AVE_TYPEFRAC:
+      break;
+      /*
+    case AVE_NCODE:
+      value = 0;
+      for (i = 0; i < average[0].Nm; i++) {
+	if (field->photcode->code != GetPhotcodeEquivCodebyCode (measure[i].photcode)) continue;
+	value ++;
+      }
+      break;
+    case AVE_NPHOT:
+      value = 0;
+      for (i = 0; i < average[0].Nm; i++) {
+	if (field->photcode->code != GetPhotcodeEquivCodebyCode (measure[i].photcode)) continue;
+	if (measure[i].flags & (ID_MEAS_POOR | ID_MEAS_SKIP)) continue;
+	value ++;
+      }
+      break;
+    case AVE_NCRIT:
+      break;
+      */
+  }
+  return (value);
+}  
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbExtractMeasures.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbExtractMeasures.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbExtractMeasures.c	(revision 15879)
@@ -0,0 +1,251 @@
+# include "dvoshell.h"
+
+/* time concepts */
+static time_t TimeReference;
+static int TimeFormat;
+
+void dbExtractMeasuresInit () {
+  GetTimeFormat (&TimeReference, &TimeFormat);
+}
+
+/* return measure.field based on the selection */
+double dbExtractMeasures (Average *average, SecFilt *secfilt, Measure *measure, dbField *field) {
+
+  int Nsec;
+  double value;
+  double ra, dec, x, y;
+
+  Image *image;
+  Coords *mosaic;
+
+  value = NAN;
+
+  switch (field->ID) {
+    case MEAS_MAG: /* magnitudes are already determined above */
+      // we return the magnitude for this measure if:
+      if (field->photcode->type == PHOT_MAG) goto valid_photcode;
+      if ((field->photcode->type == PHOT_REF) && (measure[0].photcode == field->photcode->code)) goto valid_photcode;
+      if ((field->photcode->type == PHOT_DEP) && (measure[0].photcode == field->photcode->code)) goto valid_photcode;
+      if ((field->photcode->type == PHOT_SEC) && (GetPhotcodeEquivCodebyCode (measure[0].photcode) == field->photcode->code)) goto valid_photcode;
+      break;
+
+  valid_photcode:
+      switch (field->magMode) {
+	case MAG_INST:
+	  value = PhotInst (measure);  
+	  break;
+	case MAG_CAT:
+	  value = PhotCat  (measure); 
+	  break;
+	case MAG_SYS:
+	  value = PhotSys  (measure, average, secfilt); 
+	  break;
+	case MAG_REL:
+	  value = PhotRel  (measure, average, secfilt); 
+	  break;
+	case MAG_CAL:
+	  value = PhotCal  (measure, average, secfilt, measure, GetPhotcodeEquivbyCode (measure[0].photcode)); 
+	  break;
+	case MAG_AVE:
+	  value = PhotAve  (GetPhotcodeEquivbyCode (measure[0].photcode), average, secfilt); 
+	  break;
+	case MAG_REF:
+	  value = PhotRef  (GetPhotcodeEquivbyCode (measure[0].photcode), average, secfilt, measure); 
+	  break;
+	case MAG_ERR:
+	  value = PhotdM  (GetPhotcodeEquivbyCode (measure[0].photcode), average, secfilt); 
+	  break;
+	case MAG_CHISQ:
+	  value = PhotXm  (GetPhotcodeEquivbyCode (measure[0].photcode), average, secfilt); 
+	  break;
+	case MAG_NCODE:
+	  Nsec = GetPhotcodeNsec (GetPhotcodeEquivCodebyCode (measure[0].photcode));
+	  if (Nsec == -1) break;
+	  value = secfilt[Nsec].Ncode;
+	  break;
+	case MAG_NPHOT:
+	  Nsec = GetPhotcodeNsec (GetPhotcodeEquivCodebyCode (measure[0].photcode));
+	  if (Nsec == -1) break;
+	  value = secfilt[Nsec].Nused;
+	  break;
+      }
+      break;
+    case MEAS_RA: /* OK */
+      value = average[0].R - measure[0].dR / 3600.0;
+      break;
+    case MEAS_DEC: /* OK */
+      value = average[0].D - measure[0].dD / 3600.0;
+      break;
+    case MEAS_RA_AVE: /* OK */
+      value = average[0].R;
+      break;
+    case MEAS_DEC_AVE: /* OK */
+      value = average[0].D;
+      break;
+    case MEAS_RA_AVE_ERR: /* OK */
+      value = average[0].dR;
+      break;
+    case MEAS_DEC_AVE_ERR: /* OK */
+      value = average[0].dD;
+      break;
+    case MEAS_U_RA: /* OK */
+      value = average[0].uR;
+      break;
+    case MEAS_U_DEC: /* OK */
+      value = average[0].uD;
+      break;
+    case MEAS_U_RA_ERR: /* OK */
+      value = average[0].duR;
+      break;
+    case MEAS_U_DEC_ERR: /* OK */
+      value = average[0].duD;
+      break;
+    case MEAS_PAR: /* OK */
+      value = average[0].R;
+      break;
+    case MEAS_PAR_ERR: /* OK */
+      value = average[0].D;
+      break;
+    case MEAS_XP: /* OK */
+      value = average[0].Xp;
+      break;
+    case MEAS_NMEAS: /* OK */
+      value = average[0].Nm;
+      break;
+    case MEAS_NMISS: /* OK */
+      value = average[0].Nn;
+      break;
+    case MEAS_OBJFLAGS: /* OK */
+      value = average[0].code;
+      break;
+    // note that these represent the ra displacement relative to the average, not 
+    // the error.
+    case MEAS_RA_OFFSET: /* OK */
+      value = measure[0].dR;
+      break;
+    case MEAS_DEC_OFFSET: /* OK */
+      value = measure[0].dD;
+      break;
+    case MEAS_RA_OFFSET_ERR: /* OK */
+      value = NAN;
+      break;
+    case MEAS_DEC_OFFSET_ERR: /* OK */
+      value = NAN;
+      break;
+    case MEAS_AIRMASS: /* OK */
+      value = measure[0].airmass;
+      break;
+    case MEAS_AZ: /* OK */
+      value = measure[0].az;
+      break;
+    case MEAS_EXPTIME: /* OK */
+      value = pow (10.0, measure[0].dt * 0.4);
+      break;
+    case MEAS_PHOTCODE: /* OK */
+      value = measure[0].photcode;
+      break;
+    case MEAS_TIME: /* OK */
+      value = TimeValue (measure[0].t, TimeReference, TimeFormat);
+      break;
+    case MEAS_FWHM: /* OK */
+      value = 0.01*(measure[0].FWx + measure[0].FWy);
+      break;
+    case MEAS_FWHM_MAJ: /* OK */
+      value = 0.01*measure[0].FWx;
+      break;
+    case MEAS_FWHM_MIN: /* OK */
+      value = 0.01*measure[0].FWy;
+      break;
+    case MEAS_THETA: /* OK */
+      value = measure[0].theta;
+      break;
+    case MEAS_DOPHOT: /* OK */
+      value = measure[0].dophot;
+      break;
+    case MEAS_DB_FLAGS: /* ? */
+      value = measure[0].dbFlags;
+      break;
+    case MEAS_PHOT_FLAGS: /* ? */
+      value = measure[0].photFlags;
+      break;
+    case MEAS_XCCD: /* OK */
+/* I need to perform this conversion for ELIXIR and LONEOS formats on load */      
+# if 0
+      value = measure[0].Xccd;
+# else
+      ra  = average[0].R - measure[0].dR / 3600.0;
+      dec = average[0].D - measure[0].dD / 3600.0;
+      image = MatchImage (measure[0].t, measure[0].photcode);
+      if (image == NULL) break;
+      RD_to_XY (&x, &y, ra, dec, &image[0].coords);
+      value = x;
+# endif
+      break;
+    case MEAS_YCCD: /* OK */
+/* I need to perform this conversion for ELIXIR and LONEOS formats on load */      
+# if 0
+      value = measure[0].Yccd;
+# else
+      ra  = average[0].R - measure[0].dR / 3600.0;
+      dec = average[0].D - measure[0].dD / 3600.0;
+      image = MatchImage (measure[0].t, measure[0].photcode);
+      if (image == NULL) break;
+      RD_to_XY (&x, &y, ra, dec, &image[0].coords);
+      value = y;
+# endif
+      break;
+    case MEAS_XMOSAIC: /* OK */
+      ra  = average[0].R - measure[0].dR / 3600.0;
+      dec = average[0].D - measure[0].dD / 3600.0;
+      mosaic = MatchMosaic (measure[0].t, measure[0].photcode);
+      if (mosaic == NULL) break;
+      RD_to_XY (&x, &y, ra, dec, mosaic);
+      value = x;
+      break;
+    case MEAS_YMOSAIC: /* OK */
+      ra  = average[0].R - measure[0].dR / 3600.0;
+      dec = average[0].D - measure[0].dD / 3600.0;
+      mosaic = MatchMosaic (measure[0].t, measure[0].photcode);
+      if (mosaic == NULL) break;
+      RD_to_XY (&x, &y, ra, dec, mosaic);
+      value = y;
+      break;
+
+    case MEAS_SKY: /* OK */
+      value = measure[0].Sky;
+      break;
+    case MEAS_dSKY: /* OK */
+      value = measure[0].dSky;
+      break;
+    case MEAS_DET_ID: /* OK */
+      value = measure[0].detID;
+      break;
+    case MEAS_OBJ_ID: /* OK */
+      value = measure[0].averef;
+      break;
+    case MEAS_IMAGE_ID: /* OK */
+      value = measure[0].imageID;
+      break;
+    case MEAS_PSF_QF: /* OK */
+      value = measure[0].qPSF;
+      break;
+    case MEAS_PSF_PROB: /* OK */
+      value = measure[0].psfProb;
+      break;
+    case MEAS_CR_NSIGMA: /* OK */
+      value = measure[0].crNsigma;
+      break;
+    case MEAS_EXT_NSIGMA: /* OK */
+      value = measure[0].extNsigma;
+      break;
+    case MEAS_STARGAL: /* OK */
+      value = measure[0].stargal;
+      break;
+  }
+  return (value);
+}
+
+/** the mosaic entries do not use the registered mosaic found 
+    by MatchImage (via FindMosaicForImage).  Rather, they use
+    a coordinate frame saved by SetImageSelection 
+**/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbFields.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbFields.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbFields.c	(revision 15879)
@@ -0,0 +1,209 @@
+# include "dvoshell.h"
+
+void dbFreeFields (dbField *fields, int Nfields) {
+
+  int i;
+
+  if (fields == NULL) return;
+
+  for (i = 0; i < Nfields; i++) {
+    if (fields[i].name != NULL) free (fields[i].name);
+    if (fields[i].photcode != NULL) {
+      if (fields[i].photcode[0].type == PHOT_MAG) {
+	free (fields[i].photcode);
+      }
+    }
+  }
+  free (fields);
+}
+
+void dbInitField (dbField *field) {
+  field->name = NULL;
+  field->extract = FALSE;
+  field->table = 0;
+  field->ID = 0;
+  field->magMode = 0;
+  field->photcode = NULL;
+}
+
+int GetMagMode (char *string) {
+
+  if (!strcasecmp (string, "inst"))  return (MAG_INST);
+  if (!strcasecmp (string, "cat"))   return (MAG_CAT);
+  if (!strcasecmp (string, "sys"))   return (MAG_SYS);
+  if (!strcasecmp (string, "rel"))   return (MAG_REL);
+  if (!strcasecmp (string, "cal"))   return (MAG_CAL);
+  if (!strcasecmp (string, "ave"))   return (MAG_AVE);
+  if (!strcasecmp (string, "ref"))   return (MAG_REF);
+  if (!strcasecmp (string, "err"))   return (MAG_ERR);
+  if (!strcasecmp (string, "chisq")) return (MAG_CHISQ);
+  if (!strcasecmp (string, "ncode")) return (MAG_NCODE);
+  if (!strcasecmp (string, "nphot")) return (MAG_NPHOT);
+  return (MAG_NONE);
+}
+
+PhotCode *ParsePhotcodeField (char *field, int *mode, int defMode) {
+
+  int useDefault;
+  char *tmpstring, *p;
+  PhotCode *code;
+
+  *mode = defMode;
+  useDefault = TRUE;
+
+  p = strchr (field, ':');
+  if (p != NULL) {
+    *mode = GetMagMode (p + 1);
+    useDefault = FALSE;
+    if (*mode == MAG_NONE) return (NULL);
+    tmpstring = strncreate (field, p - field);
+  } else {
+    tmpstring = strcreate (field);
+  }
+  if (!strcasecmp (tmpstring, "MAG")) {
+    ALLOCATE (code, PhotCode, 1);
+    code[0].code = 0;
+    strcpy (code[0].name, "MAG");
+    code[0].type = PHOT_MAG;
+    free (tmpstring);
+    return (code);
+  }
+  code = GetPhotcodebyName (tmpstring);
+  if (!code) {
+      return NULL;
+  }
+
+
+  // enforce compatibility
+  // XXX this is kind of poorly done
+  if ((code[0].type == PHOT_REF) && (*mode != MAG_ERR)) {
+    *mode = MAG_CAT;
+  }
+  if (code[0].type == PHOT_DEP) {
+    if (useDefault) {
+      *mode = MAG_REL;
+    }
+  } 
+  free (tmpstring);
+  return (code);
+}
+
+# define ESCAPE(F,M) { \
+  field->ID = (F); \
+  field->magMode = (M); \
+  field->photcode = NULL; \
+  return (TRUE); }
+
+int ParseMeasureField (dbField *field, char *fieldName) {
+
+  int mode;
+  PhotCode *code;
+
+  field->table = DVO_TABLE_MEASURE;
+  field->name  = strcreate (fieldName);
+
+  if (!strcasecmp (fieldName, "RA"))         ESCAPE (MEAS_RA,   	MAG_NONE);
+  if (!strcasecmp (fieldName, "DEC"))        ESCAPE (MEAS_DEC,  	MAG_NONE);
+  if (!strcasecmp (fieldName, "RA:AVE"))     ESCAPE (MEAS_RA_AVE,      	MAG_NONE);
+  if (!strcasecmp (fieldName, "DEC:AVE"))    ESCAPE (MEAS_DEC_AVE,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "RA:ERR"))     ESCAPE (MEAS_RA_AVE_ERR,  	MAG_NONE);
+  if (!strcasecmp (fieldName, "DEC:ERR"))    ESCAPE (MEAS_DEC_AVE_ERR, 	MAG_NONE);
+  if (!strcasecmp (fieldName, "uRA"))        ESCAPE (MEAS_U_RA,        	MAG_NONE);
+  if (!strcasecmp (fieldName, "uDEC"))       ESCAPE (MEAS_U_DEC,       	MAG_NONE);
+  if (!strcasecmp (fieldName, "duRA"))       ESCAPE (MEAS_U_RA_ERR,    	MAG_NONE);
+  if (!strcasecmp (fieldName, "duDEC"))      ESCAPE (MEAS_U_DEC_ERR,   	MAG_NONE);
+  if (!strcasecmp (fieldName, "PAR"))        ESCAPE (MEAS_PAR,         	MAG_NONE);
+  if (!strcasecmp (fieldName, "dPAR"))       ESCAPE (MEAS_PAR_ERR,      MAG_NONE);
+  if (!strcasecmp (fieldName, "dR"))         ESCAPE (MEAS_RA_OFFSET,   	MAG_NONE);
+  if (!strcasecmp (fieldName, "dD"))         ESCAPE (MEAS_DEC_OFFSET,  	MAG_NONE);
+  if (!strcasecmp (fieldName, "dR:ERR"))     ESCAPE (MEAS_RA_OFFSET_ERR,  MAG_NONE);
+  if (!strcasecmp (fieldName, "dD:ERR"))     ESCAPE (MEAS_DEC_OFFSET_ERR, MAG_NONE);
+  if (!strcasecmp (fieldName, "xp"))         ESCAPE (MEAS_XP,          	MAG_NONE);
+  if (!strcasecmp (fieldName, "nmeas"))      ESCAPE (MEAS_NMEAS,       	MAG_NONE);
+  if (!strcasecmp (fieldName, "nmiss"))      ESCAPE (MEAS_NMISS,       	MAG_NONE);
+  if (!strcasecmp (fieldName, "objflags"))   ESCAPE (MEAS_OBJFLAGS,     MAG_NONE);
+  if (!strcasecmp (fieldName, "AIRMASS"))    ESCAPE (MEAS_AIRMASS,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "ALT"))        ESCAPE (MEAS_ALT,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "AZ"))         ESCAPE (MEAS_AZ,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "EXPTIME"))    ESCAPE (MEAS_EXPTIME,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "PHOTCODE"))   ESCAPE (MEAS_PHOTCODE,    	MAG_NONE);
+  if (!strcasecmp (fieldName, "TIME"))       ESCAPE (MEAS_TIME,        	MAG_NONE);
+  if (!strcasecmp (fieldName, "FWHM"))       ESCAPE (MEAS_FWHM,        	MAG_NONE);
+  if (!strcasecmp (fieldName, "FWHM_MAJ"))   ESCAPE (MEAS_FWHM_MAJ,    	MAG_NONE);
+  if (!strcasecmp (fieldName, "FWHM_MIN"))   ESCAPE (MEAS_FWHM_MIN,    	MAG_NONE);
+  if (!strcasecmp (fieldName, "THETA"))      ESCAPE (MEAS_THETA,       	MAG_NONE);
+  if (!strcasecmp (fieldName, "DOPHOT"))     ESCAPE (MEAS_DOPHOT,      	MAG_NONE);
+  if (!strcasecmp (fieldName, "DB_FLAGS"))   ESCAPE (MEAS_DB_FLAGS,    	MAG_NONE);
+  if (!strcasecmp (fieldName, "PHOT_FLAGS")) ESCAPE (MEAS_PHOT_FLAGS, 	MAG_NONE);
+  if (!strcasecmp (fieldName, "XCCD"))       ESCAPE (MEAS_XCCD, 	MAG_NONE);
+  if (!strcasecmp (fieldName, "YCCD"))       ESCAPE (MEAS_YCCD, 	MAG_NONE);
+  if (!strcasecmp (fieldName, "XMOSAIC"))    ESCAPE (MEAS_XMOSAIC,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "YMOSAIC"))    ESCAPE (MEAS_YMOSAIC,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "XCHIP"))      ESCAPE (MEAS_XCCD, 	MAG_NONE);
+  if (!strcasecmp (fieldName, "YCHIP"))      ESCAPE (MEAS_YCCD, 	MAG_NONE);
+  if (!strcasecmp (fieldName, "XFPA"))       ESCAPE (MEAS_XMOSAIC,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "YFPA"))       ESCAPE (MEAS_YMOSAIC,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "DETID"))      ESCAPE (MEAS_DET_ID,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "OBJID"))      ESCAPE (MEAS_OBJ_ID,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "IMAGEID"))    ESCAPE (MEAS_IMAGE_ID,     MAG_NONE);
+  if (!strcasecmp (fieldName, "PSF_QF"))     ESCAPE (MEAS_PSF_QF,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "PSF_PROB"))   ESCAPE (MEAS_PSF_PROB,     MAG_NONE);
+  if (!strcasecmp (fieldName, "CR_NSIGMA"))  ESCAPE (MEAS_CR_NSIGMA,    MAG_NONE);
+  if (!strcasecmp (fieldName, "EXT_NSIGMA")) ESCAPE (MEAS_EXT_NSIGMA,   MAG_NONE);
+  if (!strcasecmp (fieldName, "SKY"))        ESCAPE (MEAS_SKY,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "SKY_ERR"))    ESCAPE (MEAS_dSKY,     	MAG_NONE);
+  if (!strcasecmp (fieldName, "STARGAL"))    ESCAPE (MEAS_STARGAL,     	MAG_NONE);
+
+  // for words that don't parse, try a photcode
+
+  // check for code:mode in photcode name 
+  code = ParsePhotcodeField (fieldName, &mode, MAG_REL);
+  if (code == NULL) return (FALSE);
+
+  field->ID = MEAS_MAG;
+  field->magMode = mode;
+  field->photcode = code;
+  return (TRUE);
+}
+  
+int ParseAverageField (dbField *field, char *fieldName) {
+
+  int mode;
+  PhotCode *code;
+
+  field->table = DVO_TABLE_AVERAGE;
+  field->name  = strcreate (fieldName);
+
+  if (!strcasecmp (fieldName, "RA"))    ESCAPE (AVE_RA,        MAG_NONE);
+  if (!strcasecmp (fieldName, "DEC"))   ESCAPE (AVE_DEC,       MAG_NONE);
+  if (!strcasecmp (fieldName, "dRA"))   ESCAPE (AVE_RA_ERR,    MAG_NONE);
+  if (!strcasecmp (fieldName, "dDEC"))  ESCAPE (AVE_DEC_ERR,   MAG_NONE);
+  if (!strcasecmp (fieldName, "uRA"))   ESCAPE (AVE_U_RA,      MAG_NONE);
+  if (!strcasecmp (fieldName, "uDEC"))  ESCAPE (AVE_U_DEC,     MAG_NONE);
+  if (!strcasecmp (fieldName, "duRA"))  ESCAPE (AVE_U_RA_ERR,  MAG_NONE);
+  if (!strcasecmp (fieldName, "duDEC")) ESCAPE (AVE_U_DEC_ERR, MAG_NONE);
+  if (!strcasecmp (fieldName, "PAR"))   ESCAPE (AVE_PAR,       MAG_NONE);
+  if (!strcasecmp (fieldName, "dPAR"))  ESCAPE (AVE_PAR_ERR,   MAG_NONE);
+  if (!strcasecmp (fieldName, "Xp"))    ESCAPE (AVE_Xp,        MAG_NONE);
+  if (!strcasecmp (fieldName, "NMEAS")) ESCAPE (AVE_NMEAS,     MAG_NONE);
+  if (!strcasecmp (fieldName, "NMISS")) ESCAPE (AVE_NMISS,     MAG_NONE);
+  if (!strcasecmp (fieldName, "FLAG"))  ESCAPE (AVE_FLAG,      MAG_NONE);
+  if (!strcasecmp (fieldName, "TYPE"))  ESCAPE (AVE_TYPE,      MAG_NONE);
+  if (!strcasecmp (fieldName, "OBJID")) ESCAPE (AVE_OBJID,     MAG_NONE);
+
+  // for words that don't parse, try a photcode
+
+  // check for code:mode in photcode name 
+  code = ParsePhotcodeField (fieldName, &mode, MAG_AVE);
+  if (code == NULL) return (FALSE);
+  if (code[0].type == PHOT_MAG) {
+    gprint (GP_ERR, "'mag' is ambiguous for avextract\n");
+    free (code);
+    return (FALSE);
+  }
+
+  field->ID = AVE_MAG;
+  field->magMode = mode;
+  field->photcode = code;
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbRPN.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbRPN.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbRPN.c	(revision 15879)
@@ -0,0 +1,210 @@
+# include "dvoshell.h"
+# define DUMPSTACK 0
+
+dbStack *dbRPN (int argc, char **argv, int *nstack) {
+  
+  int type, Nx, Ny;
+  int i, j, Nstack, Nop_stack, NSTACK;
+  dbStack *stack, *op_stack;
+
+  /* max total stack size is argc, though should be less, this is safe */
+  NSTACK = argc + 5;
+  ALLOCATE (stack, dbStack, NSTACK);
+  ALLOCATE (op_stack, dbStack, NSTACK);
+  for (i = 0; i < NSTACK; i++) {
+    dbInitStack (&stack[i]);
+    dbInitStack (&op_stack[i]);
+  }
+  
+  Nx = Ny = Nstack = Nop_stack = 0;
+  for (i = 0; i < argc; i++) {
+    
+    /* decide on priority of object */
+    type = 0;
+    /* unary operations */
+    if (!strcmp (argv[i], "abs"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "int"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "exp"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "ten"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "log"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "ln"))     { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "sqrt"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "erf"))    { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "sinh"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "cosh"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "asinh"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "acosh"))  { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "sin"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "cos"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "tan"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dsin"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dcos"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dtan"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "asin"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "acos"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "atan"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dasin"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dacos"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "datan"))  { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "lgamma")) { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "rnd"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "xramp"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "yramp"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "ramp"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "zero"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "--"))     { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "not"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "isinf"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "isnan"))  { type = 9; goto gotit; }
+
+    /* binary operations */
+    if (!strcmp (argv[i], "^"))      { type = 8; goto gotit; }
+
+    if (!strcmp (argv[i], "@"))      { type = 7; goto gotit; }
+    if (!strcmp (argv[i], "/"))      { type = 7; goto gotit; }
+    if (!strcmp (argv[i], "*"))      { type = 7; goto gotit; }
+    if (!strcmp (argv[i], "%"))      { type = 7; goto gotit; }
+
+    if (!strcmp (argv[i], "+"))      { type = 6; goto gotit; }
+    if (!strcmp (argv[i], "-"))      { type = 6; goto gotit; }
+	
+    if (!strcmp (argv[i], "&"))      { type = 5; goto gotit; }
+    if (!strcmp (argv[i], "|"))      { type = 5; goto gotit; }
+
+    if (!strcmp (argv[i], "<"))      { type = 4; goto gotit; }
+    if (!strcmp (argv[i], ">"))      { type = 4; goto gotit; }
+    if (!strcmp (argv[i], "=="))     { type = 4; strcpy (argv[i], "E"); goto gotit; }
+    if (!strcmp (argv[i], "!="))     { type = 4; strcpy (argv[i], "N"); goto gotit; }
+    if (!strcmp (argv[i], "<="))     { type = 4; strcpy (argv[i], "L"); goto gotit; }
+    if (!strcmp (argv[i], ">="))     { type = 4; strcpy (argv[i], "G"); goto gotit; }
+    if (!strcmp (argv[i], ">>"))     { type = 4; strcpy (argv[i], "U"); goto gotit; }
+    if (!strcmp (argv[i], "<<"))     { type = 4; strcpy (argv[i], "D"); goto gotit; }
+
+    if (!strcmp (argv[i], "&&"))     { type = 3; strcpy (argv[i], "A"); goto gotit; }
+    if (!strcmp (argv[i], "||"))     { type = 3; strcpy (argv[i], "O"); goto gotit; }
+
+    if (!strcmp (argv[i], "("))      { type = 2; goto gotit; }
+    if (!strcmp (argv[i], ")"))      { type = 1; goto gotit; }
+
+  gotit:
+    /* choose how to deal with object */
+    switch (type) {
+      case 8:  /* exponentiation: 2^2^3 = 64 != 256 (precedence is right-to-left, not left-to-right!) */
+	/* pop previous, higher operators from OP stack to stack */
+	for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type > type); j--) {
+	  stack[Nstack] = op_stack[j];
+	  op_stack[j].name = NULL;
+	  Nstack ++;
+	  Nop_stack --;
+	}
+	/* push operator on OP stack */
+	op_stack[Nop_stack].name = strcreate (argv[i]);
+	op_stack[Nop_stack].type = type;
+	Nop_stack ++;
+	break;
+      case 9: /* unary OPs */
+      case 7: /* binary OPs */
+      case 6:
+      case 5: 
+      case 4: 
+      case 3: 
+	/* pop previous, higher or equal operators from OP stack to stack */
+	for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type >= type); j--) {
+	  stack[Nstack] = op_stack[j];
+	  op_stack[j].name = NULL;
+	  Nstack ++;
+	  Nop_stack --;
+	}
+	/* push operator on OP stack */
+	op_stack[Nop_stack].name = strcreate (argv[i]);
+	op_stack[Nop_stack].type = type;
+	Nop_stack ++;
+	break;
+      case 2:  
+	/* push operator on OP stack */
+	op_stack[Nop_stack].name = strcreate (argv[i]);
+	op_stack[Nop_stack].type = type;
+	Nop_stack ++;
+	break;
+      case 1: 
+	/* pop rest of operators from OP stack to stack, looking for '(' */
+	for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type != 2); j--) {
+	  stack[Nstack] = op_stack[j];
+	  op_stack[j].name = NULL;
+	  Nstack ++;
+	  Nop_stack --;
+	}
+	if ((j == -1) || (op_stack[j].type != 2)) {
+	  push_error ("syntax error: mismatched parenthesis");
+	  Nstack = 0;
+	  goto cleanup;
+	}
+	Nop_stack --;
+	break;
+      case 0:
+	/* place the value (number or vector/matrix name) on stack */
+	/* value of 'X' is used as sentinel until we sort out values */
+	stack[Nstack].name = strcreate (argv[i]);
+	stack[Nstack].type = 'X';
+	Nstack ++;
+	break;
+    }
+  }
+
+  /* dump remaining operators on stack, checking for ')' */
+  for (j = Nop_stack - 1; j >= 0; j--) {
+    if (op_stack[j].type == 2) {
+      push_error ("syntax error: mismatched parenthesis");
+      Nstack = 0;
+      goto cleanup;
+    }
+    stack[Nstack] = op_stack[j];
+    op_stack[j].name = NULL;
+    Nstack ++;
+  }
+
+cleanup: 
+  /*** free up unused stack space ***/
+  dbFreeStack (op_stack, NSTACK);
+  free (op_stack);
+  dbFreeStack (&stack[Nstack], NSTACK - Nstack);
+  REALLOCATE (stack, dbStack, MAX (Nstack, 1));
+  *nstack = Nstack;
+
+  for (i = 0; i < argc; i++) {
+    free (argv[i]);
+  }
+  free (argv);
+
+# if (DUMPSTACK)
+  for (i = 0; i < Nstack; i++) {
+    gprint (GP_ERR, "%s ", stack[i].name);
+  }
+  if (Nstack > 0) gprint (GP_ERR, "\n");
+  for (i = 0; i < Nstack; i++) {
+    gprint (GP_ERR, "%d ", stack[i].type);
+  }
+  if (Nstack > 0) gprint (GP_ERR, "\n");
+# endif
+
+  return (stack);
+
+}
+
+/* here are the rules for parsing a math AOL expression to RPN:
+
+1) if object is a number, push on stack
+2) if object is a third order operand (exp, sin, cos), push on op stack
+3) if object is an open paren, push on op stack,
+4) if object is a second order operand, push on stack
+5) if object is a first order operand, pop all second order operands from stack 
+until paren, push on stack
+6) if object is an end paren, pop all objects from stack until paren, 
+pop next stack, if third order op
+7) if end of line, pop all remaining objects, second order first, etc.
+   
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbStackMath.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbStackMath.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbStackMath.c	(revision 15879)
@@ -0,0 +1,161 @@
+# include "dvoshell.h"
+
+static int NallocBinary = 0;
+static int NallocUnary = 0;
+
+dbStack *dbBinary (dbStack *V1, dbStack *V2, char *op, float *fields) {
+
+  int N;
+  float M1, M2;
+  dbStack *OUT;
+  
+  if (V1->type == 'F') {
+    N = V1->field;
+    M1 = fields[N];
+  } else {
+    M1 = V1->Float;
+  }
+  
+  if (V2->type == 'F') {
+    N = V2->field;
+    M2 = fields[N];
+  } else {
+    M2 = V2->Float;
+  }
+
+  NallocBinary ++;
+  ALLOCATE (OUT, dbStack, 1);
+  OUT->type = 'T';
+  OUT->name = NULL;
+
+  // use an enum for the op...
+  switch (op[0]) { 
+  case '+': 
+    OUT->Float = M1 + M2;
+    break; 
+  case '-': 
+    OUT->Float = M1 - M2;
+    break; 
+  case '*': 
+    OUT->Float = M1 * M2;
+    break; 
+  case '/': 
+    OUT->Float = M1 / M2;
+    break; 
+  case '%': 
+    OUT->Float = (int) M1 % (int) M2;
+    break; 
+  case 0x5e: 
+    OUT->Float = pow (M1, M2);
+    break; 
+  case 'D': 
+    OUT->Float = MIN (M1, M2);
+    break; 
+  case 'U': 
+    OUT->Float = MAX (M1, M2);
+    break; 
+  case '<': 
+    OUT->Float = (M1 < M2) ? 1 : 0;
+    break; 
+  case '>': 
+    OUT->Float = (M1 > M2) ? 1 : 0;
+    break; 
+  case '&': 
+    OUT->Float = ((int)M1 & (int)M2);
+    break; 
+  case '|': 
+    OUT->Float = ((int)M1 | (int)M2);
+    break; 
+  case 'E': 
+    OUT->Float = (M1 == M2) ? 1 : 0;
+    break; 
+  case 'N': 
+    OUT->Float = (M1 != M2) ? 1 : 0;
+    break; 
+  case 'L': 
+    OUT->Float = (M1 <= M2) ? 1 : 0;
+    break; 
+  case 'G': 
+    OUT->Float = (M1 >= M2) ? 1 : 0;
+    break; 
+  case 'A': 
+    OUT->Float = (M1 && M2) ? 1 : 0;
+    break; 
+  case 'O': 
+    OUT->Float = (M1 || M2) ? 1 : 0;
+    break; 
+  default:
+    return (NULL);
+  }
+
+  return (OUT);
+}
+
+dbStack *dbUnary (dbStack *V1, char *op, float *fields) {
+
+  int N;
+  float M1;
+  dbStack *OUT;
+
+  if (V1->type == 'F') {
+    N = V1->field;
+    M1 = fields[N];
+  } else {
+    M1 = V1->Float;
+  }
+  
+  NallocUnary ++;
+  ALLOCATE (OUT, dbStack, 1);
+  OUT->type = 'T';
+  OUT->name = NULL;
+
+  if (!strcmp (op, "="))      {   OUT->Float = M1;                 }
+  if (!strcmp (op, "abs"))    {   OUT->Float = fabs(M1);           }
+  if (!strcmp (op, "int"))    {   OUT->Float = (float)(int)(M1);   }
+  if (!strcmp (op, "exp"))    {   OUT->Float = exp (M1);           }
+  if (!strcmp (op, "ten"))    {   OUT->Float = pow (10.0,M1);      }
+  if (!strcmp (op, "log"))    {   OUT->Float = log10 (M1);         }
+  if (!strcmp (op, "ln"))     {   OUT->Float = log (M1);           }
+  if (!strcmp (op, "sqrt"))   {   OUT->Float = sqrt (M1);          }
+  if (!strcmp (op, "erf"))    {   OUT->Float = erf (M1);           }
+			      			      
+  if (!strcmp (op, "sinh"))   {   OUT->Float = sinh (M1);          }
+  if (!strcmp (op, "cosh"))   {   OUT->Float = cosh (M1);          }
+  if (!strcmp (op, "asinh"))  {   OUT->Float = asinh (M1);         }
+  if (!strcmp (op, "acosh"))  {   OUT->Float = acosh (M1);         }
+  if (!strcmp (op, "lgamma")) {   OUT->Float = lgamma (M1);        }
+
+  if (!strcmp (op, "sin"))    {   OUT->Float = sin (M1);           }
+  if (!strcmp (op, "cos"))    {   OUT->Float = cos (M1);           }
+  if (!strcmp (op, "tan"))    {   OUT->Float = tan (M1);           }
+  if (!strcmp (op, "dsin"))   {   OUT->Float = sin (M1*RAD_DEG);   }
+  if (!strcmp (op, "dcos"))   {   OUT->Float = cos (M1*RAD_DEG);   }
+  if (!strcmp (op, "dtan"))   {   OUT->Float = tan (M1*RAD_DEG);   }
+  if (!strcmp (op, "asin"))   {   OUT->Float = asin (M1);          }
+  if (!strcmp (op, "acos"))   {   OUT->Float = acos (M1);          }
+  if (!strcmp (op, "atan"))   {   OUT->Float = atan (M1);          }
+  if (!strcmp (op, "dasin"))  {   OUT->Float = asin (M1)*DEG_RAD;  }
+  if (!strcmp (op, "dacos"))  {   OUT->Float = acos (M1)*DEG_RAD;  }
+  if (!strcmp (op, "datan"))  {   OUT->Float = atan (M1)*DEG_RAD;  }
+  if (!strcmp (op, "rnd"))    {   OUT->Float = drand48();          }
+  if (!strcmp (op, "not"))    {   OUT->Float = !(M1);              }
+  if (!strcmp (op, "--"))     {   OUT->Float = - (M1);             }
+  if (!strcmp (op, "isinf"))  {   OUT->Float = !finite(M1);        }
+  if (!strcmp (op, "isnan"))  {   OUT->Float = isnan(M1);          } 
+
+  return (OUT);
+}
+
+int dbStackAllocPrint () {
+
+  fprintf (stderr, "dbAllocBinary: %d\n", NallocBinary);
+  fprintf (stderr, "dbAllocUnary:  %d\n", NallocUnary);
+  return (TRUE);
+}
+
+int dbStackAllocReset () {
+
+  NallocBinary = 0;
+  NallocUnary = 0;
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbStackOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbStackOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dbStackOps.c	(revision 15879)
@@ -0,0 +1,51 @@
+# include "dvoshell.h"
+
+void dbInitStack (dbStack *stack) {
+  stack[0].type   = 0;
+  stack[0].name   = NULL;
+}
+
+// free data for stack entries (free stack explicitly)
+void dbFreeStack (dbStack *stack, int Nstack) {
+
+  int i;
+
+  if (stack == NULL) return;
+
+  for (i = 0; i < Nstack; i++) {
+    if (stack[i].name != NULL) {
+      free (stack[i].name);
+      stack[i].name = NULL;
+    }
+  }
+}
+
+static int NfreeStack = 0;
+
+/* delete name and data */
+void dbFreeEntry (dbStack *stack) {
+
+  if (stack[0].name != NULL)  free (stack[0].name);
+  free (stack);
+  NfreeStack ++;
+}
+
+/* delete name and data */
+void dbFreeTempEntry (dbStack *stack) {
+
+  if (stack->type != 'T') return;
+
+  if (stack[0].name != NULL)  free (stack[0].name);
+  free (stack);
+  NfreeStack ++;
+}
+
+void dbStackFreePrint () {
+
+  fprintf (stderr, "dbFreeStack: %d\n", NfreeStack);
+}
+
+void dbStackFreeReset () {
+
+  NfreeStack = 0;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/db_check_stack.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/db_check_stack.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/db_check_stack.c	(revision 15879)
@@ -0,0 +1,54 @@
+# include "opihi.h"
+
+int db_check_stack (dvoStack *stack, int Nstack, int table, dvoField *fields, int *Nfields) {
+
+  int i, Nx, Ny, Nv, size;
+  char *c;
+
+  NFIELDS = *Nfields + 10;
+  REALLOCATE (fields, dvoField, NFIELDS);
+
+  for (i = 0; i < Nstack; i++) {
+    if (stack[i].type == 'X') {
+
+      /** if this is a number, put it on the list of scalers and move on **/
+      stack[i].Float = strtod (stack[i].name, &c);
+      if (c == stack[i].name + strlen (stack[i].name)) {
+	stack[i].type  = 'S';
+	continue;
+      } 
+
+      // this must be a field : is it already in the list?
+      for (j = 0; (j < *Nfields) && strcasecmp (stack[i].name, fields[j].name); j++);
+      if (j < *Nfields) {
+	stack[i].field = j;
+	stack[i].type  = 'F';
+	continue;
+      }
+
+      // this must be a field : is it a valid name?
+      if (table == DVO_TABLE_MEASURE) {
+	status = ParseMeasureField (&fields[*Nfields], stack[i].name);
+      } 
+      if (table == DVO_TABLE_AVERAGE) {
+	status = ParseAverageField (&fields[*Nfields], stack[i].name);
+      } 
+      if (!status) {
+	gprint (GP_ERR, "unknown database field %s\n", stack[i].name);
+	return (FALSE);
+      }
+      stack[i].field = *Nfields;
+      stack[i].type  = 'F';
+
+      *Nfields ++;
+      CHECK_REALLOCATE (fields, dvoField, NFIELDS, *Nfields, 10);
+    }
+  }
+  return (TRUE);
+}
+
+/* check stack identifies the data elements as plain scalars or table fields
+   operators have already been identified.  
+   check stack returns the total stack dimensionality (0,1,2)
+   on error, check stack returns FALSE
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/db_convert_to_RPN.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/db_convert_to_RPN.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/db_convert_to_RPN.c	(revision 15879)
@@ -0,0 +1,210 @@
+# include "opihi.h"
+# define DUMPSTACK 0
+
+dvoStack *convert_to_RPN (int argc, char **argv, int *nstack) {
+  
+  int type, Nx, Ny;
+  int i, j, Nstack, Nop_stack, NSTACK;
+  dvoStack *stack, *op_stack;
+
+  /* max total stack size is argc, though should be less, this is safe */
+  NSTACK = argc + 5;
+  ALLOCATE (stack, dvoStack, NSTACK);
+  ALLOCATE (op_stack, dvoStack, NSTACK);
+  for (i = 0; i < NSTACK; i++) {
+    init_stack (&stack[i]);
+    init_stack (&op_stack[i]);
+  }
+  
+  Nx = Ny = Nstack = Nop_stack = 0;
+  for (i = 0; i < argc; i++) {
+    
+    /* decide on priority of object */
+    type = 0;
+    /* unary operations */
+    if (!strcmp (argv[i], "abs"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "int"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "exp"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "ten"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "log"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "ln"))     { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "sqrt"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "erf"))    { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "sinh"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "cosh"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "asinh"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "acosh"))  { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "sin"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "cos"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "tan"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dsin"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dcos"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dtan"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "asin"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "acos"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "atan"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dasin"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dacos"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "datan"))  { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "lgamma")) { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "rnd"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "xramp"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "yramp"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "ramp"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "zero"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "--"))     { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "not"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "isinf"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "isnan"))  { type = 9; goto gotit; }
+
+    /* binary operations */
+    if (!strcmp (argv[i], "^"))      { type = 8; goto gotit; }
+
+    if (!strcmp (argv[i], "@"))      { type = 7; goto gotit; }
+    if (!strcmp (argv[i], "/"))      { type = 7; goto gotit; }
+    if (!strcmp (argv[i], "*"))      { type = 7; goto gotit; }
+    if (!strcmp (argv[i], "%"))      { type = 7; goto gotit; }
+
+    if (!strcmp (argv[i], "+"))      { type = 6; goto gotit; }
+    if (!strcmp (argv[i], "-"))      { type = 6; goto gotit; }
+	
+    if (!strcmp (argv[i], "&"))      { type = 5; goto gotit; }
+    if (!strcmp (argv[i], "|"))      { type = 5; goto gotit; }
+
+    if (!strcmp (argv[i], "<"))      { type = 4; goto gotit; }
+    if (!strcmp (argv[i], ">"))      { type = 4; goto gotit; }
+    if (!strcmp (argv[i], "=="))     { type = 4; strcpy (argv[i], "E"); goto gotit; }
+    if (!strcmp (argv[i], "!="))     { type = 4; strcpy (argv[i], "N"); goto gotit; }
+    if (!strcmp (argv[i], "<="))     { type = 4; strcpy (argv[i], "L"); goto gotit; }
+    if (!strcmp (argv[i], ">="))     { type = 4; strcpy (argv[i], "G"); goto gotit; }
+    if (!strcmp (argv[i], ">>"))     { type = 4; strcpy (argv[i], "U"); goto gotit; }
+    if (!strcmp (argv[i], "<<"))     { type = 4; strcpy (argv[i], "D"); goto gotit; }
+
+    if (!strcmp (argv[i], "&&"))     { type = 3; strcpy (argv[i], "A"); goto gotit; }
+    if (!strcmp (argv[i], "||"))     { type = 3; strcpy (argv[i], "O"); goto gotit; }
+
+    if (!strcmp (argv[i], "("))      { type = 2; goto gotit; }
+    if (!strcmp (argv[i], ")"))      { type = 1; goto gotit; }
+
+  gotit:
+    /* choose how to deal with object */
+    switch (type) {
+      case 8:  /* exponentiation: 2^2^3 = 64 != 256 (precedence is right-to-left, not left-to-right!) */
+	/* pop previous, higher operators from OP stack to stack */
+	for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type > type); j--) {
+	  strcpy (stack[Nstack].name, op_stack[j].name);
+	  stack[Nstack].type = op_stack[j].type;
+	  Nstack ++;
+	  Nop_stack --;
+	}
+	/* push operator on OP stack */
+	strcpy (op_stack[Nop_stack].name, argv[i]);
+	op_stack[Nop_stack].type = type;
+	Nop_stack ++;
+	break;
+      case 9: /* unary OPs */
+      case 7: /* binary OPs */
+      case 6:
+      case 5: 
+      case 4: 
+      case 3: 
+	/* pop previous, higher or equal operators from OP stack to stack */
+	for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type >= type); j--) {
+	  strcpy (stack[Nstack].name, op_stack[j].name);
+	  stack[Nstack].type = op_stack[j].type;
+	  Nstack ++;
+	  Nop_stack --;
+	}
+	/* push operator on OP stack */
+	strcpy (op_stack[Nop_stack].name, argv[i]);
+	op_stack[Nop_stack].type = type;
+	Nop_stack ++;
+	break;
+      case 2:  
+	/* push operator on OP stack */
+	strcpy (op_stack[Nop_stack].name, argv[i]);
+	op_stack[Nop_stack].type = type;
+	Nop_stack ++;
+	break;
+      case 1: 
+	/* pop rest of operators from OP stack to stack, looking for '(' */
+	for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type != 2); j--) {
+	  strcpy (stack[Nstack].name, op_stack[j].name);
+	  stack[Nstack].type = op_stack[j].type;
+	  Nstack ++;
+	  Nop_stack --;
+	}
+	if ((j == -1) || (op_stack[j].type != 2)) {
+	  push_error ("syntax error: mismatched parenthesis");
+	  Nstack = 0;
+	  goto cleanup;
+	}
+	Nop_stack --;
+	break;
+      case 0:
+	/* place the value (number or vector/matrix name) on stack */
+	/* value of 'X' is used as sentinel until we sort out values */
+	strcpy (stack[Nstack].name, argv[i]);
+	stack[Nstack].type = 'X';
+	Nstack ++;
+	break;
+    }
+  }
+
+  /* dump remaining operators on stack, checking for ')' */
+  for (j = Nop_stack - 1; j >= 0; j--) {
+    if (op_stack[j].type == 2) {
+      push_error ("syntax error: mismatched parenthesis");
+      Nstack = 0;
+      goto cleanup;
+    }
+    strcpy (stack[Nstack].name, op_stack[j].name);
+    stack[Nstack].type = op_stack[j].type;
+    Nstack ++;
+  }
+
+cleanup: 
+  /*** free up unused stack space ***/
+  clean_stack (op_stack, NSTACK);
+  free (op_stack);
+  clean_stack (&stack[Nstack], NSTACK - Nstack);
+  REALLOCATE (stack, dvoStack, MAX (Nstack, 1));
+  *nstack = Nstack;
+
+  for (i = 0; i < argc; i++) {
+    free (argv[i]);
+  }
+  free (argv);
+
+# if (DUMPSTACK)
+  for (i = 0; i < Nstack; i++) {
+    gprint (GP_ERR, "%s ", stack[i].name);
+  }
+  if (Nstack > 0) gprint (GP_ERR, "\n");
+  for (i = 0; i < Nstack; i++) {
+    gprint (GP_ERR, "%d ", stack[i].type);
+  }
+  if (Nstack > 0) gprint (GP_ERR, "\n");
+# endif
+
+  return (stack);
+
+}
+
+/* here are the rules for parsing a math AOL line to RPN:
+
+1) if object is a number, push on stack
+2) if object is a third order operand (exp, sin, cos), push on op stack
+3) if object is an open paren, push on op stack,
+4) if object is a second order operand, push on stack
+5) if object is a first order operand, pop all second order operands from stack 
+until paren, push on stack
+6) if object is an end paren, pop all objects from stack until paren, 
+pop next stack, if third order op
+7) if end of line, pop all remaining objects, second order first, etc.
+   
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ddmags.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ddmags.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/ddmags.c	(revision 15879)
@@ -0,0 +1,136 @@
+# include "dvoshell.h"
+
+int ddmags (int argc, char **argv) {
+  
+  gprint (GP_ERR, "this function is deprecated\n");
+  return (FALSE);
+
+} 
+
+# if (0) 
+  char *RegionName, *RegionList;
+  double *M1, *M2;
+  int i, m, k, N, Npts, NPTS;
+  int N1, N2, i1, i2, mode[4];
+  int Nsecfilt, KeepNulls;
+
+  Catalog catalog;
+  PhotCode *code[4];
+  SkyList *skylist;
+  Vector *xvec, *yvec;
+
+  /* defaults */
+  catalog.average = NULL; 
+  catalog.secfilt = NULL;
+  catalog.measure = NULL;
+  RegionName = NULL;
+  RegionList = NULL;
+  skylist = NULL;
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  /* interpret command-line options */
+  if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape;
+  if (!SetPhotSelections (&argc, argv, 4)) goto usage;
+
+  KeepNulls = FALSE;
+  if ((N = get_argument (argc, argv, "-nulls"))) {
+    KeepNulls = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  /* interpret command-line options */
+  if (argc != 8) goto usage;
+  if (strcmp (argv[2], "-")) goto usage;
+  if (strcmp (argv[4], ":")) goto usage;
+  if (strcmp (argv[6], "-")) goto usage;
+  if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) return (FALSE);
+  if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) return (FALSE);
+  if (!GetPhotcodeInfo (argv[5], &code[2], &mode[2])) return (FALSE);
+  if (!GetPhotcodeInfo (argv[7], &code[3], &mode[3])) return (FALSE);
+  if (!TestPhotSelections (&code[0], &mode[0], MEAS_ZERO)) goto escape;
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
+
+  /* init vectors to save data */
+  Npts = 0;
+  NPTS = 1;
+  if ((xvec = SelectVector ("xv", ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((yvec = SelectVector ("yv", ANYVECTOR, TRUE)) == NULL) goto escape;
+
+  /* loop over regions, extract data for each region */
+  for (k = 0; k < skylist[0].Nregions; k++) {
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[k];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    // gprint (GP_ERR, "seaching %s with %d stars\n", catalog.filename, catalog.Naverage);
+    // ListPhotSelections ();
+
+    /* get correct mags, convert to X,Y */
+    for (i = 0; i < catalog.Naverage; i++) {
+      M1 = M2 = NULL;
+      m = catalog.average[i].offset;
+
+      SetSelectionParam (0);
+      M1 = ExtractDMag (&code[0], &mode[0], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N1);
+      if (N1 == 0) goto skip;
+
+      SetSelectionParam (2);
+      M2 = ExtractDMag (&code[2], &mode[2], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N2);
+      if (N2 == 0) {
+	if (KeepNulls) {
+	  ALLOCATE (M2, double, 1);
+	  N2 = 1;
+	  M2[0] = NAN;
+	} else {
+	  goto skip;
+	}
+      }
+
+      for (i1 = 0; i1 < N1; i1++) {
+	for (i2 = 0; i2 < N2; i2++) {
+	  xvec[0].elements[Npts] = M1[i1];
+	  yvec[0].elements[Npts] = M2[i2];
+	  Npts++;
+	  if (Npts >= NPTS) {
+	    NPTS += 2000;
+	    REALLOCATE (xvec[0].elements, float, NPTS);
+	    REALLOCATE (yvec[0].elements, float, NPTS);
+	  }
+	}
+      }
+    skip:
+      if (M1 != NULL) free (M1);
+      if (M2 != NULL) free (M2);
+    }
+    // gprint (GP_ERR, "selected %d stars\n", Npts);
+    dvo_catalog_free (&catalog);
+  }
+  SkyListFree (skylist);
+  xvec[0].Nelements = yvec[0].Nelements = Npts;
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: ddmags F - F : measure.param\n");
+
+escape:
+  SkyListFree (skylist);
+  dvo_catalog_free (&catalog);
+  if (RegionName != NULL) free (RegionName);
+  if (RegionList != NULL) free (RegionList);
+  return (FALSE);
+}
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/detrend.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/detrend.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/detrend.c	(revision 15879)
@@ -0,0 +1,207 @@
+# include "dvoshell.h"
+
+/* qualities to be extracted */
+enum {ZERO, DTIME, SKY, BIAS, FWHM, AIRM, TIME, TEMP};
+
+int detrend (int argc, char **argv) {
+ 
+  FILE *f;
+  int i, Nimage, status, N, TimeSelect;
+  char DataBase[256];
+  time_t tzero, tend;
+  double trange;
+  int TypeSelect, CCDSelect, FilterSelect;
+  char *Filter;
+  int Type, mode, CCD;
+  int NVALUE;
+  float *value;
+  time_t TimeReference;
+  int TimeFormat;
+  Header header;
+  RegImage *pimage;
+  Vector *vec;
+
+  VarConfig ("REGISTRATION_DATABASE", "%s", DataBase);
+
+  TimeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-time"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (trange < 0) {
+      trange = fabs (trange);
+      tzero -= trange;
+    }
+    TimeSelect = TRUE;
+  }
+  if ((N = get_argument (argc, argv, "-trange"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tend)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    trange = tend - tzero;
+    if (trange < 0) {
+      trange = fabs (trange);
+      tzero -= trange;
+    }
+    TimeSelect = TRUE;
+  }
+ 
+  Type = 0;
+  TypeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-type"))) {
+    remove_argument (N, &argc, argv);
+    Type = get_image_type (argv[N]);
+    if (Type == T_UNDEF) {
+      gprint (GP_ERR, "ERROR: invalid image type %s\n", argv[N]);
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    TypeSelect = TRUE;
+  }
+
+  CCD = 0;
+  CCDSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-ccd"))) {
+    remove_argument (N, &argc, argv);
+    CCD = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+    CCDSelect = TRUE;
+  }
+ 
+  Filter = NULL;
+  FilterSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-filter"))) {
+    remove_argument (N, &argc, argv);
+    Filter = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    FilterSelect = TRUE;
+    if (!strcasecmp (Filter, "X")) {
+      FilterSelect = FALSE;
+    }
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: imrough (value)\n");
+    return (FALSE);
+  }
+  gprint (GP_ERR, "  this function is not well-defined.  re-work and re-code\n");
+  return (FALSE);
+  
+  /* identify selection */
+  mode = ZERO;
+  if (!strcasecmp (argv[1], "exptime")) mode = DTIME;
+  if (!strcasecmp (argv[1], "sky")) mode = SKY;
+  if (!strcasecmp (argv[1], "bias")) mode = BIAS;
+  if (!strcasecmp (argv[1], "fwhm")) mode = FWHM;
+  if (!strcasecmp (argv[1], "airmass")) mode = AIRM;
+  if (!strcasecmp (argv[1], "time")) mode = TIME;
+  if (!strcasecmp (argv[1], "temp")) mode = TEMP;
+  if (mode == ZERO) {
+    gprint (GP_ERR, "value may be one of the following:\n");
+    gprint (GP_ERR, " exptime, sky, bias, fwhm, airmass, time\n");
+    return (FALSE);
+  }
+
+  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  /* load in database header */
+  if (!gfits_read_header (DataBase, &header)) {
+    gprint (GP_ERR, "ERROR: trouble reading database header\n");
+    return (FALSE);
+  }
+
+  /* open database */
+  f = fopen (DataBase, "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "ERROR: can't open Registration Database\n");
+    return (FALSE);
+  }
+  fseek (f, header.size, SEEK_SET);
+
+  /* load existing data from database */
+  gfits_scan (&header, "NIMAGES", "%d", 1, &Nimage);
+  ALLOCATE (pimage, RegImage, Nimage);
+  status = fread (pimage, sizeof(RegImage), Nimage, f);
+  fclose (f);
+
+  if (status != Nimage) {
+    gprint (GP_ERR, "ERROR: header and data in dB don't match (%d vs %d)\n", Nimage, status);
+    gfits_free_header (&header);
+    free (pimage);
+    return (FALSE);
+  }
+  gfits_convert_RegImage (pimage, sizeof (RegImage), Nimage);
+
+  N = 0;
+  NVALUE = 1000;
+  REALLOCATE (vec[0].elements, float, NVALUE);
+  value = vec[0].elements;
+
+  GetTimeFormat (&TimeReference, &TimeFormat);
+  gprint (GP_ERR, "%ld %d\n", TimeReference, TimeFormat);
+
+  /* get data */
+  for (i = 0; i < Nimage; i++) {
+    /* skip unmatched selections */
+    if (TimeSelect && ((pimage[i].obstime < tzero) || (pimage[i].obstime > tzero + trange))) continue;
+    if (TimeSelect && ((pimage[i].obstime < tzero) || (pimage[i].obstime > tzero + trange))) continue;
+    if (FilterSelect && (strcasecmp (pimage[i].filter, Filter))) continue;
+    if (CCDSelect && (pimage[i].ccd != CCD)) continue;
+    if (TypeSelect && (pimage[i].type != Type)) continue;
+
+    /* assign correct value */
+    switch (mode) {
+    case (DTIME):
+      value[N] = pimage[i].exptime;
+      break;
+    case (TIME):
+      value[N] = TimeValue (pimage[i].obstime, TimeReference, TimeFormat);
+      break;
+    case (SKY):
+      value[N] = pimage[i].sky;
+      break;
+    case (BIAS):
+      value[N] = pimage[i].bias;
+      break;
+    case (FWHM):
+      value[N] = pimage[i].fwhm;
+      break;
+    case (AIRM):
+      value[N] = pimage[i].airmass;
+      break;
+    case (TEMP):
+      value[N] = pimage[i].teltemp_0;
+      break;
+    }
+    N++;
+    if (N >= NVALUE - 1) {
+      NVALUE += 1000;
+      REALLOCATE (vec[0].elements, float, NVALUE);
+      value = vec[0].elements;
+    }
+  }
+
+  REALLOCATE (vec[0].elements, float, MAX (1,N));
+  vec[0].Nelements = N;
+
+  free (pimage);
+  gfits_free_header (&header);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmagaves.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmagaves.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmagaves.c	(revision 15879)
@@ -0,0 +1,113 @@
+# include "dvoshell.h"
+
+int dmagaves (int argc, char **argv) {
+  
+  gprint (GP_ERR, "this function is deprecated\n");
+  return (FALSE);
+
+} 
+
+# if (0) 
+  char *RegionName, *RegionList;
+  double *M1, M2;
+  int i, j, k, m, N1;
+  int Npts, NPTS, param, mode[3];
+  int Nsecfilt;
+
+  PhotCode *code[3];
+  Catalog catalog;
+  SkyList *skylist;
+  Vector *xvec, *yvec;
+
+  /* defaults */
+  catalog.average = NULL; 
+  catalog.secfilt = NULL;
+  catalog.measure = NULL;
+  RegionName = NULL;
+  RegionList = NULL;
+  skylist = NULL;
+  code[2] = NULL;
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  /* interpret command-line options */
+  if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape;
+  if (!SetPhotSelections (&argc, argv, 3)) goto usage;
+
+  /* interpret command-line options: dmagaves F1 - F2 : (value) */
+  if (argc != 6) { goto usage; }
+  if (strcmp (argv[2], "-")) goto usage;
+  if (strcmp (argv[4], ":")) goto usage;
+  if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) goto usage;
+  if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) goto usage;
+  if ((param = GetAverageParam (argv[5])) == AVE_ZERO) goto usage;
+  if (!TestPhotSelections (&code[2], &mode[2], param)) goto escape;
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
+
+  /* init vectors to save data */
+  Npts = 0;
+  NPTS = 1;
+  if ((xvec = SelectVector ("xv", ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((yvec = SelectVector ("yv", ANYVECTOR, TRUE)) == NULL) goto escape;
+
+  for (j = 0; j < skylist[0].Nregions; j++) {
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[j];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    /* get correct mags, convert to X,Y */
+    for (i = 0; i < catalog.Naverage; i++) {
+      M1 = NULL;
+      m = catalog.average[i].offset;
+
+      SetSelectionParam (0);
+      M1 = ExtractDMag (code, mode, &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N1);
+      if (N1 == 0) goto skip;
+
+      SetSelectionParam (2);
+      M2 = ExtractAverages (code[2], mode[2], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], param);
+
+      for (k = 0; k < N1; k++) {
+	xvec[0].elements[Npts] = M1[k];
+	yvec[0].elements[Npts] = M2;
+	Npts++;
+	if (Npts >= NPTS) {
+	  NPTS += 2000;
+	  REALLOCATE (xvec[0].elements, float, NPTS);
+	  REALLOCATE (yvec[0].elements, float, NPTS);
+	}
+      }
+    skip:
+      if (M1 != NULL) free (M1);
+    }
+    dvo_catalog_free (&catalog);
+  }
+  SkyListFree (skylist);
+  xvec[0].Nelements = yvec[0].Nelements = Npts;
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: dmagaves F - F : average.param\n");
+  return (FALSE);
+
+escape:
+  SkyListFree (skylist);
+  dvo_catalog_free (&catalog);
+  if (RegionName != NULL) free (RegionName);
+  if (RegionList != NULL) free (RegionList);
+  return (FALSE);
+}
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmagmeas.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmagmeas.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmagmeas.c	(revision 15879)
@@ -0,0 +1,135 @@
+# include "dvoshell.h"
+
+int dmagmeas (int argc, char **argv) {
+  
+  gprint (GP_ERR, "this function is deprecated\n");
+  return (FALSE);
+
+} 
+
+# if (0) 
+  char *RegionName, *RegionList;
+  double *M1, *M3;
+  int i, j, m, i1, i3, N1, N3, N;
+  int Npts, NPTS, param, mode[3];
+  int Nsecfilt, KeepNulls;
+
+  Catalog catalog;
+  PhotCode *code[3];
+  SkyList *skylist;
+  Vector *xvec, *yvec;
+
+  /* defaults */
+  catalog.average = NULL; 
+  catalog.secfilt = NULL;
+  catalog.measure = NULL;
+  RegionName = NULL;
+  RegionList = NULL;
+  skylist = NULL;
+  code[2] = NULL;
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  /* interpret command-line options */
+  if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape;
+  if (!SetPhotSelections (&argc, argv, 3)) goto usage;
+
+  KeepNulls = FALSE;
+  if ((N = get_argument (argc, argv, "-nulls"))) {
+    KeepNulls = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  /* interpret command-line arguments: dmagmeas F1 - F2 : (value) */
+  if (argc != 6) { goto usage; }
+  if (strcmp (argv[2], "-")) goto usage;
+  if (strcmp (argv[4], ":")) goto usage;
+  if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) goto usage;
+  if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) goto usage;
+  if ((param = GetMeasureParam (argv[5])) == MEAS_ZERO) goto usage;
+  if (!TestPhotSelections (&code[2], &mode[2], MEAS_ZERO)) goto escape;
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
+  if (!SetImageSelection (((param == MEAS_XMOSAIC) || (param == MEAS_YMOSAIC)), ((RegionName == NULL) && (RegionList == NULL)))) goto escape;
+
+  /* init vectors to save data */
+  Npts = 0;
+  NPTS = 1;
+  if ((xvec = SelectVector ("xv", ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((yvec = SelectVector ("yv", ANYVECTOR, TRUE)) == NULL) goto escape;
+
+  /* loop over regions, extract data for each region */
+  for (j = 0; j < skylist[0].Nregions; j++) {
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[j];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    /* get correct mags, convert to X,Y */
+    for (i = 0; i < catalog.Naverage; i++) {
+      M1 = M3 = NULL;
+      m = catalog.average[i].offset;
+
+      SetSelectionParam (0);
+      M1 = ExtractDMag (code, mode, &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N1);
+      if (N1 == 0) goto skip;
+
+      SetSelectionParam (2);
+      M3 = ExtractMeasures (code[2], mode[2], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N3, param);
+      if (N3 == 0) {
+	if (KeepNulls) {
+	  ALLOCATE (M3, double, 1);
+	  N3 = 1;
+	  M3[0] = NAN;
+	} else {
+	  goto skip;
+	}
+      }
+
+      for (i1 = 0; i1 < N1; i1++) {
+	for (i3 = 0; i3 < N3; i3++) {
+	  xvec[0].elements[Npts] = M1[i1];
+	  yvec[0].elements[Npts] = M3[i3];
+	  Npts++;
+	  if (Npts >= NPTS) {
+	    NPTS += 2000;
+	    REALLOCATE (xvec[0].elements, float, NPTS);
+	    REALLOCATE (yvec[0].elements, float, NPTS);
+	  }
+	}
+      }
+    skip:
+      if (M1 != NULL) free (M1);
+      if (M3 != NULL) free (M3);
+    }
+    dvo_catalog_free (&catalog);
+  }
+  FreeImageSelection ();
+  SkyListFree (skylist);
+  xvec[0].Nelements = yvec[0].Nelements = Npts;
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: dmagmeas F - F : measure.param\n");
+  return (FALSE);
+
+escape:
+  FreeImageSelection ();
+  SkyListFree (skylist);
+  dvo_catalog_free (&catalog);
+  if (RegionName != NULL) free (RegionName);
+  if (RegionList != NULL) free (RegionList);
+  return (FALSE);
+}
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmags.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmags.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmags.c	(revision 15879)
@@ -0,0 +1,136 @@
+# include "dvoshell.h"
+
+int dmags (int argc, char **argv) {
+  
+  gprint (GP_ERR, "this function is deprecated\n");
+  return (FALSE);
+
+} 
+
+# if (0) 
+  char *RegionName, *RegionList;
+  double *M1, *M3;
+  int i, j, m, i1, i3, N1, N3, N;
+  int Npts, NPTS, mode[3];
+  int Nsecfilt, KeepNulls;
+
+  PhotCode *code[3];
+  Catalog catalog;
+  SkyList *skylist;
+  Vector *xvec, *yvec;
+
+  /* defaults */
+  catalog.average = NULL; 
+  catalog.secfilt = NULL;
+  catalog.measure = NULL;
+  RegionName = NULL;
+  RegionList = NULL;
+  skylist = NULL;
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  /* interpret command-line options */
+  if (!SetRegionSelection (&argc, argv, &RegionName, &RegionList)) goto escape;
+  if (!SetPhotSelections (&argc, argv, 3)) goto usage;
+
+  KeepNulls = FALSE;
+  if ((N = get_argument (argc, argv, "-nulls"))) {
+    KeepNulls = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  /* interpret required command-line arguments: dmags F1 - F2 : F3 */
+  if (argc != 6) { goto usage; }
+  if (strcmp (argv[2], "-")) goto usage;
+  if (strcmp (argv[4], ":")) goto usage;
+  if (!GetPhotcodeInfo (argv[1], &code[0], &mode[0])) goto usage;
+  if (!GetPhotcodeInfo (argv[3], &code[1], &mode[1])) goto usage;
+  if (!GetPhotcodeInfo (argv[5], &code[2], &mode[2])) goto usage;
+  if (!TestPhotSelections (&code[0], &mode[0], MEAS_ZERO)) goto escape;
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (RegionName, RegionList)) == NULL) goto escape;
+
+  /* init vectors to save data */
+  Npts = 0;
+  NPTS = 1;
+  if ((xvec = SelectVector ("xv", ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((yvec = SelectVector ("yv", ANYVECTOR, TRUE)) == NULL) goto escape;
+
+  /* loop over regions, extract data for each region */
+  for (j = 0; j < skylist[0].Nregions; j++) {
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[j];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    /* get correct mags, convert to X,Y */
+    for (i = 0; i < catalog.Naverage; i++) {
+      M1 = M3 = NULL;
+      m = catalog.average[i].offset;
+
+      SetSelectionParam (0);
+      M1 = ExtractDMag (code, mode, &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N1);
+      if (N1 == 0) goto skip;
+
+      SetSelectionParam (2);
+      M3 = ExtractMagnitudes (code[2], mode[2], &catalog.average[i], &catalog.secfilt[i*Nsecfilt], &catalog.measure[m], &N3);
+      if (N3 == 0) {
+	if (KeepNulls) {
+	  ALLOCATE (M3, double, 1);
+	  N3 = 1;
+	  M3[0] = NAN;
+	} else {
+	  goto skip;
+	}
+      }
+
+      for (i1 = 0; i1 < N1; i1++) {
+	for (i3 = 0; i3 < N3; i3++) {
+	  xvec[0].elements[Npts] = M1[i1];
+	  yvec[0].elements[Npts] = M3[i3];
+	  Npts++;
+	  if (Npts >= NPTS) {
+	    NPTS += 2000;
+	    REALLOCATE (xvec[0].elements, float, NPTS);
+	    REALLOCATE (yvec[0].elements, float, NPTS);
+	  }
+	}
+      }
+    skip:
+      if (M1 != NULL) free (M1);
+      if (M3 != NULL) free (M3);
+    }
+    dvo_catalog_free (&catalog);
+  }
+
+  /* need to free SkyList / or free all regions as well */
+  SkyListFree (skylist);
+  xvec[0].Nelements = yvec[0].Nelements = Npts;
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: dmags F - F : F\n");
+  gprint (GP_ERR, "    F : any photcodes with matched qualifiers:\n");
+  gprint (GP_ERR, "    pri: F:inst, F:cat, F:sys, F:rel, F:cal, F:ave, F:ref\n");
+  gprint (GP_ERR, "    sec: F:inst, F:cat, F:sys, F:rel, F:cal, F:ave, F:ref\n");
+  gprint (GP_ERR, "    dep: F:inst, F:cat, F:sys, F:rel, F:cal\n");
+  gprint (GP_ERR, "    ref: F:cat\n");
+
+escape:
+  SkyListFree (skylist);
+  dvo_catalog_free (&catalog);
+  if (RegionName != NULL) free (RegionName);
+  if (RegionList != NULL) free (RegionList);
+  return (FALSE);
+}
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmt.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmt.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dmt.c	(revision 15879)
@@ -0,0 +1,157 @@
+# include "dvoshell.h"
+
+/* extract vectors giving delta mags for multiple measurements */ 
+int dmt (int argc, char **argv) {
+  
+  // XXX this needs to be fixed: how to access different graphs at once?
+  gprint (GP_ERR, "ERROR: this function is currently disabled\n");
+  return (FALSE);
+
+# if (0)
+
+  int i, m, k, N, kapa, SaveVectors;
+  int Nsec, Nsecfilt, NPTS;
+  double Radius;
+  float dt1, dt2, dmt1, dmt2;
+  float M0, M1, M2, M3;
+  PhotCode *code;
+  Catalog catalog;
+  Graphdata graphmode, graphsky;
+  SkyTable *sky;
+  SkyList *skylist;
+  Vector Xvec, Yvec, Zvec, Rvec, Dvec;
+  Vector *vec1, *vec2, *vec3, *vec4, *vec5;
+
+  Dvec.elements = Rvec.elements = Zvec.elements = NULL;
+
+  if (!InitPhotcodes ()) return (FALSE);
+
+  vec1 = vec2 = vec3 = vec4 = vec5 = NULL;
+  SaveVectors = FALSE;
+  if ((N = get_argument (argc, argv, "-vect"))) {
+    remove_argument (N, &argc, argv);
+    if ((vec1 = SelectVector ("dmtdmt", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    if ((vec2 = SelectVector ("dmtvar", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    if ((vec3 = SelectVector ("dmtmag", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    if ((vec4 = SelectVector ("dmtra",  ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    if ((vec5 = SelectVector ("dmtdec", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    SaveVectors = TRUE;
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: dmags filter\n");
+    return (FALSE);
+  }
+
+  if (!GetGraphData (&graphsky, &kapa, NULL)) return (FALSE);
+  if (!GetGraph (&graphmode, NULL, NULL)) return (FALSE);
+
+  if ((code = GetPhotcodebyName (argv[1])) == NULL) {
+    gprint (GP_ERR, "ERROR: photcode not found in photcode table\n");
+    return (FALSE);
+  }
+  if (code[0].type != PHOT_SEC) {
+    gprint (GP_ERR, "first filter must be a average photometry type\n");
+    return (FALSE);
+  }
+  Nsecfilt = GetPhotcodeNsecfilt();
+  Nsec = GetPhotcodeNsec (code[0].code);
+
+  Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax));
+
+  sky = GetSkyTable ();
+  skylist = SkyListByRadius (sky, -1, graphsky.coords.crval1, graphsky.coords.crval2, Radius);
+  
+  N = 0;
+  NPTS = catalog.Nmeasure;
+  ALLOCATE (Xvec.elements, float, NPTS);
+  ALLOCATE (Yvec.elements, float, NPTS);
+  if (SaveVectors) {
+    ALLOCATE (Zvec.elements, float, NPTS);
+    ALLOCATE (Rvec.elements, float, NPTS);
+    ALLOCATE (Dvec.elements, float, NPTS);
+  }
+
+  for (k = 0; k < skylist[0].Nregions; k++) {
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[k];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    for (i = 0; i < catalog.Naverage; i++) {
+      if (catalog.average[i].Nm != 3) continue;
+      m = catalog.average[i].offset;
+      M0 = catalog.secfilt[i*Nsecfilt+Nsec].M;
+      M1 = PhotCat (&catalog.measure[m+0]);
+      M2 = PhotCat (&catalog.measure[m+1]);
+      M3 = PhotCat (&catalog.measure[m+2]);
+
+      dt1 = (catalog.measure[m+0].t < catalog.measure[m+1].t) ? catalog.measure[m+1].t - catalog.measure[m+0].t : -1 * ((float)(catalog.measure[m+1].t - catalog.measure[m+0].t));
+      dt2 = (catalog.measure[m+1].t < catalog.measure[m+2].t) ? catalog.measure[m+2].t - catalog.measure[m+1].t : -1 * ((float)(catalog.measure[m+2].t - catalog.measure[m+1].t));
+      dmt1 = (M2 - M1) / dt1;
+      dmt2 = (M3 - M2) / dt2;
+      Xvec.elements[N] = (dmt1 - dmt2) / (dmt1 + dmt2);
+      Yvec.elements[N] = (dmt1 + dmt2) / 2.0;
+      if (SaveVectors) {
+	Rvec.elements[N] = catalog.average[i].R;
+	Dvec.elements[N] = catalog.average[i].D;
+	Zvec.elements[N] = M0;
+      }
+      N++;
+      if (N == NPTS - 1) {
+	NPTS += 2000;
+	REALLOCATE (Xvec.elements, float, NPTS);
+	REALLOCATE (Yvec.elements, float, NPTS);
+	if (SaveVectors) {
+	  REALLOCATE (Zvec.elements, float, NPTS);
+	  REALLOCATE (Rvec.elements, float, NPTS);
+	  REALLOCATE (Dvec.elements, float, NPTS);
+	}
+      }
+    }
+    dvo_catalog_free (&catalog);
+  }
+  Yvec.Nelements = Xvec.Nelements = N;
+  REALLOCATE (Xvec.elements, float, MAX (1, N));
+  REALLOCATE (Yvec.elements, float, MAX (1, N));
+  if (SaveVectors) {
+    Rvec.Nelements = Dvec.Nelements = Zvec.Nelements = N;
+    REALLOCATE (Zvec.elements, float, MAX (1, N));
+    REALLOCATE (Rvec.elements, float, MAX (1, N));
+    REALLOCATE (Dvec.elements, float, MAX (1, N));
+  }
+
+  if (SaveVectors) {
+    free (vec1[0].elements);
+    vec1[0].elements = Yvec.elements;
+    vec1[0].Nelements = Yvec.Nelements;
+    free (vec2[0].elements);
+    vec2[0].elements = Xvec.elements;
+    vec2[0].Nelements = Xvec.Nelements;
+    free (vec3[0].elements);
+    vec3[0].elements = Zvec.elements;
+    vec3[0].Nelements = Zvec.Nelements;
+    free (vec4[0].elements);
+    vec4[0].elements = Rvec.elements;
+    vec4[0].Nelements = Rvec.Nelements;
+    free (vec5[0].elements);
+    vec5[0].elements = Dvec.elements;
+    vec5[0].Nelements = Dvec.Nelements;
+  } else {
+    graphmode.style = 2; /* set style to points */
+    PlotVector (kapa, N, Xvec.elements, Yvec.elements, &graphmode);
+
+    free (Xvec.elements);
+    free (Yvec.elements);
+    free (Zvec.elements);
+  }
+  return (TRUE);
+# endif 
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvo.c.in
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvo.c.in	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvo.c.in	(revision 15879)
@@ -0,0 +1,67 @@
+# include "dvoshell.h"
+
+# define opihi_name "DVO"
+# define opihi_prompt "dvo: "
+# define opihi_description "desktop virtual observatory\n"
+# define opihi_history ".dvo"
+# define opihi_rcfile ".dvorc"
+
+/* program-dependent initialization */
+void program_init (int *argc, char **argv) {
+  
+  auto_break = TRUE;
+
+  /* load the commands used by this implementation */
+  InitBasic ();
+  InitData ();
+  InitAstro ();
+  InitDVO ();
+
+  // XXX don't open the catdir until needed
+  // if (!SetCATDIR (NULL, FALSE)) {
+  //  gprint (GP_ERR, "CATDIR is not defined\n");
+  // }
+
+  rl_readline_name = opihi_name;
+  rl_attempted_completion_function = command_completer;
+
+  set_str_variable ("HISTORY", opihi_history);
+  set_str_variable ("PROMPT", opihi_prompt);
+  set_str_variable ("RCFILE", opihi_rcfile);
+
+  {
+    char *helpdir;
+    char *modules;
+    static char *datadir = "@DATADIR@";
+    ALLOCATE (helpdir, char, strlen(datadir) + strlen("/help") + 2);
+    sprintf (helpdir, "%s/help", datadir);
+    set_str_variable ("HELPDIR", helpdir);
+    free (helpdir);
+    ALLOCATE (modules, char, strlen(datadir) + strlen("/modules") + 2);
+    sprintf (modules, "%s/modules", datadir);
+    set_str_variable ("MODULES:0", modules);
+    set_int_variable ("MODULES:n", 1);
+    free (modules);
+  }
+
+  return;
+}
+
+/* standard welcome message */
+void welcome () {
+  gprint (GP_ERR, "\n");
+  gprint (GP_ERR, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
+/* add program-dependent exit functions here */
+void cleanup () {
+  QuitKapa ();
+  return;
+}
+
+/* call to opihi shell */
+int main (int argc, char **argv) {
+  int status;
+  status = opihi (argc, argv);
+  exit (status);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvoBooleanElements.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvoBooleanElements.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvoBooleanElements.c	(revision 15879)
@@ -0,0 +1,158 @@
+# include "opihi.h"
+
+/* local private functions */
+void InsertValue (char c);
+void EndOfString (void);
+int IsAnOp (char *c);
+int IsTwoOp (char *c);
+
+/* local private static variables */
+int Nchar, Nout, NOUT;
+char **out;
+
+// split up the input arguments into appropriate blocks
+char **dvoBooleanElements (int Nin, char **in, int *nout) {
+  
+  int i, j, minus, negate, plus, posate, OpStat, SciNotation;
+
+  NOUT = Nin;
+  Nchar = Nout = 0;
+  ALLOCATE (out, char *, NOUT);
+  ALLOCATE (out[Nout], char, NCHARS);
+
+  for (i = 0; i < Nin; i++) {
+    for (j = 0; j < strlen(in[i]); j++) {
+      SciNotation = FALSE;
+      /* identify 'negate' or 'minus' ops */
+      negate = minus = FALSE;
+      if (in[i][j] == '-') { 
+	minus = TRUE;  
+	/* if - is first thing on line, must be a negator */
+	if ((Nout == 0) && (Nchar == 0)) {  
+	  minus = FALSE;
+	  negate = TRUE;
+	  goto skip1;
+	}
+	/* check previous entry on line */
+	if (Nchar) {
+	  OpStat = IsAnOp (out[Nout]);
+	  if (out[Nout][0] == ')') OpStat = FALSE;
+	} else {
+	  OpStat = IsAnOp (out[Nout-1]);
+	  if (out[Nout-1][0] == ')') OpStat = FALSE;
+	}
+	/* if - follows an operator, must be negator */
+	if (OpStat) {
+	  minus = FALSE;
+	  negate = TRUE;
+	  goto skip1;
+	}
+	/* if - follows 'e' is part of 1e-5 */
+	if (j == 0) goto skip1;
+	if ((in[i][j-1] == 'e') || (in[i][j-1] == 'E')) {
+	  SciNotation = TRUE;
+	  negate = minus = FALSE;
+	}
+      }
+    skip1:
+      /* idenfity 'posate' or 'plus' ops */
+      posate = plus = FALSE;
+      if (in[i][j] == '+') { 
+	plus = TRUE;  
+	/* if + is first thing on line, must be a posator */
+	if ((Nout == 0) && (Nchar == 0)) {  
+	  plus = FALSE;
+	  posate = TRUE;
+	  goto skip2;
+	}
+	/* check previous entry on line */
+	if (Nchar) {
+	  OpStat = IsAnOp (out[Nout]);
+	  if (out[Nout][0] == ')') OpStat = FALSE;
+	} else {
+	  OpStat = IsAnOp (out[Nout-1]);
+	  if (out[Nout-1][0] == ')') OpStat = FALSE;
+	}
+	/* if + follows an operator, must be posator */
+	if (OpStat) {
+	  plus = FALSE;
+	  posate = TRUE;
+	  goto skip2;
+	}
+	/* if + follows 'e' is part of 1e+5 */
+	if (j == 0) goto skip2;
+	if ((in[i][j-1] == 'e') || (in[i][j-1] == 'E')) {
+	  SciNotation = TRUE;
+	  posate = plus = FALSE;
+	}
+      }
+    skip2:
+      /* operators */
+      if (negate || minus || posate || plus || (IsAnOp (&in[i][j]) && !SciNotation)) {
+	if (posate) continue;
+	EndOfString ();
+	/* copy operator to out[Nout] */
+	InsertValue (in[i][j]);
+	if (negate) InsertValue ('-');
+
+	if (IsTwoOp (&in[i][j])) {
+	  InsertValue (in[i][j+1]);
+	  j++;
+	} 
+	EndOfString ();
+	continue;
+      }
+      /* quoted string */
+      if (in[i][j] == '"') {
+	InsertValue (in[i][j]);
+	j++;
+	while ((j < strlen(in[i])) && (in[i][j] != '"')) {
+	  InsertValue (in[i][j]);
+	  j++;
+	}
+	if (in[i][j] != '"') continue;
+	/* 
+	  gprint (GP_ERR, "mismatched quotes\n");
+	  return (FALSE);
+	}
+	*/
+	InsertValue (in[i][j]);
+	EndOfString ();
+	continue;
+      }
+      /* not an operator, not a quoted string */
+      if (!OHANA_WHITESPACE (in[i][j])) {
+	InsertValue (in[i][j]);
+      } else {
+	EndOfString ();
+      }
+    }
+    EndOfString ();
+  }
+
+  /* one extra entry is allocated, free here */
+  free (out[Nout]);
+  *nout = Nout;
+  return (out);
+
+}
+
+void InsertValue (char c) {
+  out[Nout][Nchar] = c;
+  Nchar ++;
+  out[Nout][Nchar] = 0;
+}
+
+void EndOfString () {
+  if (Nchar > 0) {
+    out[Nout][Nchar] = 0;
+    Nout ++;
+    Nchar = 0;
+    
+    if (Nout >= NOUT - 1) {
+      NOUT += 10; 
+      REALLOCATE (out, char *, NOUT); 
+    } 
+    ALLOCATE (out[Nout], char, NCHARS); 
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvoEvaluateStack.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvoEvaluateStack.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvoEvaluateStack.c	(revision 15879)
@@ -0,0 +1,65 @@
+# include "opihi.h"
+
+int CheckBooleanCondition (dvoStack dbStack, int NdbStack, float *values, dvoFields *fields, int Nfields) {
+  
+  int i, j, Nstack;
+  dvoStack **stack, *output;
+
+  Nstack = NdbStack;
+  ALLOCATE (stack, dvoStack *, NdbStack);
+  for (i = 0; i < NdbStack; i++) {
+    stack[i] = &dbStack[i];
+  }
+
+  for (i = 0; i < Nstack; i++) {
+
+    /***** binary operators *****/
+    if ((stack[i].type >= 3) && (stack[i].type <= 8)) {
+
+      // pre-test that op and entries match
+      output = db_binary (stack[i-2], stack[i-1], stack[i].name, fields, Nfields); 
+
+      // free temporary stack items, drop external items
+      clear_stack (stack[i-2]);
+      clear_stack (stack[i-1]);
+
+      stack[i-2] = output;
+      for (j = i + 1; j < Nstack; j++) {
+	stack[j-2] = stack[j];
+      }
+
+      Nstack -= 2;
+      i -= 2;
+      continue;
+    }
+
+    /***** unary operators **/
+    if (stack[i].type == 9) {
+
+      // pre-test that op and entries match
+      output = db_unary (&stack[i-1], stack[i].name, fields, Nfields); 
+
+      // free temporary stack items, drop external items
+      clear_stack (stack[i-2]);
+      clear_stack (stack[i-1]);
+
+      for (j = i + 1; j < Nstack; j++) {
+	stack[j-1] = stack[j];
+      }
+
+      Nstack -= 1;
+      i -= 1;
+      continue;
+    } 
+  }
+
+  // pre-test that op and entries match
+  return (TRUE);
+}
+
+/* delete name and data */
+void clear_stack (dvoStack *stack) {
+
+  if (stack->type != 'T') return;
+  free (stack);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvodb.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvodb.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvodb.c	(revision 15879)
@@ -0,0 +1,77 @@
+
+/* dvo fields and boolean expressions
+   - evaluate the command line:
+     * avextract ra,dec,g,r,i where (uRA < 0.1)
+     1) identify all fields in extraction list
+     2) parse boolean expression
+     3) identify additional fields from expression
+*/
+
+enum {DVO_TABLE_AVERAGE, DVO_TABLE_MEASURE};
+
+// a single db field 
+typedef struct {
+  char *name;
+  int extract;
+  int table;
+  int ID;
+  int magMode;
+  PhotCode *photcode;
+} dvoField;
+
+// db boolean operations
+typedef struct {
+  char   *name;
+  char    type;
+  int     field;
+  float   Float;
+} dvoStack;
+
+dvoField *ParseCmdlineFields (int argc, char **argv, int table, int *last, int *nfields) {
+
+  int i, Nfields, NFIELDS, 
+
+  *nfields = 0;
+  Nfields = 0;
+  NFIELDS = 10;
+  ALLOCATE (fields, dvoField, NFIELDS);
+
+  // examine each argv[i] entry until we reach a where 
+  for (i = 1; (i < argc) && strcasecmp (argv[i], "where"); i++) {
+    // split the word by ","
+    p = argv[i];
+    while (*p) {
+      q = strchr (p, ',');
+      if (q == NULL) {
+	field = strcreate (p);
+	p = p + strlen(p);
+      } else {
+	field = strncreate (p, q-p);
+	p = q + 1;
+      }
+      // identify field for word
+      // need to know which type of fields to look for...
+      // xxx extend this more generally later
+      if (table == DVO_TABLE_MEASURE) {
+	status = ParseMeasureField (&fields[Nfields], field);
+      } 
+      if (table == DVO_TABLE_AVERAGE) {
+	status = ParseAverageField (&fields[Nfields], field);
+      } 
+      if (!status) {
+	gprint (GP_ERR, "unknown database field %s\n", field);
+	free (field);
+	free (fields);
+	return (NULL);
+      }
+      free (field);
+
+      Nfields ++;
+      CHECK_REALLOCATE (fields, dvoField, NFIELDS, Nfields, 10);
+    }
+  }
+
+  *last = i;
+  *nfields = Nfields;
+  return (fields);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvofields.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvofields.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvofields.c	(revision 15879)
@@ -0,0 +1,129 @@
+
+int GetMagMode (char *string) {
+
+  if (!strcasecmp (string, "inst"))  return (MAG_INST);
+  if (!strcasecmp (string, "cat"))   return (MAG_CAT);
+  if (!strcasecmp (string, "sys"))   return (MAG_SYS);
+  if (!strcasecmp (string, "rel"))   return (MAG_REL);
+  if (!strcasecmp (string, "cal"))   return (MAG_CAL);
+  if (!strcasecmp (string, "ave"))   return (MAG_AVE);
+  if (!strcasecmp (string, "ref"))   return (MAG_REF);
+  if (!strcasecmp (string, "err"))   return (MAG_ERR);
+  if (!strcasecmp (string, "chisq")) return (MAG_CHISQ);
+  return (MAG_NONE);
+}
+
+PhotCode *ParsePhotcodeField (char *field, int *mode, int default) {
+
+  char *tmpstring, *p;
+  PhotCode *code;
+
+  *mode = default;
+
+  p = strchr (field, ':');
+  if (p != NULL) {
+    *mode = GetMagMode (p + 1);
+    if (*mode == MAG_NONE) return (NULL);
+    tmpstring = strncreate (field, p - field);
+  } else {
+    tmpstring = strcreate (field);
+  }
+  code = GetPhotcodebyName (tmpstring);
+  free (tmpstring);
+
+  return (code);
+}
+
+# define ESCAPE(F,M) { \
+  field->ID = (F); \
+  field->magMode = (M); \
+  field->photcode = NULL; \
+  return (TRUE);
+
+int ParseMeasureField (dvoField *field, char *fieldName) {
+
+  PhotCode *code;
+
+  field->table = DVO_TABLE_MEASURE;
+  field->name  = strcreate (fieldName);
+
+  if (!strcasecmp (fieldName, "RA"))       ESCAPE (MEAS_RA,   	  MAG_NONE);
+  if (!strcasecmp (fieldName, "DEC"))      ESCAPE (MEAS_DEC,  	  MAG_NONE);
+  if (!strcasecmp (fieldName, "MAG"))      ESCAPE (MEAS_MAG,  	  MAG_REL);
+  if (!strcasecmp (fieldName, "dMAG"))     ESCAPE (MEAS_dMAG, 	  MAG_ERR);
+  if (!strcasecmp (fieldName, "AIRMASS"))  ESCAPE (MEAS_AIRMASS,  MAG_NONE);
+  if (!strcasecmp (fieldName, "EXPTIME"))  ESCAPE (MEAS_EXPTIME,  MAG_NONE);
+  if (!strcasecmp (fieldName, "PHOTCODE")) ESCAPE (MEAS_PHOTCODE, MAG_NONE);
+  if (!strcasecmp (fieldName, "TIME"))     ESCAPE (MEAS_TIME,     MAG_NONE);
+  if (!strcasecmp (fieldName, "dR"))       ESCAPE (MEAS_dR, 	  MAG_NONE);
+  if (!strcasecmp (fieldName, "dD"))       ESCAPE (MEAS_dD, 	  MAG_NONE);
+  if (!strcasecmp (fieldName, "FWHM"))     ESCAPE (MEAS_FWHM,     MAG_NONE);
+  if (!strcasecmp (fieldName, "DOPHOT"))   ESCAPE (MEAS_DOPHOT,   MAG_NONE);
+  if (!strcasecmp (fieldName, "FLAGS"))    ESCAPE (MEAS_FLAGS,    MAG_NONE);
+  if (!strcasecmp (fieldName, "XCCD"))     ESCAPE (MEAS_XCCD, 	  MAG_NONE);
+  if (!strcasecmp (fieldName, "YCCD"))     ESCAPE (MEAS_YCCD, 	  MAG_NONE);
+  if (!strcasecmp (fieldName, "XMOSAIC"))  ESCAPE (MEAS_XMOSAIC,  MAG_NONE);
+  if (!strcasecmp (fieldName, "YMOSAIC"))  ESCAPE (MEAS_YMOSAIC,  MAG_NONE);
+
+  // for words that don't parse, try a photcode
+
+  // check for code:mode in photcode name 
+  code = ParsePhotcodeField (&mode, MAG_REL);
+  if (code == NULL) return (FALSE);
+
+  if (mode == MAG_ERR) {
+    field->ID = MEAS_dMAG;
+  } else {
+    field->ID = MEAS_MAG;
+  }    
+  
+  field->magMode = mode;
+  field->photcode = code;
+  return (TRUE);
+}
+  
+int ParseAverageField (char *fieldName) {
+
+  PhotCode *code;
+
+  field->table = DVO_TABLE_AVERAGE;
+
+  if (!strcasecmp (fieldName, "RA"))    ESCAPE (AVE_RA,        MAG_NONE);
+  if (!strcasecmp (fieldName, "DEC"))   ESCAPE (AVE_DEC,       MAG_NONE);
+  if (!strcasecmp (fieldName, "dRA"))   ESCAPE (AVE_RA_ERR,    MAG_NONE);
+  if (!strcasecmp (fieldName, "dDEC"))  ESCAPE (AVE_DEC_ERR,   MAG_NONE);
+  if (!strcasecmp (fieldName, "uRA"))   ESCAPE (AVE_U_RA,      MAG_NONE);
+  if (!strcasecmp (fieldName, "uDEC"))  ESCAPE (AVE_U_DEC,     MAG_NONE);
+  if (!strcasecmp (fieldName, "duRA"))  ESCAPE (AVE_U_RA_ERR,  MAG_NONE);
+  if (!strcasecmp (fieldName, "duDEC")) ESCAPE (AVE_U_DEC_ERR, MAG_NONE);
+  if (!strcasecmp (fieldName, "PAR"))   ESCAPE (AVE_PAR,       MAG_NONE);
+  if (!strcasecmp (fieldName, "dPAR"))  ESCAPE (AVE_PAR_ERR,   MAG_NONE);
+  if (!strcasecmp (fieldName, "MAG"))   ESCAPE (AVE_MAG,       MAG_AVE);
+  if (!strcasecmp (fieldName, "dMAG"))  ESCAPE (AVE_dMAG,      MAG_AVE_ERR);
+  if (!strcasecmp (fieldName, "NMEAS")) ESCAPE (AVE_NMEAS,     MAG_NONE);
+  if (!strcasecmp (fieldName, "NMISS")) ESCAPE (AVE_NMISS,     MAG_NONE);
+  if (!strcasecmp (fieldName, "Xp"))    ESCAPE (AVE_Xp,        MAG_NONE);
+  if (!strcasecmp (fieldName, "Xm"))    ESCAPE (AVE_Xm,        MAG_CHISQ);
+  if (!strcasecmp (fieldName, "FLAG"))  ESCAPE (AVE_FLAG,      MAG_NONE);
+  if (!strcasecmp (fieldName, "TYPE"))  ESCAPE (AVE_TYPE,      MAG_NONE);
+  if (!strcasecmp (fieldName, "NPHOT")) ESCAPE (AVE_NPHOT,     MAG_NONE);
+  if (!strcasecmp (fieldName, "NCODE")) ESCAPE (AVE_NCODE,     MAG_NONE);
+  if (!strcasecmp (fieldName, "NCRIT")) ESCAPE (AVE_NCRIT,     MAG_NONE);
+
+  // for words that don't parse, try a photcode
+
+  // check for code:mode in photcode name 
+  code = ParsePhotcodeField (&mode, MAG_AVE);
+  if (code == NULL) return (FALSE);
+
+  // need to distinguish phot, sys errors and scatter
+  if (mode == MAG_ERR) {
+    field->ID = MEAS_dMAG;
+  } else {
+    field->ID = MEAS_MAG;
+  }    
+  
+  field->magMode = mode;
+  field->photcode = code;
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvomisc.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvomisc.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/dvomisc.c	(revision 15879)
@@ -0,0 +1,142 @@
+# include "dvoshell.h"
+
+void cprecess (Average *average, int Naverage, double in_epoch, double out_epoch) {
+
+  int i;
+  double T;
+  double A, D, RA, DEC, zeta, z, theta;
+  double SA, CA, SD, CD;
+  
+  T = (out_epoch - in_epoch) / 100.0;
+  
+  zeta  = RAD_DEG*(0.6406161*T + 0.0000839*T*T + 0.0000050*T*T*T);
+  theta = RAD_DEG*(0.5567530*T - 0.0001185*T*T - 0.0000116*T*T*T);
+  z     =          0.6406161*T + 0.0003041*T*T + 0.0000051*T*T*T;
+  
+  for (i = 0; i < Naverage; i++) {
+    A = average[i].R;
+    D = average[i].D;
+    SD =  cos(RAD_DEG*A + zeta)*sin(theta)*cos(RAD_DEG*D) + cos(theta)*sin(RAD_DEG*D);
+    CD = sqrt (1 - SD*SD);
+    SA =  sin(RAD_DEG*A + zeta)*cos(RAD_DEG*D)/CD;
+    CA = (cos(RAD_DEG*A + zeta)*cos(theta)*cos(RAD_DEG*D) - sin(theta)*sin(RAD_DEG*D))/CD;
+    
+    DEC = DEG_RAD*asin(SD);
+    RA  = DEG_RAD*atan2(SA, CA) + z;
+    
+    if (RA < 0)
+      RA += 360;
+    
+    average[i].R = RA;
+    average[i].D = DEC; 
+  }
+
+}
+
+/* values are ave[i].R, ave[i].D, ave[i].M */
+void sortave (Average *ave, int N) {
+
+  int l,j,ir,i;
+  Average tmp;
+
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      l--;
+      tmp = ave[l];
+    }
+    else {
+      tmp = ave[ir];
+      ave[ir] = ave[0];
+      if (--ir == 0) {
+	ave[0] = tmp;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && ave[j].R < ave[j+1].R) j++;
+      if (tmp.R < ave[j].R) {
+	ave[i] = ave[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    ave[i] = tmp;
+  }
+}
+
+/** this does not seem to be used at the moment */
+/* values are ave[i].R, ave[i].D, ave[i].M */
+void sort_images (Image *image, int N) {
+
+  int l,j,ir,i;
+  Image tmp;
+
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      l--;
+      tmp = image[l];
+    }
+    else {
+      tmp = image[ir];
+      image[ir] = image[0];
+      if (--ir == 0) {
+	image[0] = tmp;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && image[j].tzero < image[j+1].tzero) j++;
+      if (tmp.tzero < image[j].tzero) {
+	image[i] = image[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    image[i] = tmp;
+  }
+}
+
+/* sort subset by image[subset[i]].tzero */
+void sort_image_subset (Image *image, int *subset, int N) {
+
+  int l, j, ir, i, tmp;
+
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      l--;
+      tmp = subset[l];
+    }
+    else {
+      tmp = subset[ir];
+      subset[ir] = subset[0];
+      if (--ir == 0) {
+	subset[0] = tmp;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && image[subset[j]].tzero < image[subset[j+1]].tzero) j++;
+      if (image[tmp].tzero < image[subset[j]].tzero) {
+	subset[i] = subset[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    subset[i] = tmp;
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/elixir.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/elixir.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/elixir.c	(revision 15879)
@@ -0,0 +1,145 @@
+# include "dvoshell.h"
+
+int WriteMsg (char *fifo, char *message);
+int ReadMsg (char *fifo, char **message);
+
+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) {
+    gprint (GP_ERR, "USAGE: elixir (elixir) [-time] [-live]\n");
+    return (FALSE);
+  }
+
+  if (!VarConfig (argv[1], "%s", ElixirBase)) {
+    gprint (GP_ERR, "elixir %s not in config file\n", argv[1]);
+    return (FALSE);
+  }
+  sprintf (fifo, "%s.msg", ElixirBase);
+  if (!VarConfig ("FIFOS", "%s", fifodir)) {
+    gprint (GP_ERR, "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)) {
+    gprint (GP_ERR, "can't access fifo %s\n", fifo);
+    return (FALSE);
+  }
+
+  if (ReadMsg (msgfile, &answer)) {
+    gprint (GP_ERR, "%s\n", answer);
+  } 
+  unlink (msgfile);
+  return (TRUE);
+  
+}
+
+int WriteMsg (char *fifo, char *message) {
+
+  int state, mode;
+  FILE *f;
+
+  /* check lockfile */
+  f = fsetlockfile (fifo, 2.0, LCK_XCLD, &state);
+  if (f == NULL) 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;
+  chmod (fifo, mode);
+
+  fclearlockfile (fifo, f, LCK_XCLD, &state);
+  return (1);
+}
+
+int ReadMsg (char *fifo, char **message) {
+
+  int i, nbytes, Nbytes, NBYTES;
+  char *buffer;
+  int 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) {
+    gprint (GP_ERR, "no response\n");
+    return (0);
+  }
+
+  /* check lockfile */
+  f = fsetlockfile (fifo, 2.0, LCK_XCLD, &state);
+  if (f == NULL) {
+    gprint (GP_ERR, "message locked (%d)\n", 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;
+    chmod (fifo, mode);
+    fclearlockfile (fifo, f, LCK_XCLD, &state);
+    return (0);
+  }  
+
+  Nbytes = 0;
+  NBYTES = 0x1000;
+  ALLOCATE (buffer, char, NBYTES);
+  while (TRUE) {
+    nbytes = fread (&buffer[Nbytes], 1, 0x1000, f);
+    if (nbytes < 0) { 
+      gprint (GP_ERR, "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;
+  chmod (fifo, mode);
+  fclearlockfile (fifo, f, LCK_XCLD, &state);
+
+  if (Nbytes == 0) {
+    free (buffer);
+    return (0);
+  }
+
+  *message = buffer;
+  return (1);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/extract.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/extract.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/extract.c	(revision 15879)
@@ -0,0 +1,450 @@
+# include "dvoshell.h"
+// XXX EAM : this function is deprecated
+
+enum {ZERO, RA, DEC, MAG, dMAG, Xm, Xp, NMEAS, NMISS, REF, TYPE, NPHOT, NCODE, FLAG};
+
+# define NBYTES 160000
+# define BYTES_STAR 23
+# define BLOCK 1000
+# define DNSTARS 1000
+
+int extract (int argc, char **argv) {
+  
+  FILE *f;
+  int i, Col, N, Nbytes, nbytes, NPTS;
+  int InRegion, GSC, ASCII, LONEOS, mode, loadmode;
+  int j, k, m, Nregions;
+  float M0, m0;
+  char filename[128];
+  float Radius;
+  char catdir[256], gscdir[256];
+  int PhotcodeSelect;
+  char PhotCodeFile[256], code[64];
+  double ZERO_POINT;
+  int Ns, N1, n1, Nsec;
+  int Ngraph;
+  int value;
+  Vector *vec;
+  PhotCodeData photcodes;
+  Graphdata graphmode;
+  Catalog catalog;
+  RegionFile *regions;
+
+  if (!GetGraphData (&graphmode, NULL, NULL)) return (FALSE);
+  if (!InitPhotcodes ()) return (FALSE);
+
+  VarConfig ("GSCDIR", "%s", gscdir);
+  VarConfig ("CATDIR", "%s", catdir);
+
+  regions = (RegionFile *) NULL;
+  ASCII = FALSE;
+  LONEOS = TRUE;
+  GSC = FALSE;
+  if (N = get_argument (argc, argv, "-g")) {
+    remove_argument (N, &argc, argv);
+    GSC = TRUE;
+    ASCII = FALSE;
+    LONEOS = FALSE;
+  }
+
+  Col = 1;
+  if (N = get_argument (argc, argv, "-a")) {
+    remove_argument (N, &argc, argv);
+    ASCII = TRUE;
+    GSC = FALSE;
+    LONEOS = FALSE;
+    Col = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  /* check for region-based selection */
+  code = NULL;
+  PhotcodeSelect = FALSE;
+  if (N = get_argument (argc, argv, "-photcode")) {
+    PhotcodeSelect = True;
+    remove_argument (N, &argc, argv);
+    if ((code = GetPhotcodebyName (argv[N])) == NULL) {
+      gprint (GP_ERR, "ERROR: photcode %s not found in photcode table\n", argv[N]);
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: extract (filename) (value) [-g / -a Ncol] \n");
+    return (FALSE);
+  }
+  
+  InRegion = FALSE;
+  if (!strcmp (argv[1], "-all")) {
+    InRegion = TRUE;
+  }
+
+  /* identify selection */
+  if (LONEOS) {
+    mode = ZERO;
+    if (!strcasecmp (argv[2], "ra")) mode = RA;
+    if (!strcasecmp (argv[2], "dec")) mode = DEC;
+    if (!strcasecmp (argv[2], "mag")) mode = MAG;
+    if (!strcasecmp (argv[2], "Nmeas")) mode = NMEAS;
+    if (!strcasecmp (argv[2], "Nmiss")) mode = NMISS;
+    if (!strcasecmp (argv[2], "Xp")) mode = Xp;
+    if (!strcasecmp (argv[2], "Xm")) mode = Xm;
+    if (!strcasecmp (argv[2], "dM")) mode = dMAG;
+    if (!strcasecmp (argv[2], "flag")) mode = FLAG;
+    if (!strcasecmp (argv[2], "ref")) mode = REF;
+    if (!strcasecmp (argv[2], "type")) mode = TYPE;
+    if (!strcasecmp (argv[2], "Nphot")) mode = NPHOT;
+    if (!strcasecmp (argv[2], "Ncode")) mode = NCODE;
+    if (mode == ZERO) {
+      gprint (GP_ERR, "value may be one of the following:\n");
+      gprint (GP_ERR, " ra dec mag Nmeas Nmiss Xp Xm ID\n");
+      return (FALSE);
+    }
+  }
+
+  if ((mode == REF) && !PhotcodeSelect) {
+    gprint (GP_ERR, "must specify photcode for Reference\n");
+    return (FALSE);
+  }
+  if ((mode == TYPE) && !PhotcodeSelect) {
+    gprint (GP_ERR, "must specify photcode for Type\n");
+    return (FALSE);
+  }
+
+  /* check photcode data / selection validity */
+  Ns = -1;
+  Nsec = GetPhotcodeNsecfilt ();
+  if (PhotcodeSelect) {
+    Ns = GetPhotcodeNsec (code[0].code);
+    if ((mode != REF) && (code[0].type != PHOT_SEC)) {
+      gprint (GP_ERR, "filter must be a average photometry type\n");
+      return (FALSE);
+    }
+    if ((mode == REF) && (code[0].type != PHOT_REF)) {
+      gprint (GP_ERR, "filter must be a REFERENCE photometry type\n");
+      return (FALSE);
+    }
+  }
+
+  if (GSC) {
+    mode = ZERO;
+    if (!strcasecmp (argv[2], "ra")) 
+      mode = RA;
+    if (!strcasecmp (argv[2], "dec")) 
+      mode = DEC;
+    if (!strcasecmp (argv[2], "mag")) 
+      mode = MAG;
+    if (mode == ZERO) {
+      gprint (GP_ERR, "for GSC, value may be one of the following:\n");
+      gprint (GP_ERR, " ra dec mag\n");
+      return (FALSE);
+    }
+  }
+
+  if ((vec = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if (InRegion) {
+    Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax));
+    regions = find_regions (graphmode.coords.crval1, graphmode.coords.crval2, Radius, &Nregions);
+  } else {
+    Nregions = 1;
+  }
+  
+  /* create storage vector */
+  NPTS = 1000;
+  REALLOCATE (vec[0].elements, float, NPTS);
+  vec[0].Nelements = N = 0;
+
+  /* we loop over Nregions, but for ASCII Nregions = 1 */
+  for (j = 0; j < Nregions; j++) {
+    
+    /* Load in data from an ASCII file list of ra, dec, mag */
+    if (ASCII) {
+      char *tbuffer;
+      double tmp;
+      float *V;
+      
+      f = fopen (argv[1], "r");
+      if (f == (FILE *) NULL) {
+	gprint (GP_ERR, "ERROR: can't open data file: %s\n", argv[1]);
+	/* delete new vector! */
+	return (FALSE);
+      }
+      ALLOCATE (tbuffer, char, 1024);
+      
+      V = vec[0].elements;
+      while (scan_line (f, tbuffer) != EOF) {
+	dparse (&tmp, Col, tbuffer);
+	*V = tmp;
+	V++;
+	N++;
+	if (N == NPTS - 1) {
+	  NPTS += 1000;
+	  REALLOCATE (vec[0].elements, float, NPTS);
+	  V = &vec[0].elements[N];
+	}
+      }
+      free (tbuffer);
+      vec[0].Nelements = N;
+      REALLOCATE (vec[0].elements, float, MAX(1,N));
+      fclose (f);
+      return (TRUE);
+    }
+    
+    /* load data from the GSC files */
+    if (GSC) {
+      char *tbuffer;
+      double tmp;
+      float *V;
+      
+      if (InRegion) {
+	sprintf (filename, "%s/%s\0", gscdir, regions[j].name);
+      } else {
+	sprintf (filename, "%s/%s\0", gscdir, argv[1]);
+      }
+      
+      f = fopen (filename, "r");
+      if (f == (FILE *) NULL) {
+	gprint (GP_ERR, "no stars in %s, skipping\n", filename);
+	continue;
+      }
+      ALLOCATE (tbuffer, char, (BLOCK*BYTES_STAR));
+      
+      V = &vec[0].elements[N];
+      Nbytes = BLOCK*BYTES_STAR;
+      while ((nbytes = fread (tbuffer, 1, Nbytes, f)) > 0) {
+	for (i = 0; i < nbytes / BYTES_STAR; i++) {
+	  if (mode == RA) {
+	    dparse (&tmp, 1, &tbuffer[i*BYTES_STAR]);
+	    *V = tmp;
+	  }
+	  if (mode == DEC) {
+	    dparse (&tmp, 2, &tbuffer[i*BYTES_STAR]);
+	    *V = tmp;
+	  }
+	  if (mode == MAG) {
+	    dparse (&tmp, 3, &tbuffer[i*BYTES_STAR]);
+	    *V = tmp;
+	  }
+	  V++;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	    V = &vec[0].elements[N];
+	  }
+	}
+      }
+      free (tbuffer);
+      fclose (f);
+    }
+  
+    /* load data from the photometry database files */
+    if (LONEOS) {
+      /* find and open correct file */
+      if (InRegion) {
+	sprintf (filename, "%s/%s\0", catdir, regions[j].name);
+      } else {
+	sprintf (filename, "%s/%s\0", catdir, argv[1]);
+      }
+      catalog.average = (Average *) NULL;
+      catalog.measure = (Measure *) NULL;
+      catalog.secfilt = (SecFilt *) NULL;
+      loadmode = LOAD_AVES | LOAD_SECF;
+      if ((mode == REF) || (mode == TYPE) || (mode == NPHOT) || (mode == NCODE)) 
+	loadmode = loadmode | LOAD_MEAS;
+
+      /* lock, load, unlock catalog */
+      catalog.filename = filename;
+      switch (lock_catalog (&catalog, LCK_SOFT)) {
+      case 2:
+	unlock_catalog (&catalog);
+      case 0:
+	continue;
+      }
+      catalog.catflags = loadmode;
+      if (!load_catalog (&catalog, TRUE)) {
+	unlock_catalog (&catalog);
+	continue;
+      }
+      unlock_catalog (&catalog);
+
+      /* assign vector values */
+      switch (mode) {
+      case (RA):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  vec[0].elements[N] = catalog.average[i].R;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (DEC):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  vec[0].elements[N] = catalog.average[i].D;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (MAG):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  M0 = (Ns == -1) ? catalog.average[i].M : catalog.secfilt[i*Nsec+Ns].M;
+	  vec[0].elements[N] = M0 / 1000.0;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (NMEAS):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  vec[0].elements[N] = catalog.average[i].Nm;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (NMISS):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  vec[0].elements[N] = catalog.average[i].Nn;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (Xp):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  /* Xp is scatter in 1/100 arcsec */
+	  vec[0].elements[N] = 0.01*catalog.average[i].Xp;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (NCODE):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  m = catalog.average[i].offset;
+	  Ncode = 0;
+	  for (k = 0; k < catalog.average[i].Nm; k++, m++) {
+	    if (code[0].code != GetPhotcodeEquivCodebyCode (catalog.measure[m].photcode)) continue;
+	    Ncode ++;
+	  }
+	  vec[0].elements[N] = Ncode;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (NPHOT):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  m = catalog.average[i].offset;
+	  Ncode = 0;
+	  for (k = 0; k < catalog.average[i].Nm; k++, m++) {
+	    if (code[0].code != GetPhotcodeEquivCodebyCode (catalog.measure[m].photcode)) continue;
+	    if (catalog.measure[m].photcode & (ID_MEAS_POOR | ID_MEAS_SKIP)) continue;
+	    Ncode ++;
+	  }
+	  vec[0].elements[N] = Ncode;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (Xm):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  M0 = (Ns == -1) ? catalog.average[i].Xm : catalog.secfilt[i*Nsec+Ns].Xm;
+	  vec[0].elements[N] = (M0 == NO_MAG) ? -1.0 : pow (10.0, 0.01*M0);
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (dMAG):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  /* dM is 1000.0 * error */
+	  M0 = (Ns == -1) ? catalog.average[i].dM : catalog.secfilt[i*Nsec+Ns].dM;
+	  vec[0].elements[N] = (M0 == NO_MAG) ? -1.0 : 0.001*M0;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (FLAG):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  vec[0].elements[N] = catalog.average[i].code;
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (REF):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  m = catalog.average[i].offset;
+	  vec[0].elements[N] = -32;
+	  for (k = 0; k < catalog.average[i].Nm; k++) {
+	    if (catalog.measure[m+k].photcode == N1) {
+	      vec[0].elements[N] = PhotCat (&catalog.measure[m+k]);
+	      k = catalog.average[i].Nm;
+	    }
+	  }
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      case (TYPE):
+	for (i = 0; i < catalog.Naverage; i++) {
+	  m = catalog.average[i].offset;
+	  vec[0].elements[N] = DetermineTypeCode (&catalog.average[i], &catalog.measure[m], &photcodes, N1);
+	  N++;
+	  if (N == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (vec[0].elements, float, NPTS);
+	  }
+	}
+	break;
+      }
+      if (catalog.average != 0) free (catalog.average);
+      if (catalog.measure != 0) free (catalog.measure);
+      if (catalog.secfilt != 0) free (catalog.secfilt);
+    }
+  }
+
+  vec[0].Nelements = N;
+  REALLOCATE (vec[0].elements, float, MAX(1,N));
+  return (TRUE);
+
+}
+  
+  /* USAGE: extract (what) (where) (from) [option] */
+  /* examples:
+     extract n0000/n0001 mag m 
+     extract -g n0000/n0020 ra r 
+     extract -all Xm xm
+     extract fred dec d -a 2 */
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/find_regions.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/find_regions.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/find_regions.c	(revision 15879)
@@ -0,0 +1,156 @@
+# include "dvoshell.h"
+# include "hstgsc.h"
+
+/* returns a list of region files within the desired RA, DEC region */
+RegionFile *find_regions (double Ra, double Dec, double radius, int *Nregions) {
+  
+  char filename[256];
+  char buffer[28800], temp[50];
+  RegionFile *regions;
+  FILE *f;
+  double minRa, maxRa, minDec, maxDec, rad;
+
+  double RA0, RA1, DEC0, DEC1;
+  int i, j, NBigDec;
+  int NLINES, done, NREGIONS, nregion;
+  
+  VarConfig ("GSCFILE", "%s", filename);
+  f = fopen (filename, "r");
+  if (f == NULL) {
+    gprint (GP_ERR, "ERROR: can't find regions file %s\n", filename);
+    *Nregions = 0;
+    return ((RegionFile *) NULL);
+  }
+  
+  NREGIONS = 50;
+  ALLOCATE (regions, RegionFile, NREGIONS);
+  nregion = 0;
+
+  while (Ra < 0) Ra += 360.0;
+  while (Ra >= 360) Ra -= 360.0;
+
+  minDec = Dec - radius;
+  maxDec = Dec + radius;
+
+  if ((minDec <= -90) || (maxDec >= 90)) {
+    minRa = 0;
+    maxRa = 360;
+  } else {
+    rad = MAX (radius / (cos(minDec*RAD_DEG)), radius / (cos(maxDec*RAD_DEG)));
+    minRa = Ra - rad;
+    maxRa = Ra + rad;
+  }
+  
+  /* use the pole regions, if near pole */
+  if (maxDec > 86.25) {
+    sprintf (regions[nregion].name, "n8230/pole.cpt");
+    regions[nregion].RA0 = 0;
+    regions[nregion].RA1 = 360;
+    regions[nregion].DEC0 = 86.25;
+    regions[nregion].DEC1 = 90.0;
+    nregion ++;
+    if (nregion == NREGIONS) {
+      NREGIONS += 50;
+      REALLOCATE (regions, RegionFile, NREGIONS);
+    }
+  }
+
+  if (minDec > 86.25) {
+    return (regions);
+  }
+    
+  if ((minDec < 0) && (maxDec > 0)) {
+    /* Search Both Sides */
+    NBigDec = 0;
+  } else {
+    /* find large DEC region (directory) */
+    NBigDec = -1;
+    for (i = 0; i < 12; i++) {
+      if ((minDec >= BigDecBounds[i]) && (minDec < BigDecBounds[i+1])) {
+	NBigDec = i;
+	break;
+      }
+    }
+    if (NBigDec < 0) {
+      for (i = 13; i < 24; i++) {
+	if ((maxDec < BigDecBounds[i]) && (maxDec >= BigDecBounds[i+1])) {
+	  NBigDec = i;
+	  break;
+	}
+      }
+    }
+  }
+  if (NBigDec < 0) {
+    gprint (GP_ERR, "ERROR: Dec out of range: %f\n", minDec);
+    *Nregions = 0;
+    return ((RegionFile *) NULL);
+  }
+  
+  /* count lines before section */
+  NLINES = 0;
+  for (i = 0; i < NBigDec; i++) {
+    NLINES += NDecLines[i];
+  }
+  fseek (f, 5*2880 + 48*NLINES, SEEK_SET);
+  
+  /* should be in this section.  if not, there is a problem counting... */
+  /* careful with the 0,360.0 boundary **/
+  done = FALSE;
+  for (j = 0; !done && (NBigDec + j < 25); j++) {
+    fread (buffer, 48*NDecLines[NBigDec + j], 1, f);
+    for (i = 0; (i < NDecLines[NBigDec + j]); i++) {
+      strncpy (temp, &buffer[i*48], 48);
+      temp[49] = 0;
+      hstgsc_hms_to_deg (&RA0, &RA1, &DEC0, &DEC1, &temp[7]);
+      if (RA1 < RA0) RA1 += 360.0;
+      if ((DEC1 > 0) && (minDec < DEC1) && (maxDec > DEC0) && (minRa < RA1) && (maxRa > RA0)) {
+	temp[5] = 0;
+	sprintf (regions[nregion].name, "%s/%s.cpt", Dec2Sections[NBigDec + j], &temp[1]);
+	regions[nregion].RA0 = RA0;
+	regions[nregion].RA1 = RA1;
+	regions[nregion].DEC0 = DEC0;
+	regions[nregion].DEC1 = DEC1;
+	nregion ++;
+	if (nregion == NREGIONS) {
+	  NREGIONS += 50;
+	  REALLOCATE (regions, RegionFile, NREGIONS);
+	}
+      }
+      if ((DEC1 < 0) && (minDec < DEC0) && (maxDec > DEC1) && (minRa < RA1) && (maxRa > RA0)) {
+	temp[5] = 0;
+	sprintf (regions[nregion].name, "%s/%s.cpt", Dec2Sections[NBigDec + j], &temp[1]);
+	regions[nregion].RA0 = RA0;
+	regions[nregion].RA1 = RA1;
+	regions[nregion].DEC0 = DEC0;
+	regions[nregion].DEC1 = DEC1;
+	nregion ++;
+	if (nregion == NREGIONS) {
+	  NREGIONS += 50;
+	  REALLOCATE (regions, RegionFile, NREGIONS);
+	}
+      }
+      if (((DEC1 > 0) && (maxDec <= DEC1)) || ((DEC1 < 0) && (minDec >= DEC1))) {
+	done = TRUE;
+      }
+    }
+    if (done && (minDec < 0) && (maxDec > 0) && (BigDecBounds[NBigDec + j + 1] > 0)) {
+      /* skip remaining north sections, try south sections */
+      /* count lines before section */
+      NLINES = 0;
+      for (i = 0; i < 13; i++) { 
+	NLINES += NDecLines[i];
+      }
+      fseek (f, 5*2880 + 48*NLINES, SEEK_SET);
+      done = FALSE;
+      j = 12;
+    }
+  }
+
+  REALLOCATE (regions, RegionFile, MAX(1,nregion));
+  *Nregions = nregion;
+  
+  fclose (f);
+  return (regions);
+  
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/fitcolors.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/fitcolors.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/fitcolors.c	(revision 15879)
@@ -0,0 +1,390 @@
+# include "dvoshell.h"
+# define NMIN_PTS 100
+
+static void free_catalog (Catalog *catalog, int Ncatalog);
+
+/* this function takes a photcode (and camera name?) and measures the  *
+ * chip-to-chip slopes for all DEP photcodes equiv to the PRI/SEC code */
+
+int fitcolors (int argc, char **argv) {
+  
+  int *list, Nlist;
+  int i, k, m, N, NP1, NP2, NP, Np, Npts, NPTS;
+  int N1, N2, i1, i2, mode[4];
+  int Nsecfilt, status;
+  void *oldsignal;
+  char *cmd, *outcmd, *camera;
+  char name[64], filename[64], plotname[64], label[64];
+  double *M1, *M2;
+  float *out, *colorFit, *deltaFit, dColor, C0, C1;
+  float minDelta, maxDelta, minColor, maxColor;
+  int kapa, Npx, Npy, NPX, NPY, Nplot, PLOT;
+  Graphdata graphdata;
+  KapaSection section;
+
+  Catalog *catalog;
+  PhotCode **codelist, *tcode, *code[4];
+  SkyList *skylist;
+  SkyRegionSelection *selection;
+  Vector *xvec, *yvec;
+  Buffer *buf;
+
+  /* defaults */
+  catalog  = NULL;
+  skylist  = NULL;
+  selection = NULL;
+  codelist = NULL;
+  xvec = yvec = NULL;
+  colorFit = NULL;
+  deltaFit = NULL;
+
+  oldsignal = signal (SIGINT, handle_interrupt);
+  interrupt = FALSE;
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  /* interpret command-line options */
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape;
+  if (!SetPhotSelections (&argc, argv, 4)) goto usage;
+
+  // range for valid data points (exclude extreme outliers)
+  minDelta = -0.2;
+  maxDelta = +0.2;
+  minColor = -1.0;
+  maxColor = +3.0;
+  if ((N = get_argument (argc, argv, "-color-range"))) {
+    remove_argument (N, &argc, argv);
+    minColor = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    maxColor = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-delta-range"))) {
+    remove_argument (N, &argc, argv);
+    minDelta = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+    maxDelta = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  PLOT = FALSE;
+  NPX = NPY = 0;
+  if ((N = get_argument (argc, argv, "-plot"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (plotname, argv[N]);
+    remove_argument (N, &argc, argv);
+    NPX = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    NPY = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    PLOT = TRUE;
+  }
+
+  /* interpret command-line options */
+  if (argc != 4) goto usage;
+
+  if (PLOT) {
+    if (!GetGraph (&graphdata, &kapa, NULL)) return (FALSE);
+    Nplot = 0;
+    Npx = Npy = 0;
+    graphdata.xmin = minColor;
+    graphdata.xmax = maxColor;
+    graphdata.ymin = minDelta;
+    graphdata.ymax = maxDelta;
+    graphdata.style = 2;
+    graphdata.ptype = 2;
+    KapaClearSections (kapa);
+    KapaSetFont (kapa, "helvetica", 14);
+
+    ALLOCATE (colorFit, float, 11);
+    ALLOCATE (deltaFit, float, 11);
+    dColor = (maxColor - minColor) / 10.0;
+    for (i = 0; i < 11; i++) {
+      colorFit[i] = minColor + i*dColor;
+    }
+  }
+
+  /* determine relevant photcodes, colors */
+  if (!(Np = GetPhotcodeCodebyName (argv[2]))) {
+    gprint (GP_ERR, "ERROR: photcode not found in photcode table\n");
+    goto usage;
+  }
+  camera = argv[3];
+
+  /* reduce the list of codes */
+  list = GetPhotcodeEquivList (Np, &Nlist);
+  ALLOCATE (codelist, PhotCode *, Nlist);
+  for (i = NP = 0; i < Nlist; i++) {
+    tcode = GetPhotcodebyCode (list[i]);
+    if (strncmp (tcode[0].name, camera, strlen(camera))) continue;
+    codelist[NP] = tcode;
+    NP++;
+  }
+  mode[0] = mode[1] = MAG_REL;  /* we should be applying any relative photometry corrections here */
+  mode[2] = mode[3] = MAG_AVE;
+
+  /* set the reference colors */
+  code[2] = GetPhotcodebyCode (codelist[0][0].c1);
+  code[3] = GetPhotcodebyCode (codelist[0][0].c2);
+  if ((code[2] == NULL) || (code[3] == NULL)) goto color_missing;
+
+  /* all codes must have the same colors (validate) */
+  for (i = 0; i < NP; i++) {
+    if (codelist[i][0].c1 != codelist[0][0].c1) goto color_mismatch;
+    if (codelist[i][0].c2 != codelist[0][0].c2) goto color_mismatch;
+  }
+  gprint (GP_ERR, "using %d photcodes\n", NP);
+
+  /* output is a named buffer */
+  if ((buf = SelectBuffer (argv[1], ANYVECTOR, TRUE)) == NULL) goto usage;
+
+  gfits_free_matrix (&buf[0].matrix);
+  gfits_free_header (&buf[0].header);
+  CreateBuffer (buf, NP, NP, -32, 0.0, 1.0);
+  strcpy (buf[0].file, "(empty)");
+
+  out = (float *) buf[0].matrix.buffer;
+  /* we set a default flag value of -1 */
+  for (i = 0; i < NP*NP; i++) {
+    out[i] = -1;
+  }
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (selection)) == NULL) goto escape;
+
+  /* loop over regions, extract data for each region */
+  ALLOCATE (catalog, Catalog, skylist[0].Nregions);
+  for (k = 0; k < skylist[0].Nregions; k++) {
+    /* lock, load, unlock catalog */
+    catalog[k].filename = skylist[0].filename[k];
+    catalog[k].catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog[k].Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog[k], NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog[k].filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog[k]);
+    // XXX make a subset catalog consisting of only Average and Measure values which meet
+    // the selection criteria
+  }
+  gprint (GP_ERR, "using %d possible regions\n", skylist[0].Nregions);
+
+  /* vectors to save data */
+  Npts = 0;
+  NPTS = 1;
+  if ((xvec = SelectVector ("tmp_x", ANYVECTOR, TRUE)) == NULL) goto escape;
+  if ((yvec = SelectVector ("tmp_y", ANYVECTOR, TRUE)) == NULL) goto escape;
+
+  // set up basic windows
+  if (PLOT) {
+    Nplot = 0;
+    Npx = Npy = 0;
+    NPX = NPY = 6;
+    KapaInitGraph (&graphdata);
+    graphdata.xmin = minColor;
+    graphdata.xmax = maxColor;
+    graphdata.ymin = minDelta;
+    graphdata.ymax = maxDelta;
+    graphdata.style = 2;
+    graphdata.ptype = 2;
+  }
+
+  /*** generate the color-color vectors for the pairs ***/
+  // XXXX this function also needs to check for interrupts
+  // XXX exclude obvious outliers (eg, fabs(dM) > 0.2)
+  /* loop over chip photcode pairs */
+  for (NP1 = 0; NP1 < NP; NP1++) {
+    for (NP2 = NP1 + 1; NP2 < NP; NP2++) {
+      code[0] = codelist[NP1];
+      code[1] = codelist[NP2];
+      
+      /* extract all magnitude pairs from catalog tables */
+      Npts = 0;
+      for (k = 0; k < skylist[0].Nregions; k++) {
+	if (catalog[k].Naverage == 0) continue;
+
+	// gprint (GP_ERR, "seaching %s with %d stars\n", catalog[k].filename, catalog[k].Naverage);
+	// ListPhotSelections ();
+
+	/* get correct mags, convert to X,Y */
+	for (i = 0; i < catalog[k].Naverage; i++) {
+	  if (interrupt) goto escape;
+
+	  M1 = M2 = NULL;
+	  m = catalog[k].average[i].offset;
+
+	  SetSelectionParam (0);
+	  M1 = ExtractDMag (&code[0], &mode[0], &catalog[k].average[i], &catalog[k].secfilt[i*Nsecfilt], &catalog[k].measure[m], &N1);
+	  if (N1 == 0) goto skip_star;
+
+	  SetSelectionParam (2);
+	  M2 = ExtractDMag (&code[2], &mode[2], &catalog[k].average[i], &catalog[k].secfilt[i*Nsecfilt], &catalog[k].measure[m], &N2);
+	  if (N2 == 0) goto skip_star;
+
+	  for (i1 = 0; i1 < N1; i1++) {
+	    for (i2 = 0; i2 < N2; i2++) {
+	      if (M1[i1] < minDelta) continue;
+	      if (M1[i1] > maxDelta) continue;
+	      if (M2[i2] < minColor) continue;
+	      if (M2[i2] > maxColor) continue;
+	      yvec[0].elements[Npts] = M1[i1];
+	      xvec[0].elements[Npts] = M2[i2];
+	      Npts++;
+	      if (Npts >= NPTS) {
+		NPTS += 2000;
+		REALLOCATE (xvec[0].elements, float, NPTS);
+		REALLOCATE (yvec[0].elements, float, NPTS);
+	      }
+	    }
+	  }
+	skip_star:
+	  if (M1 != NULL) free (M1);
+	  if (M2 != NULL) free (M2);
+	}
+	// gprint (GP_ERR, "selected %d stars\n", Npts);
+      }
+
+      if (Npts < NMIN_PTS) continue;
+      xvec[0].Nelements = Npts;
+      yvec[0].Nelements = Npts;
+
+      /* perform robust fit on dmag vs color */
+      cmd = strcreate ("fit tmp_x tmp_y 1 -clip 3 3 -quiet");
+      status = command (cmd, &outcmd, TRUE);
+      if (outcmd != NULL) free (outcmd);
+      
+      C0 = get_double_variable ("C0", &status);
+      C1 = get_double_variable ("C1", &status);
+      
+      /* do something useful with the results (stored in Cn, C0, C1, etc) */
+      gprint (GP_LOG, "%s - %s : ", code[0][0].name, code[1][0].name);
+      gprint (GP_LOG, "%7.4f %7.4f   %7.4f   ", 
+	       C0, C1, get_double_variable ("dC", &status));
+      gprint (GP_LOG, "%5s of %5d\n", get_variable ("Cnv"), Npts);
+      out[NP1 + NP2*NP] = C1;
+
+      // make an illustrating plot of each chip vs each other chip
+      // each page should have, say, a 6x6 grid of plots. each one should show a single chip pair
+      // as the page fills up, it gets written and a new one created.  
+      if (PLOT) {
+	sprintf (name, "s%02d.%02d", Npx, Npy);
+	section.name = strcreate (name);
+	if (Npx || Npy) {
+	  section.dx = 0.9 / NPX;
+	  section.dy = 0.9 / NPY;
+	  section.x = 0.1 + Npx * section.dx;
+	  section.y = 0.1 + Npy * section.dy;
+	  strcpy (graphdata.labels, "0000");
+	} 
+	if (Npx == 0) {
+	  section.dx = 0.9 / NPX + 0.1;
+	  section.dy = 0.9 / NPY;
+	  section.x = 0.0;
+	  section.y = 0.1 + Npy * section.dy;
+	  strcpy (graphdata.labels, "0100");
+	}
+	if (Npy == 0) {
+	  section.dx = 0.9 / NPX;
+	  section.dy = 0.9 / NPY + 0.1;
+	  section.x = 0.1 + Npx * section.dx;
+	  section.y = 0.0;
+	  strcpy (graphdata.labels, "1000");
+	}
+	if (!Npx && !Npy) {
+	  section.dx = 0.9 / NPX + 0.1;
+	  section.dy = 0.9 / NPY + 0.1;
+	  section.x = 0.0;
+	  section.y = 0.0;
+	  strcpy (graphdata.labels, "1100");
+	}
+	KapaSetSection (kapa, &section);
+	KapaSetLimits (kapa, &graphdata);
+	KapaBox (kapa, &graphdata);
+	KapaPrepPlot (kapa, Npts, &graphdata);
+	KapaPlotVector (kapa, Npts, xvec[0].elements, "x");
+	KapaPlotVector (kapa, Npts, yvec[0].elements, "y");
+
+	for (i = 0; i < 11; i++) {
+	  deltaFit[i] = C0 + C1*colorFit[i];
+	}
+	graphdata.style = 0;
+	graphdata.color = KapaColorByName ("red");
+	KapaPrepPlot (kapa, 11, &graphdata);
+	KapaPlotVector (kapa, 11, colorFit, "x");
+	KapaPlotVector (kapa, 11, deltaFit, "y");
+
+	KapaSetFont (kapa, "helvetica", 8);
+	sprintf (label, "%s", code[0][0].name);
+	KapaSendTextline (kapa, label, 0.2*maxColor + 0.8*minColor, 0.8*maxDelta + 0.2*minDelta, 0.0);
+	sprintf (label, "%s", code[1][0].name);
+	KapaSendTextline (kapa, label, 0.2*maxColor + 0.8*minColor, 0.2*maxDelta + 0.8*minDelta, 0.0);
+	KapaSetFont (kapa, "helvetica", 14);
+
+	graphdata.style = 2;
+	graphdata.color = KapaColorByName ("black");
+
+	free (section.name);
+
+	Npx++;
+	if (Npx == NPX) {
+	  Npx = 0;
+	  Npy ++;
+	  if (Npy == NPY) {
+	    Npy = 0;
+	    sprintf (filename, "%s.%02d.png", plotname, Nplot);
+	    KapaPNG (kapa, filename);
+	    KapaClearSections (kapa);
+	    Nplot++;
+	  }
+	}
+      }	
+    }
+  }
+  if (skylist != NULL) free_catalog (catalog, skylist[0].Nregions);
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  if (codelist != NULL) free (codelist);
+  if (colorFit != NULL) free (colorFit);
+  if (deltaFit != NULL) free (deltaFit);
+  signal (SIGINT, oldsignal);
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: chipcolors (output) (photcode) (camera)\n");
+  goto escape;
+
+color_missing:
+  gprint (GP_ERR, "error: chips are missing a color reference\n");
+  goto escape;
+
+color_mismatch:
+  gprint (GP_ERR, "error: all chips must have the same colors\n");
+  goto escape;
+
+escape:
+  if (skylist != NULL) free_catalog (catalog, skylist[0].Nregions);
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  if (codelist != NULL) free (codelist);
+  if (colorFit != NULL) free (colorFit);
+  if (deltaFit != NULL) free (deltaFit);
+  DeleteVector (xvec);
+  DeleteVector (yvec);
+  signal (SIGINT, oldsignal);
+  return (FALSE);
+}
+
+static void free_catalog (Catalog *catalog, int Ncatalog) {
+
+  int i;
+
+  if (catalog == NULL) return;
+  for (i = 0; i < Ncatalog; i++) {
+    dvo_catalog_free (&catalog[i]);
+  }
+  free (catalog);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/fitsed.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/fitsed.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/fitsed.c	(revision 15879)
@@ -0,0 +1,479 @@
+# include "dvoshell.h"
+
+typedef struct {
+  float *mags;
+  float color;
+  float Temp;
+  float Av;
+} SEDtableRow;
+
+typedef struct {
+  float chisq;
+  float Md;
+  int row;
+} SEDfit;
+
+SEDtableRow **sort_SEDtable (SEDtableRow *raw, int N);
+int SEDcolorBracket (SEDtableRow **table, int Ntable, float color);
+SEDfit SEDchisq (SEDtableRow *ref, SEDtableRow *data, SEDtableRow *error, int Nfilter);
+
+/* this function takes a photcode (and camera name?) and measures the  *
+ * chip-to-chip slopes for all DEP photcodes equiv to the PRI/SEC code */
+
+int fitsed (int argc, char **argv) {
+  
+  int *hashcode;
+  int i, j, k, m, N, done, Nfit;
+  int Nsecfilt, status;
+  void *oldsignal;
+  char name[64], line[1024], key[20];
+  float *fitmags, *fiterrs, *wavecode, *vegaToAB;
+  float color;
+  double X, Y, ZP, RA, DEC;
+  int kapa, PLOT;
+  int Nrow, NROW, idx, Nfilter, start, row;
+  unsigned short colorP, colorM, code, USNOred, USNOblu;
+  int codeP, codeM;
+  FILE *f;
+
+  Graphdata graphdata;
+  KapaSection magSection, resSection;
+
+  Catalog catalog, outcat;
+  SkyList *skylist;
+  SkyRegionSelection *selection;
+
+  SEDtableRow *SEDtableRaw, **SEDtable;
+  SEDtableRow sourceValue, sourceError;
+  SEDfit minFit, testFit;
+
+  /* defaults */
+  skylist  = NULL;
+  selection = NULL;
+
+  catalog.average = NULL;
+  catalog.measure = NULL;
+  catalog.secfilt = NULL;
+
+  outcat.average = NULL;
+  outcat.measure = NULL;
+  outcat.secfilt = NULL;
+
+  SEDtable = NULL;
+  SEDtableRaw = NULL;
+  sourceValue.mags = NULL;
+  sourceError.mags = NULL;
+  wavecode = NULL;
+  hashcode = NULL;
+  magSection.name = NULL;
+  resSection.name = NULL;
+
+  Nrow = 0;
+
+  fiterrs = NULL;
+  fitmags = NULL;
+
+  oldsignal = signal (SIGINT, handle_interrupt);
+  interrupt = FALSE;
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  /* interpret command-line options */
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape;
+  if (!SetPhotSelections (&argc, argv, 4)) goto usage;
+
+  PLOT = FALSE;
+  if ((N = get_argument (argc, argv, "-plot"))) {
+    remove_argument (N, &argc, argv);
+    PLOT = TRUE;
+  }
+
+  /* interpret command-line options */
+  if (argc != 6) goto usage;
+
+  Nfit = 0;
+  colorP = GetPhotcodeCodebyName (argv[3]);
+  colorM = GetPhotcodeCodebyName (argv[5]);
+  if (!colorP || !colorM) goto color_undefined;
+
+  // artificially set USNOred and blu errors to 0.3
+  USNOred = GetPhotcodeCodebyName ("USNO_RED");
+  USNOblu = GetPhotcodeCodebyName ("USNO_BLUE");
+
+  // load SED table
+  f = fopen (argv[1], "r");
+  if (f == NULL) goto table_missing;
+
+  // XXX add error checks for header data
+  scan_line (f, line);
+  sscanf (line, "%*s %*s %d", &Nfilter);
+
+  // load SED table photcodes, generate the photcode hashtable
+  ALLOCATE (hashcode, int, 0x10000);
+  ALLOCATE (wavecode, float, Nfilter);
+  ALLOCATE (vegaToAB, float, Nfilter);
+
+  for (i = 0; i < 0x10000; i++) hashcode[i] = -1;
+  for (i = 0; i < Nfilter; i++) {
+    scan_line (f, line);
+    sscanf (line, "%*s %s %f %f", name, &wavecode[i], &vegaToAB[i]);
+    code = GetPhotcodeCodebyName (name);
+    if (code == 0) goto code_missing;
+    hashcode[code] = i;
+  }
+  codeP = hashcode[colorP];
+  codeM = hashcode[colorM];
+  if ((codeP == -1) || (codeM == -1)) goto color_missing;
+    
+  // skip remaining header lines
+  scan_line (f, line);
+  scan_line (f, line);
+  scan_line (f, line);
+  scan_line (f, line);
+  
+  // load the SED table data
+  Nrow = 0;
+  NROW = 100;
+  ALLOCATE (SEDtableRaw, SEDtableRow, NROW);
+  while (scan_line(f, line) != EOF) {
+    fparse (&SEDtableRaw[Nrow].Temp, 1, line);
+    fparse (&SEDtableRaw[Nrow].Av, 2, line);
+    ALLOCATE (SEDtableRaw[Nrow].mags, float, Nfilter);
+    for (i = 0; i < Nfilter; i++) {
+      fparse (&SEDtableRaw[Nrow].mags[i], i + 3, line);
+    }
+    SEDtableRaw[Nrow].color = SEDtableRaw[Nrow].mags[codeP] - SEDtableRaw[Nrow].mags[codeM];
+    Nrow ++;
+    CHECK_REALLOCATE (SEDtableRaw, SEDtableRow, NROW, Nrow, 100);
+  }      
+
+  // sort the SEDtable by the reference colors
+  SEDtable = sort_SEDtable (SEDtableRaw, Nrow);
+
+  // create holder for the source data
+  ALLOCATE (sourceValue.mags, float, Nfilter);
+  ALLOCATE (sourceError.mags, float, Nfilter);
+
+  if (PLOT) {
+    if (!GetGraph (&graphdata, &kapa, NULL)) return (FALSE);
+    SetLimitsRaw (wavecode, NULL, Nfilter, &graphdata);
+    graphdata.style = 2;
+    graphdata.ptype = 2;
+    KapaClearSections (kapa);
+    magSection.name = strcreate ("mag");
+    magSection.x  = 0;
+    magSection.dx = 1;
+    magSection.y  = 0.5;
+    magSection.dy = 0.5;
+    resSection.name = strcreate ("res");
+    resSection.x  = 0.0;
+    resSection.dx = 1.0;
+    resSection.y  = 0.0;
+    resSection.dy = 0.5;
+    
+    KapaSetFont (kapa, "helvetica", 14);
+    ALLOCATE (fitmags, float, Nfilter);
+    ALLOCATE (fiterrs, float, Nfilter);
+  }
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (selection)) == NULL) goto escape;
+
+  /* loop over regions, extract data for each region */
+  // XXX add interrupt checks
+  gprint (GP_ERR, "using %d possible regions\n", skylist[0].Nregions);
+  for (k = 0; k < skylist[0].Nregions; k++) {
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[k];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    // perform the fit to all sources
+    for (i = 0; i < catalog.Naverage; i++) {
+
+      // blank out the source array
+      for (j = 0; j < Nfilter; j++) {
+	sourceValue.mags[j] = 100;
+      }	
+
+      // load the measurements for this source
+      m = catalog.average[i].offset;
+      for (j = 0; j < catalog.average[i].Nm; j++) {
+	idx = hashcode[catalog.measure[m+j].photcode];
+	if (idx == -1) continue;
+	// XXX do something more clever if more than one value exists per photcode
+	sourceValue.mags[idx] = catalog.measure[m+j].M + vegaToAB[idx];
+	sourceError.mags[idx] = catalog.measure[m+j].dM;
+	if ((catalog.measure[m+j].photcode == USNOred) || (catalog.measure[m+j].photcode == USNOblu)) {
+	  sourceError.mags[idx] = 0.3;
+	}
+      }
+
+      // XXX for the moment, skip sources without ref color
+      if (sourceValue.mags[codeP] > 50) continue;
+      if (sourceValue.mags[codeM] > 50) continue;
+      color = sourceValue.mags[codeP] - sourceValue.mags[codeM];
+
+      // XXX find tableRow within 0.1 mag of color
+      start = SEDcolorBracket (SEDtable, Nrow, color);
+      minFit = SEDchisq (SEDtable[start], &sourceValue, &sourceError, Nfilter);
+      minFit.row = start;
+
+      // search for min chisq backwards
+      done = FALSE;
+      row = start - 1;
+      while (!done && (row > 0)) {
+	testFit = SEDchisq (SEDtable[row], &sourceValue, &sourceError, Nfilter);
+	if (testFit.chisq < minFit.chisq) {
+	  minFit = testFit;
+	  minFit.row = row;
+	}
+	if (fabs(SEDtable[row][0].color - color) > 0.5) done = TRUE;
+	row --;
+      }
+
+      // search for min chisq forwards
+      done = FALSE;
+      row = start + 1;
+      while (!done && (row < Nrow)) {
+	testFit = SEDchisq (SEDtable[row], &sourceValue, &sourceError, Nfilter);
+	if (testFit.chisq < minFit.chisq) {
+	  minFit = testFit;
+	  minFit.row = row;
+	}
+	if (fabs(SEDtable[row][0].color - color) > 0.5) done = TRUE;
+	row ++;
+      }
+
+      Nfit ++;
+      // create the vectors for the example plots
+      if (PLOT) {
+	// find plot range
+	SetLimitsRaw (NULL, SEDtable[minFit.row][0].mags, Nfilter, &graphdata);
+	SWAP (graphdata.ymin, graphdata.ymax);
+
+	KapaClearSections (kapa);
+	KapaSetSection (kapa, &magSection);
+    	KapaSetLimits (kapa, &graphdata);
+	KapaBox (kapa, &graphdata);
+	graphdata.color = KapaColorByName ("blue");
+	graphdata.etype = 0;
+	KapaPrepPlot (kapa, Nfilter, &graphdata);
+	KapaPlotVector (kapa, Nfilter, wavecode, "x");
+	KapaPlotVector (kapa, Nfilter, SEDtable[minFit.row][0].mags, "y");
+	graphdata.color = KapaColorByName ("red");
+	graphdata.etype = 1;
+	for (j = 0; j < Nfilter; j++) {
+	  fitmags[j] = 100;
+	  fiterrs[j] = 0;
+	  if (sourceValue.mags[j] > 50) continue;
+	  fitmags[j] = sourceValue.mags[j] - minFit.Md;
+	  fiterrs[j] = sourceError.mags[j];
+	}
+	KapaPrepPlot (kapa, Nfilter, &graphdata);
+	KapaPlotVector (kapa, Nfilter, wavecode, "x");
+	KapaPlotVector (kapa, Nfilter, fitmags, "y");
+	KapaPlotVector (kapa, Nfilter, fiterrs, "dym");
+	KapaPlotVector (kapa, Nfilter, fiterrs, "dyp");
+	KapaSendLabel (kapa, "model,fit (mags)", 1);
+
+	sprintf (line, "star: %10.6f %10.6f  T: %5.0fK  A_V|: %4.2f  M_D|: %5.2f  &sc&h^2|: %5.2f", 
+		 catalog.average[i].R, catalog.average[i].D, 
+		 SEDtable[minFit.row][0].Temp, SEDtable[minFit.row][0].Av, minFit.Md, minFit.chisq);
+	KapaSendLabel (kapa, line, 2);
+	KapaSendLabel (kapa, "model,fit (mags)", 1);
+
+	KapaSetSection (kapa, &resSection);
+	graphdata.ymin = -1.0;
+	graphdata.ymax = +1.0;
+    	KapaSetLimits (kapa, &graphdata);
+	KapaBox (kapa, &graphdata);
+	graphdata.color = KapaColorByName ("red");
+	graphdata.etype = 1;
+
+	for (j = 0; j < Nfilter; j++) {
+	  fitmags[j] = 100;
+	  fiterrs[j] = 0;
+	  if (sourceValue.mags[j] > 50) continue;
+	  fitmags[j] = sourceValue.mags[j] - minFit.Md - SEDtable[minFit.row][0].mags[j];
+	  fiterrs[j] = sourceError.mags[j];
+	}
+	KapaPrepPlot (kapa, Nfilter, &graphdata);
+	KapaPlotVector (kapa, Nfilter, wavecode, "x");
+	KapaPlotVector (kapa, Nfilter, fitmags, "y");
+	KapaPlotVector (kapa, Nfilter, fiterrs, "dym");
+	KapaPlotVector (kapa, Nfilter, fiterrs, "dyp");
+	KapaSendLabel (kapa, "wavelength (nm)", 0);
+	KapaSendLabel (kapa, "resid (mags)", 1);
+
+	KiiCursorOn (kapa);
+	while (KiiCursorRead (kapa, &X, &Y, &ZP, &RA, &DEC, key)) {
+	  gprint (GP_ERR, "window: %f %f (%s)\n", X, Y, key);
+	  if (!strcasecmp (key, "Q")) {
+	    KiiCursorOff (kapa);
+	    break;
+	  }
+	  if (!strcasecmp (key, "ESCAPE")) {
+	    KiiCursorOff (kapa);
+	    goto escape;
+	  }
+	}
+      }
+      // we now have the min chisq row. use this to supply the other filter values....
+    }
+    dvo_catalog_free (&catalog);
+  }
+  gprint (GP_ERR, "fitted %d stars\n", Nfit);
+  status = TRUE;
+  goto finish;
+  
+usage:
+  gprint (GP_ERR, "USAGE: fitset (sedtable) : (F) - (F)\n");
+  goto escape;
+
+table_missing:
+  gprint (GP_ERR, "ERROR: can't open the SED table\n");
+  goto escape;
+
+color_missing:
+  gprint (GP_ERR, "ERROR: reference color not in SED table\n");
+  goto escape;
+
+color_undefined:
+  gprint (GP_ERR, "ERROR: undefined photcode in reference color\n");
+  goto escape;
+
+code_missing:
+  gprint (GP_ERR, "ERROR: undefined photcode in SED table\n");
+  goto escape;
+
+escape:
+  status = FALSE;
+  goto finish;
+
+finish:
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  if (wavecode != NULL) free (wavecode);
+  if (hashcode != NULL) free (hashcode);
+  if (SEDtableRaw != NULL) {
+    for (i = 0; i < Nrow; i++) {
+      free (SEDtableRaw[i].mags);
+    }
+    free (SEDtableRaw);
+  }
+  if (SEDtable != NULL) free (SEDtable);
+  if (sourceValue.mags != NULL) free (sourceValue.mags);
+  if (sourceError.mags != NULL) free (sourceError.mags);
+
+  signal (SIGINT, oldsignal);
+  return (status);
+}
+
+// fit the data (with errors) to the given table row
+SEDfit SEDchisq (SEDtableRow *ref, SEDtableRow *data, SEDtableRow *error, int Nfilter) {
+
+  int i;
+  double Sm, Sd, S2, wt, dM;
+  SEDfit fit;
+
+  Sm = Sd = S2 = 0.0;
+
+  for (i = 0; i < Nfilter; i++) {
+    if (data[0].mags[i] > 50.0) continue;
+
+    if (error[0].mags[i] == 0.0) {
+      wt = 1.0;
+    } else {
+      wt = 1.0 / SQ(error[0].mags[i]);
+    }
+
+    dM = data[0].mags[i] - ref[0].mags[i];
+    S2 += SQ(dM) * wt;
+    Sm += dM * wt;
+    Sd += wt;
+  }
+    
+  // row is assigned after fit
+  fit.row = -1;
+  fit.Md = Sm / Sd;
+  fit.chisq = S2 + SQ(fit.Md) * Sd - 2*fit.Md*Sm;
+
+  return (fit);
+}
+
+// find the first table row within 0.1 mag of the requested color (or within 10)
+int SEDcolorBracket (SEDtableRow **table, int Ntable, float color) {
+
+  int Nlo, Nhi, N;
+  float tcolor;
+
+  N = Nlo = 0; Nhi = Ntable;
+  tcolor = table[Nlo][0].color;
+  while ((Nhi - Nlo > 10) && (fabs(tcolor-color) > 0.1)) {
+    N = 0.5*(Nlo + Nhi);
+    N = MAX (N, 0);
+    N = MIN (N, Ntable - 1);
+    tcolor = table[N][0].color;
+    if (tcolor < color) {
+      Nlo = N;
+    } else {
+      Nhi = N + 1;
+    }
+  }
+  return (N);
+}
+
+SEDtableRow **sort_SEDtable (SEDtableRow *raw, int N) {
+
+  int l,j,ir,i;
+  SEDtableRow **value, *temp;
+  
+  if (N <= 0) return (NULL);
+
+  ALLOCATE (value, SEDtableRow *, N);
+  for (i = 0; i < N; i++) {
+    value[i] = &raw[i];
+  }
+  if (N < 2) return (value);
+
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      l--;
+      temp = value[l];
+    }
+    else {
+      temp = value[ir];
+      value[ir] = value[0];
+      if (--ir == 0) {
+	value[0] = temp;
+	return (value);
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && value[j][0].color < value[j+1][0].color) ++j;
+      if (temp[0].color < value[j][0].color) {
+	value[i] = value[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    value[i] = temp;
+  }
+
+  return (value);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/gcat.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/gcat.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/gcat.c	(revision 15879)
@@ -0,0 +1,38 @@
+# include "dvoshell.h"
+
+int gcat (int argc, char **argv) {
+  
+  int i;
+  struct stat filestat;
+  double Ra, Dec, Radius;
+  SkyTable *sky;
+  SkyList *skylist;
+
+  if ((argc != 3) && (argc != 4)) {
+    gprint (GP_ERR, "USAGE: gcat RA DEC [Radius]\n");
+    return (FALSE);
+  }
+
+  /* load sky from correct table */
+  Ra = atof (argv[1]);
+  Dec = atof (argv[2]);
+  if (argc == 4) 
+    Radius = atof(argv[3]);
+  else 
+    Radius = 0.0001;
+
+  sky = GetSkyTable ();
+  skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius);
+
+  for (i = 0; i < skylist[0].Nregions; i++) {
+    if (stat (skylist[0].filename[i], &filestat) != -1) {
+      gprint (GP_ERR, "%3d %s *\n", i, skylist[0].regions[i][0].name);
+    } else {
+      gprint (GP_ERR, "%3d %s\n", i, skylist[0].regions[i][0].name);
+    } 
+    set_str_variable ("CATNAME", skylist[0].filename[i]);
+  }
+
+  return (TRUE);
+  SkyListFree (skylist);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/get_regions.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/get_regions.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/get_regions.c	(revision 15879)
@@ -0,0 +1,50 @@
+# include "dvoshell.h"
+
+/* return region files containing given image */
+GSCRegion *get_regions (Image *image, int *Nregions) {
+  
+  GSCRegion *region;
+  FILE *f;
+  double x, y;
+  double dec, ra;
+  int j, done, nregion, NREGION;
+  char filename[256], path[256];
+  
+  VarConfig ("CATDIR", "%s", path);
+  VarConfig ("GSCFILE", "%s", filename);
+  f = fopen (filename, "r");
+  if (f == NULL) {
+    gprint (GP_ERR, "ERROR: can't find GSC region file %s\n", filename);
+    exit (0);
+  }
+  
+  /* find regions at image corners */
+  NREGION = 10;
+  ALLOCATE (region, GSCRegion, NREGION);
+  nregion = 0;
+
+  /* look for new regions on grid across image */ 
+  for (x = 0.0; x <= 1.0; x+=0.25) {
+    for (y = 0.0; y <= 1.0; y+=0.25) {
+      XY_to_RD (&ra, &dec, image[0].NX*(1.1*x - 0.05), image[0].NY*(1.1*y - 0.05), &image[0].coords);
+      aregion (&region[nregion], f, ra, dec, path);
+      done = FALSE;
+      for (j = 0; (j < nregion) && !done; j++) {
+	if (!strcmp (region[nregion].filename, region[j].filename)) {
+	  nregion --;
+	  done = TRUE;
+	}
+      }
+      nregion ++;
+      if (nregion == NREGION) {
+	NREGION += 10;
+	REALLOCATE (region, GSCRegion, NREGION);
+      }
+    }
+  }
+  *Nregions = nregion;
+  
+  fclose (f);
+  return (region);
+  
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/getxtra.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/getxtra.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/getxtra.c	(revision 15879)
@@ -0,0 +1,63 @@
+# include "dvoshell.h"
+
+int getxtra (int argc, char **argv) {
+  
+  SelectXtra = (char *) NULL;
+  if (N = get_argument (argc, argv, "-xtra")) {
+    SelectXtra = TRUE;
+    remove_argument (N, &argc, argv);
+    XtraType = strcreate (atof[N]);
+    remove_argument (N, &argc, argv);
+    XtraValue = strcreate (atof[N]);
+    remove_argument (N, &argc, argv);
+  }
+  SelectRegion = (char *) NULL;
+  if (N = get_argument (argc, argv, "-region")) {
+    SelectRegion = TRUE;
+    remove_argument (N, &argc, argv);
+    RA = atof (atof[N]);
+    remove_argument (N, &argc, argv);
+    Dec = atof (atof[N]);
+    remove_argument (N, &argc, argv);
+    Radius = atof (atof[N]);
+    remove_argument (N, &argc, argv);
+  }
+  Mode = (char *) NULL;
+  if (N = get_argument (argc, argv, "-mode")) {
+    remove_argument (N, &argc, argv);
+    Mode = strcreate (atof[N]);
+    remove_argument (N, &argc, argv);
+  }
+  Range = (char *) NULL;
+  if (N = get_argument (argc, argv, "-range")) {
+    remove_argument (N, &argc, argv);
+    Range = strcreate (atof[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 6) {
+    gprint (GP_ERR, "USAGE: addxtra R D radius (type) (value)\n");
+    return (FALSE);
+  }
+  
+  
+
+  /*
+
+  validate the input values (type, defines the needed options)
+  find catalog (based on r,d)
+  load catalog (need to load measures?)
+  find the object
+  find the xtra entry (sorted by ra/dec? sorted by averef?)
+  add new entry
+  save catalog 
+  */
+}
+
+/* 
+   get specified values for specified objects 
+
+   getxtra type -xtra name K01.01 
+   getxtra type -region R D radius 
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/gimages.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/gimages.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/gimages.c	(revision 15879)
@@ -0,0 +1,184 @@
+# include "dvoshell.h"
+
+// XXX this needs some help: it should define the region for image_subset or otherwise
+// limit the input selection
+int gimages (int argc, char **argv) {
+  
+  int i, j, N, Nimage, Nfound, *subset, Nsubset, status;
+  double ra, dec, Ra, Dec, X, Y, Yo;
+  double trange, t;
+  int TimeSelect, PixelCoords, TimeFormat, PhotCodeSelect;
+  time_t tzero, TimeReference;
+  char name[64], *date;
+  int typehash;
+  SkyRegionSelection *selection;
+
+  PhotCode *code;
+  Image *image;
+
+  if (!InitPhotcodes ()) return (FALSE);
+
+  GetTimeFormat (&TimeReference, &TimeFormat);
+
+  // parse skyregion options
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) {
+    gprint (GP_ERR, "invalid sky region selection\n");
+    return FALSE;
+  }
+
+  TimeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-time"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    TimeSelect = TRUE;
+  }
+  if ((N = get_argument (argc, argv, "-tref"))) {
+    remove_argument (N, &argc, argv);
+    TimeSelect = TRUE;
+
+    t = atof (argv[N]);
+    tzero = TimeRef (t, TimeReference, TimeFormat);
+    remove_argument (N, &argc, argv);
+
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+  }
+
+  code = NULL;
+  PhotCodeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-photcode"))) {
+    remove_argument (N, &argc, argv);
+    if ((code = GetPhotcodebyName (argv[N])) == NULL) {
+      gprint (GP_ERR, "ERROR: photcode not found in photcode table\n");
+      return (FALSE);
+    }
+    PhotCodeSelect = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  PixelCoords = FALSE;
+  if ((N = get_argument (argc, argv, "-pix"))) {
+    remove_argument (N, &argc, argv);
+    PixelCoords = TRUE;
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: gimages RA DEC [-time t dt] [-pix]\n");
+    return (FALSE);
+  }
+
+  if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
+
+  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
+  image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, trange, TimeSelect);
+  BuildChipMatch (image, Nimage);
+
+  int DistortImage = wordhash ("-DIS");
+  int TriangleUp   = wordhash ("TRP-");
+  int TriangleDn   = wordhash ("TRM-");
+
+  Nfound = 0;
+  for (j = 0; j < Nsubset; j++) {
+    i = subset[j];
+    if (PhotCodeSelect) {
+      if ((code[0].type == PHOT_REF) || (code[0].type == PHOT_DEP)) {
+	if (code[0].code != image[i].photcode) continue;
+      } 
+      if (code[0].type == PHOT_SEC) {
+	if (code[0].code != GetPhotcodeEquivCodebyCode (image[i].photcode)) continue;
+      } 
+    }      
+    if (!FindMosaicForImage (image, Nimage, i)) continue;
+
+    status = RD_to_XY (&X, &Y, Ra, Dec, &image[i].coords);
+    if (!finite(X)) continue;
+    if (!finite(Y)) continue;
+    if (!status) continue;
+
+    typehash = wordhash (&image[i].coords.ctype[4]);
+
+    if (typehash == DistortImage) {
+      if (X < -0.5*image[i].NX) continue;
+      if (Y < -0.5*image[i].NY) continue;
+      if (X > +0.5*image[i].NX) continue;
+      if (Y > +0.5*image[i].NY) continue;
+      goto got_spot;
+    } 
+
+    typehash = wordhash (image[i].coords.ctype);
+    if (typehash == TriangleUp) {
+      if (Y < -0.5*image[i].NY) continue;
+      Yo = +0.5*image[i].NY + 2.0*(image[i].NY/image[i].NX)*X;
+      if (Y > Yo) continue;
+      Yo = +0.5*image[i].NY - 2.0*(image[i].NY/image[i].NX)*X;
+      if (Y > Yo) continue;
+      goto got_spot;
+    }
+    if (typehash == TriangleDn) {
+      if (Y > +0.5*image[i].NY) continue;
+      Yo = -0.5*image[i].NY + 2.0*(image[i].NY/image[i].NX)*X;
+      if (Y < Yo) continue;
+      Yo = -0.5*image[i].NY - 2.0*(image[i].NY/image[i].NX)*X;
+      if (Y < Yo) continue;
+      goto got_spot;
+    }
+
+    {
+      if (X < 0) continue;
+      if (Y < 0) continue;
+      if (X > image[i].NX) continue;
+      if (Y > image[i].NY) continue;
+    }
+
+    /*** XXX we need to re-introduce the use of applyMcal
+    Mcal = applyMcal (&image[i], 2048.0, 2048.0);
+    ***/
+
+  got_spot:
+    date = ohana_sec_to_date (image[i].tzero);
+
+    if (PixelCoords) {
+      gprint (GP_LOG, "%3d %s %6.1f %6.1f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x\n", 
+	       Nfound, image[i].name, X, Y, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].code);
+    } else {
+      XY_to_RD (&ra, &dec, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
+      gprint (GP_LOG, "%3d %s %8.4f %8.4f %20s %5d %2d %4.2f %6.3f %5.3f %5.3f %4x\n", 
+	       Nfound, image[i].name, ra, dec, date, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal, image[i].exptime, image[i].code);
+    }
+    sprintf (name, "IMAGEx:%d", Nfound);
+    set_variable     (name, X);
+    sprintf (name, "IMAGEy:%d", Nfound);
+    set_variable     (name, Y);
+    sprintf (name, "IMAGEt:%d", Nfound);
+    set_str_variable (name, date);
+    sprintf (name, "IMAGEccd:%d", Nfound);
+    set_int_variable (name, image[i].ccdnum);
+    sprintf (name, "IMAGEname:%d", Nfound);
+    set_str_variable (name, image[i].name);
+    Nfound ++;
+    free (date);
+  }
+  set_int_variable ("IMAGEx:n", Nfound);
+  set_int_variable ("IMAGEy:n", Nfound);
+  set_int_variable ("IMAGEt:n", Nfound);
+  set_int_variable ("IMAGEccd:n", Nfound);
+  set_int_variable ("IMAGEname:n", Nfound);
+
+  free (image);
+  free (subset);
+
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/gstar.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/gstar.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/gstar.c	(revision 15879)
@@ -0,0 +1,356 @@
+# include "dvoshell.h"
+
+void initPhotcodeSequence (int Nsecfilt);
+void freePhotcodeSequence ();
+void printPhotcodeSequence (Average *average, SecFilt *secfilt, int entry, int type);
+
+int gstar (int argc, char **argv) {
+  
+  char *date;
+  double Ra, Dec, Radius, Radius2, r, dec0, dec1;
+  double Mcat, Mrel;
+  float *RA, *DEC;
+  int i, j, k, m, N, *N1, Nsecfilt, NPTS, QUIET, FULL_OUTPUT;
+  int Nstars, found, GetMeasures, Nlo, Nhi;
+  int SaveVectors;
+  Vector *vec1, *vec2, *vec3, *vec4;
+  SkyTable *sky;
+  SkyList *skylist;
+  Catalog catalog;
+  int TimeFormat;
+  time_t TimeReference;
+
+  if (!InitPhotcodes ()) return (FALSE);
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  QUIET = FALSE;
+  if ((N = get_argument (argc, argv, "-q"))) {
+    QUIET = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  NPTS = 0;
+  vec1 = vec2 = vec3 = vec4 = NULL;
+  SaveVectors = FALSE;
+  if ((N = get_argument (argc, argv, "-save"))) {
+    remove_argument (N, &argc, argv);
+    SaveVectors = TRUE;
+    if ((vec1 = SelectVector ("gs:m", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    if ((vec2 = SelectVector ("gs:t", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    if ((vec3 = SelectVector ("gs:z", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    if ((vec4 = SelectVector ("gs:f", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  }
+
+  FULL_OUTPUT = FALSE;
+  if ((N = get_argument (argc, argv, "-full"))) {
+    FULL_OUTPUT = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  GetMeasures = FALSE;
+  if ((N = get_argument (argc, argv, "-m"))) {
+    GetMeasures = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+  if ((N = get_argument (argc, argv, "-meas"))) {
+    GetMeasures = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: gstar RA DEC Radius [-m]\n");
+    return (FALSE);
+  }
+  
+  GetTimeFormat (&TimeReference, &TimeFormat);
+
+  Ra = atof (argv[1]);
+  Dec = atof (argv[2]);
+  Radius = atof (argv[3]);
+
+  while (Ra < 0.0) Ra += 360.0;
+  while (Ra > 360.0) Ra -= 360.0;
+  
+  /* load sky from correct table */
+  sky = GetSkyTable ();
+  skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius);
+
+  if (skylist[0].Nregions > 1) {
+    gprint (GP_ERR, "warning, radius overlaps region boundary, not yet implemented\n");
+  }
+
+  /* lock, load, unlock catalog */
+  catalog.filename = skylist[0].filename[0];
+  catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+  catalog.Nsecfilt = 0;
+
+  // an error exit status here is a significant error
+  if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+  }
+  dvo_catalog_unlock (&catalog);
+
+  Nstars = catalog.Naverage;
+  ALLOCATE (RA, float, Nstars);
+  ALLOCATE (DEC, float, Nstars);
+  ALLOCATE (N1, int, Nstars);
+
+  /* find star(s) in RA, DEC list -- use a dumb algorithm for now, improve later */
+  /* stars are not guaranteed to be sorted in RA or in DEC, so first sort the list */
+  for (i = 0; i < Nstars; i++) {
+    RA[i] = catalog.average[i].R;
+    DEC[i] = catalog.average[i].D;
+    N1[i] = i;
+  }
+  /* sort list by DEC */
+  if (Nstars > 1) sort_lists (DEC, RA, N1, Nstars);
+  /* at this point, RA, DEC, and N1 are sorted by DEC.  
+     catalog.average[N1[i]].R = RA[i] */
+
+  /* bracket the RA range of interest */
+  dec0 = Dec - Radius;
+  dec1 = Dec + Radius;
+
+  Nlo = 0; Nhi = catalog.Naverage;
+  while (Nhi - Nlo > 10) {
+    N = 0.5*(Nlo + Nhi);
+    if (DEC[N] < dec0) {
+      Nlo = N;
+    } else {
+      Nhi = N + 1;
+    }
+  }
+  /* DEC[Nlo] is guaranteed to be just lower than dec0 */
+
+  Radius2 = Radius*Radius;
+  found = FALSE;
+
+  /* data has been loaded, get ready to plot it */
+  if (SaveVectors) {
+    N = 0;
+    NPTS = 1000;
+    ALLOCATE (vec1[0].elements, float, NPTS);
+    ALLOCATE (vec2[0].elements, float, NPTS);
+    ALLOCATE (vec3[0].elements, float, NPTS);
+    ALLOCATE (vec4[0].elements, float, NPTS);
+  }
+
+  initPhotcodeSequence (Nsecfilt);
+
+  for (i = Nlo; (i < catalog.Naverage) && !found; i++) {
+
+    if (dec0 > DEC[i]) continue;
+    if (dec1 < DEC[i]) found = TRUE;
+    
+    r = SQ(Dec - DEC[i]) + SQ(Ra - RA[i]);
+    if (r < Radius2) {
+      k = N1[i];
+      if (!QUIET) {
+	gprint (GP_LOG, "star: %d\n", k);
+	gprint (GP_LOG, "%11.7f ", catalog.average[k].R);
+	gprint (GP_LOG, "%11.7f ", catalog.average[k].D);
+	gprint (GP_LOG, "%3d   ",  catalog.average[k].Nm);
+	gprint (GP_LOG, "%4.1f ",  0.01*catalog.average[k].Xp);
+	gprint (GP_LOG, "%5d",     catalog.average[k].code);
+
+	if (FULL_OUTPUT) {
+	    gprint (GP_LOG, "%f",     catalog.average[k].dR);
+	    gprint (GP_LOG, "%f",     catalog.average[k].dD);
+	    gprint (GP_LOG, "%f",     catalog.average[k].uR);
+	    gprint (GP_LOG, "%f",     catalog.average[k].uD);
+	    gprint (GP_LOG, "%f",     catalog.average[k].duR);
+	    gprint (GP_LOG, "%f",     catalog.average[k].duD);
+	    gprint (GP_LOG, "%f",     catalog.average[k].P);
+	    gprint (GP_LOG, "%f",     catalog.average[k].dP);
+	    gprint (GP_LOG, "%x",     catalog.average[k].objID_hi);
+	    gprint (GP_LOG, "%x",     catalog.average[k].objID_lo);
+	}
+
+	gprint (GP_LOG, "\n");
+      
+	/* filter names */
+	for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, 3);
+	gprint (GP_LOG, "\n");
+
+	/* average mags */
+	for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, 0);
+	gprint (GP_LOG, "\n");
+
+	/* average mag errors */
+	for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, 1);
+	gprint (GP_LOG, "\n");
+
+	/* average mag chisq */
+	for (j = 0; j < Nsecfilt; j++) printPhotcodeSequence (&catalog.average[k], &catalog.secfilt[Nsecfilt*k], j, 2);
+	gprint (GP_LOG, "\n");
+      }
+
+      if (GetMeasures || SaveVectors) {
+	m = catalog.average[k].offset;
+	for (j = 0; j < catalog.average[k].Nm; j++, m++) {
+
+	  Mcat = PhotCat (&catalog.measure[m]);
+	  Mrel = PhotRel (&catalog.measure[m], &catalog.average[k], &catalog.secfilt[k*Nsecfilt]);
+
+	  if (GetMeasures && !QUIET) {
+	    date = ohana_sec_to_date (catalog.measure[m].t);
+	    gprint (GP_LOG, "%6.3f ",  Mcat);
+	    gprint (GP_LOG, "%6.3f ",  Mrel);
+	    gprint (GP_LOG, "%5.3f  ", catalog.measure[m].dM);
+	    gprint (GP_LOG, "%20s  ",  date);
+	    gprint (GP_LOG, "%7.4f ",  catalog.measure[m].dR);
+	    gprint (GP_LOG, "%7.4f",   catalog.measure[m].dD);
+	    gprint (GP_LOG, "%2d ",    catalog.measure[m].dophot);
+	    gprint (GP_LOG, "%3x ",    catalog.measure[m].dbFlags);
+	    gprint (GP_LOG, "%3d ",    catalog.measure[m].photcode);
+	    gprint (GP_LOG, "%-20s  ", GetPhotcodeNamebyCode (catalog.measure[m].photcode));
+
+	    if (FULL_OUTPUT) {
+		gprint (GP_LOG, "%f", catalog.measure[m].Mcal);
+		gprint (GP_LOG, "%f", catalog.measure[m].Mgal);
+		gprint (GP_LOG, "%f", pow(10.0, 0.4*catalog.measure[m].dt));
+		gprint (GP_LOG, "%f", 1.0 + catalog.measure[m].airmass);
+		gprint (GP_LOG, "%f", catalog.measure[m].az);
+		gprint (GP_LOG, "%f", catalog.measure[m].Xccd);
+		gprint (GP_LOG, "%f", catalog.measure[m].Yccd);
+		gprint (GP_LOG, "%d", catalog.measure[m].dXccd);
+		gprint (GP_LOG, "%d", catalog.measure[m].dYccd);
+		gprint (GP_LOG, "%f", catalog.measure[m].Sky);
+		gprint (GP_LOG, "%f", catalog.measure[m].dSky);
+		gprint (GP_LOG, "%d", catalog.measure[m].averef);
+		gprint (GP_LOG, "%d", catalog.measure[m].detID);
+		gprint (GP_LOG, "%d", catalog.measure[m].imageID);
+		gprint (GP_LOG, "%f", catalog.measure[m].qPSF);
+		gprint (GP_LOG, "%f", catalog.measure[m].psfProb);
+		gprint (GP_LOG, "%f", catalog.measure[m].crNsigma);
+		gprint (GP_LOG, "%f", catalog.measure[m].extNsigma);
+		gprint (GP_LOG, "%f", 0.01*catalog.measure[m].FWx);
+		gprint (GP_LOG, "%f", 0.01*catalog.measure[m].FWy);
+		gprint (GP_LOG, "%f", (360.0/(float)0xffff)*catalog.measure[m].theta);
+
+		gprint (GP_LOG, "%x", catalog.measure[m].photFlags);
+		gprint (GP_LOG, "%d", catalog.measure[m].stargal);
+	    }
+	    gprint (GP_LOG, "\n");
+
+	    free (date);
+	  }
+	  
+	  if (SaveVectors) {
+	    vec1[0].elements[N] = Mcat;
+	    vec2[0].elements[N] = TimeValue (catalog.measure[m].t, TimeReference, TimeFormat);
+	    vec3[0].elements[N] = catalog.measure[m].airmass;
+	    vec4[0].elements[N] = catalog.measure[m].photcode;
+	    N ++;
+	    if (N == NPTS - 1) {
+	      NPTS += 2000;
+	      REALLOCATE (vec1[0].elements, float, NPTS);
+	      REALLOCATE (vec2[0].elements, float, NPTS);
+	      REALLOCATE (vec3[0].elements, float, NPTS);
+	      REALLOCATE (vec4[0].elements, float, NPTS);
+	    }
+	  }
+	}
+      }
+    }
+  }
+
+  if (SaveVectors) {
+    vec1[0].Nelements = N;
+    vec2[0].Nelements = N;
+    vec3[0].Nelements = N;
+    vec4[0].Nelements = N;
+  }
+
+  free (RA);
+  free (DEC);
+  free (N1);
+  dvo_catalog_free (&catalog);
+
+  freePhotcodeSequence ();
+  return (TRUE);
+
+}
+
+void print_double (double value) {
+  if (isnan(value)) 
+    gprint (GP_LOG, "NaN    ");
+  else 
+    gprint (GP_LOG, "%6.3f ", value);
+}
+
+void print_short (double value, short int ival) {
+  if (ival == NAN_S_SHORT) 
+    gprint (GP_LOG, "NaN    ");
+  else 
+    gprint (GP_LOG, "%6.3f ", value);
+}
+
+// XXX fix printing to be in photcode numerical order for PRI/SEC data
+static int *sequence = NULL;
+
+void initPhotcodeSequence (int Nsecfilt) {
+
+  int j;
+  int *codeNumber;
+  PhotCode *code;
+
+  // sequence contains, in desired order, secfilt number (0 == pri)
+  ALLOCATE (sequence, int, Nsecfilt);
+  ALLOCATE (codeNumber, int, Nsecfilt);
+  
+  /* filter names -- primary code is 0 in this function */
+  for (j = 0; j < Nsecfilt; j++) {
+    code = GetPhotcodebyNsec (j);
+    codeNumber[j] = code[0].code;
+    sequence[j] = j;
+  }
+
+  isort_pair (codeNumber, sequence, Nsecfilt);
+  free (codeNumber);
+}
+
+void freePhotcodeSequence () {
+  free (sequence);
+}
+
+
+void printPhotcodeSequence (Average *average, SecFilt *secfilt, int entry, int type) {
+
+  int seq;
+  PhotCode *code;
+
+  seq = sequence[entry];
+
+  switch (type) {
+    case 0: /* average mags */
+      if (seq == -1) {
+	print_double (NAN);
+      } else {
+	print_double (secfilt[seq].M);
+      }
+      break;
+
+    case 1: /* average mags errors */
+      if (seq == -1) {
+	print_double (NAN);
+      } else {
+	print_double (secfilt[seq].dM);
+      }
+      break;
+
+    case 2: /* average mag chisq */
+      if (seq == -1) {
+	print_short (NAN_S_SHORT, NAN_S_SHORT);
+      } else {
+	print_short (pow (10.0, 0.01*secfilt[seq].Xm), secfilt[seq].Xm);
+      }
+      break;
+
+    case 3: /* filter names */
+      code = GetPhotcodebyNsec (seq);
+      gprint (GP_LOG, "%-6s ", code[0].name);
+      break;
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/Photometry
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/Photometry	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/Photometry	(revision 15879)
@@ -0,0 +1,26 @@
+
+cals: Plot residuals for reference stars. 
+
+ This function takes the currently displayed region and looks for all
+ stars which have 'reference' photometry and plots the difference
+ between the reference magnitude (in the given filter) and the
+ observed magnitude (same filter) versus one of several options:  the
+ star color (based on the 'reference' photometry), the star magnitude,
+ the airmass, time, secqunce, etc.
+
+ These plots can use one of two options for the 'observed' magnitude.
+ Either, the magnitude for individual measurement, using the currently
+ set values for the CCD zeropoints (from the photometry database), or
+ using the relative photometry determined for the particular star.  
+
+
+dmags: plot difference between two measured magnitudes
+
+resid: 
+
+abszero
+
+zeropts
+
+cmd
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/catalog
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/catalog	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/catalog	(revision 15879)
@@ -0,0 +1,74 @@
+
+  catalog (filename/-all) [many options!]
+
+  plot the star positions from any of several possible catalogs.  By
+default, the photometry database (see Database) is used, but the HST
+Guide Star Catalog and a simple ASCII file may also be used.  The
+plotting is done on window 0, with the current point type.  The point
+size can be scaled by the magnitude of the star or by the number
+of observations (-n).  
+
+There are many options to this function.  Here they are all:
+
+-e epoch: given ASCII catalog has this epoch, plot in J2000
+
+-ID ID: plot only measurements with this ID number
+ ID may be one of:
+	0 - star
+	4 - variable
+	5 - transient
+      100 - ghost image
+      101 - trail (satellite)
+      102 - bright star garbage	
+      note that numbers < 50 are static objects, 
+	and numbers > 100 are bad data.
+
+-all:  plot all data for the current display region
+
+-g: use the HST GSC instead of the photometry database
+
+-a RA DEC MAG:  the given file is an ASCII file with 
+	RA, DEC, and MAG in columns given by the three numbers
+
+-v ra dec scale: save the values in vectors with the three names given
+	the ra and dec are always used, but the third is the size of 
+	the points plotted, based on whatever the scaling is.
+
+-m m1 m2: scale points by magnitude, with smallest points having
+	magnitude m2.
+
++n n1 n2: scale points by number of measurements, with smallest points
+	having number n1.
+
+-n n1 n2: scale points by number of missing values, with smallest points
+	having number n1.
+
+Note that if two of -m, -n, +n are given, the first determines the
+ scaling of the points.  the second provides an allowed range, so
+ points are only plotted if the second parameter has a value in the
+ given range.
+
+Examples: 
+
+  catalog -all -m 12 18  
+    plot all stars in current region with magnitude 12 having the
+    biggest points and magnitude 18 having the smallest.
+   
+  catalog -all -m 12 18 +n 2 4
+    plot all stars in current region with magnitude 12 having the
+    biggest points and magnitude 18 having the smallest, but only
+    if the stars have 2-4 measurements each
+   
+  catalog -all -m 12 18 +n 0 1 -ID 101
+    plot all stars in current region with magnitude 12 having the
+    biggest points and magnitude 18 having the smallest, but only
+    if the stars have 1 measurements each, and if the object is 
+    found to be a trail.
+   
+  catalog n2230/1819.cpt -n 2 8  
+    plot all stars in catalog n2230/1819.cpt with the biggest points
+    having 8 measurements and the smallest having only 2.
+
+  See Also: lcat, pcat, style, region
+
+   
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/images
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/images	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/images	(revision 15879)
@@ -0,0 +1,9 @@
+
+  images 
+
+  plot the outlines of images in the photometry database and list
+  along with relevant information.  An example of relevant data is the
+  image time, which can be used in other functions to define a specific
+  image or a range of images relevant for the function.
+
+  See also: Database, lcat, pcat
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/imstats
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/imstats	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/imstats	(revision 15879)
@@ -0,0 +1,5 @@
+
+  imstats 
+
+  list interesting statistics for a set of images.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/lcat
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/lcat	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/lcat	(revision 15879)
@@ -0,0 +1,10 @@
+
+  lcat [-all]
+
+  list photometry database files in the current region.  if the option
+  -all is given, all database in the region are listed, along with a
+  comment to show if there is data in the file or not.  if the option
+  is not given, only those files with data are listed.
+
+  See also: region, pcat
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/lcurve
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/lcurve	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/lcurve	(revision 15879)
@@ -0,0 +1,8 @@
+
+  lcurve RA DEC Radius [-l]
+
+  plot light curves for all stars within Radius of the given
+  coordinates.  The units for all three are decimal degrees.  
+  The option -l autoscales the limits of the plot.  
+
+  See also: limits
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/mextract
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/mextract	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/mextract	(revision 15879)
@@ -0,0 +1,12 @@
+
+ mextract (filename) (value) [-g / -a Ncol]
+
+ extracts a vector from the photometry database.  The name also
+ specifies the type of data extracted (and is case insensitive).  Only
+ certain names may be used.
+
+ The possible values are:
+ ra, dec, mag, dmag, Mcal, Mrel, source, time, dR, dD
+
+
+ Note: this routine extracts the individual measurements.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/pcat
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/pcat	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/pcat	(revision 15879)
@@ -0,0 +1,9 @@
+
+  pcat [-all]
+
+  plot outlines of photometry database files in the current region.
+  if the option -all is given, all database in the region are listed.
+  if the option is not given, only those files with data are listed.
+
+  See also: region, lcat
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/resid
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/resid	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/resid	(revision 15879)
@@ -0,0 +1,12 @@
+
+  resid [-im time] [-X] [-l] (photometry file)
+
+  plot the photometry residuals for a photometry database file. 
+  For every star in the database, the average magnitude is plotted 
+  vs the difference between the average magnitude and each existing 
+  measurement for that star.  
+
+  -l		automatically set the plot limits.
+  -X		plot residual divided by photometric error
+  -im time	only plot the residuals for one of the images 
+		in the database, specified by the obseravation time.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/simage
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/simage	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/help/simage	(revision 15879)
@@ -0,0 +1,7 @@
+
+  simage (filename)
+
+  plot the positions of stars in a CMP file.  This function is a
+  useful test for image comparisons, and astrometry must be determined
+  before the function is run.
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/images.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/images.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/images.c	(revision 15879)
@@ -0,0 +1,301 @@
+# include "dvoshell.h"
+# define BETA 0.41421
+
+int wordhash (char *word) {
+  int value;
+
+  value = *(int *)word;
+  return value;
+}
+
+int images (int argc, char **argv) {
+
+  int i, j, Nimage, status, InPic, leftside, *plist, TimeSelect, ByName;
+  int WITH_MOSAIC, SOLO_MOSAIC, HIDDEN;
+  time_t tzero, tend;
+  int N, NPTS, n, npts, Npts, kapa;
+  Vector Xvec, Yvec;
+  double r[8], d[8], x[8], y[8], Rmin, Rmax, Rmid, trange, Radius;
+  Image *image;
+  Graphdata graphmode;
+  char name[256];
+  int typehash;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) goto usage;
+
+  WITH_MOSAIC = FALSE;
+  if ((N = get_argument (argc, argv, "+mosaic"))) {
+    remove_argument (N, &argc, argv);
+    WITH_MOSAIC = TRUE;
+  }
+
+  SOLO_MOSAIC = FALSE;
+  if ((N = get_argument (argc, argv, "-mosaic"))) {
+    remove_argument (N, &argc, argv);
+    SOLO_MOSAIC = TRUE;
+    WITH_MOSAIC = TRUE;
+  }
+
+  HIDDEN = FALSE;
+  if ((N = get_argument (argc, argv, "-hidden"))) {
+    remove_argument (N, &argc, argv);
+    HIDDEN = TRUE;
+  }
+
+  ByName = FALSE;
+  if ((N = get_argument (argc, argv, "-name"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (name, argv[N]);
+    remove_argument (N, &argc, argv);
+    ByName = TRUE;
+  }
+
+  Radius = 45;
+  if ((N = get_argument (argc, argv, "-radius"))) {
+    remove_argument (N, &argc, argv);
+    Radius = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  TimeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-time"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) {
+      gprint (GP_ERR, "syntax error\n");
+      goto usage;
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      goto usage;
+    }
+    remove_argument (N, &argc, argv);
+    if (trange < 0) {
+      trange = fabs (trange);
+      tzero -= trange;
+    }
+    TimeSelect = TRUE;
+  }
+  if ((N = get_argument (argc, argv, "-trange"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      goto usage;
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tend)) { 
+      gprint (GP_ERR, "syntax error\n");
+      goto usage;
+    }
+    remove_argument (N, &argc, argv);
+    trange = tend - tzero;
+    if (trange < 0) {
+      trange = fabs (trange);
+      tzero -= trange;
+    }
+    TimeSelect = TRUE;
+  }
+ 
+  if (argc != 1) goto usage;
+  
+  /* it is not an error for the database not to have any images */
+  if ((image = LoadImages (&Nimage)) == NULL) return (TRUE);
+  BuildChipMatch (image, Nimage);
+
+  Rmin = graphmode.coords.crval1 - 180.0;
+  Rmax = graphmode.coords.crval1 + 180.0;
+  Rmid = 0.5*(Rmin + Rmax);
+  
+  int DistortImage = wordhash ("-DIS");
+  int TriangleUp   = wordhash ("TRP-");
+  int TriangleDn   = wordhash ("TRM-");
+  int TrianglePts  = wordhash ("TRI-");
+
+  npts = NPTS = 200;
+  ALLOCATE (Xvec.elements, float, NPTS);
+  ALLOCATE (Yvec.elements, float, NPTS);
+  ALLOCATE (plist, int, NPTS);
+  n = N = 0;
+  for (i = 0; i < Nimage; i++) {
+    if (ByName && strcmp (name, image[i].name)) continue;
+    if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue;
+    if (!FindMosaicForImage (image, Nimage, i)) continue;
+
+    Npts = 4;
+    status = TRUE;
+    leftside = FALSE;
+
+    typehash = wordhash (&image[i].coords.ctype[4]);
+
+    /* DIS images represent a field, not a chip */
+    if ((typehash == DistortImage) && !WITH_MOSAIC) continue;
+    if ((typehash != DistortImage) &&  SOLO_MOSAIC) continue;
+    if (typehash == DistortImage) {
+      x[0] = -0.5*image[i].NX; y[0] = -0.5*image[i].NY;
+      x[1] = +0.5*image[i].NX; y[1] = -0.5*image[i].NY;
+      x[2] = +0.5*image[i].NX; y[2] = +0.5*image[i].NY;
+      x[3] = -0.5*image[i].NX; y[3] = +0.5*image[i].NY;
+      goto got_type;
+    }
+
+    typehash = wordhash (image[i].coords.ctype);
+    if (typehash == TriangleUp) {
+      Npts = 3;
+      x[0] =                0; y[0] = +0.5*image[i].NY;
+      x[1] = +0.5*image[i].NX; y[1] = -0.5*image[i].NY;
+      x[2] = -0.5*image[i].NX; y[2] = -0.5*image[i].NY;
+      goto got_type;
+    }
+    if (typehash == TriangleDn) {
+      Npts = 3;
+      x[0] =                0; y[0] = -0.5*image[i].NY;
+      x[1] = +0.5*image[i].NX; y[1] = +0.5*image[i].NY;
+      x[2] = -0.5*image[i].NX; y[2] = +0.5*image[i].NY;
+      goto got_type;
+    }
+    // For 'TrianglePts' (TRI-), we are using the Mx,My, etc terms to save the coordinates
+    // this means triangular images cannot carry photometric zero-point variations
+    if (typehash == TrianglePts) {
+      Npts = 3;
+      x[0] = image[i].Mx;   y[0] = image[i].My;
+      x[1] = image[i].Mxxx; y[1] = image[i].Mxyy;
+      x[2] = image[i].Mxxy; y[2] = image[i].Myyy;
+      goto got_type;
+    }
+
+    // default layout
+    {
+      x[0] = 0;           y[0] = 0;
+      x[1] = image[i].NX; y[1] = 0;
+      x[2] = image[i].NX; y[2] = image[i].NY;
+      x[3] = 0;           y[3] = image[i].NY;
+    }
+
+  got_type:
+
+    /* project this image to screen display coords */
+    // check for boundary overlap?
+    for (j = 0; j < Npts; j++) {
+      status = XY_to_RD (&r[j], &d[j], x[j], y[j], &image[i].coords);
+      if (!status) break;
+      while (r[j] < Rmin) { r[j] += 360.0; }
+      while (r[j] > Rmax) { r[j] -= 360.0; }
+      if (j == 0) {
+	leftside = (r[j] < Rmid);
+      } 
+      if (j > 0) { 
+	if ( leftside && (r[j] > Rmid + 90)) { r[j] -= 360.0; }
+	if (!leftside && (r[j] < Rmid - 90)) { r[j] += 360.0; }
+      }
+    }
+
+    // extremely large-scale images with certain projections will have odd boundaries.
+    // eg, the ASCA images are essentially circles of radius ~60 degrees.  plot these as 
+    // octagons with some dummy size.
+    if (!status) {
+      int jp, xo, yo;
+      double rc, dc;
+      xo = 0.5*image[i].NX;
+      yo = 0.5*image[i].NY;
+      // is the image center on the screen?
+      status = XY_to_RD (&rc, &dc, 0.5*x[2], 0.5*y[2], &image[i].coords);
+      if (status && (image[i].NX * image[i].coords.cdelt2 > 90)) {
+	// draw an octagon with radius 45 degrees
+	double dX = Radius / image[i].coords.cdelt2;
+	x[0] = xo+dX;      y[0] = yo+BETA*dX;
+	x[1] = xo+BETA*dX; y[1] = yo+dX;
+	x[2] = xo-BETA*dX; y[2] = yo+dX;
+	x[3] = xo-dX;      y[3] = yo+BETA*dX;
+	x[4] = xo-dX;      y[4] = yo-BETA*dX;
+	x[5] = xo-BETA*dX; y[5] = yo-dX;
+	x[6] = xo+BETA*dX; y[6] = yo-dX;
+	x[7] = xo+dX;      y[7] = yo-BETA*dX;
+	Npts = 8;
+	j = 0;
+	for (jp = 0; jp < 8; jp++) {
+	  status = XY_to_RD (&r[j], &d[j], x[jp], y[jp], &image[i].coords);
+	  if (!status) continue;
+	  while (r[j] < Rmin) { r[j] += 360.0; }
+	  while (r[j] > Rmax) { r[j] -= 360.0; }
+	  if (j == 0) {
+	    leftside = (r[j] < Rmid);
+	  } 
+	  if (j > 0) { 
+	    if ( leftside && (r[j] > Rmid + 90)) { r[j] -= 360.0; }
+	    if (!leftside && (r[j] < Rmid - 90)) { r[j] += 360.0; }
+	  }
+	  j++;
+	}
+	Npts = j;
+      } else {
+	continue;
+      }
+    }
+    if (Npts == 0) continue;
+
+    status = FALSE;
+    for (j = 0; j < Npts; j++) {
+      status |= fRD_to_XY (&Xvec.elements[N+2*j], &Yvec.elements[N+2*j], r[j], d[j], &graphmode.coords);
+      if (j > 0) {
+	Xvec.elements[N+2*j - 1] = Xvec.elements[N+2*j];
+	Yvec.elements[N+2*j - 1] = Yvec.elements[N+2*j];
+      }
+    }
+    Xvec.elements[N+2*Npts-1] = Xvec.elements[N];
+    Yvec.elements[N+2*Npts-1] = Yvec.elements[N];
+    if (!status) continue;
+    // if none of the points are on the visible side of the projection, do not plot the image
+
+    InPic = FALSE;
+    for (j = 0; j < 2*Npts; j+=2) {
+      if ((Xvec.elements[N+j] >= graphmode.xmin) && 
+	  (Xvec.elements[N+j] <= graphmode.xmax) && 
+	  (Yvec.elements[N+j] >= graphmode.ymin) && 
+	  (Yvec.elements[N+j] <= graphmode.ymax))
+	InPic = TRUE;
+    }
+    // if (!status && HIDDEN) status = TRUE;
+    if (!InPic) continue;
+
+    plist[n] = i;
+    n++;
+    if (n > npts - 1) {
+      npts += 200;
+      REALLOCATE (plist, int, npts);
+    }
+    N+=2*Npts;
+    if (N + 16 >= NPTS) {  /* need to leave room for 8 point image */
+      NPTS += 400;
+      REALLOCATE (Xvec.elements, float, NPTS);
+      REALLOCATE (Yvec.elements, float, NPTS);
+    }
+  }
+
+  gprint (GP_ERR, "plotting %d images\n", n);
+  Xvec.Nelements = Xvec.Nelements = N;
+  if (N > 0) {
+    graphmode.style = 2; /* points */
+    graphmode.ptype = 100; /* connect pairs of points */
+    graphmode.etype = 0;
+    PlotVectorPair (kapa, N, Xvec.elements, Yvec.elements, &graphmode);
+  }
+
+  free (Xvec.elements);
+  free (Yvec.elements);
+  free (image);
+  return (TRUE);
+
+
+ usage:
+  gprint (GP_ERR, "USAGE: image [options]\n");
+  gprint (GP_ERR, "  +mosaic : show mosaic outline\n");
+  gprint (GP_ERR, "  -mosaic : only mosaic outline\n");
+  gprint (GP_ERR, "  -hidden : (deprecated)\n");
+  gprint (GP_ERR, "  -name   : only names matching (start of name)\n");
+  gprint (GP_ERR, "  -radius : display all-sky images with given radius octagon\n");
+  gprint (GP_ERR, "  -time (start) (range)  : show images for time and interval\n");
+  gprint (GP_ERR, "  -trange (start) (stop) : show images within time range\n");
+  return (FALSE);
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imbox.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imbox.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imbox.c	(revision 15879)
@@ -0,0 +1,92 @@
+# include "dvoshell.h"
+
+int imbox (int argc, char **argv) {
+  
+  int j, kapa, Nskip, status, InPic, flipped;
+  Vector Xvec, Yvec;
+  double r, d, x[4], y[4], Rmin, Rmax, Rmid;
+  Header header;
+  Coords coords;
+  Coords mosaic;
+  Graphdata graphmode;
+  FILE *f;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: imbox (filename)\n");
+    return (FALSE);
+  }
+
+  f = fopen (argv[1], "r");
+  if (f == NULL) {
+    gprint (GP_ERR, "file not found\n");
+    return (FALSE);
+  }
+  
+  Rmin = graphmode.coords.crval1 - 182.0;
+  Rmax = graphmode.coords.crval1 + 182.0;
+  Rmid = 0.5*(Rmin + Rmax);
+  
+  /* project this image to screen display coords */
+  ALLOCATE (Xvec.elements, float, 8);
+  ALLOCATE (Yvec.elements, float, 8);
+
+  while (gfits_fread_header (f, &header)) {
+    if (!GetCoords (&coords, &header)) goto skip;
+    if (!strcmp (&coords.ctype[4], "-DIS")) {
+      mosaic = coords;
+      RegisterMosaic (&mosaic);
+      goto skip;
+    }
+    x[0] = 0;               y[0] = 0;
+    x[1] = header.Naxis[0]; y[1] = 0;
+    x[2] = header.Naxis[0]; y[2] = header.Naxis[1];
+    x[3] = 0;               y[3] = header.Naxis[1];
+    status = FALSE;
+    flipped = FALSE;
+    for (j = 0; j < 4; j++) {
+      XY_to_RD (&r, &d, x[j], y[j], &coords);
+      while ((j == 0) && (r < Rmin)) { flipped = TRUE; r += 360.0; }
+      while ((j == 0) && (r > Rmax)) { flipped = TRUE; r -= 360.0; }
+      if ((j > 0) && flipped) {
+	while (r < Rmid) r+= 360.0;
+	while (r > Rmid) r-= 360.0;
+      }
+      status |= fRD_to_XY (&Xvec.elements[2*j], &Yvec.elements[2*j], r, d, &graphmode.coords);
+      if (j > 0) {
+	Xvec.elements[2*j - 1] = Xvec.elements[2*j];
+	Yvec.elements[2*j - 1] = Yvec.elements[2*j];
+      }
+    }
+    Xvec.elements[7] = Xvec.elements[0];
+    Yvec.elements[7] = Yvec.elements[0];
+    InPic = FALSE;
+    for (j = 0; j < 8; j+=2) {
+      if ((Xvec.elements[j] >= graphmode.xmin) && 
+	  (Xvec.elements[j] <= graphmode.xmax) && 
+	  (Yvec.elements[j] >= graphmode.ymin) && 
+	  (Yvec.elements[j] <= graphmode.ymax))
+	InPic = TRUE;
+    }
+
+    Xvec.Nelements = Xvec.Nelements = 8;
+    if (InPic) {
+      graphmode.style = 2; /* points */
+      graphmode.ptype = 100; /* connect pairs of points */
+      graphmode.etype = 0;
+      PlotVectorPair (kapa, 8, Xvec.elements, Yvec.elements, &graphmode);
+    }
+  skip:
+    Nskip = gfits_data_size (&header);
+    fseek (f, Nskip, SEEK_CUR); 
+    gfits_free_header (&header);
+  }
+  fclose (f);
+  free (Xvec.elements);
+  free (Yvec.elements);
+  return (TRUE);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imdata.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imdata.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imdata.c	(revision 15879)
@@ -0,0 +1,219 @@
+# include "dvoshell.h"
+
+int imdata (int argc, char **argv) {
+  
+  int i, j, k, I;
+  int Nimage, N, NPTS, found, mode, TimeSelect;
+  int n, Nregions, NREGIONS, TimeFormat;
+  int *subset, Nsubset;
+  double trange;
+  time_t tzero, start, stop, TimeReference;
+  Image *image;
+  Catalog catalog;
+  SkyTable *sky;
+  SkyList *skylist, *skyset;
+  Vector *vec;
+  SkyRegionSelection *selection;
+
+  // parse skyregion options
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) {
+    gprint (GP_ERR, "invalid sky region selection\n");
+    return FALSE;
+  }
+
+  start = stop = 0;
+  TimeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-time"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    TimeSelect = TRUE;
+    gprint (GP_ERR, "searching in range %ds - %ds (%f seconds)\n", (int)tzero, (int)(tzero + trange), trange);
+    if (trange > 0) {
+      start = tzero;
+      stop  = tzero + trange;
+    } else {
+      stop = tzero;
+      start  = tzero + trange;
+    }      
+  }
+
+  gprint (GP_ERR, "function is poorly defined; disabled and may be removed\n");
+  return (FALSE);
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: imdata (value) [-time t dt]\n");
+    return (FALSE);
+  }
+
+  /* identify selection */
+  mode = 0;
+  if (!strcasecmp (argv[1], "ra")) 
+    mode = 1;
+  if (!strcasecmp (argv[1], "dec")) 
+    mode = 2;
+  if (!strcasecmp (argv[1], "mag")) 
+    mode = 3;
+  if (!strcasecmp (argv[1], "dmag")) 
+    mode = 4;
+  if (!strcasecmp (argv[1], "Mcal")) 
+    mode = 5;
+  if (!strcasecmp (argv[1], "Mrel")) 
+    mode = 6;
+  if (!strcasecmp (argv[1], "source")) 
+    mode = 7;
+  if (!strcasecmp (argv[1], "x")) 
+    mode = 8;
+  if (!strcasecmp (argv[1], "y")) 
+    mode = 9;
+  if (!strcasecmp (argv[1], "time")) 
+    mode = 10;
+  if (mode == 0) {
+    gprint (GP_ERR, "value may be one of the following:\n");
+    gprint (GP_ERR, " ra dR dec dD mag dmag Mrel Mcal source time\n");
+    return (FALSE);
+  }
+  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
+  image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, trange, TimeSelect);
+  BuildChipMatch (image, Nimage);
+  GetTimeFormat (&TimeReference, &TimeFormat);
+
+  /* load sky from correct table */
+  sky = GetSkyTable ();
+
+  Nregions = 0;
+  NREGIONS = 10;
+  ALLOCATE (skylist, SkyList, 1);
+  ALLOCATE (skylist[0].regions, SkyRegion *, NREGIONS);
+  skylist[0].ownElements = FALSE;
+
+  /* for each image of interest, find the appropriate region files */
+  for (i = 0; i < Nsubset; i++) {
+    I = subset[i];
+
+    if (!FindMosaicForImage (image, Nimage, I)) continue;
+    skyset = SkyListByImage (sky, -1, &image[I]);
+
+    for (j = 0; j < skyset[0].Nregions; j++) {
+      found = FALSE;
+      for (k = 0; (k < skylist[0].Nregions) && !found; k++) {
+	found = !strcmp (skylist[0].regions[k][0].name, skyset[0].regions[j][0].name);
+      }
+      if (found) continue;
+      skylist[0].regions[Nregions] = skyset[0].regions[j];
+      Nregions ++;
+      CHECK_REALLOCATE (skylist[0].regions, SkyRegion *, NREGIONS, Nregions, 10);
+    }
+    SkyListFree (skyset);
+  }	
+  free (subset);
+  for (i = 0; i < skylist[0].Nregions; i++) {
+    gprint (GP_ERR, "try %s\n", skylist[0].regions[i][0].name);
+  } 
+  
+  /* create output vector */
+  NPTS = 1000;
+  REALLOCATE (vec[0].elements, float, NPTS);
+  vec[0].Nelements = N = 0;
+
+  /* for each region file, extract the data of interest in the right time range */
+  for (j = 0; j < skylist[0].Nregions; j++) {
+
+    /* get file name and open */
+    catalog.filename = skylist[0].filename[j];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    /* assign vector values */
+    switch (mode) {
+      case (1):  /* ra */
+	for (i = 0; i < catalog.Nmeasure; i++) {
+	  if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
+	  n = catalog.measure[i].averef;
+	  vec[0].elements[N] = catalog.average[n].R - catalog.measure[i].dR / 3600.0;
+	  N++;
+	  CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
+	}
+	break;
+      case (2):  /* dec */
+	for (i = 0; i < catalog.Nmeasure; i++) {
+	  if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
+	  n = catalog.measure[i].averef;
+	  vec[0].elements[N] = catalog.average[n].D - catalog.measure[i].dD / 3600.0;
+	  N++;
+	  CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
+	}
+	break;
+      case (3):  /* mag */
+	for (i = 0; i < catalog.Nmeasure; i++) {
+	  if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
+	  vec[0].elements[N] = catalog.measure[i].M;
+	  N++;
+	  CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
+	}
+	break;
+      case (4):  /* dmag */
+	for (i = 0; i < catalog.Nmeasure; i++) {
+	  if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
+	  vec[0].elements[N] = catalog.measure[i].dM;
+	  N++;
+	  CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
+	}
+	break;
+      case (5):  /* Mcal */
+	for (i = 0; i < catalog.Nmeasure; i++) {
+	  if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
+	  vec[0].elements[N] = catalog.measure[i].Mcal;
+	  N++;
+	  CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
+	}
+	break;
+      case (6):  /* Mrel */
+	for (i = 0; i < catalog.Nmeasure; i++) {
+	  if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
+	  n = catalog.measure[i].averef;
+	  // vec[0].elements[N] = catalog.average[n].M;
+	  N++;
+	}
+	break;
+      case (7):  /* source */
+	for (i = 0; i < catalog.Nmeasure; i++) {
+	  if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
+	  vec[0].elements[N] = catalog.measure[i].photcode;
+	  N++;
+	  CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
+	}
+	break;
+      case (10):  /* time */
+	for (i = 0; i < catalog.Nmeasure; i++) {
+	  if ((catalog.measure[i].t < start) || (catalog.measure[i].t > stop)) continue;
+	  vec[0].elements[N] = TimeValue (catalog.measure[i].t, TimeReference, TimeFormat);
+	  N++;
+	  CHECK_REALLOCATE (vec[0].elements, float, NPTS, N, 1000);
+	}
+	break;
+    }
+    dvo_catalog_free (&catalog);
+  }
+  
+  vec[0].Nelements = N;
+  REALLOCATE (vec[0].elements, float, MAX(1,N));
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imdense.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imdense.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imdense.c	(revision 15879)
@@ -0,0 +1,74 @@
+# include "dvoshell.h"
+extern double drand48();
+
+int imdense (int argc, char **argv) {
+  
+  long A, B;
+  int i, kapa, N, Nimage, status, NPTS;
+  double r, d, x, y, Rmin, Rmax;
+  Vector Xvec, Yvec;
+  Image *image;
+  Graphdata graphmode;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  /* need options to list only images in region and only images in a time range */
+  /* also, option to list and not plot or plot and not list images */
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: image\n");
+    return (FALSE);
+  }
+
+  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
+  BuildChipMatch (image, Nimage);
+
+  Rmin = graphmode.coords.crval1 - 182.0;
+  Rmax = graphmode.coords.crval1 + 182.0;
+  
+  A = time(NULL);
+  for (B = 0; A == time(NULL); B++);
+  srand48(B);
+
+  NPTS = 200;
+  ALLOCATE (Xvec.elements, float, NPTS);
+  ALLOCATE (Yvec.elements, float, NPTS);
+  N = 0;
+  for (i = 0; i < Nimage; i++) {
+    /* choose a position for point within image box */
+    x = (0.1 + 0.9*drand48()) * image[i].NX;
+    y = (0.1 + 0.9*drand48()) * image[i].NY;
+    /* project this image to screen display coords */
+    status = FALSE;
+    if (!FindMosaicForImage (image, Nimage, i)) continue;
+    XY_to_RD (&r, &d, x, y, &image[i].coords);
+    while (r < Rmin) r += 360.0; 
+    while (r > Rmax) r -= 360.0; 
+    status |= fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], r, d, &graphmode.coords);
+    if ((Xvec.elements[N] >= graphmode.xmin) && 
+	(Xvec.elements[N] <= graphmode.xmax) && 
+	(Yvec.elements[N] >= graphmode.ymin) && 
+	(Yvec.elements[N] <= graphmode.ymax) && status) {
+      N++;
+      if (N > NPTS - 1) { 
+	NPTS += 200;
+	REALLOCATE (Xvec.elements, float, NPTS);
+	REALLOCATE (Yvec.elements, float, NPTS);
+      }
+    }
+  }
+
+  Xvec.Nelements = Xvec.Nelements = N;
+  if (N > 0) {
+    graphmode.style = 2; /* points */
+    graphmode.etype = 0;
+    PlotVectorPair (kapa, N, Xvec.elements, Yvec.elements, &graphmode);
+  }
+
+  free (Xvec.elements);
+  free (Yvec.elements);
+  free (image);
+  return (TRUE);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imextract.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imextract.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imextract.c	(revision 15879)
@@ -0,0 +1,223 @@
+# include "dvoshell.h"
+
+enum {ZERO, RA, DEC, Xm, AIRMASS, MCAL, dMCAL, PHOTCODE, TIME, FWHM, EXPTIME, NSTAR, SKY, NCAL, FLAG, NX_PIX, NY_PIX, THETA, SKEW, SCALE, DSCALE};
+
+int imextract (int argc, char **argv) {
+  
+  int i, j, Nimage, mode, N, PhotcodeSelect;
+  int TimeSelect, *subset, Nsubset, TimeFormat, FlagSelect, FlagValue;
+  double x, y, ra, dec, t, trange;
+  time_t tzero, TimeReference;
+  SkyRegionSelection *selection;
+
+  PhotCode *code;
+  Image *image;
+  Vector *vec;
+
+  if (!InitPhotcodes ()) return (FALSE);
+
+  // parse skyregion options
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) {
+    gprint (GP_ERR, "invalid sky region selection\n");
+    return FALSE;
+  }
+
+  /* check for time-based selection */
+  TimeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-time"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    TimeSelect = TRUE;
+  }
+
+  /* check for region-based selection */
+  FlagValue = 0;
+  FlagSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-flag"))) {
+    remove_argument (N, &argc, argv);
+    FlagValue = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+    FlagSelect = TRUE;
+  }
+
+  /* check for photcode-based selection */
+  code = NULL;
+  PhotcodeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-photcode"))) {
+    PhotcodeSelect = TRUE;
+    remove_argument (N, &argc, argv);
+    if ((code = GetPhotcodebyName (argv[N])) == NULL) {
+      gprint (GP_ERR, "ERROR: photcode %s not found in photcode table\n", argv[N]);
+      return (FALSE);
+    }
+    if ((code[0].type != PHOT_SEC) && (code[0].type != PHOT_DEP)) {
+      gprint (GP_ERR, "photcode must be primary, secondary, or dependent code\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: imextract (value) [-region] [-time start range] [-photcode photcode]\n");
+    return (FALSE);
+  }
+  
+  /* identify selection */
+  mode = ZERO;
+  if (!strcasecmp (argv[1], "ra")) mode = RA;
+  if (!strcasecmp (argv[1], "dec")) mode = DEC;
+  if (!strcasecmp (argv[1], "Xm")) mode = Xm;
+  if (!strcasecmp (argv[1], "airmass")) mode = AIRMASS;
+  if (!strcasecmp (argv[1], "Mcal")) mode = MCAL;
+  if (!strcasecmp (argv[1], "dMcal")) mode = dMCAL;
+  if (!strcasecmp (argv[1], "photcode")) mode = PHOTCODE;
+  if (!strcasecmp (argv[1], "time")) mode = TIME;
+  if (!strcasecmp (argv[1], "FWHM")) mode = FWHM;
+  if (!strcasecmp (argv[1], "exptime")) mode = EXPTIME;
+  if (!strcasecmp (argv[1], "nstar")) mode = NSTAR;
+  if (!strcasecmp (argv[1], "ncal")) mode = NCAL;
+  if (!strcasecmp (argv[1], "sky")) mode = SKY;
+  if (!strcasecmp (argv[1], "flag")) mode = FLAG;
+  if (!strcasecmp (argv[1], "NX")) mode = NX_PIX;
+  if (!strcasecmp (argv[1], "NY")) mode = NY_PIX;
+  if (!strcasecmp (argv[1], "theta")) mode = THETA;
+  if (!strcasecmp (argv[1], "skew")) mode = SKEW;
+  if (!strcasecmp (argv[1], "scale")) mode = SCALE;
+  if (!strcasecmp (argv[1], "dscale")) mode = DSCALE;
+  if (mode == ZERO) {
+    gprint (GP_ERR, "value may be one of the following:\n");
+    gprint (GP_ERR, " ra dec airmass Mcal dMcal Xm photcode time fwhm exptime nstar ncal sky flag\n");
+    return (FALSE);
+  }
+  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
+  image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, trange, TimeSelect);
+  if ((mode == RA) || (mode == DEC)) BuildChipMatch (image, Nimage);
+
+  GetTimeFormat (&TimeReference, &TimeFormat);
+
+  /* create storage vector */
+  REALLOCATE (vec[0].elements, float, Nimage);
+  vec[0].Nelements = Nimage;
+  
+  N = 0;
+  /* assign vector values */
+  for (i = 0; i < Nsubset; i++) {
+    j = subset[i];
+    if (PhotcodeSelect) {
+      if (code[0].type == PHOT_DEP) {
+	if (code[0].code != image[j].photcode) continue;
+      } else {
+	if (code[0].code != GetPhotcodeEquivCodebyCode (image[j].photcode)) continue;
+      }
+    }
+    if (FlagSelect && (FlagValue != image[j].code)) continue;
+    switch (mode) {
+      case RA:
+	if (!FindMosaicForImage (image, Nimage, j)) continue;
+	x = 0.5*image[j].NX;
+	y = 0.5*image[j].NY;
+	XY_to_RD (&ra, &dec, x, y, &image[j].coords);
+	vec[0].elements[N] = ra;
+	break;
+      case DEC:
+	if (!FindMosaicForImage (image, Nimage, j)) continue;
+	x = 0.5*image[j].NX;
+	y = 0.5*image[j].NY;
+	XY_to_RD (&ra, &dec, x, y, &image[j].coords);
+	vec[0].elements[N] = dec;
+	break;
+      case Xm:
+	vec[0].elements[N] = pow(10.0, 0.01*image[j].Xm);
+	break;
+      case AIRMASS:
+	vec[0].elements[N] = image[j].secz;
+	break;
+      case MCAL:
+	vec[0].elements[N] = image[j].Mcal;
+	break;
+      case dMCAL:
+	vec[0].elements[N] = image[j].dMcal;
+	break;
+      case PHOTCODE:
+	vec[0].elements[N] = image[j].photcode;
+	break;
+      case TIME:
+	t = image[j].tzero + 0.5*image[j].NY * image[j].trate / 10000;
+	vec[0].elements[N] = TimeValue (t, TimeReference, TimeFormat);
+	break;
+      case FWHM:
+	vec[0].elements[N] = image[j].fwhm_x / 25.0;
+	break;
+      case EXPTIME:
+	vec[0].elements[N] = image[j].exptime;
+	break;
+      case NSTAR:
+	vec[0].elements[N] = image[j].nstar;
+	break;
+      case NCAL:
+	vec[0].elements[N] = image[j].Mxxxx;
+	break;
+      case SKY:
+	vec[0].elements[N] = image[j].Myyyy + 0x8000;
+	break;
+      case FLAG:
+	vec[0].elements[N] = image[j].code;
+	break;
+      case NX_PIX:
+	vec[0].elements[N] = image[j].NX;
+	break;
+      case NY_PIX:
+	vec[0].elements[N] = image[j].NY;
+	break;
+      case THETA: {
+	double theta1, theta2, s1, s2;
+	s1 = SIGN(image[j].coords.pc1_1);
+	s2 = SIGN(image[j].coords.pc2_2);
+	theta1 = DEG_RAD*atan2 (+s1*image[j].coords.pc1_2, s1*image[j].coords.pc1_1);
+	theta2 = DEG_RAD*atan2 (-s2*image[j].coords.pc2_1, s2*image[j].coords.pc2_2);
+	vec[0].elements[N] = 0.5*(theta1+theta2);
+	break; }
+      case SKEW: {
+	double theta1, theta2, s1, s2;
+	s1 = SIGN(image[j].coords.pc1_1);
+	s2 = SIGN(image[j].coords.pc2_2);
+	theta1 = DEG_RAD*atan2 (+s1*image[j].coords.pc1_2, s1*image[j].coords.pc1_1);
+	theta2 = DEG_RAD*atan2 (-s2*image[j].coords.pc2_1, s2*image[j].coords.pc2_2);
+	vec[0].elements[N] = (theta1-theta2);
+	break; }
+      case SCALE: {
+	double scale1, scale2;
+	scale1 = fabs(image[j].coords.cdelt1);
+	scale2 = fabs(image[j].coords.cdelt2);
+	vec[0].elements[N] = 0.5*(scale1+scale2);
+	break; }
+      case DSCALE: {
+	double scale1, scale2;
+	scale1 = fabs(image[j].coords.cdelt1);
+	scale2 = fabs(image[j].coords.cdelt2);
+	vec[0].elements[N] = (scale1-scale2);
+	break; }
+	  }
+    N++;
+  }
+  
+  vec[0].Nelements = N;
+  REALLOCATE (vec[0].elements, float, N);
+
+  free (subset);
+  free (image);
+  return (TRUE);
+  
+}
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imlist.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imlist.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imlist.c	(revision 15879)
@@ -0,0 +1,100 @@
+# include "dvoshell.h"
+
+int imlist (int argc, char **argv) {
+  
+  int i, j, N, Nimage, *subset, Nsubset, TimeSelect, RegionSelect, TimeFormat, NameSelect;
+  int PhotcodeSelect;
+  time_t tzero, TimeReference;
+  double r, d, trange, t;
+  char *name;
+  Image *image;
+  PhotCode *PhotcodeValue;
+  SkyRegionSelection *selection;
+
+  // parse skyregion options
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) {
+    gprint (GP_ERR, "invalid sky region selection\n");
+    return FALSE;
+  }
+
+  TimeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-time"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    TimeSelect = TRUE;
+    gprint (GP_ERR, "plotting in range %ds - %ds (%f seconds)\n", (int)tzero, (int)(tzero + trange), trange);
+  }
+
+  RegionSelect = FALSE;
+  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"))) {
+    PhotcodeSelect = TRUE;
+    remove_argument (N, &argc, argv);
+    PhotcodeValue = GetPhotcodebyName (argv[N]);
+    if (PhotcodeValue == NULL) {
+      gprint (GP_ERR, "photcode not found in photcode table\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+  }
+
+  name = NULL;
+  NameSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-name"))) {
+    remove_argument (N, &argc, argv);
+    name = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    NameSelect = TRUE;
+  }
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: image [-time start range] [-region] [-name string]\n");
+    return (FALSE);
+  }
+  
+  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
+  image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, trange, TimeSelect);
+  BuildChipMatch (image, Nimage);
+
+  GetTimeFormat (&TimeReference, &TimeFormat);
+
+  for (j = 0; j < Nsubset; j++) {
+    i = subset[j];
+    if (NameSelect && (strstr (image[i].name, name) == (char *) NULL)) continue;
+    if (PhotcodeSelect) {
+      if (PhotcodeValue[0].type == PHOT_DEP) {
+	if (PhotcodeValue[0].code != image[i].photcode) continue;
+      } else {
+	if (PhotcodeValue[0].code != GetPhotcodeEquivCodebyCode (image[i].photcode)) continue;
+      }
+    }
+    if (!FindMosaicForImage (image, Nimage, i)) continue;
+    t = TimeValue (image[i].tzero, TimeReference, TimeFormat);
+    if (!strcmp(&image[i].coords.ctype[4], "-DIS")) {
+      XY_to_RD (&r, &d, 0.0, 0.0, &image[i].coords);
+    } else {
+      XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
+    }
+    gprint (GP_LOG, "%3d %s %8.4f %8.4f %f %5d %2d %4.2f %5.3f %5.3f\n", 
+	     i, image[i].name, r, d, t, image[i].nstar, image[i].photcode, image[i].secz, image[i].Mcal, image[i].dMcal);
+  }
+
+  free (subset);
+  free (image);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imphot.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imphot.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imphot.c	(revision 15879)
@@ -0,0 +1,98 @@
+# include "dvoshell.h"
+
+int imphot (int argc, char **argv) {
+  
+  time_t tzero;
+  double trange;
+  int N, GreyScale;
+  int i, j, Nimage, Nsubset, *subset;
+  char bufname[64];
+  float *p;
+  double fx, fy, x, y, applyMcal();
+  Image *image;
+  Buffer *buf;
+  SkyRegionSelection *selection;
+
+  GreyScale = FALSE;
+  if ((N = get_argument (argc, argv, "-g"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (bufname, argv[N]);
+    remove_argument (N, &argc, argv);
+    GreyScale = TRUE;
+  }
+
+  // parse skyregion options
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) {
+    gprint (GP_ERR, "invalid sky region selection\n");
+    return FALSE;
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: imphot tzero trange [-g buffer]\n");
+    return (FALSE);
+  }
+
+  buf = NULL;
+  if (GreyScale) {
+    if ((buf = SelectBuffer (bufname, ANYBUFFER, TRUE)) == NULL) return (FALSE);
+    CreateBuffer (buf, 100, 200, -32, 0.0, 1.0);
+  }
+
+  /* load image(s) in time range given */
+  if (!ohana_str_to_time (argv[1], &tzero)) { 
+    gprint (GP_ERR, "syntax error\n");
+    return (FALSE);
+  }
+  if (!ohana_str_to_dtime (argv[2], &trange)) { 
+    gprint (GP_ERR, "syntax error\n");
+    return (FALSE);
+  }    
+  gprint (GP_ERR, "searching in range %ds - %ds (%f seconds)\n", (int)tzero, (int)(tzero + trange), trange);
+  
+  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
+  image_subset (image, Nimage, &subset, &Nsubset, selection, tzero, trange, TRUE);
+
+  if ((Nsubset > 1) && GreyScale) {
+    gprint (GP_ERR, "more than one image selected, making GreyScale of first only\n");
+  }
+
+  if (GreyScale && Nsubset) {
+    fx = image[subset[0]].NX / 100;
+    fy = image[subset[0]].NY / 200;
+    p = (float *) buf[0].matrix.buffer;
+    for (y = 0; y < 200; y+=1.0) {
+      for (x = 0; x < 100; x+=1.0, p++) {
+	*p = applyMcal (&image[subset[0]], (fx*x), (fy*y));
+      }
+    }
+  }
+
+  for (j = 0; j < Nsubset; j++) {
+    i = subset[j];
+    switch (image[i].order) {
+    case 0:
+      gprint (GP_ERR, "%s: %d - %f\n", image[i].name, image[i].order, image[i].Mcal);
+      break;
+    case 1:
+      gprint (GP_ERR, "%s: %d - %f, %d %d\n", image[i].name, image[i].order, image[i].Mcal, image[i].Mx, image[i].My);
+      break;
+    case 2:
+      gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d\n", image[i].name, image[i].order, image[i].Mcal, image[i].Mx, image[i].My, image[i].Mxx, image[i].Mxy, image[i].Myy);
+      break;
+    case 3:
+      gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d, %d %d %d %d\n", image[i].name, image[i].order, image[i].Mcal, image[i].Mx, image[i].My, 
+	       image[i].Mxx, image[i].Mxy, image[i].Myy, image[i].Mxxx, image[i].Mxxy, image[i].Mxyy, image[i].Myyy);
+      break;
+    case 4:
+      gprint (GP_ERR, "%s: %d - %f, %d %d, %d %d %d, %d %d %d %d, %d %d %d %d %d\n", image[i].name, image[i].order, image[i].Mcal, image[i].Mx, image[i].My, 
+	       image[i].Mxx, image[i].Mxy, image[i].Myy, image[i].Mxxx, image[i].Mxxy, image[i].Mxyy, image[i].Myyy,
+	       image[i].Mxxxx, image[i].Mxxxy, image[i].Mxxyy, image[i].Mxyyy, image[i].Myyyy);
+      break;
+    }
+  }
+
+  free (image);
+  free (subset);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imrough.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imrough.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imrough.c	(revision 15879)
@@ -0,0 +1,310 @@
+# include "dvoshell.h"
+RegImage *load_imreg (char *DataBase, int *nimage);
+
+# define NVALUE 22
+enum {V_NONE, V_EXPTIME, V_CCDN, V_SKY, V_BIAS, V_FILTER, V_FWHM, V_AIRM, V_TIME, V_TEMP0, V_TEMP1, V_TEMP2, V_TEMP3, V_TELFOCUS, V_XPROBE, V_YPROBE, V_ZPROBE, V_RA, V_DEC, V_DETTEMP, V_ROTANGLE, V_REGTIME};
+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"};
+
+int imrough (int argc, char **argv) {
+ 
+  int i, N, Nimage, TimeSelect;
+  int ModeSelect, TypeSelect, CCDSelect, FilterSelect, TimeFormat;
+  int type, value, mode, CCD, NVEC;
+  char DataBase[256], *Filter;
+  double trange;
+  float *Vec;
+  time_t tzero, tend, TimeReference;
+  RegImage *image;
+  Vector *vec;
+
+  VarConfig ("REGISTRATION_DATABASE", "%s", DataBase);
+
+  TimeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-time"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (trange < 0) {
+      trange = fabs (trange);
+      tzero -= trange;
+    }
+    TimeSelect = TRUE;
+  }
+  if ((N = get_argument (argc, argv, "-trange"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tend)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    trange = tend - tzero;
+    if (trange < 0) {
+      trange = fabs (trange);
+      tzero -= trange;
+    }
+    TimeSelect = TRUE;
+  }
+ 
+  type = T_UNDEF;
+  TypeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-type"))) {
+    TypeSelect = TRUE;
+    remove_argument (N, &argc, argv);
+    type = get_image_type (argv[N]);
+    if (type == T_UNDEF) {
+      gprint (GP_ERR, "ERROR: invalid image type %s\n", argv[N]);
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+  }
+
+  mode = M_NONE;
+  ModeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-mode"))) {
+    ModeSelect = TRUE;
+    remove_argument (N, &argc, argv);
+    mode = get_image_mode (argv[N]);
+    if (mode == M_UNDEF) {
+      gprint (GP_ERR, "ERROR: invalid image mode %s\n", argv[N]);
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+  }
+
+  CCD = 0;
+  CCDSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-ccd"))) {
+    remove_argument (N, &argc, argv);
+    CCD = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+    CCDSelect = TRUE;
+  }
+ 
+  Filter = NULL;
+  FilterSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-filter"))) {
+    remove_argument (N, &argc, argv);
+    Filter = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    FilterSelect = TRUE;
+    if (!strcasecmp (Filter, "X")) {
+      FilterSelect = FALSE;
+    }
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: imrough (value)\n");
+    gprint (GP_ERR, "       value options:\n");
+    for (i = 1; i < NVALUE; i++) {
+      gprint (GP_ERR, "%s\n", valuename[i]);
+    }
+    return (FALSE);
+  }
+ 
+  /* identify selection */
+  value = V_NONE;
+  for (i = 0; (i < NVALUE) && (value == V_NONE); i++) {
+    if (!strncasecmp (argv[1], valuename[i], strlen(argv[1]))) value = i;
+  }
+  if (value == V_NONE) {
+    gprint (GP_ERR, "ERROR: invalid image value %s\n", argv[1]);
+    return (FALSE);
+  }
+
+  if ((vec = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  image = load_imreg (DataBase, &Nimage);
+  if (image == (RegImage *) NULL) return (FALSE);
+
+  N = 0;
+  NVEC = 1000;
+  REALLOCATE (vec[0].elements, float, NVEC);
+  Vec = vec[0].elements;
+
+  GetTimeFormat (&TimeReference, &TimeFormat);
+
+  /* get data */
+  for (i = 0; i < Nimage; i++) {
+    /* skip unmatched selections */
+    if (TimeSelect && ((image[i].obstime < tzero) || (image[i].obstime > tzero + trange))) continue;
+    if (TimeSelect && ((image[i].obstime < tzero) || (image[i].obstime > tzero + trange))) continue;
+    if (FilterSelect && (strcasecmp (image[i].filter, Filter))) continue;
+    if (CCDSelect && (image[i].ccd != CCD)) continue;
+    if (TypeSelect && (image[i].type != type)) continue;
+    if (ModeSelect && (image[i].mode != mode)) continue;
+
+    /* assign correct value */
+    switch (value) {
+    case (V_EXPTIME):
+      Vec[N] = image[i].exptime;
+      break;
+    case (V_CCDN):
+      Vec[N] = image[i].ccd;
+      break;
+    case (V_SKY):
+      Vec[N] = image[i].sky;
+      break;
+    case (V_BIAS):
+      Vec[N] = image[i].bias;
+      break;
+    case (V_FILTER):
+      Vec[N] = image[i].filter[0];
+      break;
+    case (V_FWHM):
+      Vec[N] = image[i].fwhm;
+      break;
+    case (V_AIRM):
+      Vec[N] = image[i].airmass;
+      break;
+    case (V_TIME):
+      Vec[N] = TimeValue (image[i].obstime, TimeReference, TimeFormat);
+      break;
+    case (V_TEMP0):
+      Vec[N] = image[i].teltemp_0;
+      break;
+    case (V_TEMP1):
+      Vec[N] = image[i].teltemp_1;
+      break;
+    case (V_TEMP2):
+      Vec[N] = image[i].teltemp_2;
+      break;
+    case (V_TEMP3):
+      Vec[N] = image[i].teltemp_3;
+      break;
+    case (V_TELFOCUS):
+      Vec[N] = image[i].telfocus;
+      break;
+    case (V_XPROBE):
+      Vec[N] = image[i].xprobe;
+      break;
+    case (V_YPROBE):
+      Vec[N] = image[i].yprobe;
+      break;
+    case (V_ZPROBE):
+      Vec[N] = image[i].zprobe;
+      break;
+    case (V_RA):
+      Vec[N] = image[i].ra;
+      break;
+    case (V_DEC):
+      Vec[N] = image[i].dec;
+      break;
+    case (V_DETTEMP):
+      Vec[N] = image[i].dettemp;
+      break;
+    case (V_ROTANGLE):
+      Vec[N] = image[i].rotangle;
+      break;
+    case (V_REGTIME):
+      Vec[N] = TimeValue (image[i].regtime, TimeReference, TimeFormat);
+      break;
+    }
+    N++;
+    if (N >= NVEC - 1) {
+      NVEC += 1000;
+      REALLOCATE (vec[0].elements, float, NVEC);
+      Vec = vec[0].elements;
+    }
+  }
+
+  REALLOCATE (vec[0].elements, float, MAX (1,N));
+  vec[0].Nelements = N;
+
+  free (image);
+  return (TRUE);
+
+}
+
+RegImage *load_imreg (char *DataBase, int *nimage) {
+
+  int Nimage, status;
+  char line[80];
+  FILE *f;
+  Header header, theader;
+  Matrix matrix;
+  FTable table;
+  RegImage *image;
+
+  *nimage = 0;
+
+  /* open database */
+  f = fopen (DataBase, "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "ERROR: can't open Registration Database\n");
+    return ((RegImage *) NULL);
+  }
+
+  /* load in database header */
+  if (!gfits_fread_header (f, &header)) {
+    fclose (f);
+    gfits_free_header (&header);
+    gprint (GP_ERR, "ERROR: trouble reading database header\n");
+    return ((RegImage *) NULL);
+  }
+
+  /* check for database v1, v2 */
+  gfits_scan (&header, "ORIGIN", "%s", 1, line);
+  if (!strcmp (line, "MDM Observatory")) {
+
+    fseek (f, header.size, SEEK_SET);
+    
+    /* load existing data from database */
+    gfits_scan (&header, "NIMAGES", "%d", 1, &Nimage);
+    ALLOCATE (image, RegImage, Nimage);
+    status = fread (image, sizeof(RegImage), Nimage, f);
+    fclose (f);
+    
+    if (status != Nimage) {
+      gprint (GP_ERR, "ERROR: header and data in dB don't match (%d vs %d)\n", Nimage, status);
+      gfits_free_header (&header);
+      free (image);
+      return ((RegImage *) NULL);
+    }
+    gfits_convert_RegImage (image, sizeof (RegImage), Nimage);
+
+    *nimage = Nimage;
+    return (image);
+  }
+
+  /* we probably have v3 */
+  if (!gfits_fread_matrix (f, &matrix, &header)) {
+    fclose (f);
+    gfits_free_header (&header);
+    gfits_free_matrix (&matrix);
+    gprint (GP_ERR, "ERROR: trouble reading database matrix\n");
+    return ((RegImage *) NULL);
+  }
+
+  table.header = &theader;
+  if (!gfits_fread_ftable  (f, &table, "IMAGE_DATABASE")) {
+    fclose (f);
+    gfits_free_header (&header);
+    gfits_free_matrix (&matrix);
+    gprint (GP_ERR, "ERROR: trouble reading database table\n");
+    return ((RegImage *) NULL);
+  }
+
+  /* convert to internal format */
+  image = (RegImage *) table.buffer;
+  gfits_scan (table.header, "NAXIS2", "%d", 1, &Nimage);
+  gfits_convert_RegImage (image, sizeof (RegImage), Nimage);
+
+  gfits_free_header (&header);
+  gfits_free_matrix (&matrix);
+
+  *nimage = Nimage;
+  return (image);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imsearch.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imsearch.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imsearch.c	(revision 15879)
@@ -0,0 +1,154 @@
+# include "dvoshell.h"
+
+int imsearch (int argc, char **argv) {
+ 
+  char DataBase[256], name[64];
+  FILE *f;
+  Header header;
+  RegImage *pimage;
+  int i, Nimage, status, N, TimeSelect, SaveNames;
+  int ModeSelect, TypeSelect, CCDSelect, FilterSelect;
+  char *Filter, *obstime;
+  int Type, Mode, CCD;
+  time_t tzero, obstime_sec;
+  double trange;
+   
+  VarConfig ("REGISTRATION_DATABASE", "%s", DataBase);
+
+  SaveNames = FALSE;
+  if ((N = get_argument (argc, argv, "-save"))) {
+    remove_argument (N, &argc, argv);
+    SaveNames = TRUE;
+  }
+ 
+  TimeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-time"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    TimeSelect = TRUE;
+  }
+ 
+  Type = 0;
+  TypeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-type"))) {
+    remove_argument (N, &argc, argv);
+    Type = get_image_type (argv[N]);
+    if (Type == T_UNDEF) {
+      gprint (GP_ERR, "ERROR: invalid image type %s\n", argv[N]);
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    TypeSelect = TRUE;
+  }
+ 
+  Mode = 0;
+  ModeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-mode"))) {
+    remove_argument (N, &argc, argv);
+    Mode = get_image_mode (argv[N]);
+    if (Mode == M_UNDEF) {
+      gprint (GP_ERR, "ERROR: invalid image mode %s\n", argv[N]);
+      exit (1);
+    }
+    remove_argument (N, &argc, argv);
+    ModeSelect = TRUE;
+  }
+ 
+  CCD = 0;
+  CCDSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-ccd"))) {
+    remove_argument (N, &argc, argv);
+    CCD = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+    CCDSelect = TRUE;
+  }
+ 
+  Filter = NULL;
+  FilterSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-filter"))) {
+    remove_argument (N, &argc, argv);
+    Filter = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    FilterSelect = TRUE;
+    if (!strcasecmp (Filter, "X")) {
+      FilterSelect = FALSE;
+    }
+  }
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: imsearch [-time start range] [-type type] [-mode mode] [-ccd N] [-filter name]\n");
+    exit (1);
+  }
+
+  /* load in database header */
+  if (!gfits_read_header (DataBase, &header)) {
+    gprint (GP_ERR, "ERROR: trouble reading database header\n");
+    return (FALSE);
+  }
+
+  /* open database */
+  f = fopen (DataBase, "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "ERROR: can't open Registration Database\n");
+    return (FALSE);
+  }
+  fseek (f, header.size, SEEK_SET);
+
+  /* load existing data from database */
+  gfits_scan (&header, "NIMAGES", "%d", 1, &Nimage);
+  ALLOCATE (pimage, RegImage, Nimage);
+  status = fread (pimage, sizeof(RegImage), Nimage, f);
+  fclose (f);
+  if (status != Nimage) {
+    gprint (GP_ERR, "ERROR: header and data in dB don't match (%d vs %d)\n", Nimage, status);
+    gfits_free_header (&header);
+    free (pimage);
+    return (FALSE);
+  }
+  gfits_convert_RegImage (pimage, sizeof (RegImage), Nimage);
+
+  /* print out all data */
+  N = 0;
+  for (i = 0; i < Nimage; i++) {
+    if (TimeSelect && ((pimage[i].obstime < tzero) || (pimage[i].obstime > tzero + trange))) continue;
+    if (FilterSelect && (strcasecmp (pimage[i].filter, Filter))) continue;
+    if (ModeSelect && (pimage[i].mode != Mode)) continue;
+    if (CCDSelect && (pimage[i].ccd != CCD)) continue;
+    if (TypeSelect && (pimage[i].type != Type)) continue;
+
+    obstime_sec = (time_t) pimage[i].obstime;
+    obstime = ctime (&obstime_sec);
+    obstime[strlen(obstime)-1] = 0;
+
+    gprint (GP_LOG, "%5d %6s %6s %2d %2d   ", i, get_type_name(pimage[i].type), get_mode_name(pimage[i].mode), pimage[i].ccd, pimage[i].type);
+    gprint (GP_LOG, "%s %s  ", pimage[i].pathname, pimage[i].filename);
+    gprint (GP_LOG, "%s %s %f %s\n", pimage[i].filter, pimage[i].instrument, pimage[i].exptime, obstime);
+
+    if (SaveNames) {
+      sprintf (name, "IMAGEpath:%d", N);
+      set_str_variable (name, pimage[i].pathname);
+      sprintf (name, "IMAGEfile:%d", N);
+      set_str_variable (name, pimage[i].filename);
+      sprintf (name, "IMAGEmode:%d", N);
+      set_int_variable (name, pimage[i].mode);
+    }
+    N++;
+  }
+  if (SaveNames) {
+    set_int_variable ("IMAGEpath:n", N);
+    set_int_variable ("IMAGEfile:n", N);
+  }
+
+  free (pimage);
+  gfits_free_header (&header);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imstats.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imstats.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/imstats.c	(revision 15879)
@@ -0,0 +1,62 @@
+# include "dvoshell.h"
+
+int imstats (int argc, char **argv) {
+  
+  int i, kapa, Nimage, N;
+  int Mcal, AutoLimits;
+  double r, d;
+  Image *image;
+  Vector Xvec, Yvec;  
+  Graphdata graphmode;
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return (FALSE);
+
+  Mcal = TRUE;
+  if ((N = get_argument (argc, argv, "-dM"))) {
+    remove_argument (N, &argc, argv);
+    Mcal = FALSE;
+  }
+
+  AutoLimits = FALSE;
+  if ((N = get_argument (argc, argv, "-l"))) {
+    remove_argument (N, &argc, argv);
+    AutoLimits = TRUE;
+  }
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: imstats [-dM] [-l]\n");
+    return (FALSE);
+  }
+
+  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
+  BuildChipMatch (image, Nimage);
+
+  /* assign vector values */
+  Xvec.Nelements = Nimage;
+  Yvec.Nelements = Nimage;
+  ALLOCATE (Xvec.elements, float, Xvec.Nelements);
+  ALLOCATE (Yvec.elements, float, Yvec.Nelements);
+  gprint (GP_LOG, "seq  ra (J2000) dec    time (s)   Nstars\n");
+  for (i = 0; i < Nimage; i++) {
+    Xvec.elements[i] = image[i].secz;
+    if (Mcal) 
+      Yvec.elements[i] = image[i].Mcal;
+    else 
+      Yvec.elements[i] = image[i].dMcal;
+    if (!FindMosaicForImage (image, Nimage, i)) continue;
+    XY_to_RD (&r, &d, 0.5*image[i].NX, 0.5*image[i].NY, &image[i].coords);
+    gprint (GP_ERR, "%d %8.4f %8.4f %10d %6d  %5.3f %6.3f %6.3f\n", 
+	     i, r, d, image[i].tzero, image[i].nstar, Xvec.elements[i], 
+	     image[i].Mcal, image[i].dMcal);
+  } 
+  if (AutoLimits) SetLimits (&Xvec, &Yvec, &graphmode);
+
+  graphmode.style = 2;
+  graphmode.etype = 0;
+  PlotVectorPair (kapa, Nimage, Xvec.elements, Yvec.elements, &graphmode);
+  
+  free (Xvec.elements);
+  free (Yvec.elements);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/init.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/init.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/init.c	(revision 15879)
@@ -0,0 +1,117 @@
+# include "dvoshell.h"
+
+int avextract	    PROTO((int, char **));
+int badimages	    PROTO((int, char **));
+int calextract	    PROTO((int, char **));
+int calmextract	    PROTO((int, char **));
+int catlog	    PROTO((int, char **));
+int catdir_define   PROTO((int, char **));
+int ccd		    PROTO((int, char **));
+int cmatch	    PROTO((int, char **));
+int cmd		    PROTO((int, char **));
+int cmpload	    PROTO((int, char **));
+int cmpread	    PROTO((int, char **));
+int ddmags	    PROTO((int, char **));
+int detrend	    PROTO((int, char **));
+int dmagaves	    PROTO((int, char **));
+int dmagmeas	    PROTO((int, char **));
+int dmags	    PROTO((int, char **));
+int dmt		    PROTO((int, char **));
+int elixir          PROTO((int, char **));
+int fitcolors       PROTO((int, char **));
+int fitsed          PROTO((int, char **));
+int gcat	    PROTO((int, char **));
+int getxtra	    PROTO((int, char **));
+int gimages	    PROTO((int, char **));
+int gstar	    PROTO((int, char **));
+int gtypes	    PROTO((int, char **));
+int images	    PROTO((int, char **));
+int imbox	    PROTO((int, char **));
+int imdata	    PROTO((int, char **));
+int imdense	    PROTO((int, char **));
+int imextract	    PROTO((int, char **));
+int imlist	    PROTO((int, char **));
+int imphot	    PROTO((int, char **));
+int imrough	    PROTO((int, char **));
+int imsearch	    PROTO((int, char **));
+int imstats	    PROTO((int, char **));
+int lcat	    PROTO((int, char **));
+int lcurve	    PROTO((int, char **));
+int lightcurve	    PROTO((int, char **));
+int mextract	    PROTO((int, char **));
+int pcat	    PROTO((int, char **));
+int photcodes	    PROTO((int, char **));
+int pmeasure	    PROTO((int, char **));
+int paverage	    PROTO((int, char **));
+int procks	    PROTO((int, char **));
+int showtile	    PROTO((int, char **));
+int skycat	    PROTO((int, char **));
+int skycoverage	    PROTO((int, char **));
+int skyregion	    PROTO((int, char **));
+int simage	    PROTO((int, char **));
+int subpix	    PROTO((int, char **));
+int version         PROTO((int, char **));
+
+static Command cmds[] = {  
+  {"avextract",   avextract,    "extract average data values"},
+  {"badimages",   badimages,    "look for images with anomalous astrometry"},
+  {"calextract",  calextract,   "extract photometry calibration"},
+  {"calmextract", calmextract,  "extract photometry calibration"},
+  {"catdir",      catdir_define,"re-define CATDIR"},
+  {"ccd",         ccd,          "plot color-color diagram"},
+  {"cmatch",      cmatch,       "match two catalogs"},
+  {"cmd",         cmd,          "plot cmd of stars in current region"},
+  {"cmpload",     cmpload,      "load cmp file into ?"},
+  {"cmpread",     cmpread,      "read data from cmp format files"},
+  {"ddmags",      ddmags,       "plot magnitude differences"},
+  {"detrend", 	  detrend,      "extract from detrend database?"},
+  {"dmagaves",    dmagaves,     "foo"},
+  {"dmagmeas",    dmagmeas,     "foo"},
+  {"dmags",       dmags,        "plot differential magnitudes between filters"},
+  {"dmt",         dmt,          "plot mag scatter"},
+  {"elixir",      elixir,       "talk to elixir"},
+  {"fitcolors",   fitcolors,    "fit chip-to-chip color terms"},
+  {"fitsed",      fitsed,       "fit stellar SEDs to objects"},
+  {"gcat",    	  gcat,         "get catalog at location"},
+  {"gimages", 	  gimages,      "get images at location"},
+  {"gstar",       gstar,        "get star statistics"},
+  {"images",  	  images,       "plot image boxes"},
+  {"imbox",   	  imbox,        "plot expected image box"},
+  {"imdata",  	  imdata,       "extract data for specific images"},
+  {"imdense", 	  imdense,      "image density plot"},
+  {"imextract",   imextract,    "extract vectors from catalogs"},
+  {"imlist",      imlist,       "list image info"},
+  {"imphot",      imphot,       "image photometry info"},
+  {"imrough",     imrough,      "get info from imruf database"},
+  {"imsearch",    imsearch,     "get info from imreg database"},
+  {"imstats", 	  imstats,      "plot image statistics"},
+  {"lcat",    	  lcat,         "list catalogs in region"},
+  {"lcurve",      lcurve,       "plot lightcurve for a star"},
+  {"lightcurve",  lightcurve,   "extract lightcurve for a star"},
+  {"mextract",    mextract,     "extract measure data values"},
+  {"pcat",    	  skycat,       "plot catalog boundaries"},
+  {"photcodes",   photcodes,    "list photometry codes"},
+  {"pmeasure",    pmeasure,     "plot individual measurements"},
+  {"paverage",    paverage,     "plot average magnitude"},
+  {"procks",      procks,       "plot rocks"},
+  {"showtile",    showtile,     "plot tile pattern"},
+  {"skycat",      skycat,       "show sky catalog boundaries"},
+  {"skycoverage", skycoverage,  "measure image union on sky"},
+  {"skyregion",   skyregion,    "set sky region for db queries"},
+  {"simage",      simage,       "plot stars in an image"},
+  {"subpix",      subpix,       "get subpixel positions"},
+  {"version",     version,      "show version information"},
+//{"addxtra",     addxtra,      "add extra data to object"},
+//{"getxtra",     getxtra,      "get extra data from object"},
+}; 
+
+/* move to astro */
+
+void InitDVO () {
+  
+  int i;
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/lcat.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/lcat.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/lcat.c	(revision 15879)
@@ -0,0 +1,46 @@
+# include "dvoshell.h"
+
+int lcat (int argc, char **argv) {
+  
+  double Radius;
+  int i, N, ShowAll;
+  char exists;
+  struct stat filestat;
+  Graphdata graphmode;
+  SkyTable *sky;
+  SkyList *skylist;
+
+  if (!GetGraphData (&graphmode, NULL, NULL)) return (FALSE);
+
+  ShowAll = FALSE;
+  if ((N = get_argument (argc, argv, "-all"))) {
+    remove_argument (N, &argc, argv);
+    ShowAll = TRUE;
+  }
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: lcat [-all]\n");
+    return (FALSE);
+  }
+
+  Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax));
+
+  /* load sky from correct table */
+  sky = GetSkyTable ();
+  skylist = SkyListByRadius (sky, -1, graphmode.coords.crval1, graphmode.coords.crval2, Radius);
+
+  for (i = 0; i < skylist[0].Nregions; i++) {
+    exists = 'Y';
+    if (stat (skylist[0].filename[i], &filestat) == -1) exists = 'N';
+    if (ShowAll) {
+      gprint (GP_ERR, "%3d %s  %c\n", i, skylist[0].regions[i][0].name, exists);
+    } else {
+      if (exists == 'Y') {
+	gprint (GP_ERR, "%3d %s\n", i, skylist[0].regions[i][0].name);
+      }
+    }
+  }
+
+  SkyListFree (skylist);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/lcurve.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/lcurve.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/lcurve.c	(revision 15879)
@@ -0,0 +1,192 @@
+# include "dvoshell.h"
+
+int lcurve (int argc, char **argv) {
+  
+  char string[128], *p;
+  double Ra, Dec, Radius, Radius2, r;
+  float *RA, *DEC;
+  int kapa, TimeFormat;
+  int Nstars, found, AutoLimits, ErrorBars, GalMag, AbsPhot, SaveVectors;
+  int i, j, m, N, NPTS, *N1;
+  time_t TimeReference;
+  struct tm *timeptr;
+  Vector *xvec, *yvec;
+  Vector Xvec, Yvec, dYvec;
+  Catalog catalog;
+  Graphdata graphmode;
+  SkyTable *sky;
+  SkyList *skylist;
+
+  if (!InitPhotcodes ()) return (FALSE);
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return (FALSE);
+
+  AutoLimits = FALSE;
+  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"))) {
+    remove_argument (N, &argc, argv);
+    SaveVectors = TRUE;
+    if ((xvec = SelectVector (argv[N], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    remove_argument (N, &argc, argv);
+    if ((yvec = SelectVector (argv[N], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+    remove_argument (N, &argc, argv);
+  }
+
+  AbsPhot = FALSE;
+  if ((N = get_argument (argc, argv, "-abs"))) {
+    remove_argument (N, &argc, argv);
+    AbsPhot = TRUE;
+  }
+
+  GalMag = FALSE;
+  if ((N = get_argument (argc, argv, "-gal"))) {
+    gprint (GP_ERR, "galaxy magnitudes currently disabled\n");
+    return (FALSE);
+  }
+
+  ErrorBars = FALSE;
+  if ((N = get_argument (argc, argv, "-d"))) {
+    remove_argument (N, &argc, argv);
+    ErrorBars = TRUE;
+  }
+
+  if (argc < 4) {
+    gprint (GP_ERR, "USAGE: lcurve RA DEC Radius\n");
+    return (FALSE);
+  }
+  
+  Ra = atof (argv[1]);
+  Dec = atof (argv[2]);
+  Radius = atof (argv[3]);
+
+  /* load sky from correct table */
+  sky = GetSkyTable ();
+  skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius);
+
+  if (skylist[0].Nregions > 1) {
+    gprint (GP_ERR, "warning, radius overlaps region boundary, not yet implemented\n");
+  }
+
+  /* set filename, read in header */
+  catalog.filename = skylist[0].filename[0];
+  catalog.catflags = LOAD_AVES | LOAD_MEAS;
+  catalog.Nsecfilt = 0;
+
+  // an error exit status here is a significant error
+  if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+  }
+  dvo_catalog_unlock (&catalog);
+
+  Nstars = catalog.Naverage;
+  ALLOCATE (RA, float, Nstars);
+  ALLOCATE (DEC, float, Nstars);
+  ALLOCATE (N1, int, Nstars);
+
+  /* find star(s) in RA, DEC list -- use a dumb algorithm for now, improve later */
+  /* stars are not guaranteed to be sorted in RA or in DEC, so first sort the list */
+  for (i = 0; i < Nstars; i++) {
+    RA[i] = catalog.average[i].R;
+    DEC[i] = catalog.average[i].D;
+    N1[i] = i;
+  }
+  /* sort list by DEC */
+  if (Nstars > 1) sort_lists (DEC, RA, N1, Nstars);
+  /* at this point, RA, DEC, and N1 are sorted by DEC.  
+     catalog.average[N1[i]].R = RA[i] */
+
+  NPTS = 100;
+  ALLOCATE (Xvec.elements, float, NPTS);
+  ALLOCATE (Yvec.elements, float, NPTS);
+  dYvec.elements = NULL;
+  if (ErrorBars) { ALLOCATE (dYvec.elements, float, NPTS); }
+  N = 0;
+
+  GetTimeFormat (&TimeReference, &TimeFormat);
+
+  Radius2 = Radius*Radius;
+  found = FALSE;
+  for (i = 0; (i < catalog.Naverage) && !found; i++) {
+
+    /* this can be improved by using a couple of jumps to get within range */
+    if (Dec > DEC[i] + Radius)
+      continue;
+    
+    r = SQ(Dec - DEC[i]) + SQ(Ra - RA[i]);
+    if (r < Radius2) {
+      /* found star, extract measurements */
+      m = catalog.average[N1[i]].offset;
+      for (j = 0; j < catalog.average[N1[i]].Nm; j++, m++) {
+	if (ErrorBars) dYvec.elements[N] = catalog.measure[m].dM;
+	Xvec.elements[N] = TimeValue (catalog.measure[m].t, TimeReference, TimeFormat);
+	Yvec.elements[N] = PhotCat (&catalog.measure[m]);
+	/**** need to use PhotRel optionally here ****/
+	N++; 
+	if (N == NPTS) {
+	  NPTS += 100;
+	  REALLOCATE (Xvec.elements, float, NPTS);
+	  REALLOCATE (Yvec.elements, float, NPTS);
+	  if (ErrorBars) { REALLOCATE (dYvec.elements, float, NPTS); }
+	}
+      }      
+    }
+  }
+  Xvec.Nelements = Yvec.Nelements = N;
+  if (ErrorBars) dYvec.Nelements = N;
+  
+  if (ErrorBars)
+    sortthree (Xvec.elements, Yvec.elements, dYvec.elements, N);
+  else
+    fsortpair (Xvec.elements, Yvec.elements, N);
+
+  /* autoscale the plot */
+  if (AutoLimits) SetLimits (&Xvec, &Yvec, &graphmode);
+
+  if (ErrorBars) 
+    graphmode.etype = 1;  /* y errors only in lcurves */
+  else
+    graphmode.etype = 0;  
+
+  KapaPrepPlot (kapa, N, &graphmode);
+  KapaPlotVector (kapa, N, Xvec.elements, "x");
+  KapaPlotVector (kapa, N, Yvec.elements, "y");
+  if (ErrorBars) {
+    KapaPlotVector (kapa, N, dYvec.elements, "dym");
+    KapaPlotVector (kapa, N, dYvec.elements, "dyp");
+  }
+
+  timeptr = gmtime ((time_t *)&TimeReference);
+
+  if ((p = get_variable ("TIMEFORMAT")) == (char *) NULL) p = strcreate ("days");
+  sprintf (string, "%s since %02d/%02d/%02d UT", p,
+	   timeptr[0].tm_year, timeptr[0].tm_mon+1, timeptr[0].tm_mday);
+  free (p);
+  KapaSendLabel (kapa, string, 0);
+
+  free (RA);
+  free (DEC);
+  free (N1);
+
+  if (SaveVectors) {
+    free (xvec[0].elements);
+    free (yvec[0].elements);
+    xvec[0].elements = Xvec.elements;
+    yvec[0].elements = Yvec.elements;
+    xvec[0].Nelements = yvec[0].Nelements = Xvec.Nelements;
+  } else {
+    free (Xvec.elements);
+    free (Yvec.elements);
+  }
+
+  if (ErrorBars) free (dYvec.elements);
+  dvo_catalog_free (&catalog);
+
+  SkyListFree (skylist);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/lightcurve.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/lightcurve.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/lightcurve.c	(revision 15879)
@@ -0,0 +1,145 @@
+# include "dvoshell.h"
+
+int lightcurve (int argc, char **argv) {
+  
+  double Ra, Dec, Radius, Radius2, r;
+  float *RA, *DEC;
+  int Nstars, found, PhotCodeSelect;
+  int i, j, k, m, N, NPTS, Nsecfilt, RELPHOT, *N1, TimeFormat;
+  time_t TimeReference;
+
+  PhotCode *code;
+  Catalog catalog;
+  SkyTable *sky;
+  SkyList *skylist;
+  Vector *tvec, *mvec, *dmvec;
+
+  if (!InitPhotcodes ()) return (FALSE);
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  if ((tvec = SelectVector ("tc", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((mvec = SelectVector ("mc", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((dmvec = SelectVector ("dmc", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  RELPHOT = FALSE;
+  if ((N = get_argument (argc, argv, "-rel"))) {
+    remove_argument (N, &argc, argv);
+    RELPHOT = TRUE;
+  }
+
+  code = NULL;
+  PhotCodeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-photcode"))) {
+    remove_argument (N, &argc, argv);
+    if ((code = GetPhotcodebyName (argv[N])) == NULL) {
+      gprint (GP_ERR, "ERROR: photcode not found in photcode table\n");
+      return (FALSE);
+    }
+    PhotCodeSelect = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc < 4) {
+    gprint (GP_ERR, "USAGE: lightcurve RA DEC Radius\n");
+    return (FALSE);
+  }
+  
+  Ra = atof (argv[1]);
+  Dec = atof (argv[2]);
+  Radius = atof (argv[3]);
+
+  sky = GetSkyTable ();
+  skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius);
+
+  if (skylist[0].Nregions > 1) {
+    gprint (GP_ERR, "warning, radius overlaps region boundary, not yet implemented\n");
+  }
+
+  /* set filename, read in header */
+  catalog.filename = skylist[0].filename[0];
+  catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+  catalog.Nsecfilt = 0;
+
+  // an error exit status here is a significant error
+  if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+  }
+  dvo_catalog_unlock (&catalog);
+
+  Nstars = catalog.Naverage;
+  ALLOCATE (RA, float, Nstars);
+  ALLOCATE (DEC, float, Nstars);
+  ALLOCATE (N1, int, Nstars);
+
+  /* find star(s) in RA, DEC list -- use a dumb algorithm for now, improve later */
+  /* stars are not guaranteed to be sorted in RA or in DEC, so first sort the list */
+  for (i = 0; i < Nstars; i++) {
+    RA[i] = catalog.average[i].R;
+    DEC[i] = catalog.average[i].D;
+    N1[i] = i;
+  }
+  /* sort list by DEC */
+  if (Nstars > 1) sort_lists (DEC, RA, N1, Nstars);
+  /* at this point, RA, DEC, and N1 are sorted by DEC.  
+     catalog.average[N1[i]].R = RA[i] */
+
+  N = 0;
+  NPTS = 100;
+  REALLOCATE (tvec[0].elements, float, NPTS);
+  REALLOCATE (mvec[0].elements, float, NPTS);
+  REALLOCATE (dmvec[0].elements, float, NPTS);
+  
+  GetTimeFormat (&TimeReference, &TimeFormat);
+
+  Radius2 = Radius*Radius;
+  found = FALSE;
+  for (i = 0; (i < catalog.Naverage) && !found; i++) {
+
+    /* this can be improved by using a couple of jumps to get within range */
+    if (Dec > DEC[i] + Radius)
+      continue;
+    
+    r = SQ(Dec - DEC[i]) + SQ(Ra - RA[i]);
+    if (r < Radius2) {
+      k = N1[i];
+      /* found star, extract measurements */
+      m = catalog.average[k].offset;
+      for (j = 0; j < catalog.average[k].Nm; j++, m++) {
+
+	if (PhotCodeSelect) {
+	  if ((code[0].type == PHOT_REF) || (code[0].type == PHOT_DEP)) {
+	    if (code[0].code != catalog.measure[m].photcode) continue;
+	  } 
+	  if (code[0].type == PHOT_SEC) {
+	    if (code[0].code != GetPhotcodeEquivCodebyCode (catalog.measure[m].photcode)) continue;
+	  } 
+	}      
+
+	tvec[0].elements[N] = TimeValue (catalog.measure[m].t, TimeReference, TimeFormat);
+	dmvec[0].elements[N] = catalog.measure[m].dM;
+	if (RELPHOT) {
+	  mvec[0].elements[N] = PhotCat (&catalog.measure[m]);
+	} else {
+	  mvec[0].elements[N] = PhotRel (&catalog.measure[m], &catalog.average[k], &catalog.secfilt[k*Nsecfilt]);
+	}
+	N++; 
+	if (N == NPTS) {
+	  NPTS += 100;
+	  REALLOCATE (tvec[0].elements, float, NPTS);
+	  REALLOCATE (mvec[0].elements, float, NPTS);
+	  REALLOCATE (dmvec[0].elements, float, NPTS);
+	}
+      }      
+    }
+  }
+  sortthree (tvec[0].elements, mvec[0].elements, dmvec[0].elements, N);
+  tvec[0].Nelements = mvec[0].Nelements = dmvec[0].Nelements = N;
+
+  free (RA);
+  free (DEC);
+  free (N1);
+  dvo_catalog_free (&catalog);
+  SkyListFree (skylist);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/match_image.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/match_image.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/match_image.c	(revision 15879)
@@ -0,0 +1,73 @@
+# include "dvoshell.h"
+
+int match_image (Image *image, int Nimage, unsigned int T, short int S) {
+
+  int N, Nlo, Nhi, N1, N2;
+
+  /* bracket first value of interest */
+  Nlo = 0; Nhi = Nimage;
+  while (Nhi - Nlo > 10) {
+    N = 0.5*(Nlo + Nhi);
+    if (image[N].tzero < T) {
+      Nlo = N;
+    } else {
+      Nhi = N + 1;
+    }
+  }
+  N1 = Nlo;
+
+  /* bracket last value of interest */
+  Nlo = 0; Nhi = Nimage;
+  while (Nhi - Nlo > 10) {
+    N = 0.5*(Nlo + Nhi);
+    if (image[N].tzero > T) {
+      Nhi = N;
+    } else {
+      Nlo = N - 1;
+    }
+  }
+  N2 = Nhi;
+
+  for (N = N1; N < N2; N++) {
+    if ((image[N].tzero == T) && (image[N].photcode == S)) {
+      return (N);
+    }
+  }
+  return (-1);
+}
+
+int match_image_subset (Image *image, int *subset, int Nsubset, unsigned int T, short int S) {
+
+  int N, Nlo, Nhi, N1, N2;
+
+  /* bracket first value of interest */
+  Nlo = 0; Nhi = Nsubset;
+  while (Nhi - Nlo > 10) {
+    N = 0.5*(Nlo + Nhi);
+    if (image[subset[N]].tzero < T) {
+      Nlo = N;
+    } else {
+      Nhi = N + 1;
+    }
+  }
+  N1 = Nlo;
+
+  /* bracket last value of interest */
+  Nlo = 0; Nhi = Nsubset;
+  while (Nhi - Nlo > 10) {
+    N = 0.5*(Nlo + Nhi);
+    if (image[subset[N]].tzero > T) {
+      Nhi = N;
+    } else {
+      Nlo = N - 1;
+    }
+  }
+  N2 = Nhi;
+
+  for (N = N1; N < N2; N++) {
+    if ((image[subset[N]].tzero == T) && (image[subset[N]].photcode == S)) {
+      return (subset[N]);
+    }
+  }
+  return (-1);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/mextract.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/mextract.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/mextract.c	(revision 15879)
@@ -0,0 +1,233 @@
+# include "dvoshell.h"
+
+int mextract (int argc, char **argv) {
+  
+  int i, j, k, m, n, N, Npts, NPTS, last, Nfields, Nreturn, Ncstack, Nstack;
+  int Nsecfilt, VERBOSE, loadImages, mosaicMode;
+  char **cstack, name[1024];
+  float *values;
+  void *Signal;
+
+  Catalog catalog;
+  SkyList *skylist;
+  PhotCode *code;
+  Vector **vec;
+  dbField *fields;
+  dbStack *stack;
+  SkyRegionSelection *selection;
+
+  /* defaults */
+  skylist = NULL;
+  code = NULL;
+  fields = NULL;
+  stack = NULL;
+
+  if ((N = get_argument (argc, argv, "-h"))) goto help;
+  if ((N = get_argument (argc, argv, "--help"))) goto help;
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    remove_argument (N, &argc, argv);
+    VERBOSE = TRUE;
+  }
+
+  dvo_catalog_init (&catalog, TRUE);
+
+  /* load photcode information */
+  if (!InitPhotcodes ()) goto escape;
+  Nsecfilt = GetPhotcodeNsecfilt ();
+  
+  // init locally static variables (time refs)
+  dbExtractMeasuresInit();
+
+  // parse skyregion options
+  if ((selection = SetRegionSelection (&argc, argv)) == NULL) goto escape;
+
+  // command-line is of the form: avextract field,field, field [where (field op value)...]
+
+  // parse the fields to be extracted and returned
+  fields = dbCmdlineFields (argc, argv, DVO_TABLE_MEASURE, &last, &Nfields);
+  if (fields == NULL) return (FALSE);
+
+  // XXX add the skyregion limits as if it were a where statement
+
+  // parse the remainder of the line as a boolean math expression
+  cstack = isolate_elements (argc-last, &argv[last], &Ncstack);
+  
+  // construct the db Boolean math stack (frees cstack)
+  stack = dbRPN (Ncstack, cstack, &Nstack);
+  if ((Ncstack > 0) && (Nstack < 1)) {
+    print_error ();
+    goto escape;
+  }
+
+  // add the skyregion limits to the where statement (or create)
+  dbAstroRegionLimits (&stack, &Nstack, selection, DVO_TABLE_MEASURE);
+
+  // parse stack elements into fields and scalars as needed
+  Nreturn = Nfields; 
+  dbCheckStack (stack, Nstack, DVO_TABLE_MEASURE, &fields, &Nfields);
+  // XXX handle errors
+
+  /* load region corresponding to selection above */
+  if ((skylist = SelectRegions (selection)) == NULL) goto escape;
+
+  // load image data if needed (for fields listed below)
+  loadImages = FALSE;
+  mosaicMode = FALSE;
+  for (i = 0; !loadImages && (i < Nfields); i++) {
+    if (fields[i].ID == MEAS_XCCD) loadImages = TRUE;
+    if (fields[i].ID == MEAS_YCCD) loadImages = TRUE;
+    if (fields[i].ID == MEAS_XMOSAIC) loadImages = mosaicMode = TRUE;
+    if (fields[i].ID == MEAS_YMOSAIC) loadImages = mosaicMode = TRUE;
+  }
+  if (loadImages && !SetImageSelection (mosaicMode, selection)) goto escape;
+
+  /* create storage vector */
+  ALLOCATE (values, float, Nfields);
+  ALLOCATE (vec, Vector *, Nreturn);
+  for (i = 0; i < Nreturn; i++) {
+    if (ISNUM(fields[i].name[0])) {
+      sprintf (name, "v_%s", fields[i].name);
+    } else {
+      sprintf (name, "%s", fields[i].name);
+    }
+    if ((vec[i] = SelectVector (name, ANYVECTOR, TRUE)) == NULL) goto escape;
+  }
+
+  Npts = 0;
+  NPTS = 1;
+
+  // grab data from all selected sky regions
+  Signal = signal (SIGINT, handle_interrupt);
+  interrupt = FALSE;
+  for (i = 0; (i < skylist[0].Nregions) && !interrupt; i++) {
+    /* lock, load, unlock catalog */
+    catalog.filename = skylist[0].filename[i];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS | LOAD_SECF;
+    catalog.Nsecfilt = Nsecfilt;
+
+    if (VERBOSE) gprint (GP_ERR, "trying %s (%d of %d)\n", catalog.filename, i, skylist[0].Nregions);
+      
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      gprint (GP_ERR, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    /* XXX need to call dvo_catalog_chipcoords here passing the loaded images */
+
+    for (j = 0; (j < catalog.Naverage) && !interrupt; j++) {
+      m = catalog.average[j].offset;
+      for (k = 0; (k < catalog.average[j].Nm); k++, m++) {
+
+	// extract the relevant values for this measurement
+	for (n = 0; n < Nfields; n++) {
+	  values[n] = dbExtractMeasures (&catalog.average[j], &catalog.secfilt[j*Nsecfilt], &catalog.measure[m], &fields[n]);
+	}
+	// fprintf (stderr, "object: ave: %f, cat: %f, averef %d\n", fields[n].name, values[2], values[3], catalog.measure[m].averef);
+
+	// test the conditional statement
+	if (!dbBooleanCond (stack, Nstack, values)) continue;
+	for (n = 0; n < Nreturn; n++) {
+	  vec[n][0].elements[Npts] = values[n];
+	  // fprintf (stderr, "keep : field: %s, value: %f\n", fields[n].name, values[n]);
+	}
+	Npts++;
+	if (Npts >= NPTS) {
+	  NPTS += 2000;
+	  for (n = 0; n < Nreturn; n++) {
+	    REALLOCATE (vec[n][0].elements, float, NPTS);
+	  }
+	}
+      }
+    }
+    dvo_catalog_free (&catalog);
+    // dbStackAllocPrint ();
+    // dbStackAllocReset ();
+    // dbStackFreePrint ();
+    // dbStackFreeReset ();
+  }
+  signal (SIGINT, Signal);
+  interrupt = FALSE;
+
+  for (n = 0; n < Nreturn; n++) {
+    vec[n][0].Nelements = Npts;
+    REALLOCATE (vec[n][0].elements, float, MAX(1,Npts));
+  }
+
+  dbFreeFields (fields, Nfields);
+  dbFreeStack (stack, Nstack);
+  free (stack);
+  FreeImageSelection ();
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  return (TRUE);
+
+escape:
+  dbFreeFields (fields, Nfields);
+  dbFreeStack (stack, Nstack);
+  free (stack);
+  FreeImageSelection ();
+  SkyListFree (skylist);
+  FreeSkyRegionSelection (selection);
+  dvo_catalog_free (&catalog);
+  return (FALSE);
+
+ help:
+  gprint (GP_ERR, "USAGE: mextract field[,field,field...] where (expression)\n");
+
+  if ((argc > N + 1) && !strcasecmp (argv[N+1], "fields")) {
+    gprint (GP_ERR, " USAGE: avextract field[,field,field...] where (expression)\n");
+    gprint (GP_ERR, "  RA : right ascension (J2000) for detection\n");
+    gprint (GP_ERR, "  DEC : declination for detection\n");
+    gprint (GP_ERR, "  RA:ave : average right ascension (J2000) for object\n");
+    gprint (GP_ERR, "  DEC:ave : average declination for object\n");
+    gprint (GP_ERR, "  RA:err : ra scatter \n");
+    gprint (GP_ERR, "  DEC:err : dec scatter\n");
+    gprint (GP_ERR, "  uRA : proper motion in ra\n");
+    gprint (GP_ERR, "  uDEC : proper motion in dec\n");
+    gprint (GP_ERR, "  duRA : proper motion error in ra\n");
+    gprint (GP_ERR, "  duDEC : proper motion error in dec\n");
+    gprint (GP_ERR, "  PAR : parallax\n");
+    gprint (GP_ERR, "  dPAR : parallax error \n");
+    gprint (GP_ERR, "  nmeas : number of measurements\n");
+    gprint (GP_ERR, "  nmiss : number of non-detections\n");
+    gprint (GP_ERR, "  xp : positional chi-square\n");
+    gprint (GP_ERR, "  objflag : object flags\n");
+    gprint (GP_ERR, "  photcode:ave : average magnitude for photcode (or equivalent)\n");
+    gprint (GP_ERR, "  photcode:ref : reference magnitude system for photcode (or equivalent)\n");
+    gprint (GP_ERR, "  photcode:inst : instrumental magnitude for photcode\n");
+    gprint (GP_ERR, "  photcode:cat :  catalog magnitude for photcode\n");
+    gprint (GP_ERR, "  photcode:sys :  system magnitude for photcode\n");
+    gprint (GP_ERR, "  photcode:rel :  relative magnitude for photcode\n");
+    gprint (GP_ERR, "  photcode:cal :  calibrated magnitude for photcode \n");
+    gprint (GP_ERR, "  photcode:err : magnitude error for photcode\n");
+    gprint (GP_ERR, "  photcode:chisq : chi-square of magnitude fit\n");
+    gprint (GP_ERR, "  photcode:ncode : number of measurements in photcode\n");
+    gprint (GP_ERR, "  photcode:nphot : number of measurements used for average magnitude\n");
+    gprint (GP_ERR, "  airmass : airmass of detection\n");
+    gprint (GP_ERR, "  exptime : exposure time\n");
+    gprint (GP_ERR, "  photcode : photcode \n");
+    gprint (GP_ERR, "  time : time of exposure\n");
+    gprint (GP_ERR, "  dR : ra offset\n");
+    gprint (GP_ERR, "  dD : dec offset\n");
+    gprint (GP_ERR, "  fwhm : fwhm (average)\n");
+    gprint (GP_ERR, "  fwhm_maj : fwhm (major axis)\n");
+    gprint (GP_ERR, "  fwhm_min : fwhm (minor axis)\n");
+    gprint (GP_ERR, "  theta : position angle\n");
+    gprint (GP_ERR, "  flags : detection flags\n");
+    gprint (GP_ERR, "  xccd : ccd x position\n");
+    gprint (GP_ERR, "  yccd : ccd y position\n");
+    gprint (GP_ERR, "  xmosaic : mosaic x position\n");
+    gprint (GP_ERR, "  ymosaic : mosaic y position\n");
+    gprint (GP_ERR, "  xchip : chip x position\n");
+    gprint (GP_ERR, "  ychip : chip y position\n");
+    gprint (GP_ERR, "  xfpa : fpa x position\n");
+    gprint (GP_ERR, "  yfpa : fpa y position\n");
+    return (FALSE);
+  }
+  gprint (GP_ERR, " mextract --help fields : for a complete listing of allowed fields\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/notes.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/notes.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/notes.txt	(revision 15879)
@@ -0,0 +1,10 @@
+
+avextract ra,dec,g,r,i where (ra > 5) && (dec < 3)
+
+
+U db_check_stack.c
+U db_convert_to_RPN.c
+U dvoBooleanElements.c
+U dvoEvaluateStack.c
+U dvodb.c
+U dvofields.c
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/paverage.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/paverage.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/paverage.c	(revision 15879)
@@ -0,0 +1,157 @@
+# include "dvoshell.h"
+# define NCHUNK 10000
+
+int paverage (int argc, char **argv) {
+  
+  FILE *f;
+  int i, j, kapa, Narg, Npts, NPTS, status, VERBOSE;
+  int Nsecfilt, Nsec;
+  double Mz, Mr, mag;
+  double Radius, Rmin, Rmax, R, D;
+  unsigned IDclip, IDchoice, LimExclude;
+  float *Xvec, *Yvec, *Zvec;
+
+  PhotCode *photcode;
+  SkyTable *sky;
+  SkyList *skylist;
+  Catalog catalog;
+  Graphdata graphmode;
+  Average *average;
+  SecFilt *secfilt;
+
+  if (!InitPhotcodes ()) return (FALSE);
+  Nsecfilt = GetPhotcodeNsecfilt ();
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  f = (FILE *) NULL;
+  Mz = 17.0;
+  Mr = -5.0;
+  Rmin = graphmode.coords.crval1 - 182.0;
+  Rmax = graphmode.coords.crval1 + 182.0;
+
+  // require a photcode?  default to 0?
+  Nsec = 0;
+  if ((Narg = get_argument (argc, argv, "-p"))) {
+    remove_argument (Narg, &argc, argv);
+    photcode = GetPhotcodebyName (argv[Narg]);
+    if (!photcode) {
+	fprintf (stderr, "unknown photcode %s\n", argv[Narg]);
+	return (FALSE);
+    }
+    remove_argument (Narg, &argc, argv);
+    Nsec = GetPhotcodeNsec (photcode[0].code);
+    if (Nsec == -1) {
+	fprintf (stderr, "photcode %s is not an AVERAGE photcode\n", argv[Narg]);
+	return (FALSE);
+    }
+  }
+
+  IDchoice = 0;
+  IDclip = FALSE;
+  if ((Narg = get_argument (argc, argv, "-ID"))) {
+    remove_argument (Narg, &argc, argv);
+    IDchoice  = atoi(argv[Narg]);
+    remove_argument (Narg, &argc, argv);
+    IDclip = TRUE;
+  }
+
+  LimExclude = FALSE;
+  if ((Narg = get_argument (argc, argv, "-x"))) {
+    remove_argument (Narg, &argc, argv);
+    LimExclude = TRUE;
+  }
+
+  VERBOSE = FALSE;
+  if ((Narg = get_argument (argc, argv, "-v"))) {
+    remove_argument (Narg, &argc, argv);
+    VERBOSE = TRUE;
+  }
+
+  if ((Narg = get_argument (argc, argv, "-m"))) {
+    remove_argument (Narg, &argc, argv);
+    Mr  = atof(argv[Narg]);
+    remove_argument (Narg, &argc, argv);
+    Mz = atof(argv[Narg]);
+    Mr = Mr - Mz;
+    remove_argument (Narg, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: paverage (-all) [-m M M] [-p photcode] [-ID ID] [-flag value] [-x]\n");
+    return (FALSE);
+  }
+  graphmode.style = 2; /* set style to points */
+  graphmode.size = -1; /* point size determined by Zvec */
+  graphmode.etype = 0; /* no errorbars */
+
+  Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax));
+
+  /* load sky from correct table */
+  sky = GetSkyTable ();
+  skylist = SkyListByRadius (sky, -1, graphmode.coords.crval1, graphmode.coords.crval2, Radius);
+  
+  /* storage for plotting the points */
+  Npts = 0;
+  NPTS = 1000;
+  ALLOCATE (Xvec, float, NPTS);
+  ALLOCATE (Yvec, float, NPTS);
+  ALLOCATE (Zvec, float, NPTS);
+
+  for (j = 0; j < skylist[0].Nregions; j++) {
+    catalog.filename = skylist[0].filename[j];
+    catalog.catflags = LOAD_AVES | LOAD_SECF;
+    catalog.Nsecfilt = Nsecfilt;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, VERBOSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    average = catalog.average;
+    secfilt = catalog.secfilt;
+
+    /* project stars to screen display coords */
+    for (i = 0; i < catalog.Naverage; i++) {
+      if (IDclip && (average[i].code != IDchoice)) continue;
+      while (average[i].R < Rmin) average[i].R += 360.0;
+      while (average[i].R > Rmax) average[i].R -= 360.0;
+
+      mag = secfilt[i*Nsecfilt+Nsec].M;
+      Zvec[Npts] = MIN (1.0, MAX (0.01, (mag - Mz) / Mr));
+      if (LimExclude && (Zvec[Npts] > 0.99)) continue;
+      if (Zvec[Npts] < 0.011) continue;
+      R = average[i].R;
+      D = average[i].D;
+      status = fRD_to_XY (&Xvec[Npts], &Yvec[Npts], R, D, &graphmode.coords);
+      if (!status) {
+	  fprintf (stderr, ".");
+	  continue;
+      }
+      Npts ++;
+
+      if (Npts == NPTS - 1) {
+	  NPTS += 1000;
+	  REALLOCATE (Xvec, float, NPTS);
+	  REALLOCATE (Yvec, float, NPTS);
+	  REALLOCATE (Zvec, float, NPTS);
+      }
+      if (Npts > NCHUNK) {
+	  PlotVectorTriplet (kapa, Npts, Xvec, Yvec, Zvec, &graphmode);
+	  Npts = 0;
+      }
+    }
+    dvo_catalog_free (&catalog);
+  }
+  if (Npts > 0) PlotVectorTriplet (kapa, Npts, Xvec, Yvec, Zvec, &graphmode);
+
+  free (Xvec);
+  free (Yvec);
+  free (Zvec);
+
+  return (TRUE);
+
+}
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/pcat.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/pcat.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/pcat.c	(revision 15879)
@@ -0,0 +1,111 @@
+# include "dvoshell.h"
+int RD_to_XYpic (double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside);
+
+// XXX EAM : this function is deprecated (now points at skycat)
+int pcat (int argc, char **argv) {
+  
+  double Radius;
+  int i, j, kapa, N, Nregions, ShowAll, NPTS, Npts, leftside;
+  RegionFile *regions;
+  char filename[128];
+  struct stat filestat;
+  Vector Xvec, Yvec;
+  Graphdata graphmode;
+  double X[4], Y[4], Rmin, Rmax, Rmid;
+  char catdir[256];
+  int VERBOSE;
+
+  VarConfig ("CATDIR", "%s", catdir);
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    remove_argument (N, &argc, argv);
+    VERBOSE = TRUE;
+  }
+
+  ShowAll = FALSE;
+  if ((N = get_argument (argc, argv, "-all"))) {
+    remove_argument (N, &argc, argv);
+    ShowAll = TRUE;
+  }
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: pcat [-all]\n");
+    return (FALSE);
+  }
+  if (!GetGraph (&graphmode, &kapa, NULL)) return (FALSE);
+  
+  Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax));
+  regions = find_regions (graphmode.coords.crval1, graphmode.coords.crval2, Radius, &Nregions);
+
+  Rmin = graphmode.coords.crval1 - 180.0;
+  Rmax = graphmode.coords.crval1 + 180.0;
+  Rmid = 0.5*(Rmin + Rmax);
+
+  NPTS = 200;
+  ALLOCATE (Xvec.elements, float, NPTS);
+  ALLOCATE (Yvec.elements, float, NPTS);
+  Npts = 0;
+   
+  for (i = 0; i < Nregions; i++) {
+    sprintf (filename, "%s/%s", catdir, regions[i].name);
+    if (ShowAll || (stat (filename, &filestat) != -1)) {
+      if (VERBOSE) gprint (GP_ERR, "%3d %s\n", i, regions[i].name);
+
+      leftside = -1;
+      RD_to_XYpic (&X[0], &Y[0], regions[i].RA0, regions[i].DEC0, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+      RD_to_XYpic (&X[1], &Y[1], regions[i].RA0, regions[i].DEC1, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+      RD_to_XYpic (&X[2], &Y[2], regions[i].RA1, regions[i].DEC1, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+      RD_to_XYpic (&X[3], &Y[3], regions[i].RA1, regions[i].DEC0, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+
+      Xvec.elements[Npts] = X[0];
+      Yvec.elements[Npts] = Y[0];
+      for (j = 1; j < 4; j++) {
+	Xvec.elements[Npts + j*2 - 0] = X[j];
+	Yvec.elements[Npts + j*2 - 0] = Y[j];
+	Xvec.elements[Npts + j*2 - 1] = X[j];
+	Yvec.elements[Npts + j*2 - 1] = Y[j];
+      }
+      Xvec.elements[Npts+7] = Xvec.elements[Npts];
+      Yvec.elements[Npts+7] = Yvec.elements[Npts];
+      Npts += 8;
+      if (Npts > NPTS - 1) {  /* this is OK because NPTS is made always a multiple of 8 */
+	NPTS += 200;
+	REALLOCATE (Xvec.elements, float, NPTS);
+	REALLOCATE (Yvec.elements, float, NPTS);
+      }
+    }
+  }
+
+  gprint (GP_ERR, "plotting %d catalogs\n", Npts/8);
+  Xvec.Nelements = Xvec.Nelements = Npts;
+  if (Npts > 0) {
+    graphmode.style = 2; /* points */
+    graphmode.ptype = 100; /* connect pairs of points */
+    graphmode.etype = 0;
+    PlotVectorPair (kapa, Npts, Xvec.elements, Yvec.elements, &graphmode);
+  }
+
+  free (Xvec.elements);
+  free (Yvec.elements);
+  free (regions);
+
+  return (TRUE);
+
+}
+
+int RD_to_XYpic (double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside) {
+
+  while (r < Rmin) { r += 360.0; }
+  while (r > Rmax) { r -= 360.0; }
+
+  if (*leftside == -1) {
+    *leftside = (r < Rmid);
+  } else {
+    if (  *leftside && (r > Rmid + 90)) { r -= 360.0; }
+    if (! *leftside && (r < Rmid - 90)) { r += 360.0; }
+  }
+
+  RD_to_XY (x, y, r, d, coords);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/photcodes.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/photcodes.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/photcodes.c	(revision 15879)
@@ -0,0 +1,63 @@
+# include "dvoshell.h"
+
+/* list or return all photcodes equivalent to the given filter */
+int photcodes (int argc, char **argv) {
+  
+  int i, Np;
+  int *list, Nlist;
+  char name[64];
+  PhotCode *code;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: photcodes (photcode)\n");
+    return (FALSE);
+  }
+
+  /* load photcodes, convert name to code */
+  if (!InitPhotcodes ()) return (FALSE);
+
+  if (!(Np = GetPhotcodeCodebyName (argv[1]))) {
+    gprint (GP_ERR, "ERROR: photcode not found in photcode table\n");
+    return (FALSE);
+  }
+
+  list = GetPhotcodeEquivList (Np, &Nlist);
+  
+  for (i = 0; i < Nlist; i++) {
+    code = GetPhotcodebyCode (list[i]);
+
+    sprintf (name, "photcode:name:%d", i);
+    set_str_variable (name, code[0].name);
+
+    sprintf (name, "photcode:C:%d", i);
+    set_variable (name, 0.001*code[0].C);
+
+    sprintf (name, "photcode:K:%d", i);
+    set_variable (name, code[0].K);
+
+    sprintf (name, "photcode:X:%d", i);
+    set_variable (name, code[0].X[0]);
+
+    sprintf (name, "photcode:dX:%d", i);
+    set_variable (name, 0.001*code[0].dX);
+
+    sprintf (name, "photcode:code:%d", i);
+    set_int_variable (name, code[0].code);
+
+    sprintf (name, "photcode:filter:%d", i);
+    set_str_variable (name, GetPhotcodeNamebyCode (code[0].equiv));
+
+    sprintf (name, "photcode:c1:%d", i);
+    set_str_variable (name, GetPhotcodeNamebyCode (code[0].c1));
+
+    sprintf (name, "photcode:c2:%d", i);
+    set_str_variable (name, GetPhotcodeNamebyCode (code[0].c2));
+
+    gprint (GP_ERR, "%5d %s %7.4f %7.4f %7.4f\n", 
+	     code[0].code, code[0].name, 0.001*code[0].C, code[0].K, code[0].X[0]);
+  }
+  set_int_variable ("photcode:n", Nlist);
+  free (list);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/photometry.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/photometry.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/photometry.c	(revision 15879)
@@ -0,0 +1,1220 @@
+# include "dvoshell.h"
+
+/* match code to measure  */
+# define TESTCODE(C,M) \
+  if (C != NULL) { \
+    switch (C[0].type) { \
+    case PHOT_DEP: \
+    case PHOT_REF: \
+      if (C[0].code != M.photcode) continue; \
+      break; \
+    case PHOT_SEC: \
+      if (C[0].code != GetPhotcodeEquivCodebyCode (M.photcode)) continue; \
+      break; \
+    default: \
+      break; \
+  } }
+
+/* exclusions based on measure.params  */
+# define TESTMEASURE(M) \
+  if (ApplySelections[SelectionParam]) { \
+    if (TimeSelect && (M.t < tzero)) continue; \
+    if (TimeSelect && (M.t > tend)) continue; \
+    if (ErrSelect  && (M.dM > ErrValue)) continue; \
+    if (TypeSelect && (TypeValue != GetMeasureTypeCode (&M))) continue; \
+    if (iMagSelect && (PhotInst (&M) < iMagMin)) continue; \
+    if (FlagSelect && (M.dbFlags != FlagValue)) continue; \
+  }
+
+# define SETMAG(MOUT,MEAS,MODE) \
+  MOUT = NAN; \
+  if (MODE == MAG_INST) MOUT = PhotInst (&MEAS);  \
+  if (MODE == MAG_CAT)  MOUT = PhotCat  (&MEAS); \
+  if (MODE == MAG_SYS)  MOUT = PhotSys  (&MEAS, average, secfilt); \
+  if (MODE == MAG_REL)  MOUT = PhotRel  (&MEAS, average, secfilt); \
+  if (MODE == MAG_CAL)  MOUT = PhotCal  (&MEAS, average, secfilt, measure, GetPhotcodeEquivbyCode (MEAS.photcode)); \
+  if (MODE == MAG_AVE)  MOUT = PhotAve  (GetPhotcodeEquivbyCode (MEAS.photcode), average, secfilt); \
+  if (MODE == MAG_REF)  MOUT = PhotRef  (GetPhotcodeEquivbyCode (MEAS.photcode), average, secfilt, measure); \
+  if (ApplySelections[SelectionParam]) { \
+    if (MagSelect && (MOUT > MagMax)) continue; \
+    if (MagSelect && (MOUT < MagMin)) continue; \
+  }
+
+/* selection criteria */
+/* selections based on Measure quantities */
+static int TimeSelect;
+static time_t tzero, tend;
+static int MagSelect;
+static double MagMax, MagMin;
+static int TypeSelect, TypeValue;
+static int ErrSelect;
+static double ErrValue;
+static int iMagSelect;
+static double iMagMin;
+static int FlagSelect, FlagValue;
+static int TypefracSelect, TypefracType, TypefracSign;
+static double TypefracValue;
+
+/* apply selections or not */
+static int ApplySelections[4];
+static int SelectionParam;
+
+/* applied to Average quantities */
+static int PhotcodeSelect;
+static PhotCode *PhotcodeValue;
+static int PhotcodeMode;
+
+/* selections based on Average quantities */
+static int ChiSelect;
+static float ChiLimit;
+
+/* selections based on ensemble quantities */
+static int NphotSelect, NphotSign, NphotValue;
+static int NcodeSelect, NcodeSign, NcodeValue;
+static int FWHMSelect, FWHMsign;
+static double FWHMvalue, FWHMfrac;
+
+/* time concepts */
+static time_t TimeReference;
+static int TimeFormat;
+
+int GetTimeSelection (time_t *tz, time_t *te) {
+  *tz = tzero;
+  *te = tend;
+  return (TimeSelect);
+}
+
+int GetPhotcodeInfo (char *string, PhotCode **Code, int *Mode) {
+
+  PhotCode *code;
+  int mode, status;
+  char *p, *tmpstring;
+
+  /* save local copy */
+  tmpstring = strcreate (string);
+
+  /* check for code:mode in photcode name */
+  mode = MAG_NONE;
+  p = strchr (tmpstring, ':');
+  if (p != NULL) {
+    mode = GetMagMode (p + 1);
+    if (mode == MAG_NONE) {
+      gprint (GP_ERR, "syntax error in magnitude mode\n");
+      free (tmpstring);
+      return (FALSE);
+    }
+    *p = 0;
+  }
+
+  /* how do we handle this elsewhere? */
+  if (!strcasecmp (tmpstring, "mag")) {
+    /* need to validate mode */
+    *Mode = mode;
+    *Code = NULL;
+    free (tmpstring);
+    return (TRUE);
+  }
+
+  code = GetPhotcodebyName (tmpstring);
+  if (code == NULL) {
+    gprint (GP_ERR, "photcode not found in photcode table\n");
+    free (tmpstring);
+    return (FALSE);
+  }
+
+  /* test allowable cases and/or set default values */
+  status = FALSE;
+  if (code[0].type == PHOT_DEP) {
+    if (mode == MAG_NONE) mode = MAG_REL;
+    if (mode == MAG_INST) status = TRUE;
+    if (mode == MAG_CAT)  status = TRUE;
+    if (mode == MAG_SYS)  status = TRUE;
+    if (mode == MAG_REL)  status = TRUE;
+    if (mode == MAG_CAL)  status = TRUE;
+  }  
+  if (code[0].type == PHOT_SEC) {
+    if (mode == MAG_NONE) mode  = MAG_AVE;
+    if (mode == MAG_INST) status = TRUE;
+    if (mode == MAG_CAT)  status = TRUE;
+    if (mode == MAG_SYS)  status = TRUE;
+    if (mode == MAG_REL)  status = TRUE;
+    if (mode == MAG_CAL)  status = TRUE;
+    if (mode == MAG_AVE)  status = TRUE;
+    if (mode == MAG_REF)  status = TRUE;
+  }  
+  if (code[0].type == PHOT_ALT) {
+    if (mode == MAG_NONE) mode  = MAG_AVE;
+    if (mode == MAG_AVE)  status = TRUE;
+    if (mode == MAG_REF)  status = TRUE;
+  }
+
+  if (code[0].type == PHOT_REF) {
+    if (mode == MAG_NONE) mode  = MAG_CAT;
+    if (mode == MAG_CAT)  status = TRUE;
+  }
+
+  if (!status) {
+    gprint (GP_ERR, "mismatch in photcode and magmode\n");
+    free (tmpstring);
+    return (FALSE);
+  }
+  *Code = code;
+  *Mode = mode;
+  free (tmpstring);
+  return (TRUE);
+}
+ 
+int SetSelectionParam (int param) {
+  SelectionParam = param;
+  return (TRUE);
+}
+
+int GetSelectionParam () {
+  return (SelectionParam);
+}
+
+int GetMeasureParam (char *parname) {
+
+  int param;
+
+  param = MEAS_ZERO;
+  if (!strcasecmp (parname, "ra"))   	 param = MEAS_RA;
+  if (!strcasecmp (parname, "dec"))  	 param = MEAS_DEC;
+  if (!strcasecmp (parname, "mag")) 	 param = MEAS_MAG;
+  // if (!strcasecmp (parname, "dmag")) 	 param = MEAS_dMAG;
+  if (!strcasecmp (parname, "airmass"))  param = MEAS_AIRMASS;
+  if (!strcasecmp (parname, "exptime"))  param = MEAS_EXPTIME;
+  if (!strcasecmp (parname, "photcode")) param = MEAS_PHOTCODE;
+  if (!strcasecmp (parname, "time"))     param = MEAS_TIME;
+  if (!strcasecmp (parname, "dR")) 	 param = MEAS_RA_OFFSET;
+  if (!strcasecmp (parname, "dD")) 	 param = MEAS_DEC_OFFSET;
+  if (!strcasecmp (parname, "fwhm"))   	 param = MEAS_FWHM;
+  // if (!strcasecmp (parname, "dophot")) 	 param = MEAS_DOPHOT;
+  if (!strcasecmp (parname, "FLAGS"))    param = MEAS_DB_FLAGS;
+  if (!strcasecmp (parname, "XCCD"))   	 param = MEAS_XCCD;
+  if (!strcasecmp (parname, "YCCD"))   	 param = MEAS_YCCD;
+  if (!strcasecmp (parname, "XMOSAIC"))  param = MEAS_XMOSAIC;
+  if (!strcasecmp (parname, "YMOSAIC"))  param = MEAS_YMOSAIC;
+  if (!strcasecmp (parname, "help")) {
+    gprint (GP_ERR, "value may be one of the following:\n");
+    gprint (GP_ERR, " ra dR dec dD mag dmag Mrel Mcal photcode time fwhm dophot xccd yccd xmosaic ymosaic flags\n");
+    gprint (GP_ERR, "value may also be a valid photcode\n");
+    gprint (GP_ERR, "photcodes or 'mag' may have optional magnitude type: mag,[Minst, Mcat, Msys, Mrel, Mcal]\n");
+  }
+  return (param);
+}
+  
+int GetAverageParam (char *parname) {
+
+  int param;
+
+  param = AVE_ZERO;
+  if (!strcasecmp (parname, "RA"))    param = AVE_RA;
+  if (!strcasecmp (parname, "DEC"))   param = AVE_DEC;
+
+  if (!strcasecmp (parname, "dRA"))   param = AVE_RA_ERR;
+  if (!strcasecmp (parname, "dDEC"))  param = AVE_DEC_ERR;
+
+  if (!strcasecmp (parname, "uRA"))   param = AVE_U_RA;
+  if (!strcasecmp (parname, "uDEC"))  param = AVE_U_DEC;
+  if (!strcasecmp (parname, "duRA"))  param = AVE_U_RA_ERR;
+  if (!strcasecmp (parname, "duDEC")) param = AVE_U_DEC_ERR;
+
+  if (!strcasecmp (parname, "par"))   param = AVE_PAR;
+  if (!strcasecmp (parname, "dpar"))  param = AVE_PAR_ERR;
+
+  if (!strcasecmp (parname, "dmag"))  param = AVE_dMAG;
+  if (!strcasecmp (parname, "mag"))   param = AVE_MAG;
+  if (!strcasecmp (parname, "Nmeas")) param = AVE_NMEAS;
+  if (!strcasecmp (parname, "Nmiss")) param = AVE_NMISS;
+  if (!strcasecmp (parname, "Xp"))    param = AVE_Xp;
+  if (!strcasecmp (parname, "Xm"))    param = AVE_Xm;
+  if (!strcasecmp (parname, "flag"))  param = AVE_FLAG;
+  if (!strcasecmp (parname, "type"))  param = AVE_TYPE;
+  if (!strcasecmp (parname, "typefrac")) {
+    if (!TypefracType) {
+      gprint (GP_ERR, "typefrac needs to specify type to use\n");
+      return (param);
+    }
+    param = AVE_TYPEFRAC;
+  }
+  if (!strcasecmp (parname, "Nphot")) param = AVE_NPHOT;
+  if (!strcasecmp (parname, "Ncode")) param = AVE_NCODE;
+  // if (!strcasecmp (parname, "Ncrit")) param = AVE_NCRIT;
+  return (param);
+}
+
+/* I've set some selections - if these require a photcode, check if I set one */
+int TestPhotSelections (PhotCode **code, int *mode, int param) {
+
+  int NeedPhotcode, Needcode;
+
+  /* if i've supplied a photcode (code != NULL), i'm not allowed to restrict it */
+  if (code[0] != NULL) {
+    if (PhotcodeSelect) {
+      gprint (GP_ERR, "photcode selection rules violated: cannot restrict photcode with a photcode\n");
+      return (FALSE);
+    } else {
+      return (TRUE);
+    }
+  }
+
+  /* for measure tests, supply MEAS_ZERO */
+
+  /* if I have an average or ensemble restriction, I must have a PRI/SEC photcode */
+  NeedPhotcode = FALSE;
+  NeedPhotcode |= ChiSelect;
+  NeedPhotcode |= NphotSelect;
+  NeedPhotcode |= ErrSelect;
+  NeedPhotcode |= TypeSelect;
+  NeedPhotcode |= TypefracSelect;
+  
+  NeedPhotcode |= (param == AVE_Xm);
+  NeedPhotcode |= (param == AVE_MAG);
+  NeedPhotcode |= (param == AVE_dMAG);
+  NeedPhotcode |= (param == AVE_TYPE);
+  NeedPhotcode |= (param == AVE_NPHOT);
+  Needcode = (param == AVE_NCODE);
+
+  if (NeedPhotcode || Needcode || NcodeSelect || PhotcodeSelect) {
+    if (!PhotcodeSelect) {
+      gprint (GP_ERR, "photcode selection problem: value requires photcode\n");
+      return (FALSE);
+    }
+    code[0] = PhotcodeValue;
+    mode[0] = PhotcodeMode;
+  }
+  if (NeedPhotcode) {
+    if (code[0][0].type == PHOT_SEC) return (TRUE);
+    if (code[0][0].type == PHOT_REF) return (TRUE);
+    gprint (GP_ERR, "photcode selection problem: average value requires average photcode\n");
+    return (FALSE);
+  }
+  return (TRUE);
+}
+
+void GetAverageParamHelp () {
+  gprint (GP_ERR, "value may be one of the following:\n");
+  gprint (GP_ERR, " ra dec dmag Nmeas Nmiss Xm Xp Nphot Ncode flag type typefrac\n\n");
+  gprint (GP_ERR, "value may also be a valid photcode\n");
+  gprint (GP_ERR, "photcodes or 'mag' may have optional magnitude mode: mag,[Mave, Mref]\n");
+  return;
+}
+
+/* (re)load photcodes from photcode table */
+int InitPhotcodes () {
+
+  double ZERO_POINT;
+  char MasterPhotcodeFile[256];
+  char CatdirPhotcodeFile[256];
+  char *catdir;
+
+  if (VarConfig ("ZERO_PT", "%lf", &ZERO_POINT) == (char *) NULL) {
+      gprint (GP_ERR, "ZERO_PT undefined in config\n");
+      return (FALSE);
+  }
+  SetZeroPoint (ZERO_POINT);
+
+  catdir = GetCATDIR();
+  if (catdir == NULL) {
+    CatdirPhotcodeFile[0] = 0;
+  } else {
+    sprintf (CatdirPhotcodeFile, "%s/Photcodes.dat", catdir);
+  }
+
+  if (VarConfig ("PHOTCODE_FILE", "%s", MasterPhotcodeFile) == (char *) NULL) {
+      gprint (GP_ERR, "PHOTCODE_FILE undefined in config\n");
+      return (FALSE);
+  }
+  if (!LoadPhotcodes (CatdirPhotcodeFile, MasterPhotcodeFile)) {
+    gprint (GP_ERR, "error loading photcode table %s or master file %s\n", CatdirPhotcodeFile, MasterPhotcodeFile);
+    return (FALSE);
+  }
+  return (TRUE);
+}
+
+int ListPhotSelections () {
+
+  gprint (GP_ERR, "TimeSelect: %d, %d - %d\n",      TimeSelect, tzero, tend);
+  gprint (GP_ERR, "MagSelect: %d, %f - %f\n",       MagSelect, MagMax, MagMin);
+  gprint (GP_ERR, "TypeSelect: %d, %d\n",           TypeSelect, TypeValue);
+  gprint (GP_ERR, "ErrSelect: %d, %f\n",            ErrSelect, ErrValue);
+  gprint (GP_ERR, "iMagSelect: %d, %f\n",           iMagSelect, iMagMin);
+  gprint (GP_ERR, "FlagSelect: %d, %x\n",           FlagSelect, FlagValue);
+  gprint (GP_ERR, "TypefracSelect: %d, %d %d %f\n", TypefracSelect, TypefracType, TypefracSign, TypefracValue);
+  gprint (GP_ERR, "ApplySelections: %d,%d,%d,%d : %d\n", ApplySelections[0], ApplySelections[1], ApplySelections[2], ApplySelections[3], SelectionParam);
+  if (PhotcodeSelect) {
+    gprint (GP_ERR, "PhotcodeSelect: %d, %s\n",       PhotcodeSelect, PhotcodeValue[0].name);
+  } else {
+    gprint (GP_ERR, "PhotcodeSelect: %d, none\n",       PhotcodeSelect);
+  }
+  gprint (GP_ERR, "ChiSelect: %d, %f\n",            ChiSelect, ChiLimit);
+  gprint (GP_ERR, "NphotSelect: %d, %d - %d\n",     NphotSelect, NphotSign, NphotValue);
+  gprint (GP_ERR, "NcodeSelect: %d, %d - %d\n",     NcodeSelect, NcodeSign, NcodeValue);
+  gprint (GP_ERR, "FWHMSelect: %d, %d %f %f\n",     FWHMSelect, FWHMsign, FWHMvalue, FWHMfrac);
+  return (TRUE);
+}
+
+/* remove standard photometry filtering options, set selections */
+/* not all functions respect all selections... */
+int SetPhotSelections (int *argc, char **argv, int Nparams) {
+
+  int i, N;
+  double trange;
+
+  if ((N = get_argument (*argc, argv, "-phothelp"))) {
+    gprint (GP_ERR, "optional photometry selection criteria:\n");
+    gprint (GP_ERR, " -magrange min max\n");
+    gprint (GP_ERR, " -imaglim min\n");
+    gprint (GP_ERR, " -flag value\n");
+    gprint (GP_ERR, " -chisq value\n");
+    gprint (GP_ERR, " -photcode code\n");
+    gprint (GP_ERR, " -time start range\n");
+    gprint (GP_ERR, " -errorlim value\n");
+    gprint (GP_ERR, " -type type\n");
+    gprint (GP_ERR, " -nmeas [+/-]N\n");
+    gprint (GP_ERR, " -fwhm [+/-]fraction\n");
+    return (FALSE);
+  }
+
+  /* select based on measured mag (MEASURE ONLY) */
+  MagSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-magrange"))) {
+    MagSelect = TRUE;
+    remove_argument (N, argc, argv);
+    MagMin = atof (argv[N]);
+    remove_argument (N, argc, argv);
+    MagMax = atof (argv[N]);
+    remove_argument (N, argc, argv);
+  }
+
+  /* select based on instrument mag (MEASURE ONLY) */
+  iMagSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-imaglim"))) {
+    iMagSelect = TRUE;
+    remove_argument (N, argc, argv);
+    iMagMin = atof (argv[N]);
+    remove_argument (N, argc, argv);
+  }
+
+  /* select on value of flag (MEASURE ONLY) */
+  FlagSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-flag"))) {
+    FlagSelect = TRUE;
+    remove_argument (N, argc, argv);
+    FlagValue = atof (argv[N]);
+    remove_argument (N, argc, argv);
+  }
+
+  /* select on value of Chisq (AVERAGE ONLY) */
+  SelectionParam = 0;
+  for (i = 0; i < 4; i++) ApplySelections[i] = TRUE;
+  if ((N = get_argument (*argc, argv, "-apply"))) {
+    remove_argument (N, argc, argv);
+    if (strlen(argv[N]) != Nparams) {
+      gprint (GP_ERR, "-apply selection must define all parameter choices\n");
+      return (FALSE);
+    }
+    for (i = 0; i < Nparams; i++) {
+      if (toupper(argv[N][i]) == 'Y') {
+	ApplySelections[i] = TRUE;
+      } else {
+	ApplySelections[i] = FALSE;
+      }
+    }
+    remove_argument (N, argc, argv);
+  }
+
+  /* select on value of photcode */
+  PhotcodeSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-photcode"))) {
+    PhotcodeSelect = TRUE;
+    remove_argument (N, argc, argv);
+    GetPhotcodeInfo (argv[N], &PhotcodeValue, &PhotcodeMode);
+    if (PhotcodeValue == NULL) {
+      gprint (GP_ERR, "photcode not found in photcode table\n");
+      return (FALSE);;
+    }
+    remove_argument (N, argc, argv);
+  }
+
+  /* selection on basis of time range (MEASURE only) */
+  TimeSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-time"))) {
+    remove_argument (N, argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, argc, argv);
+    TimeSelect = TRUE;
+    if (trange < 0) {
+      trange = fabs (trange);
+      tend = tzero;
+      tzero -= trange;
+    } else {
+      tend = tzero + trange;
+    }
+  }
+
+  /* select by error (on measure or average) */
+  ErrSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-errorlim"))) {
+    remove_argument (N, argc, argv);
+    ErrValue = atof (argv[N]);
+    remove_argument (N, argc, argv);
+    ErrSelect = TRUE;
+  }
+
+  /* select on value of Chisq (AVERAGE ONLY) */
+  ChiSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-chisq"))) {
+    ChiSelect = TRUE;
+    remove_argument (N, argc, argv);
+    ChiLimit = atof (argv[N]);
+    remove_argument (N, argc, argv);
+  }
+
+  /* select on measurement type: 1,2,3 (AVERAGE ONLY) */
+  TypeSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-type"))) {
+    remove_argument (N, argc, argv);
+    TypeValue = atoi (argv[N]);
+    remove_argument (N, argc, argv);
+    TypeSelect = TRUE;
+  }
+
+  /* select on measurement type: 1,2,3 (AVERAGE ONLY) */
+  TypefracType = 0;
+  if ((N = get_argument (*argc, argv, "-usetype"))) {
+    remove_argument (N, argc, argv);
+    TypefracType = atoi (argv[N]);
+    remove_argument (N, argc, argv);
+  }
+
+  /* select on measurement type: 1,2,3 (AVERAGE ONLY) */
+  TypefracSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-typefrac"))) {
+    remove_argument (N, argc, argv);
+    TypefracType  = atoi (argv[N]);
+    remove_argument (N, argc, argv);
+    TypefracValue = fabs (atof (argv[N]));
+    TypefracSign = 0;
+    if (argv[N][0] == '-') TypefracSign = -1;
+    if (argv[N][0] == '+') TypefracSign = +1;
+    remove_argument (N, argc, argv);
+    TypefracSelect = TRUE;
+  }
+
+  /* select by number of measurements (AVERAGE ONLY) */
+  NphotSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-nphot"))) {
+    remove_argument (N, argc, argv);
+    NphotValue = abs (atoi (argv[N]));
+    NphotSign = 0;
+    if (argv[N][0] == '-') NphotSign = -1;
+    if (argv[N][0] == '+') NphotSign = +1;
+    remove_argument (N, argc, argv);
+    NphotSelect = TRUE;
+  }
+
+  /* select by number of measurements (AVERAGE ONLY) */
+  NcodeSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-ncode"))) {
+    remove_argument (N, argc, argv);
+    NcodeValue = abs (atoi (argv[N]));
+    NcodeSign = 0;
+    if (argv[N][0] == '-') NcodeSign = -1;
+    if (argv[N][0] == '+') NcodeSign = +1;
+    remove_argument (N, argc, argv);
+    NcodeSelect = TRUE;
+  }
+
+  /* -fwhm value frac (AVERAGE ONLY) */
+  FWHMSelect = FALSE;
+  if ((N = get_argument (*argc, argv, "-fwhm"))) {
+    remove_argument (N, argc, argv);
+    FWHMvalue = abs (atof (argv[N]));
+    FWHMsign = 0;
+    if (argv[N][0] == '-') FWHMsign = -1;
+    if (argv[N][0] == '+') FWHMsign = +1;
+    remove_argument (N, argc, argv);
+    FWHMSelect = TRUE;
+    remove_argument (N, argc, argv);
+    FWHMfrac = atof (argv[N]);
+  }
+
+  GetTimeFormat (&TimeReference, &TimeFormat);
+  return (TRUE);
+}
+
+/* extract a list of measure parameters from the specified average entry based on the pre-set selections */
+double *ExtractMeasures (PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param) {
+
+  int i, Nlist, NLIST;
+  double M, *list;
+  
+  *nlist = 0; 
+  Nlist = 0;
+  NLIST = MAX (1, average[0].Nm);
+  ALLOCATE (list, double, NLIST);
+
+  /* check selections based on averages & ensembles: chisq, Nphot, etc */
+  if (!TestAverage (code, average, secfilt, measure)) return (list); 
+
+  /* look for measures */
+  for (i = 0; i < average[0].Nm; i++) {
+    TESTCODE (code, measure[i]);  /* skip measurements not matching photcode */
+    TESTMEASURE (measure[i]);     /* exclusions based on measure.params  */
+    SETMAG (M, measure[i], mode); /* set appropriate magnitude (also does MagSelect) */ 
+
+    /* assign value */
+    list[Nlist] = GetMeasure (param, &average[0], &measure[i], M);
+    Nlist ++;
+  }
+  *nlist = Nlist;
+  return (list);
+}
+
+/* return average.param based on the selection */
+double ExtractAverages (PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int param) {
+
+  int i;
+  double value;
+
+  value = NAN;
+
+  /* this function requires code set for certain value of param.  
+     use TestPhotSelectionsAverage to validate code/param choices */
+
+  /* filter by average quantities (eg, chisq, Nphot, etc) */
+  if (!TestAverage (code, average, secfilt, measure)) return (NAN);
+
+  /* assign vector values */
+  switch (param) {
+    case AVE_RA:
+      value = average[0].R;
+      break;
+    case AVE_DEC:
+      value = average[0].D;
+      break;
+    case AVE_RA_ERR:
+      value = average[0].dR;
+      break;
+    case AVE_DEC_ERR:
+      value = average[0].dD;
+      break;
+
+    case AVE_U_RA:
+      value = average[0].uR;
+      break;
+    case AVE_U_DEC:
+      value = average[0].uD;
+      break;
+    case AVE_U_RA_ERR:
+      value = average[0].duR;
+      break;
+    case AVE_U_DEC_ERR:
+      value = average[0].duD;
+      break;
+
+    case AVE_PAR:
+      value = average[0].P;
+      break;
+    case AVE_PAR_ERR:
+      value = average[0].dP;
+      break;
+
+
+    case AVE_NMEAS:
+      value = average[0].Nm;
+      break;
+    case AVE_NMISS:
+      value = average[0].Nn;
+      break;
+    case AVE_Xp:
+      value = 0.01*average[0].Xp;
+      break;
+    case AVE_FLAG:
+      value = average[0].code;
+      break;
+    case AVE_MAG:
+      switch (mode) {
+	case MAG_AVE:
+	  value = PhotAve  (code, average, secfilt);
+	  break;
+	case MAG_REF:
+	  value = PhotRef  (code, average, secfilt, measure);
+	  break;
+	case MAG_INST:
+	case MAG_CAT:
+	case MAG_SYS:
+	case MAG_REL:
+	case MAG_CAL:
+	  value = NAN;
+	  for (i = 0; i < average[0].Nm; i++) {
+	      if (code[0].code != measure[i].photcode) continue;
+	      value = measure[i].M;
+	  }
+	  break;
+      }
+      break;
+    case AVE_dMAG:
+      value = PhotdM (code, average, secfilt);
+      break;
+    case AVE_Xm:
+      value = PhotXm (code, average, secfilt);
+      break;
+    case AVE_TYPE:
+      value = DetermineTypeCode (average, measure, code[0].code);
+      break;
+    case AVE_TYPEFRAC:
+      value = DetermineTypefrac (average, measure, code);
+      break;
+    case AVE_NCODE:
+      value = 0;
+      for (i = 0; i < average[0].Nm; i++) {
+	if (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].photcode)) continue;
+	value ++;
+      }
+      break;
+    case AVE_NPHOT:
+      value = 0;
+      for (i = 0; i < average[0].Nm; i++) {
+	if (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].photcode)) continue;
+	if (measure[i].dbFlags & (ID_MEAS_POOR | ID_MEAS_SKIP)) continue;
+	value ++;
+      }
+      break;
+# if (0)
+    case AVE_NCRIT:
+      value = 0;
+      for (i = 0; i < average[0].Nm; i++) {
+	if ((code != NULL) && (code[0].code != GetPhotcodeEquivCodebyCode (measure[i].photcode))) continue;
+	if (ErrSelect && (measure[i].dM > ErrValue)) continue;
+	if (FlagSelect && (measure[i].dbFlags != FlagValue)) continue;
+	if (TypeSelect && (TypeValue != GetMeasureTypeCode (&measure[i]))) continue;
+	if (iMagSelect && (PhotInst (&measure[i]) < iMagMin)) continue;
+	value ++;
+      }
+      break;
+# endif
+  }
+  return (value);
+}  
+
+/* return fraction of measures (matching code) which have requested type */
+double DetermineTypefrac (Average *average, Measure *measure, PhotCode *code) {
+
+  double frac;
+  int k, Nc, Nt;
+  
+  Nt = Nc = 0;
+  for (k = 0; k < average[0].Nm; k++) {
+    if ((code != NULL) && (code[0].code != GetPhotcodeEquivCodebyCode (measure[k].photcode))) continue;
+    Nc ++;
+    if (measure[k].dophot != TypefracType) continue;
+    Nt ++;
+  }
+  frac = (double) Nt / (double) Nc;
+  return (frac);
+}
+
+/* determine the representative dophot type for this photcode (must be PRI/SEC) */
+int DetermineTypeCode (Average *average, Measure *measure, int code) {
+
+  int k, N, Nt[3];
+  
+  Nt[0] = Nt[1] = Nt[2] = 0;
+  for (k = 0; k < average[0].Nm; k++) {
+    if (code != GetPhotcodeEquivCodebyCode (measure[k].photcode)) continue;
+    N = GetMeasureTypeCode (&measure[k]);
+    Nt[N] ++;
+  }
+  if (Nt[0]) return (0);
+  if (Nt[1]) return (1);
+  if (Nt[2]) return (2);
+  return (3);
+}
+
+int GetMeasureTypeCode (Measure *measure) {
+  switch (measure[0].dophot) {
+    case 0:
+    case 1:
+    case 2:
+      return (0);
+      break;
+    case 3:
+    case 4:
+    case 5:
+    case 7:
+    case 9:
+      return (1);
+      break;
+    case 10:
+    default:
+      return (2);
+  }
+  return (2);
+}  
+
+int Quality (Measure *measure, int IsDophot) {
+
+  return (TRUE);
+  
+  if (IsDophot) {
+    
+    if (measure[0].dophot == 4) return (FALSE);
+    return (TRUE);
+  
+  } else {
+    
+    if (0.01 * measure[0].FWx < 3.0) return (FALSE);
+    if (0.01 * measure[0].FWx > 10.0) return (FALSE);
+
+    return (TRUE);
+
+  }
+}
+
+/* test if this average object meets the specified selection criteria.
+   for photcode-dependent quantities, only test for PRI/SEC photcodes */
+int TestAverage (PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure) {
+
+  int i, Nm, Type, Select;
+  double fwhm, typefrac, dM, Xm;
+
+  /** temporary special case for Jen Katz: exclude REF with Ncode > 1 */
+  if ((code != NULL) && (code[0].type == PHOT_REF)) {
+    Nm = 0;
+    for (i = 0; i < average[0].Nm; i++) {
+      TESTCODE (code, measure[i]);
+      Nm++;
+    }
+    if (Nm > 1) return (FALSE);
+  }
+
+  if (!ApplySelections[SelectionParam]) return (TRUE);
+
+  /* pass objects with more than FWHMfrac points with FWHM above / below FWHMvalue */ 
+  if (FWHMSelect) {
+    Nm = 0;
+    for (i = 0; i < average[0].Nm; i++) {
+      fwhm = measure[i].FWx / 100.0;
+      switch (FWHMsign) {
+	case 0:
+	  if (fwhm == FWHMvalue) break;
+	  continue;
+	case +1:
+	  if (fwhm >= FWHMvalue) break;
+	  continue;
+	case -1:
+	  if (fwhm <= FWHMvalue) break;
+	  continue;
+      }
+      Nm++;
+    }
+    if (average[0].Nm * FWHMfrac > Nm) return (FALSE);
+  }
+
+  /* all selections below require a valid photcode */
+  Select = ChiSelect || ErrSelect || NcodeSelect || NphotSelect || TypeSelect || TypefracSelect;
+  if (!Select) return (TRUE);
+
+  /* must have a valid code of some kind */
+  if (code == NULL) return (FALSE);
+
+  /* for NcodeSelect, count Nmeas for appropriate photcode */
+  if (NcodeSelect) {
+    Nm = 0;
+    for (i = 0; i < average[0].Nm; i++) {
+      TESTCODE (code, measure[i]);
+      Nm++;
+    }
+    switch (NcodeSign) {
+      case 0:
+	if (Nm == NcodeValue) break;
+	return (FALSE);
+      case 1:
+	if (Nm >= NcodeValue) break;
+	return (FALSE);
+      case -1:
+	if (Nm <= NcodeValue) break;
+	return (FALSE);
+      default:
+	return (FALSE);
+    }
+  }
+
+  /* only PRI/SEC photcodes apply the filter */
+  if (code[0].type == PHOT_DEP) return (TRUE);
+  if (code[0].type == PHOT_REF) return (TRUE);
+
+  /* exclusions based on average.params  */
+  if (ChiSelect) {
+    Xm = PhotXm (code, average, secfilt);
+    if (Xm == -1) return (FALSE);
+    if (Xm > ChiLimit) return (FALSE);
+  }
+  
+  /* for ErrSelect, check average errors */
+  if (ErrSelect) {
+    dM = PhotdM (code, average, secfilt);
+    if (dM > ErrValue) return (NAN);
+  }
+  
+  /* for NphotSelect, count Nmeas for appropriate photcode */
+  if (NphotSelect) {
+    Nm = 0;
+    for (i = 0; i < average[0].Nm; i++) {
+      TESTCODE (code, measure[i]);
+      if (measure[i].dbFlags && ID_MEAS_SKIP) continue;
+      Nm++;
+    }
+    switch (NphotSign) {
+      case 0:
+	if (Nm == NphotValue) break;
+	return (FALSE);
+      case 1:
+	if (Nm >= NphotValue) break;
+	return (FALSE);
+      case -1:
+	if (Nm <= NphotValue) break;
+	return (FALSE);
+      default:
+	return (FALSE);
+    }
+  }
+
+  /* for TypeSelect, check on TypeCode for this object */
+  if (TypeSelect) {
+    Type = DetermineTypeCode (average, measure, code[0].code);
+    if (Type != TypeValue) return (FALSE);
+  }
+
+  /* for TypeSelect, check on TypeCode for this object */
+  if (TypefracSelect) {
+    typefrac = DetermineTypefrac (average, measure, code);
+    switch (TypefracSign) {
+      case 0:
+	if (typefrac == TypefracValue) break;
+	return (FALSE);	
+      case +1:
+	if (typefrac >= TypefracValue) break;
+	return (FALSE);	
+      case -1:
+	if (typefrac <= TypefracValue) break;
+	return (FALSE);	
+      default:
+	return (FALSE);
+    }
+  }
+
+  return (TRUE);
+}
+
+/* for this function, we don't need to call PhotRel, etc, but we
+   do need to multiply by 0.001:
+   average[].M is stored as 1000*mag where mag is PhotAbs
+   measure[].M for PHOT_REL is the same 
+   XXX EAM : note that we are transitioning away from millimag internal storage 
+*/ 
+
+/* send in:
+   Nphot - photcode number
+   Tphot - photcode type
+   Ns    - secfilt entry (-1 for PRI)
+   &catalog.average[i], 
+   &catalog.measure[catalog.average[i].offset], 
+   &catalog.secfilt[i*Nsec] 
+*/
+
+
+double *ExtractMagnitudes (PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int *n) {
+  
+  double *M, mag;
+  int N;
+
+  if ((mode == MAG_AVE) || (mode == MAG_REF)) {
+    ALLOCATE (M, double, 1);
+    mag = ExtractAverages (code, mode, average, secfilt, measure, AVE_MAG);
+    if (isnan(mag)) {
+      N = 0;
+    } else {
+      N = 1;
+      M[0] = mag;
+    }
+  } else {
+    M = ExtractMeasures (code, mode, average, secfilt, measure, &N, MEAS_MAG);
+  }
+  
+  *n = N;
+  return (M);
+}
+
+/* extract delta-mag pairs applying specified selections */
+double *ExtractDMag (PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist) {
+
+  int i, j, A1, A2, N1, N2, Np, Nlist, NLIST;
+  double *M1, *M2, *list;
+
+  /* check for special case of measure-measure - this is needed to drop self-matches */
+  A1 = ((mode[0] == MAG_AVE) || (mode[0] == MAG_REF));
+  A2 = ((mode[1] == MAG_AVE) || (mode[1] == MAG_REF));
+  if (!A1 && !A2) {
+    list = ExtractMeasuresDMag (code, mode, average, secfilt, measure, nlist);
+    return (list);
+  }
+
+  *nlist = 0; 
+  Nlist = 0;
+  NLIST = MAX (1, average[0].Nm*average[0].Nm);
+  ALLOCATE (list, double, NLIST);
+  M1 = M2 = NULL;
+
+  /* one of the two is an average, must do independently */
+  M1 = ExtractMagnitudes (code[0], mode[0], average, secfilt, measure, &N1);
+  if (N1 == 0) goto skip;
+  
+  Np = GetSelectionParam ();
+  SetSelectionParam (Np + 1);
+  M2 = ExtractMagnitudes (code[1], mode[1], average, secfilt, measure, &N2);
+  if (N2 == 0) goto skip;
+
+  /* magnitudes may be NAN : set delta to NAN */
+  for (i = 0; i < N1; i++) {
+    for (j = 0; j < N2; j++) {
+      if (isnan(M1[i]) || isnan(M2[j])) {
+	list[Nlist] = NAN;
+      } else {
+	list[Nlist] = M1[i] - M2[j];
+      }
+      Nlist ++;
+    }
+  }
+
+skip: 
+  if (M1 != NULL) free (M1);
+  if (M2 != NULL) free (M2);
+  *nlist = Nlist;
+  return (list);
+}
+  
+/* extract a list of delta-measure-mags from the specified average entry based on the 
+   pre-set selections - does not return self-matched measurements */
+double *ExtractMeasuresDMag (PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist) {
+
+  int i, j, Np0, Np1, Nlist, NLIST;
+  double *list, M1, M2;
+  
+  *nlist = 0; 
+  Nlist = 0;
+  NLIST = MAX (1, average[0].Nm*average[0].Nm);
+  ALLOCATE (list, double, NLIST);
+
+  /* must have two code values - drop this test? this is programming case, not a user case */
+  if (code == NULL) return (list);
+  if (code[0] == NULL) return (list);
+  if (code[1] == NULL) return (list);
+
+  /* exclude based on average parameters for both codes  */
+  if (!TestAverage (code[0], average, secfilt, measure)) return (list);
+  if (!TestAverage (code[1], average, secfilt, measure)) return (list);
+
+  Np0 = GetSelectionParam ();
+  Np1 = Np0 + 1;
+
+  /* loop twice over all measures */
+  for (i = 0; i < average[0].Nm; i++) {
+    SetSelectionParam (Np0);
+    TESTCODE (code[0], measure[i]);
+    TESTMEASURE (measure[i]);
+    SETMAG(M1, measure[i], mode[0]);
+    for (j = 0; j < average[0].Nm; j++) {
+      if (i == j) continue;
+      SetSelectionParam (Np1);
+      TESTCODE (code[1], measure[j]);
+      TESTMEASURE (measure[j]);
+      SETMAG(M2, measure[j], mode[1]);
+      if (isnan(M1) || isnan(M2)) {
+	list[Nlist] = NAN;
+      } else {
+	list[Nlist] = M1 - M2;
+      }
+      Nlist ++;
+    }
+  }
+  *nlist = Nlist;
+  return (list);
+}
+
+/* extract a measurement list matching the number of dmag entries */
+double *ExtractByDMag (PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param) {
+
+  int A1, A2, N1;
+  double *list;
+
+  /* check for special case of measure-measure */
+  A1 = ((mode[0] == MAG_AVE) || (mode[0] == MAG_REF));
+  A2 = ((mode[1] == MAG_AVE) || (mode[1] == MAG_REF));
+  if (!A1 && !A2) {
+    list = ExtractMeasuresByDMag (code, mode, 1, average, secfilt, measure, nlist, param);
+    return (list);
+  }
+
+  /* one of the two entries results in a single element. extract the other */
+  if (A1) {
+    list = ExtractMeasures (code[1], mode[1], average, secfilt, measure, &N1, param);
+  } else {
+    list = ExtractMeasures (code[0], mode[0], average, secfilt, measure, &N1, param);
+  }
+  *nlist = N1;
+  return (list);
+}
+  
+/* extract a list of delta-measure-mags from the specified average entry based on the pre-set selections */
+double *ExtractMeasuresByDMag (PhotCode **code, int *mode, int use_first, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param) {
+
+  int i, j, n, Nlist, NLIST;
+  double *list, M1, M2;
+  
+  *nlist = 0; 
+  Nlist = 0;
+  NLIST = MAX (1, average[0].Nm*average[0].Nm);
+  ALLOCATE (list, double, NLIST);
+
+  /* must have two code values */
+  if (code == NULL) return (list);
+  if (code[0] == NULL) return (list);
+  if (code[1] == NULL) return (list);
+
+  /* chisq, fwhm, Nphot, Ncode */
+  if (!TestAverage (code[0], average, secfilt, measure)) return (list);
+  if (!TestAverage (code[1], average, secfilt, measure)) return (list);
+
+  /* loop twice over all measures */
+  for (i = 0; i < average[0].Nm; i++) {
+    TESTCODE (code[0], measure[i]);
+    TESTMEASURE (measure[i]);
+    SETMAG(M1, measure[i], mode[0]);
+    for (j = 0; j < average[0].Nm; j++) {
+      if (i == j) continue;
+      TESTCODE (code[1], measure[j]);
+      TESTMEASURE (measure[j]);
+      SETMAG(M2, measure[j], mode[1]);
+      n = (use_first) ? i : j;
+
+      /* assign value */
+      list[Nlist] = GetMeasure (param, &average[0], &measure[n], (use_first ? M1 : M2));
+      Nlist ++;
+    }
+  }
+  *nlist = Nlist;
+  return (list);
+}
+
+double GetMeasure (int param, Average *average, Measure *measure, double mag) {
+
+  double ra, dec, x, y;
+  double value;
+  Image *image;
+  Coords *mosaic;
+
+  value = 0;
+  switch (param) {
+    case MEAS_MAG: /* magnitudes are already determined above */
+      value = mag;
+      break;
+    case MEAS_RA: /* OK */
+      value = average[0].R - measure[0].dR / 3600.0;
+      break;
+    case MEAS_DEC: /* OK */
+      value = average[0].D - measure[0].dD / 3600.0;
+      break;
+# if (0)
+    case MEAS_dMAG: /* OK */
+      value = measure[0].dM;
+      break;
+    case MEAS_DOPHOT: /* OK */
+      value = measure[0].dophot;
+      break;
+# endif
+    case MEAS_AIRMASS: /* OK */
+      value = measure[0].airmass;
+      break;
+    case MEAS_EXPTIME: /* OK */
+      value = pow (10.0, measure[0].dt * 0.4);
+      break;
+    case MEAS_PHOTCODE: /* OK */
+      value = measure[0].photcode;
+      break;
+    case MEAS_TIME: /* OK */
+      value = TimeValue (measure[0].t, TimeReference, TimeFormat);
+      break;
+    case MEAS_RA_OFFSET: /* OK */
+      value = measure[0].dR;
+      break;
+    case MEAS_DEC_OFFSET: /* OK */
+      value = measure[0].dD;
+      break;
+    case MEAS_FWHM: /* OK */
+      value = 0.01*measure[0].FWx;
+      break;
+    case MEAS_DB_FLAGS: /* ? */
+      value = measure[0].dbFlags;
+      break;
+    case MEAS_XCCD: /* OK */
+/* I need to perform this conversion for ELIXIR and LONEOS formats on load */      
+# if 0
+      value = measure[0].Xccd;
+# else
+      ra  = average[0].R - measure[0].dR / 3600.0;
+      dec = average[0].D - measure[0].dD / 3600.0;
+      image = MatchImage (measure[0].t, measure[0].photcode);
+      if (image == NULL) break;
+      RD_to_XY (&x, &y, ra, dec, &image[0].coords);
+      value = x;
+# endif
+      break;
+    case MEAS_YCCD: /* OK */
+/* I need to perform this conversion for ELIXIR and LONEOS formats on load */      
+# if 0
+      value = measure[0].Yccd;
+# else
+      ra  = average[0].R - measure[0].dR / 3600.0;
+      dec = average[0].D - measure[0].dD / 3600.0;
+      image = MatchImage (measure[0].t, measure[0].photcode);
+      if (image == NULL) break;
+      RD_to_XY (&x, &y, ra, dec, &image[0].coords);
+      value = y;
+# endif
+      break;
+    case MEAS_XMOSAIC: /* OK */
+      ra  = average[0].R - measure[0].dR / 3600.0;
+      dec = average[0].D - measure[0].dD / 3600.0;
+      mosaic = MatchMosaic (measure[0].t, measure[0].photcode);
+      if (mosaic == NULL) break;
+      RD_to_XY (&x, &y, ra, dec, mosaic);
+      value = x;
+      break;
+    case MEAS_YMOSAIC: /* OK */
+      ra  = average[0].R - measure[0].dR / 3600.0;
+      dec = average[0].D - measure[0].dD / 3600.0;
+      mosaic = MatchMosaic (measure[0].t, measure[0].photcode);
+      if (mosaic == NULL) break;
+      RD_to_XY (&x, &y, ra, dec, mosaic);
+      value = y;
+      break;
+  }
+  return (value);
+}
+
+/** the mosaic entries do not use the registered mosaic found 
+    by MatchImage (via FindMosaicForImage).  Rather, they use
+    a coordinate frame saved by SetImageSelection 
+**/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/pmeasure.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/pmeasure.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/pmeasure.c	(revision 15879)
@@ -0,0 +1,163 @@
+# include "dvoshell.h"
+# define NCHUNK 10000
+
+int pmeasure (int argc, char **argv) {
+  
+  FILE *f;
+  int i, j, k, m, kapa, Narg, Npts, NPTS, status, VERBOSE;
+  double Mz, Mr, mag;
+  double Radius, Rmin, Rmax, R, D;
+  unsigned IDclip, IDchoice, LimExclude;
+  unsigned FlagChoice, FlagClip, flags;
+  int PhotcodeClip;
+  float *Xvec, *Yvec, *Zvec;
+
+  SkyTable *sky;
+  SkyList *skylist;
+  Catalog catalog;
+  Graphdata graphmode;
+
+  if (!InitPhotcodes ()) return (FALSE);
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  f = (FILE *) NULL;
+  Mz = 17.0;
+  Mr = -5.0;
+  Rmin = graphmode.coords.crval1 - 182.0;
+  Rmax = graphmode.coords.crval1 + 182.0;
+
+  PhotcodeClip = -1;
+  if ((Narg = get_argument (argc, argv, "-p"))) {
+    remove_argument (Narg, &argc, argv);
+    PhotcodeClip = GetPhotcodeCodebyName (argv[Narg]);
+    remove_argument (Narg, &argc, argv);
+  }
+  IDchoice = 0;
+  IDclip = FALSE;
+  if ((Narg = get_argument (argc, argv, "-ID"))) {
+    remove_argument (Narg, &argc, argv);
+    IDchoice  = atoi(argv[Narg]);
+    remove_argument (Narg, &argc, argv);
+    IDclip = TRUE;
+  }
+  FlagChoice = 0;
+  FlagClip = FALSE;
+  if ((Narg = get_argument (argc, argv, "-flag"))) {
+    remove_argument (Narg, &argc, argv);
+    FlagChoice  = atoi(argv[Narg]);
+    remove_argument (Narg, &argc, argv);
+    FlagClip = TRUE;
+  }
+
+  // XXX Add time restrictions
+
+  LimExclude = FALSE;
+  if ((Narg = get_argument (argc, argv, "-x"))) {
+    remove_argument (Narg, &argc, argv);
+    LimExclude = TRUE;
+  }
+
+  VERBOSE = FALSE;
+  if ((Narg = get_argument (argc, argv, "-v"))) {
+    remove_argument (Narg, &argc, argv);
+    VERBOSE = TRUE;
+  }
+
+  if ((Narg = get_argument (argc, argv, "-m"))) {
+    remove_argument (Narg, &argc, argv);
+    Mr  = atof(argv[Narg]);
+    remove_argument (Narg, &argc, argv);
+    Mz = atof(argv[Narg]);
+    Mr = Mr - Mz;
+    remove_argument (Narg, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: pmeasure (-all) [-m M M] [-p photcode] [-ID ID] [-flag value] [-x]\n");
+    return (FALSE);
+  }
+  graphmode.style = 2; /* set style to points */
+  graphmode.size = -1; /* point size determined by Zvec */
+  graphmode.etype = 0; /* no errorbars */
+
+  Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax));
+
+  /* load sky from correct table */
+  sky = GetSkyTable ();
+  skylist = SkyListByRadius (sky, -1, graphmode.coords.crval1, graphmode.coords.crval2, Radius);
+  
+  /* storage for plotting the points */
+  Npts = 0;
+  NPTS = 1000;
+  ALLOCATE (Xvec, float, NPTS);
+  ALLOCATE (Yvec, float, NPTS);
+  ALLOCATE (Zvec, float, NPTS);
+
+  for (j = 0; j < skylist[0].Nregions; j++) {
+    catalog.filename = skylist[0].filename[j];
+    catalog.catflags = LOAD_AVES | LOAD_MEAS;
+    catalog.Nsecfilt = 0;
+
+    // an error exit status here is a significant error
+    if (!dvo_catalog_open (&catalog, NULL, VERBOSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+    }
+    dvo_catalog_unlock (&catalog);
+
+    /* project stars to screen display coords */
+    for (i = 0; i < catalog.Naverage; i++) {
+      if (IDclip && (catalog.average[i].code != IDchoice)) continue;
+      while (catalog.average[i].R < Rmin) catalog.average[i].R += 360.0;
+      while (catalog.average[i].R > Rmax) catalog.average[i].R -= 360.0;
+      m = catalog.average[i].offset;
+      for (k = 0; k < catalog.average[i].Nm; k++) {
+	if (FlagClip) {
+	  flags = catalog.measure[m+k].dbFlags;
+	  if (!(flags & FlagChoice)) continue;
+	}
+	if ((PhotcodeClip != -1) && (catalog.measure[m+k].photcode != PhotcodeClip)) continue;
+	mag = PhotCat (&catalog.measure[m+k]);
+	Zvec[Npts] = MIN (1.0, MAX (0.01, (mag - Mz) / Mr));
+	if (LimExclude && (Zvec[Npts] > 0.99)) continue;
+	if (Zvec[Npts] < 0.011) continue;
+	R = catalog.average[i].R - catalog.measure[m+k].dR/3600.0;
+	D = catalog.average[i].D - catalog.measure[m+k].dD/3600.0;
+	// XXX drop this check
+	if ((R < Rmin) || (R > Rmax) || (D < -90.0) || (D > 90.0)) {
+	  char *date;
+	  date = ohana_sec_to_date (catalog.measure[m+k].t);
+	  gprint (GP_LOG, "out: %f, %f : %s : (%f, %f) + (%f, %f)\n", R, D, date, catalog.average[i].R, catalog.average[i].D, catalog.measure[m+k].dR/3600.0, catalog.measure[m+k].dD/3600.0);
+	  free (date);
+	}
+	status = fRD_to_XY (&Xvec[Npts], &Yvec[Npts], R, D, &graphmode.coords);
+	if (!status) {
+	  fprintf (stderr, ".");
+	  continue;
+	}
+	Npts ++;
+
+	if (Npts == NPTS - 1) {
+	    NPTS += 1000;
+	    REALLOCATE (Xvec, float, NPTS);
+	    REALLOCATE (Yvec, float, NPTS);
+	    REALLOCATE (Zvec, float, NPTS);
+	}
+	if (Npts > NCHUNK) {
+	    PlotVectorTriplet (kapa, Npts, Xvec, Yvec, Zvec, &graphmode);
+	    Npts = 0;
+	}
+      }
+    }
+    dvo_catalog_free (&catalog);
+  }
+  if (Npts > 0) PlotVectorTriplet (kapa, Npts, Xvec, Yvec, Zvec, &graphmode);
+
+  free (Xvec);
+  free (Yvec);
+  free (Zvec);
+
+  return (TRUE);
+
+}
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/procks.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/procks.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/procks.c	(revision 15879)
@@ -0,0 +1,153 @@
+# include "dvoshell.h"
+
+typedef struct {
+  double ra[3];
+  double dec[3];
+  double X[3];
+  double Y[3];
+  unsigned int t[3];
+  double mag[3];
+} Rocks;
+static Rocks *rocks = (Rocks *) NULL;
+static int   Nrocks;
+
+int procks (int argc, char **argv) {
+  
+  FILE *f;
+  Vector Xvec, Yvec;
+  int kapa, i, j, N, NROCKS;
+  int N0, N1, SpeedClip, Reload;
+  unsigned int t0, t1;
+  double Mz, Mr, S0, S1;
+  double Rmin, Rmax;
+  Graphdata graphmode;
+  char rockcat[256];
+
+  VarConfig ("ROCK_CATALOG", "%s", rockcat);
+  if (!GetGraph (&graphmode, &kapa, NULL)) return (FALSE);
+
+  f = (FILE *) NULL;
+  Mz = 17.0;
+  Mr = -5.0;
+  Rmin = graphmode.coords.crval1 - 182.0;
+  Rmax = graphmode.coords.crval1 + 182.0;
+
+  if ((N = get_argument (argc, argv, "-m"))) {
+    remove_argument (N, &argc, argv);
+    Mr  = 1000*atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    Mz = 1000*atof(argv[N]);
+    Mr = Mr - Mz;
+    remove_argument (N, &argc, argv);
+  }
+
+  S0 = S1 = 0;
+  SpeedClip = FALSE;
+  if ((N = get_argument (argc, argv, "-speed"))) {
+    SpeedClip = TRUE;
+    remove_argument (N, &argc, argv);
+    S0 = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    S1 = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  Reload = FALSE;
+  if ((N = get_argument (argc, argv, "-reload"))) {
+    Reload = TRUE;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: procks [-m M M] [-speed s s] \n");
+    return (FALSE);
+  }
+  
+  f = fopen (rockcat, "r");
+  if (f == (FILE *) NULL) {
+    gprint (GP_ERR, "can't open rock catalog\n");
+    return (TRUE);
+  }
+
+  if ((rocks == (Rocks *) NULL) || Reload) {
+    if (rocks != (Rocks *) NULL) free (rocks);
+    NROCKS = 100;
+    ALLOCATE (rocks, Rocks, NROCKS);
+    for (i = 0; fscanf (f, "%lf %lf %d%lf%lf%lf %d%lf%lf%lf %d%lf%lf%lf", 
+			&rocks[i].X[0], &rocks[i].Y[0], 
+			&rocks[i].t[0], &rocks[i].ra[0], &rocks[i].dec[0], &rocks[i].mag[0], 
+			&rocks[i].t[1], &rocks[i].ra[1], &rocks[i].dec[1], &rocks[i].mag[1], 
+			&rocks[i].t[2], &rocks[i].ra[2], &rocks[i].dec[2], &rocks[i].mag[2]
+			) != EOF; i++) {
+      if (i == NROCKS - 1) {
+	NROCKS += 100;
+	REALLOCATE (rocks, Rocks, NROCKS);
+      }
+    }
+    Nrocks = i;
+  }
+      
+  if (Nrocks == 0) {
+    free (rocks);
+    gprint (GP_ERR, "no rocks in datafile\n");
+    return (TRUE);
+  }
+
+  /* data has been loaded, get ready to plot it */
+  Yvec.Nelements = Xvec.Nelements = 3*Nrocks;
+  ALLOCATE (Xvec.elements, float, Xvec.Nelements);
+  ALLOCATE (Yvec.elements, float, Yvec.Nelements);
+  
+  /* project stars to screen display coords */
+  for (N = i = 0; i < Nrocks; i++) {
+    if (SpeedClip && ((rocks[i].Y[0] < S0) || (rocks[i].Y[0] > S1))) continue;
+    for (j = 0; j < 3; j++) {
+      while (rocks[i].ra[j] < Rmin) rocks[i].ra[j] += 360.0;
+      while (rocks[i].ra[j] > Rmax) rocks[i].ra[j] -= 360.0;
+      fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], rocks[i].ra[j], rocks[i].dec[j], &graphmode.coords);
+      N ++;
+    }
+  }
+  Yvec.Nelements = Xvec.Nelements = N;
+  
+  graphmode.style = 2; /* set style to points */
+  graphmode.etype = 0; /* no errorbars */
+  PlotVectorPair (kapa, N, Xvec.elements, Yvec.elements, &graphmode);
+
+  /* now plot vectors between two extrema */
+  Yvec.Nelements = Xvec.Nelements = 2*Nrocks;
+  REALLOCATE (Xvec.elements, float, Xvec.Nelements);
+  REALLOCATE (Yvec.elements, float, Yvec.Nelements);
+  
+  /* project stars to screen display coords */
+  for (N = i = 0; i < Nrocks; i++) {
+    if (SpeedClip && ((rocks[i].Y[0] < S0) || (rocks[i].Y[0] > S1))) continue;
+    N0 = N1 = 0;
+    t0 = t1 = rocks[i].t[0];
+    for (j = 1; j < 3; j++) {
+      if (rocks[i].t[j] < t0) { N0 = j; t0 = rocks[i].t[j]; }
+      if (rocks[i].t[j] > t1) { N1 = j; t1 = rocks[i].t[j]; }
+    }
+    while (rocks[i].ra[N0] < Rmin) rocks[i].ra[N0] += 360.0;
+    while (rocks[i].ra[N0] > Rmax) rocks[i].ra[N0] -= 360.0;
+    while (rocks[i].ra[N1] < Rmin) rocks[i].ra[N1] += 360.0;
+    while (rocks[i].ra[N1] > Rmax) rocks[i].ra[N1] -= 360.0;
+    fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], rocks[i].ra[N0], rocks[i].dec[N0], &graphmode.coords);
+    N ++;
+    fRD_to_XY (&Xvec.elements[N], &Yvec.elements[N], rocks[i].ra[N1], rocks[i].dec[N1], &graphmode.coords);
+    N ++;
+  }
+  Yvec.Nelements = Xvec.Nelements = N;
+  
+  graphmode.style = 2; /* set style to points */
+  graphmode.ptype = 100; /* connect pairs */
+  graphmode.etype = 0; /* no errorbars */
+
+  PlotVectorPair (kapa, N, Xvec.elements, Yvec.elements, &graphmode);
+
+  free (Xvec.elements);
+  free (Yvec.elements);
+  return (TRUE);
+
+}
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/region_list.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/region_list.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/region_list.c	(revision 15879)
@@ -0,0 +1,215 @@
+# include "dvoshell.h"
+
+/* XXX note : for RegionName or RegionList, we need to free the skylist
+   elements, but not in the case of radius selection - this implies 
+   information carried back up */
+
+static char *CATDIR  = NULL;
+static SkyTable *sky = NULL;
+
+int SetCATDIR (char *path, int verbose) {
+
+  char *newpath;
+  char catdir_config[256];
+  char gscfile[256];
+  char skyfile[256];
+  int  skydepth;
+
+  /* find CATDIR in config system */
+  if (path == NULL) {
+    if (VarConfig ("CATDIR", "%s", catdir_config) == NULL) return (FALSE);
+    newpath = catdir_config;
+  } else {
+    newpath = path;
+  }
+
+  if (CATDIR != NULL) free (CATDIR);
+  CATDIR = strcreate (newpath);
+
+  if (VarConfig ("GSCFILE",  "%s", gscfile) == NULL) gscfile[0] = 0;
+  if (VarConfig ("SKYFILE",  "%s", skyfile) == NULL) skyfile[0] = 0;
+  if (VarConfig ("SKYDEPTH", "%d", &skydepth) == NULL) skydepth = 2;
+
+  if (verbose) {
+      gprint (GP_ERR, "CATDIR %s\n", CATDIR);
+      gprint (GP_ERR, "GSCFILE %s\n", gscfile);
+      gprint (GP_ERR, "SKYFILE %s\n", skyfile);
+      gprint (GP_ERR, "SKYDEPTH %d\n", skydepth);
+  }
+
+  /* load the SkyTable at this point */
+  /* set the image path as well */
+
+  if (sky != NULL) SkyTableFree (sky);
+  sky = SkyTableLoadOptimal (CATDIR, skyfile, gscfile, skydepth, verbose);
+  if (sky == NULL) return FALSE;
+
+  SkyTableSetFilenames (sky, CATDIR, "cpt");
+
+  return (TRUE);
+}
+
+char *GetCATDIR () {
+  if (CATDIR == NULL) {
+    SetCATDIR (NULL, FALSE);
+  }
+  return (CATDIR);
+}
+
+SkyTable *GetSkyTable () {
+  if (sky == NULL) {
+    SetCATDIR (NULL, FALSE);
+  }
+  return (sky);
+}
+
+void FreeSkyRegionSelection (SkyRegionSelection *selection) {
+
+  if (selection == NULL) return;
+  if (selection[0].name != NULL) free (selection[0].name);
+  if (selection[0].list != NULL) free (selection[0].list);
+  free (selection);
+}
+
+SkyRegionSelection *SetRegionSelection (int *argc, char **argv) {
+  
+  int N;
+  SkyRegionSelection *selection;
+
+  ALLOCATE (selection, SkyRegionSelection, 1);
+  selection[0].name = NULL;
+  selection[0].list = NULL;
+  selection[0].useDisplay = FALSE;
+  selection[0].useSkyregion = FALSE;
+
+  /* check for Region selection (named dvo catalog file) */
+  if ((N = get_argument (*argc, argv, "-cpt"))) {
+    remove_argument (N, argc, argv);
+    selection[0].name = strcreate (argv[N]);
+    remove_argument (N, argc, argv);
+    return selection;
+  }    
+
+  /* check for Region list (file containing dvo catalog file list)*/
+  if ((N = get_argument (*argc, argv, "-cptlist"))) {
+    remove_argument (N, argc, argv);
+    selection[0].list = strcreate (argv[N]);
+    remove_argument (N, argc, argv);
+    return selection;
+  } 
+
+  /* check for Region selection from display */
+  if ((N = get_argument (*argc, argv, "-region"))) {
+    remove_argument (N, argc, argv);
+    selection[0].useDisplay = TRUE;
+    return selection;
+  }    
+
+  /* check for Region selection from display */
+  if ((N = get_argument (*argc, argv, "-skyregion"))) {
+    if (N + 5 >= *argc) {
+      gprint (GP_ERR, "USAGE: -skyregion (RA) (RA) (DEC) (DEC)\n");
+      FreeSkyRegionSelection (selection);
+      return NULL;
+    }
+    remove_argument (N, argc, argv);
+    selection[0].useSkyregion = TRUE;
+    set_skyregion (atof(argv[N]), atof(argv[N+1]), atof(argv[N+2]), atof(argv[N+3]));
+    remove_argument (N, argc, argv);
+    remove_argument (N, argc, argv);
+    remove_argument (N, argc, argv);
+    remove_argument (N, argc, argv);
+    return selection;
+  }    
+
+  /* default to pre-defined sky region */
+  selection[0].useSkyregion = TRUE;
+  return selection;
+}
+
+/* given possible options (by name, by list, by graph region), select SkyRegions */
+SkyList *SelectRegions (SkyRegionSelection *selection) {
+
+  SkyList *skylist;
+
+  /* determine region-file names */
+  if (selection->name != NULL) {
+    char filename[256];
+
+    ALLOCATE (skylist, SkyList, 1);
+    ALLOCATE (skylist[0].regions, SkyRegion *, 1);
+    ALLOCATE (skylist[0].regions[0], SkyRegion, 1);
+    ALLOCATE (skylist[0].filename, char *, 1);
+    skylist[0].ownElements = TRUE; // free these elements when freeing the list
+    
+    strcpy (skylist[0].regions[0][0].name, selection->name);
+    sprintf (filename, "%s/%s.cpt", CATDIR, selection->name);
+    skylist[0].filename[0] = strcreate (filename);
+    return (skylist);
+  } 
+
+  if (selection->list != NULL) {
+    skylist = SkyListLoadFile (selection->list);
+    return (skylist);
+  }
+
+  if (selection->useDisplay) {
+    double Radius;
+    Graphdata graphsky;
+
+    if (!GetGraphData (&graphsky, NULL, NULL)) {
+      gprint (GP_ERR, "region display not available\n");
+      return (NULL);
+    }
+
+    Radius = MAX (fabs(graphsky.xmax), fabs(graphsky.ymax));
+    skylist = SkyListByRadius (sky, -1, graphsky.coords.crval1, graphsky.coords.crval2, Radius);
+    return (skylist);
+  }
+
+  if (selection->useSkyregion) {
+    double Rmin, Rmax, Dmin, Dmax;
+
+    get_skyregion (&Rmin, &Rmax, &Dmin, &Dmax);
+    skylist = SkyListByBounds (sky, -1, Rmin, Rmax, Dmin, Dmax);
+    return (skylist);
+  }    
+
+  return NULL;
+}
+
+/* returns a list of region files names from file */
+SkyList *SkyListLoadFile (char *filename) {
+  
+  FILE *f;
+  int NREGIONS, Nregions;
+  SkyList *skylist;
+
+  ALLOCATE (skylist, SkyList, 1);
+
+  f = fopen (filename, "r");
+  if (f == NULL) {
+    gprint (GP_ERR, "ERROR: can't find region list file %s\n", filename);
+    skylist[0].Nregions = 0;
+    skylist[0].regions = NULL;
+    return (skylist);
+  }
+  
+  Nregions = 0;
+  NREGIONS = 50;
+  ALLOCATE (skylist[0].regions, SkyRegion *, NREGIONS);
+  ALLOCATE (skylist[0].filename, char *, NREGIONS);
+  skylist[0].ownElements = TRUE; // free these elements when freeing the list
+
+  while (fscanf (f, "%s", filename) != EOF) {
+    ALLOCATE (skylist[0].regions[Nregions], SkyRegion, 1);
+    strcpy (skylist[0].regions[Nregions][0].name, filename);
+    sprintf (filename, "%s/%s.cpt", CATDIR, skylist[0].regions[Nregions][0].name);
+    skylist[0].filename[Nregions] = strcreate (filename);
+    Nregions ++;
+    CHECK_REALLOCATE (skylist[0].regions, SkyRegion *, NREGIONS, Nregions, 50);
+  }
+  skylist[0].Nregions = Nregions;
+  return (skylist);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/scripts/navigate
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/scripts/navigate	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/scripts/navigate	(revision 15879)
@@ -0,0 +1,623 @@
+# -*- perl -*-
+
+macro navigate
+  style -n 0
+  limits
+  $DRAWSTARS  = -1
+  $DRAWIMAGES =  1
+  $DRAWGRID   = -1
+  $ZOOM = 180 / ($YMAX - $YMIN)
+  #this should be changed to a while loop, except 'while' is broken for some reason
+  $KEY = "none"
+  while ("$KEY" != "q")
+    cursor 1
+
+    # help list
+    if ("$KEY" == "h")
+     echo "Arrow Keys - pan in that direction"
+     echo "PgUp,PgDn - zoom in/out a factor of 1.2"
+     echo "Home,End  - zoom in/out a factor of 2"
+     echo "1 - zoom in factor of 2 at the cursor"
+     echo "2 - zoom in factor of 1.2 at the cursor"
+     echo "3 - recenter at cursor"
+     echo "4 - zoom out factor of 1.2 at the cursor"
+     echo "5 - zoom out factor of 2 at the cursor"
+     echo "6 - zoom out factor of 10 at the cursor"
+     echo "z - zoom to radius (requires 2nd keystroke)"
+     echo "f - show full sky"
+     echo ""
+     echo "q - quit"
+     echo "S - toggle auto-plotting of stars"
+     echo "A - toggle auto-plotting of image borders"
+     echo "g - toggle skygrid on/off"
+     echo "c - plot status catalog boundaries"
+     echo "C - list catalog at cursor location"
+     echo "i - list info about images touching cursor location" 
+     echo "I - list info about images, with pixel coords of cursor position"
+     echo "j - adjust mag scale, +0.5"
+     echo "k - adjust mag scale, -0.5"
+     echo "J - adjust dmag scale, /1.25"
+     echo "K - adjust dmag scale, *1.25"
+     echo "r - plot detected asteroids (rocks)"
+     echo "l - plot HST GSC"
+     echo "L - plot Landolt stars"
+     echo "m - list measurements for stars within 1 pixel of cursor"
+     echo "M - list measurements for stars within 1.8 arcsec of cursor"
+     echo "p - ****(don't know what this does)"
+     echo "s - ****(don't know what this does)"
+     echo "t - plot light curve for star within 2 arcsec of cursor position"
+     echo "T - plot 'galaxy' light curve for star within 2 arcsec of cursor position"
+     echo "u - ****(don't know what this does)"
+     echo "x - plot stars scaled by magnitude Chisq"
+     echo "X - plot stars by magnitude scatter"
+     echo "y - ****(don't know what this does)"
+     echo ""
+     echo "@ - execute macro `user_macro`"
+     echo ": - ****input a line and execute (not yet implemented)"
+    end
+
+    # quit from navigate
+    if ("$KEY" == "q") continue
+
+    #pan controls
+    if (("$KEY" == "Left") || ("$KEY" == "Right") || ("$KEY" == "Up") || ("$KEY" == "Down"))
+      $SHIFT = 0.2
+      $R$KEY  = $RMAX-$XMAX  
+      $D$KEY  = $DMAX-$YMAX
+      #assumes standard sky orientation!! (N up, E left)
+      if ("$KEY"=="Left")
+        $R$KEY = $R$KEY + $SHIFT*$XMAX
+      end
+      if ("$KEY"=="Right")
+        $R$KEY = $R$KEY + $SHIFT*$XMIN
+      end
+      if ("$KEY"=="Up")
+        $D$KEY = $D$KEY + $SHIFT*$YMAX
+      end
+      if ("$KEY"=="Down")
+        $D$KEY = $D$KEY + $SHIFT*$YMIN
+      end
+      #pretend like I hit '3' in the place to recenter it
+      nav_zoom 1      
+    end
+
+    # NEW zoom controls
+    if (("$KEY" == "Prior") || ("$KEY" == "Next") || ("$KEY" == "Home") || ("$KEY" == "End") || ("$KEY" == "Button4") || ("$KEY" == "Button5"))    
+      #move where key was hit to center      
+      $R$KEY  = $RMAX-$XMAX  
+      $D$KEY  = $DMAX-$YMAX
+      if ("$KEY" == "Prior")
+        $zfac=1.2
+      end
+      if ("$KEY" == "Next")
+        $zfac={1/1.2}
+      end
+      if ("$KEY" == "Home")
+        $zfac=2
+      end
+      if ("$KEY" == "End")
+        $zfac={1/2.}
+      end
+      if ("$KEY"=="Button4")
+        $zfac=1.6
+      end
+      if ("$KEY"=="Button5")
+        $zfac={1/1.6}
+      end
+      nav_zoom $zfac
+    end
+
+    if ("$KEY"=="Button1")
+      nav_zoom 1
+    end
+    if ("$KEY"=="Button2")
+      nav_zoom {1/2.}
+    end
+    if ("$KEY"=="Button3")
+      nav_zoom 2
+    end
+
+
+
+    # zoom controls
+    if ("$KEY" == "1")
+      nav_zoom 2
+    end
+    if ("$KEY" == "2")
+      nav_zoom 1.2
+    end
+    if ("$KEY" == "3")
+      nav_zoom 1
+    end
+    if ("$KEY" == "4")
+      nav_zoom {1/1.2}
+    end
+    if ("$KEY" == "5")
+      nav_zoom {1/2.}
+    end
+    if ("$KEY" == "6")
+      nav_zoom {1/20.}
+    end
+
+ 
+   # measure distance
+    if ("$KEY" == "d")
+      $r0 = $R$KEY
+      $d0 = $D$KEY
+      $ok = $KEY
+      echo "type 'd' again at endpoint"
+      cursor 1
+      $r1 = $R$KEY
+      $d1 = $D$KEY
+      $dr = 3600*((dcos($d0)*($r0-$r1))^2 + ($d0-$d1)^2)^0.5
+      echo "$dr arcsec"
+    end
+    # show ra, dec
+    if ("$KEY" == "w")
+      $tmp = $R$KEY
+      if ($tmp < 0) 
+        $tmp = $R$KEY + 360.0
+      end
+      echo "$tmp $D$KEY" 
+      exec echo $tmp $D$KEY | radec -hh
+    end
+    # zoom to radius
+    if ("$KEY" == "z")
+      $r0 = $R$KEY
+      $d0 = $D$KEY
+      $ok = $KEY
+      echo "type 'z' again at radius"
+      cursor 1
+      $r1 = $R$KEY
+      $d1 = $D$KEY
+      $dr = (($r0-$r1)^2 + ($d0-$d1)^2)^0.5
+      $ZOOM = $RAD / $dr
+      nav_recenter
+      nav_redraw
+      $KEY = $ok
+      $R$KEY = $r0
+      $D$KEY = $d0
+    end
+
+    # adjust mag scaling
+    if ("$KEY" == "J")
+      $MAG = $MAG - 0.5
+      nav_redraw
+    end
+    if ("$KEY" == "K")
+      $MAG = $MAG + 0.5
+      nav_redraw
+    end
+    if ("$KEY" == "j")
+      $dMAG = $dMAG * 0.8
+      nav_redraw
+    end
+    if ("$KEY" == "k")
+      $dMAG = $dMAG * 1.25
+      nav_redraw
+    end
+    echo "mag, dmag: $MAG, $dMAG"
+
+
+
+    # plot full sky
+    if ("$KEY" == "f") 
+      echo "full"
+      $ZOOM = 1
+      resize 1150 600		      
+      region 0 0 90 ait
+      $RMIN = 0
+      $RMAX = 360
+      $DMIN = -90
+      $DMAX = +90
+      style -c red; cgrid
+      style -c black
+      images
+    end
+
+    # plot rocks
+    if ("$KEY" == "r") 
+#      plot.rocks
+      style -c blue   -pt 1; procks -speed 0.0041 1
+      style -c red    -pt 1; procks -speed 0.00041 0.0041
+      style -c indigo -pt 1; procks -speed 0 0.00041
+      style -c black -lw 0;
+    end
+    # plot HST-GSC
+    if ("$KEY" == "l") 
+      style -c blue -pt 7; cat -all -g -m 9 16
+      style -c black
+    end
+    # plot Landolt
+    if ("$KEY" == "L") 
+#      style -c red  -lw 2 -pt 3; cat -a 1 2 3 /data/elixir/srcdir/refs/stetson/stetsonBn.txt -m 9 18
+#      style -c blue -lw 2 -pt 3; cat -a 25 26 8 /data/elixir/srcdir/refs/landolt/new/Landolt92.fix -m 9 18
+      style -c red -lw 2 -pt 7; cat -a 1 2 3 /data/elixir/srcdir/refs/sdss/g_SDSS.dat -m 9 14
+#      style -c red -lw 2 -pt 3; cat -a 25 26 8 /data/elixir/srcdir/refs/landolt/new/Landolt92.hq -m 9 18
+#      style -c red -lw 2 -pt 3; cat -a 22 23 8 /data/elixir/srcdir/refs/landolt/new/Landolt92.unfix -m 9 18
+#      style -c blue -lw 2 -pt 7; cat -a 1 2 4 /data/elixir/srcdir/refs/landolt/extreme/extreme.match -m 0 20
+#      style -x 2 -c red -pt 7 ; cplot RA DEC
+      style -c black -lw 0
+    end
+
+    # list star measurements
+    if ("$KEY" == "m") 
+        $dR = $RAD/$ZOOM/300
+        if ($dR < 0.0005)
+	 $dR = 0.0005
+        end
+	gstar $R$KEY $D$KEY $dR -m
+    end
+
+    # plot mag residuals
+    if ("$KEY" == "R") 
+      echo "filter: "
+      cursor 1
+      clear -n 1 -s; lim 10 22 -0.2 0.2; clear; box
+      dmags $KEY\:rel - $KEY : $KEY -type 0
+      plot -x 2 -pt 0 -sz 0.3 -c red yv xv
+      dmags $KEY\:rel - $KEY : $KEY -type 0 -flag 0 -nphot +3 -chisq 2.0
+      plot -x 2 -pt 2 -sz 0.5 -c black yv xv
+      $KEY = R
+      style -n 0
+    end
+
+    if ("$KEY" == "M") 
+	gstar $R$KEY $D$KEY 0.0005 -m
+    end
+    # list images
+    if ("$KEY" == "i") 
+	gimages $R$KEY $D$KEY
+    end
+    if ("$KEY" == "I") 
+	gimages $R$KEY $D$KEY -pix
+    end
+
+    #toggle images on / off
+    if ("$KEY" == "A")
+      $DRAWIMAGES = $DRAWIMAGES * -1
+      if ($DRAWIMAGES == 1)
+        images
+      end
+    end
+    # toggle stars on / off
+    if ("$KEY" == "S")
+      $DRAWSTARS = $DRAWSTARS * -1
+      if (($ZOOM > 20) && ($DRAWSTARS == 1))
+       style -pt 7
+       pmeasure -all -m $MAG {$MAG + $dMAG}
+      end
+    end
+    # turn grid on / off
+    if ("$KEY" == "g")
+      $DRAWGRID = $DRAWGRID * -1
+      if (($ZOOM > 20) && ($DRAWGRID==1))
+        style -c black; cgrid
+      end
+      if (($ZOOM > 20) && ($DRAWGRID==-1))
+        nav_redraw
+      end
+    end
+
+    # plot light-curve interactive
+    if ("$KEY" == "t")
+      style -n 1 -pt 2 -x 2
+      clear
+      if ($R$KEY < 0) 
+       $R$KEY = $R$KEY + 360
+      end
+      lcurve -l $R$KEY $D$KEY {30/3600} -d -v time mag
+      box
+      lcv
+      style -n 0
+    end
+    # plot light-curve 
+    if ("$KEY" == "T")
+      style -n 1 -pt 1 -c red -x 2
+      lcurve $R$KEY $D$KEY {30/3600} -d
+      style -c black
+      style -n 0 
+    end
+    # plot catalogs
+    if ("$KEY" == "c")
+      style -c blue; pcat; style -c black
+    end
+    # list catalogs
+    if ("$KEY" == "C")
+      gcat $R$KEY $D$KEY
+    end
+
+    # plot image chisqs
+    if ("$KEY" == "x") 
+       gcat $R$KEY $D$KEY
+       extract $CATNAME Xm -photcode R
+       extract $CATNAME ra
+       extract $CATNAME dec
+       style -x 2 -pt 7 -c blue
+       czplot ra dec Xm 3 30
+       style -c black -pt 1
+    end
+    # plot meas errors
+    if ("$KEY" == "X") 
+       gcat $R$KEY $D$KEY
+       extract $CATNAME dM -photcode R
+       extract $CATNAME ra
+       extract $CATNAME dec
+       style -x 2 -pt 7 -c red
+       czplot ra dec dM 0 30
+       style -c black -pt 1
+    end
+
+
+    # temp plot for skyprobe
+    if ("$KEY" == "u") 
+      imextract -region time
+      imextract -region mcal
+      imextract -region airmass
+      imextract -region nstar
+      vstat time
+      clear -n 1;
+      section a 0 0.00 1 0.33
+      lim {$MEDIAN-0.3} {$MEDIAN+0.3} -0.8 -0.5; box; plot time mcal
+      section b 0 0.33 1 0.33
+      lim {$MEDIAN-0.3} {$MEDIAN+0.3}  0.95 3.0; box; plot time airmass
+      section c 0 0.66 1 0.33
+      lim {$MEDIAN-0.3} {$MEDIAN+0.3} 0 3000; box; plot time nstar
+      style -n 0
+    end
+    if ("$KEY" == "s")
+      $tmp = $R$KEY
+      if ($tmp < 0) 
+        $tmp = $R$KEY + 360.0
+      end
+      $line = `echo $tmp $D$KEY | radec -hh`
+      imextract -region photcode
+      imextract -region time
+     
+      subset t = time if (int(photcode/100) == 1)
+      uniq t T
+      $Bn = t[]
+      $BN = T[]
+      
+      subset t = time if (int(photcode/100) == 2)
+      uniq t T
+      $Vn = t[]
+      $VN = T[]
+      
+      subset t = time if (int(photcode/100) == 3)
+      uniq t T
+      $Rn = t[]
+      $RN = T[]
+      
+      subset t = time if (int(photcode/100) == 4)
+      uniq t T
+      $In = t[]
+      $IN = T[]
+     
+      echo "$line  $Bn $BN  $Vn $VN  $Rn $RN  $In $IN"
+    end
+
+    if ("$KEY" == "p") 
+      echo "P - new coords; p - old coords"
+      cursor 1
+      exec echo $Rp $Dp $RP $DP >> fix.coords
+    end
+
+    if ("$KEY" == "y")
+      ccd I - 2MASS_J : 2MASS_J - 2MASS_K
+      lim -n 1 -1 10 -1 3; clear; box; plot -x 2 -pt 2 -sz 0.5 xv yv
+      dev -n 0 -g
+    end
+
+    #  User-defined macro
+    if ("$KEY" == "at")
+      user_macro
+    end
+
+    if ("$KEY" == "colon")
+      #make this work similar to ':' in vi or iraf
+      #does not work correctly now.
+      scan stdin line
+      $line
+    end
+
+  end
+end
+
+#define this so navigate doesn't crash if you try to call it.
+#If you define a user_macro, be sure to do so AFTER this in .dvorc.
+macro user_macro
+  #echo "success!"
+  $do_nothing=0
+end
+    
+
+macro nav_zoom
+  $ZOOM = $ZOOM * $1
+  nav_recenter
+  nav_redraw
+  $Rnum = $R$KEY		      
+  $Dnum = $D$KEY
+  $KEY = num
+end
+
+macro nav_recenter
+  region $R$KEY $D$KEY {$RAD/$ZOOM} sin
+  #assumes standard sky orientation!! (N up, E left)
+  $RMIN = $R$KEY + $XMIN
+  $RMAX = $R$KEY + $XMAX
+  $DMIN = $D$KEY + $YMIN
+  $DMAX = $D$KEY + $YMAX
+end
+
+macro nav_redraw
+  clear
+  if ($ZOOM <= 20) 
+    style -c red; cgrid
+  end
+  if (($ZOOM > 20) && ($DRAWGRID==1))
+    style -c black; cgrid
+  end
+  if (($ZOOM > 20) && ($DRAWSTARS == 1))
+    pmeasure -all -m $MAG {$MAG + $dMAG}
+  end    
+  style -c black
+  if ($DRAWIMAGES == 1)
+    images
+  end
+end
+
+
+
+#==================================================
+#=================   END BSNAV   ==================
+#==================================================
+
+
+macro sigclip
+  if ("$0" == "1")
+    echo ""
+    echo "sigclip <clipvector> <N_iterations> <N_sigma> [other vectors ..]"
+    echo ""
+  end
+
+  #required parameters
+  $CLIPVECT = $1
+  $NITERATE = $2
+  $NSIGCLIP = $3
+  
+  for i 0 $NITERATE
+    vstat -q $CLIPVECT
+    #clip boundaries
+    $top = $MEAN + ($NSIGCLIP*$SIGMA)
+    $bot = $MEAN - ($NSIGCLIP*$SIGMA)
+    
+    #clip it good.
+    subset temp = $CLIPVECT if (($CLIPVECT < $top) && ($CLIPVECT > $bot))
+    
+    #if you specify other vectors, clip the same elements from them too.
+    #they must all be the same length, of course!!
+    if ($0>4)
+      for j 4 $0
+        subset $$j = $$j if (($CLIPVECT < $top) && ($CLIPVECT > $bot))
+      end
+    end
+    
+    #copy temp back to $CLIPVECT and reiterate!
+    delete $CLIPVECT
+    concat temp $CLIPVECT  
+  end
+end
+
+
+macro binvec
+  if ("$0" == "1")
+    echo ""
+    echo "binvec <vec> <Nbins> [other vectors...]"
+    echo ""
+    echo "Bin the vector 'vec' into Nbin bins.  Listing other vectors will"
+    echo "put the corresponding elements of those into other vectors which"
+    echo "are the subset of the vector in that bin.  (That can probably be"
+    echo "stated better.)  This macro makes lots of new vectors.  Hooray!"
+    echo ""
+    echo "Creates"
+  end
+
+  #REQUIRED PARAMS
+  $binvect = $1
+  $NBINS   = $2
+
+  vstat -q $binvect
+  $step = ($MAX-$MIN)/$NBINS
+  $vmin = $MIN
+  $vmax = $MAX
+  delete -q $binvect\_bins
+  delete -q $binvect\_num
+  for i 1 {$NBINS+1}
+    $top = $vmin + ( $i   *$step)
+    $bot = $vmin + (($i-1)*$step)
+    #      sightly different behavior for last bin    -------v
+    if ($i != $NBINS)
+      subset temp = $binvect if (($binvect>=$bot)&&($binvect< $top))
+    else
+      subset temp = $binvect if (($binvect>=$bot)&&($binvect<=$top))
+    end
+    set $binvect\_bin$i = temp
+    set temp2 = temp
+    delete temp
+    #if you specify other vectors, grab the same elements from them too.
+    #they must all be the same length, of course!!
+
+    if ($0>3)
+      for j 3 $0
+        if ($i != $NBINS)
+          subset temp = $$j if (($binvect>=$bot)&&($binvect< $top))
+        else 
+          subset temp = $$j if (($binvect>=$bot)&&($binvect<=$top))
+        end
+        set $$j\_bin$i = temp
+        delete temp
+      end
+    end
+
+
+    concat {$bot+($step/2)} $binvect\_bins
+    concat temp2[] $binvect\_num
+    #dvo didn't like me saying 'concat $binvect\_bin$i[] $binvect\_num
+    delete temp2
+  end
+end
+
+macro binvec.2
+  if ("$0" == "1")
+    echo ""
+    echo "binvec.2 <vec> <min> <max> <binsize> [other vectors...]"
+    echo ""
+    echo ""
+    echo "see also 'binvec'"
+  end
+
+  #REQUIRED PARAMS
+  $binvect = $1
+  $vmin    = $2
+  $vmax    = $3
+  $step    = $4
+
+  $NBINS = ($MAX-$MIN)/$step
+
+  delete -q $binvect\_bins
+  delete -q $binvect\_num
+  for i 1 {$NBINS+1}
+    $top = $vmin + ( $i   *$step)
+    $bot = $vmin + (($i-1)*$step)
+    #      sightly different behavior for last bin    -------v
+    if ($i != $NBINS)
+      subset temp = $binvect if (($binvect>=$bot)&&($binvect< $top))
+    else
+      subset temp = $binvect if (($binvect>=$bot)&&($binvect<=$top))
+    end
+    set $binvect\_bin$i = temp
+    set temp2 = temp
+    delete temp
+    #if you specify other vectors, grab the same elements from them too.
+    #they must all be the same length, of course!!
+
+    if ($0>5)
+      for j 5 $0
+        if ($i != $NBINS)
+          subset temp = $$j if (($binvect>=$bot)&&($binvect< $top))
+        else 
+          subset temp = $$j if (($binvect>=$bot)&&($binvect<=$top))
+        end
+        set $$j\_bin$i = temp
+        delete temp
+      end
+    end
+
+
+    concat {$bot+($step/2)} $binvect\_bins
+    concat temp2[] $binvect\_num
+    #dvo didn't like me saying 'concat $binvect\_bin$i[] $binvect\_num
+    delete temp2
+  end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/showtile.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/showtile.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/showtile.c	(revision 15879)
@@ -0,0 +1,95 @@
+# include "dvoshell.h"
+static float dr[] = {0.0, 1.0, 1.0, 0.0};
+static float dd[] = {0.0, 0.0, 1.0, 1.0};
+
+int showtile (int argc, char **argv) {
+
+  int kapa, Nd, N, NPTS, status, i, InPic;
+  Graphdata graphmode;
+  Coords coords;
+  Vector Xvec, Yvec;
+  float r, d, R, D;
+  float Ro[90], Do[90];
+
+  /* show tile pattern in viewed region */
+  if (!GetGraph (&graphmode, &kapa, NULL)) return (FALSE);
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: showtile [option]\n");
+    return (FALSE);
+  }
+  
+  N = 0;
+  NPTS = 200;
+  ALLOCATE (Xvec.elements, float, NPTS);
+  ALLOCATE (Yvec.elements, float, NPTS);
+
+  /* starting position */
+
+  /* reference for coords is this image */
+  coords.crpix1 = coords.crpix2 = 0.0;
+  coords.crval1 = coords.crval2 = 0.0;
+  coords.cdelt1 = coords.cdelt2 = 1.0;
+  coords.pc1_1  = coords.pc2_2  = 1.0;
+  coords.pc1_2  = coords.pc2_1  = 0.0;
+  coords.Npolyterms = 0;
+  strcpy (coords.ctype, "RA---TAN");
+  
+  /* fill in top-left region */
+  for (r = 0; r < 3; r += 1.0) {
+    gprint (GP_ERR, "r: %f\n", r);
+    for (Nd = d = 0; d < 90; Nd ++, d += 1.0) {
+      if (r == 0) {
+	coords.crval1 = r;
+	coords.crval2 = d;
+      } else {
+	coords.crval1 = Ro[Nd];
+	coords.crval2 = Do[Nd];
+      }
+      for (i = 0; i < 4; i++) {
+	fXY_to_RD (&R, &D, dr[i], dd[i], &coords);
+	status |= fRD_to_XY (&Xvec.elements[N+2*i], &Yvec.elements[N+2*i], R, D, &graphmode.coords);
+	if (i > 0) {
+	  Xvec.elements[N+2*i - 1] = Xvec.elements[N+2*i];
+	  Yvec.elements[N+2*i - 1] = Yvec.elements[N+2*i];
+	}
+	if (i == 1) {
+	  Ro[Nd] = R;
+	  Do[Nd] = D;
+	}
+      }
+      Xvec.elements[N+7] = Xvec.elements[N];
+      Yvec.elements[N+7] = Yvec.elements[N];
+
+      /* check if any corner is in plotting region */
+      InPic = FALSE;
+      for (i = 0; i < 8; i+=2) {
+	if ((Xvec.elements[N+i] >= graphmode.xmin) && 
+	    (Xvec.elements[N+i] <= graphmode.xmax) && 
+	    (Yvec.elements[N+i] >= graphmode.ymin) && 
+	    (Yvec.elements[N+i] <= graphmode.ymax))
+	  InPic = TRUE;
+      }
+      if (!InPic) continue;
+      N+=8;
+      if (N > NPTS - 1) {  /* this is OK because NPTS is made always a multiple of 8 */
+	NPTS += 200;
+	REALLOCATE (Xvec.elements, float, NPTS);
+	REALLOCATE (Yvec.elements, float, NPTS);
+      }
+    }
+  }
+  
+  Xvec.Nelements = Xvec.Nelements = N;
+  if (N > 0) {
+    graphmode.style = 2; /* points */
+    graphmode.ptype = 100; /* connect pairs of points */
+    graphmode.etype = 0;
+    PlotVectorPair (kapa, N, Xvec.elements, Yvec.elements, &graphmode);
+  }
+
+  free (Xvec.elements);
+  free (Yvec.elements);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/simage.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/simage.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/simage.c	(revision 15879)
@@ -0,0 +1,168 @@
+# include "dvoshell.h"
+# define D_NSTARS 1000
+# define BYTES_STAR 31
+# define BLOCK 1000
+
+int simage (int argc, char **argv) {
+
+  char *buffer;
+  Vector Xvec, Yvec, Zvec;
+  double R, D, X, Y, M, zero, range;
+  FILE *f;
+  Header header;
+  Coords coords;
+  int i, j, kapa, Nstars, nstars, Nbytes, nbytes, Npts, N;
+  Graphdata graphmode;
+
+  if (!GetGraph (&graphmode, &kapa, NULL)) return (FALSE);
+
+  zero = 17.0;
+  range = -5.0;
+  if ((N = get_argument (argc, argv, "-m"))) {
+    remove_argument (N, &argc, argv);
+    range = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+    zero  = atof(argv[N]);
+    range = range - zero;
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: image (filename)\n");
+    return (FALSE);
+  }
+
+  gprint (GP_ERR, "not working at the moment (cmp format)\n");
+  return (FALSE);
+  
+  /* read header */
+  if (!gfits_read_header (argv[1], &header)) {
+    gprint (GP_ERR, "ERROR: can't find image file %s\n", argv[1]);
+    return (FALSE);
+  }
+  /* get astrometry information */
+  strcpy (coords.ctype, "NONE");
+  gfits_scan (&header, "CTYPE1",   "%s",  1, coords.ctype);
+  if (strcmp (coords.ctype, "RA---PLY")) {
+    gprint (GP_ERR, "ERROR: wrong astrometric info in header\n");
+    return (FALSE);
+  }
+  gfits_scan (&header, "CDELT1",   "%f", 1, &coords.cdelt1); 
+  gfits_scan (&header, "CDELT2",   "%f", 1, &coords.cdelt2);
+  gfits_scan (&header, "CRVAL1",   "%lf", 1, &coords.crval1);
+  gfits_scan (&header, "CRVAL2",   "%lf", 1, &coords.crval2);  
+  gfits_scan (&header, "CRPIX1",   "%f", 1, &coords.crpix1);
+  gfits_scan (&header, "CRPIX2",   "%f", 1, &coords.crpix2);
+  gfits_scan (&header, "PC001001", "%f", 1, &coords.pc1_1);
+  gfits_scan (&header, "PC001002", "%f", 1, &coords.pc1_2);
+  gfits_scan (&header, "PC002001", "%f", 1, &coords.pc2_1);
+  gfits_scan (&header, "PC002002", "%f", 1, &coords.pc2_2);
+  /* RA Terms */
+  gfits_scan (&header, "PCA1X2Y0", "%f", 1, &coords.polyterms[0][0]);
+  gfits_scan (&header, "PCA1X1Y1", "%f", 1, &coords.polyterms[1][0]);
+  gfits_scan (&header, "PCA1X0Y2", "%f", 1, &coords.polyterms[2][0]);
+  gfits_scan (&header, "PCA1X3Y0", "%f", 1, &coords.polyterms[3][0]);
+  gfits_scan (&header, "PCA1X2Y1", "%f", 1, &coords.polyterms[4][0]);
+  gfits_scan (&header, "PCA1X1Y2", "%f", 1, &coords.polyterms[5][0]);
+  gfits_scan (&header, "PCA1X0Y3", "%f", 1, &coords.polyterms[6][0]);
+  /* Dec Terms */			    
+  gfits_scan (&header, "PCA2X2Y0", "%f", 1, &coords.polyterms[0][1]);
+  gfits_scan (&header, "PCA2X1Y1", "%f", 1, &coords.polyterms[1][1]);
+  gfits_scan (&header, "PCA2X0Y2", "%f", 1, &coords.polyterms[2][1]);
+  gfits_scan (&header, "PCA2X3Y0", "%f", 1, &coords.polyterms[3][1]);
+  gfits_scan (&header, "PCA2X2Y1", "%f", 1, &coords.polyterms[4][1]);
+  gfits_scan (&header, "PCA2X1Y2", "%f", 1, &coords.polyterms[5][1]);
+  gfits_scan (&header, "PCA2X0Y3", "%f", 1, &coords.polyterms[6][1]);
+  coords.Npolyterms = 2; /* how many do we use? */
+
+  /* find number of stars */
+  gfits_scan (&header, "NSTARS", "%d", 1, &Nstars);
+  if (Nstars == 0) {
+    gprint (GP_ERR, "no stars in file\n");
+    return (FALSE);
+  }
+
+  /* open file data */
+  f = fopen (argv[1], "r");
+  if (f == NULL) {
+    gprint (GP_ERR, "can't find data in file %s\n", argv[1]);
+    return (FALSE);
+  }
+  fseek (f, header.size, SEEK_SET); 
+
+  /* set up storage buffers */
+  Xvec.Nelements = Nstars;
+  Yvec.Nelements = Nstars;
+  Zvec.Nelements = Nstars;
+  ALLOCATE (Xvec.elements, float, Xvec.Nelements);
+  ALLOCATE (Yvec.elements, float, Yvec.Nelements);
+  ALLOCATE (Zvec.elements, float, Zvec.Nelements);
+  ALLOCATE (buffer, char, (BLOCK*BYTES_STAR));
+
+  /* load in stars by blocks of 1000 */
+  nstars = 0;
+  Nbytes = Nstars*BYTES_STAR;
+  for (i = 0; i < (int)(Nbytes / (BLOCK*BYTES_STAR)); i++) {
+    nbytes = fread (buffer, 1, (BLOCK*BYTES_STAR), f);
+    if (nbytes != BLOCK*BYTES_STAR) {
+      gprint (GP_ERR, "failed to read in stars (1)\n");
+      free (Xvec.elements);
+      free (Yvec.elements);
+      free (Zvec.elements);
+      free (buffer);
+      return (FALSE);
+    }
+    for (j = 0; j < BLOCK; j++, nstars++) {
+      dparse (&X,  1, &buffer[j*BYTES_STAR]);
+      dparse (&Y,  2, &buffer[j*BYTES_STAR]);
+      dparse (&M,  3, &buffer[j*BYTES_STAR]);
+      XY_to_RD (&R, &D, X, Y, &coords);
+      fRD_to_XY (&Xvec.elements[nstars], &Yvec.elements[nstars], R, D, &graphmode.coords);
+      Zvec.elements[nstars] = MIN (1.0, MAX (0.01, (M - zero) / range));
+    }
+  }
+  /* left over fraction of a block */
+  nbytes = fread (buffer, 1, (Nbytes % (BLOCK*BYTES_STAR)), f);
+  if (nbytes != (Nbytes % (BLOCK*BYTES_STAR))) {
+    gprint (GP_ERR, "ERROR: failed to read in stars (2)\n");
+    free (Xvec.elements);
+    free (Yvec.elements);
+    free (Zvec.elements);
+    free (buffer);
+    return (FALSE);
+  }
+  for (j = 0; j < nbytes / BYTES_STAR; j++, nstars++) {
+    dparse (&X,  1, &buffer[j*BYTES_STAR]);
+    dparse (&Y,  2, &buffer[j*BYTES_STAR]);
+    dparse (&M,  3, &buffer[j*BYTES_STAR]);
+    XY_to_RD (&R, &D, X, Y, &coords);
+    fRD_to_XY (&Xvec.elements[nstars], &Yvec.elements[nstars], R, D, &graphmode.coords);
+    Zvec.elements[nstars] = MIN (1.0, MAX (0.01, (M - zero) / range));
+  }
+  
+  if (nstars != Nstars) {
+    gprint (GP_ERR, "ERROR: failed to read in all stars (%d of %d)\n", nstars, Nstars);
+    free (Xvec.elements);
+    free (Yvec.elements);
+    free (Zvec.elements);
+    free (buffer);
+    return (FALSE);
+  }
+
+  graphmode.style = 2;
+  graphmode.size = -1;
+  graphmode.etype = 0;
+  Npts = Xvec.Nelements;
+
+  PlotVectorTriplet (kapa, Npts, Xvec.elements, Yvec.elements, Zvec.elements, &graphmode);
+
+  free (Xvec.elements);
+  free (Yvec.elements);
+  free (Zvec.elements);
+  free (buffer);
+
+  return (TRUE);
+
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skycat.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skycat.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skycat.c	(revision 15879)
@@ -0,0 +1,125 @@
+# include "dvoshell.h"
+
+int RD_to_XYpic (double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside);
+
+int skycat (int argc, char **argv) {
+  
+  double Radius;
+  int i, j, N, Nregions, kapa, ShowAll, NPTS, Npts, leftside, Depth, VERBOSE;
+  struct stat filestat;
+  Vector Xvec, Yvec;
+  Graphdata graphmode;
+  double X[4], Y[4], Rmin, Rmax, Rmid;
+  SkyTable *sky;
+  SkyList *skylist;
+  SkyRegion **regions;
+
+  VERBOSE = FALSE;
+  if ((N = get_argument (argc, argv, "-v"))) {
+    remove_argument (N, &argc, argv);
+    VERBOSE = TRUE;
+  }
+  ShowAll = FALSE;
+  if ((N = get_argument (argc, argv, "-all"))) {
+    remove_argument (N, &argc, argv);
+    ShowAll = TRUE;
+  }
+  Depth = -1;
+  if ((N = get_argument (argc, argv, "-depth"))) {
+    remove_argument (N, &argc, argv);
+    Depth = atoi (argv[N]);
+    remove_argument (N, &argc, argv);    
+  }
+
+  if (!style_args (&graphmode, &argc, argv, &kapa)) return FALSE;
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: skycat [-all]\n");
+    return (FALSE);
+  }
+
+  Radius = MAX (fabs(graphmode.xmax), fabs(graphmode.ymax));
+
+  sky = GetSkyTable ();
+  skylist = SkyListByRadius (sky, Depth, graphmode.coords.crval1, graphmode.coords.crval2, Radius);
+  
+  if (VERBOSE) gprint (GP_ERR, "region: %6.2f - %6.2f, %6.2f - %6.2f\n", 
+			graphmode.coords.crval1 - Radius, graphmode.coords.crval1 + Radius, 
+			graphmode.coords.crval2 - Radius, graphmode.coords.crval2 + Radius);
+
+  Rmin = graphmode.coords.crval1 - 180.0;
+  Rmax = graphmode.coords.crval1 + 180.0;
+  Rmid = 0.5*(Rmin + Rmax);
+
+  NPTS = 200;
+  ALLOCATE (Xvec.elements, float, NPTS);
+  ALLOCATE (Yvec.elements, float, NPTS);
+  Npts = 0;
+   
+  regions = skylist[0].regions;
+  Nregions = skylist[0].Nregions;
+
+  for (i = 0; i < Nregions; i++) {
+    if (ShowAll || (stat (skylist[0].filename[i], &filestat) != -1)) {
+      if (VERBOSE) gprint (GP_ERR, "%3d %s %6.2f - %6.2f, %6.2f - %6.2f\n", i, regions[i][0].name, 
+			    regions[i][0].Rmin, regions[i][0].Rmax, regions[i][0].Dmin, regions[i][0].Dmax);
+
+      leftside = -1;
+      RD_to_XYpic (&X[0], &Y[0], regions[i][0].Rmin, regions[i][0].Dmin, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+      RD_to_XYpic (&X[1], &Y[1], regions[i][0].Rmin, regions[i][0].Dmax, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+      RD_to_XYpic (&X[2], &Y[2], regions[i][0].Rmax, regions[i][0].Dmax, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+      RD_to_XYpic (&X[3], &Y[3], regions[i][0].Rmax, regions[i][0].Dmin, &graphmode.coords, Rmin, Rmax, Rmid, &leftside);
+
+      Xvec.elements[Npts] = X[0];
+      Yvec.elements[Npts] = Y[0];
+      for (j = 1; j < 4; j++) {
+	Xvec.elements[Npts + j*2 - 0] = X[j];
+	Yvec.elements[Npts + j*2 - 0] = Y[j];
+	Xvec.elements[Npts + j*2 - 1] = X[j];
+	Yvec.elements[Npts + j*2 - 1] = Y[j];
+      }
+      Xvec.elements[Npts+7] = Xvec.elements[Npts];
+      Yvec.elements[Npts+7] = Yvec.elements[Npts];
+      Npts += 8;
+      if (Npts > NPTS - 1) {  /* this is OK because NPTS is made always a multiple of 8 */
+	NPTS += 200;
+	REALLOCATE (Xvec.elements, float, NPTS);
+	REALLOCATE (Yvec.elements, float, NPTS);
+      }
+    }
+  }
+
+  gprint (GP_ERR, "plotting %d catalogs\n", Npts/8);
+  Xvec.Nelements = Xvec.Nelements = Npts;
+  if (Npts > 0) {
+    graphmode.style = 2; /* points */
+    graphmode.ptype = 100; /* connect pairs of points */
+    graphmode.etype = 0;
+    PlotVectorPair (kapa, Npts, Xvec.elements, Yvec.elements, &graphmode);
+  }
+
+  free (Xvec.elements);
+  free (Yvec.elements);
+  free (regions);
+
+  return (TRUE);
+
+}
+
+
+int RD_to_XYpic (double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside) {
+
+  while (r < Rmin) { r += 360.0; }
+  while (r > Rmax) { r -= 360.0; }
+
+  if (*leftside == -1) {
+    *leftside = (r < Rmid);
+  } else {
+    if (  *leftside && (r > Rmid + 90)) { r -= 360.0; }
+    if (! *leftside && (r < Rmid - 90)) { r += 360.0; }
+  }
+
+  RD_to_XY (x, y, r, d, coords);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skycoverage.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skycoverage.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skycoverage.c	(revision 15879)
@@ -0,0 +1,146 @@
+# include "dvoshell.h"
+
+int skycoverage (int argc, char **argv) {
+
+  int i, N, Nimage, status, TimeSelect, ByName, xs, ys;
+  time_t tzero, tend;
+  double pixscale, dPix, r, d, Xi, Yi, Xs, Ys, x[2], y[2], trange;
+  Image *image;
+  char name[256];
+  float *V;
+  int Nx, Ny;
+  Buffer *buf;
+  Coords coords;
+
+  ByName = FALSE;
+  if ((N = get_argument (argc, argv, "-name"))) {
+    remove_argument (N, &argc, argv);
+    strcpy (name, argv[N]);
+    remove_argument (N, &argc, argv);
+    ByName = TRUE;
+  }
+
+  TimeSelect = FALSE;
+  if ((N = get_argument (argc, argv, "-time"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_dtime (argv[N], &trange)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (trange < 0) {
+      trange = fabs (trange);
+      tzero -= trange;
+    }
+    TimeSelect = TRUE;
+  }
+  if ((N = get_argument (argc, argv, "-trange"))) {
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tzero)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    if (!ohana_str_to_time (argv[N], &tend)) { 
+      gprint (GP_ERR, "syntax error\n");
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    trange = tend - tzero;
+    if (trange < 0) {
+      trange = fabs (trange);
+      tzero -= trange;
+    }
+    TimeSelect = TRUE;
+  }
+ 
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: skycoverage (buffer) (pixscale) (dPix) [-time start range] [-name name]\n");
+    gprint (GP_ERR, "       (buffer) saves bitmapped AIT plot\n");
+    gprint (GP_ERR, "       (pixscale) specifies the pixel size in degrees\n");
+    gprint (GP_ERR, "       note: we need 64800 / (pixscale)^2 pixels to represent the sky\n");
+    return (FALSE);
+  }
+  
+  if ((buf = SelectBuffer (argv[1], ANYBUFFER, TRUE)) == NULL) return (FALSE);
+  pixscale = atof(argv[2]);
+  dPix     = atof(argv[3]);
+
+  Nx = 360/pixscale;
+  Ny = 180/pixscale;
+
+  gfits_free_matrix (&buf[0].matrix);
+  gfits_free_header (&buf[0].header);
+  CreateBuffer (buf, Nx, Ny, -32, 0.0, 1.0);
+  strcpy (buf[0].file, "(empty)");
+
+  coords.crval1 = 180;
+  coords.crval2 = 0;
+  coords.crpix1 = 0.5*Nx;
+  coords.crpix2 = 0.5*Ny;
+  strcpy (coords.ctype, "DEC--AIT");
+  coords.pc1_1 = coords.pc2_2 = 1;
+  coords.pc1_2 = coords.pc2_1 = 0;
+  coords.cdelt1 = coords.cdelt2 = pixscale;
+  coords.Npolyterms = 0;
+
+  PutCoords (&coords, &buf[0].header);
+
+  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
+  BuildChipMatch (image, Nimage);
+
+  V = (float *)buf[0].matrix.buffer;
+  bzero (V, Nx*Ny*sizeof(float));
+
+  for (ys = 0; ys < Ny; ys++) {
+    for (xs = 0; xs < Nx; xs++) {
+      status = XY_to_RD (&r, &d, (double)(xs), (double)(ys), &coords);
+      status &= (r > 0);
+      status &= (r < 360);
+      if (status) {
+	V[ys*Nx + xs] = 2;
+      }
+    }
+  }
+
+  for (i = 0; i < Nimage; i++) {
+    if (ByName && strcmp (name, image[i].name)) continue;
+    if (TimeSelect && ((image[i].tzero < tzero) || (image[i].tzero+image[i].trate*image[i].NY > tzero + trange))) continue;
+    if (!FindMosaicForImage (image, Nimage, i)) continue;
+
+    /* project this image to screen display coords */
+    /* DIS images represent a field, not a chip */
+    if (!strcmp(&image[i].coords.ctype[4], "-DIS")) {
+      x[0] = -0.5*image[i].NX; y[0] = -0.5*image[i].NY;
+      x[1] = +0.5*image[i].NX; y[1] = +0.5*image[i].NY;
+    } else {
+      x[0] = 0;                y[0] = 0;
+      x[1] = image[i].NX;      y[1] = image[i].NY;
+    }
+    status = FALSE;
+    
+    for (Yi = y[0] + 0.5*dPix; Yi < y[1]; Yi += dPix) {
+      for (Xi = x[0] + 0.5*dPix; Xi < x[1]; Xi += dPix) {
+	XY_to_RD (&r, &d, Xi, Yi, &image[i].coords);
+	while (r <   0.0) { r += 360.0; }
+	while (r > 360.0) { r -= 360.0; }
+	status = RD_to_XY (&Xs, &Ys, r, d, &coords);
+	if (status) {
+	  xs = (int)Xs;
+	  ys = (int)Ys;
+	  V[ys*Nx + xs] = 1;
+	}
+      }
+    }
+  }
+
+  free (image);
+  return (TRUE);
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skydbtile.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skydbtile.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skydbtile.c	(revision 15879)
@@ -0,0 +1,283 @@
+# include "dvo2.h"
+SkyRegion *SkyDivideList (SkyRegion *list, int Nlist);
+
+/* region names:
+
+ depth Ntables  Name 
+ 0     1      	fullsky.cpt
+ 1     16     	n????.cpt, s????.cpt
+ 2     256    	n????/r????.cpt
+ 3     4096   	n????/t????.cpt
+ 4     65536  	n????/r????/r????.cpt
+ 5     1.0+06  	n????/t????/t????.cpt
+ 6     1.7+07  	n????/r????/r????/r????.cpt
+
+ depth Ntables  Name 
+ 0     1      	fullsky
+ 1     16     	d%02
+ 2     256    	d%02/r%03d
+ 3     4096   	d%02/t%04d
+ 4     65536  	d%02/r%03d/r%03d
+ 5     1.0+06  	d%02/t%04d/t%04d
+ 6     1.7+07  	d%02/r%03d/r%03d/r%03d
+ 7     2.7+08  	d%02/t%04d/t%04d/t%04d
+
+*/
+
+/* a valid SkyRegion set must always start with the fullsky as the first entry, 
+   with the sequence of entries ordered primarily by depth, followed by parent 
+*/
+
+int SkyMakeNames (SkyRegion *db, SkyRegion *ref, int depth) {
+
+  int i, j, N, Ns, Ne, ns, ne;
+
+  if (db == NULL) return (FALSE);
+  if (depth == 0) {
+    if (db[0].depth != 0) return (FALSE);
+    strcpy (db[0].name, "fullsky");
+    Ns = db[0].childS;
+    Ne = db[0].childE;
+    for (i = Ns; i < Ne; i++) {
+      sprintf (db[i].name, "d%02d", i - 1);
+      if (!SkyMakeNames (db, &db[i], 2)) return (FALSE);
+      if (!SkyMakeNames (db, &db[i], 3)) return (FALSE);
+    }
+    return (TRUE);
+  }
+
+  if (ref == NULL) return (FALSE);
+  
+  if (depth == 2) {
+    if (!ref[0].child) return (TRUE);
+    Ns = ref[0].childS;
+    Ne = ref[0].childE;
+    N = 0;
+    for (i = Ns; i < Ne; i++, N++) {
+      sprintf (db[i].name, "%s/r%02d", ref[0].name, N);
+      if (!SkyMakeNames (db, &db[i], depth + 2)) return (FALSE);
+    }
+  }
+  
+  if (depth > 2) {
+    Ns = ref[0].childS;
+    Ne = ref[0].childE;
+    N = 0;
+    for (i = Ns; i < Ne; i++) {
+      if (!ref[0].child) continue;
+      ns = db[i].childS;
+      ne = db[i].childE;
+      for (j = ns; j < ne; j++, N++) {
+	if (depth % 2) {
+	  sprintf (db[j].name, "%s/t%03d", ref[0].name, N);
+	} else {				      			    
+	  sprintf (db[j].name, "%s/r%02d", ref[0].name, N);
+	}
+	if (!SkyMakeNames (db, &db[j], depth + 2)) return (FALSE);
+      }
+    }  
+  }
+}
+
+SkyRegion *SkyMakeRegions (int Nlevels, int *nlist) {
+
+  int Nlist, Nnext, Ncurr, i, j;
+  SkyRegion *list, *curr, *next;
+
+  Nlist = 0;
+  Nnext = 1;
+  Ncurr = 1;
+  ALLOCATE (list, SkyRegion, Ncurr);
+  ALLOCATE (curr, SkyRegion, Ncurr);
+
+  curr[0].Rmin =   0;
+  curr[0].Rmax = 360;
+  curr[0].Dmin = -90;
+  curr[0].Dmax =  90;
+  curr[0].depth = 0;
+  curr[0].object = FALSE;
+  curr[0].image = FALSE;
+  curr[0].child = FALSE;
+  curr[0].childS = 0;
+  curr[0].childE = 0;
+
+  for (i = 1; i < Nlevels; i++) {
+    next  = SkyDivideRegions (curr, &Nnext);
+    for (j = 0; j < Nnext; j++) {
+      next[j].depth = i;
+    }   
+    REALLOCATE (list, SkyRegion, Nlist + Ncurr);
+    memcpy (&list[Nlist], curr, Ncurr*sizeof(SkyRegion));
+    for (j = Nlist; j < Nlist + Ncurr; j++) {
+      list[j].childS += Nlist + Ncurr;
+      list[j].childE += Nlist + Ncurr;
+    }
+    Nlist += Ncurr;
+    free (curr);
+    curr = next;
+    Ncurr = Nnext;
+  }
+  REALLOCATE (list, SkyRegion, Nlist + Ncurr);
+  memcpy (&list[Nlist], curr, Ncurr*sizeof(SkyRegion));
+  Nlist += Ncurr;
+  free (curr);
+
+  list[0].object = TRUE;
+  list[0].image = TRUE;
+  *nlist = Nlist;
+  return (list);
+}
+
+SkyRegion *SkyDivideRegions (SkyRegion *parents, int *N) {
+
+  int i, Nchildren, Nparents, Np;
+  SkyRegion *children, *temp;
+  float *child, *index;
+
+  Nchildren = Nparents = *N;
+
+  /* copy input list to a new list, set child to be sequence number */
+  ALLOCATE (children, SkyRegion, Nchildren);
+  memcpy (children, parents, Nchildren*sizeof(SkyRegion));
+  for (i = 0; i < Nchildren; i++) {
+    children[i].childS = i;
+    parents[i].childS = i;
+  }
+
+  /* double the number of children, dividing only the largest in half each pass */
+  for (i = 0; i < 4; i++) {
+    temp = SkyDivideList (children, Nchildren);
+    free (children);
+    children = temp;
+    Nchildren *= 2;
+  }
+
+  /* sort children by childS (currently is parent entry) */
+  ALLOCATE (child, float, Nchildren);
+  ALLOCATE (index, float, Nchildren);
+  for (i = 0; i < Nchildren; i++) {
+    index[i] = i;
+    child[i] = children[i].childS;
+  }
+  fsortpair (child, index, Nchildren);
+  ALLOCATE (temp, SkyRegion, Nchildren);
+  for (i = 0; i < Nchildren; i++) {
+    temp[i] = children[(int)index[i]];
+  }
+  free (children);
+  free (child);
+  free (index);
+  children = temp;
+  
+  /* look for all matching values of childS, setup parent values of childS, childE */
+  Np = children[0].childS;
+  parents[Np].childS = 0;
+  parents[Np].child = TRUE;
+  for (i = 0; i < Nchildren; i++) {
+    if (children[i].childS != Np) {
+      parents[Np].childE = i;
+      Np = children[i].childS;
+      parents[Np].childS = i;
+      parents[Np].child = TRUE;
+    }
+    children[i].childS = 0;
+    children[i].childE = 0;
+    children[i].child = FALSE;
+  }
+  parents[Np].childE = i;
+  *N = Nchildren;
+  return (children);
+}
+
+/* always break the region with the largest area */
+SkyRegion *SkyDivideBiggest (SkyRegion *list, int *nlist) {
+
+  int i, N, Nlist;
+  float *area, *indx, dec;
+  SkyRegion *out, save;
+
+  Nlist = *nlist;
+  ALLOCATE (area, float, Nlist);
+  ALLOCATE (indx, float, Nlist);
+  for (i = 0; i < Nlist; i++) {
+    dec = 0.5*(list[i].Dmax + list[i].Dmin);
+    area[i] = (list[i].Rmax - list[i].Rmin)*(list[i].Dmax - list[i].Dmin)*cos(RAD_DEG*dec);
+    indx[i] = i;
+  }
+  fsortpair (area, indx, Nlist);
+
+  N = indx[Nlist - 1];
+  out = SkyDivide (&list[N]);
+  
+  REALLOCATE (list, SkyRegion, Nlist + 1);
+  list[N] = out[0];
+  list[Nlist] = out[1];
+
+  *nlist = Nlist + 1;
+  free (out);
+  free (area);
+  free (indx);
+  return (list);
+}
+
+SkyRegion *SkyDivide (SkyRegion *in) {
+
+  SkyRegion *out;
+  double RA, DEC, R_div, D_div;
+
+  ALLOCATE (out, SkyRegion, 2);
+
+  out[0] = in[0];
+  out[1] = in[0];
+
+  RA  = 0.5*(in[0].Rmin + in[0].Rmax);
+  DEC = 0.5*(in[0].Dmin + in[0].Dmax);
+  if ((DEC >= 90) || (DEC <= -90)) {
+    gprint (GP_ERR, "error in Dmin");
+    return (NULL);
+  }
+ 
+  D_div = (in[0].Rmax - in[0].Rmin) * cos (RAD_DEG*DEC);
+  R_div = (in[0].Dmax - in[0].Dmin);
+  if (R_div < D_div) {
+    /* divide RA range */
+    out[0].Rmax = RA;
+    out[1].Rmin = RA;
+  } else {
+    out[0].Dmax = DEC;
+    out[1].Dmin = DEC;
+  }
+
+  return (out);
+}
+
+/* return a list with 2x as many entries, each split in two */
+SkyRegion *SkyDivideList (SkyRegion *in, int Nin) {
+
+  SkyRegion *out;
+  double RA, DEC, R_div, D_div;
+  int i;
+
+  ALLOCATE (out, SkyRegion, 2*Nin);
+
+  for (i = 0; i < Nin; i++) {
+    /* inherit properties from parent */
+    out[2*i + 0] = in[i];
+    out[2*i + 1] = in[i];
+
+    RA  = 0.5*(in[i].Rmin + in[i].Rmax);
+    DEC = 0.5*(in[i].Dmin + in[i].Dmax);
+    
+    /* split along longest axis */
+    D_div = (in[i].Rmax - in[i].Rmin) * cos (RAD_DEG*DEC);
+    R_div = (in[i].Dmax - in[i].Dmin);
+    if (R_div < D_div) {
+      out[2*i + 0].Rmax = RA;
+      out[2*i + 1].Rmin = RA;
+    } else {
+      out[2*i + 0].Dmax = DEC;
+      out[2*i + 1].Dmin = DEC;
+    }
+  }
+  return (out);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skyregion.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skyregion.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/skyregion.c	(revision 15879)
@@ -0,0 +1,45 @@
+# include "dvoshell.h"
+
+static double RAs = 0.0;
+static double RAe = 0.0;
+static double DECs = 0.0;
+static double DECe = 0.0;
+
+// define the sky region for which extractions are limited
+int skyregion (int argc, char **argv) {
+  
+  if (argc == 1) {
+    gprint (GP_ERR, "current skyregion: %f - %f : %f - %f\n", RAs, RAe, DECs, DECe);
+    gprint (GP_ERR, "USAGE:  skyregion (min RA) (max RA) (min DEC) (max DEC)\n");
+    return (FALSE);
+  }
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: skyregion (min RA) (max RA) (min DEC) (max DEC)\n");
+    return (FALSE);
+  }
+
+  set_skyregion (atof(argv[1]), atof(argv[2]), atof(argv[3]), atof(argv[4]));
+
+  return (TRUE);
+}
+
+int get_skyregion (double *Rs, double *Re, double *Ds, double *De) {
+
+  *Rs = RAs;
+  *Re = RAe;
+  *Ds = DECs;
+  *De = DECe;
+
+  return TRUE;
+}
+
+int set_skyregion (double Rs, double Re, double Ds, double De) {
+
+  RAs  = Rs;
+  RAe  = Re;
+  DECs = Ds;
+  DECe = De;
+
+  return TRUE;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/subpix.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/subpix.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/subpix.c	(revision 15879)
@@ -0,0 +1,154 @@
+# include "dvoshell.h"
+
+int subpix (int argc, char **argv) {
+  
+  int i, j, I, Nlo, Nhi, Nentry, Nstars, Nimage, Nmeasure;
+  int *index, *entry;
+  int Nmin, Nsub, NSUB, status;
+  int TimeFormat;
+  time_t Timage, TimeReference;
+  double X, Y, Mabs, t;
+  double Ra, Dec, Radius, Radius2, r, Rmin;
+  double *RA, *DEC;
+  
+  SkyTable *sky;
+  SkyList *skylist;
+  Measure *measure;
+  Image *image;
+  Catalog catalog;
+
+  if (!InitPhotcodes ()) return (FALSE);
+
+  GetTimeFormat (&TimeReference, &TimeFormat);
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: subpix ra dec radius\n");
+    return (FALSE);
+  }
+  if (!ohana_str_to_radec (&Ra, &Dec, argv[1], argv[2])) return (FALSE);
+  if (Ra < 0) Ra += 360.0;
+  if (Ra > 360.0) Ra -= 360.0;
+  Radius = atof (argv[3]);
+
+  /* load star nearest position */
+  sky = GetSkyTable ();
+  skylist = SkyListByRadius (sky, -1, Ra, Dec, Radius);
+  if (skylist[0].Nregions > 1) {
+    gprint (GP_ERR, "warning, radius overlaps region boundary, not yet implemented\n");
+  }
+
+  /* lock, load, unlock catalog */
+  catalog.filename = skylist[0].filename[0];
+  catalog.catflags = LOAD_AVES | LOAD_MEAS;
+  catalog.Nsecfilt = 0;
+
+  // an error exit status here is a significant error
+  if (!dvo_catalog_open (&catalog, NULL, FALSE, "r")) {
+      fprintf (stderr, "ERROR: failure to open catalog file %s\n", catalog.filename);
+      exit (2);
+  }
+  dvo_catalog_unlock (&catalog);
+
+  /* quick search of star list for Ra, Dec */
+  Nstars = catalog.Naverage;
+  ALLOCATE (RA, double, Nstars);
+  ALLOCATE (DEC, double, Nstars);
+  ALLOCATE (index, int, Nstars);
+  for (i = 0; i < Nstars; i++) {
+    RA[i] = catalog.average[i].R;
+    DEC[i] = catalog.average[i].D;
+    index[i] = i;
+  }
+  if (Nstars > 1) dsort_lists (DEC, RA, index, Nstars);
+
+  /* bracket the DEC range of interest */
+  Nlo = bracket (DEC, Nstars, FALSE, Dec - Radius);
+  Nhi = bracket (DEC, Nstars, TRUE,  Dec + Radius);
+  ALLOCATE (entry, int, MAX (Nhi - Nlo, 1));
+  Nentry = 0;
+
+  /* find the list of stars */
+  Radius2 = Radius*Radius;
+  for (i = Nlo; i < Nhi; i++) {
+    r = SQ(Dec - DEC[i]) + SQ(Ra - RA[i]);
+    if (r < Radius2) {
+      entry[Nentry] = i;
+      Nentry ++;
+    }
+  }
+  if (!Nentry) {
+    gprint (GP_ERR, "no stars found\n");
+    free (RA);
+    free (DEC);
+    free (entry);
+    free (index);
+    dvo_catalog_free (&catalog);
+    SkyListFree (skylist);
+    return (TRUE);
+  }
+
+  /* find the closest star */
+  Nmin = 0;
+  Rmin = SQ(Dec - DEC[entry[0]]) + SQ(Ra - RA[entry[0]]);
+  for (i = 1; i < Nentry; i++) {
+    r = SQ(Dec - DEC[entry[i]]) + SQ(Ra - RA[entry[i]]);
+    if (r < Rmin) {
+      Rmin = r;
+      Nmin = i;
+    }
+  }
+  Nentry = index[entry[Nmin]];
+  Ra = RA[entry[Nmin]];
+  Dec = DEC[entry[Nmin]];
+  gprint (GP_ERR, "finding subpix values for star @ %f %f\n", Ra, Dec);
+
+  free (RA);
+  free (DEC);
+  free (entry);
+  free (index);
+
+  /* storage for the image references */
+  Nsub = 0;
+  NSUB = 100;
+  ALLOCATE (index, int, NSUB);
+
+  /* load all images, extract those touching Ra, Dec */
+  if ((image = LoadImages (&Nimage)) == NULL) return (FALSE);
+  BuildChipMatch (image, Nimage);
+
+  for (i = 0; i < Nimage; i++) {
+    if (!FindMosaicForImage (image, Nimage, i)) continue;
+    status = RD_to_XY (&X, &Y, Ra, Dec, &image[i].coords);
+    if (!status || (X < 0) || (X > image[i].NX) || (Y < 0) || (Y > image[i].NY)) continue;
+    index[Nsub] = i;
+    Nsub ++;
+    if (Nsub == NSUB - 1) {
+      NSUB += 100;
+      REALLOCATE (index, int, NSUB);
+    }
+  }
+
+  /* only print the entries for existing measurements of this star */ 
+  measure = &catalog.measure[catalog.average[Nentry].offset];
+  Nmeasure = catalog.average[Nentry].Nm;
+  for (i = 0; i < Nsub; i++) {
+    I = index[i];
+    if (!FindMosaicForImage (image, Nimage, I)) continue;
+    Timage = image[I].tzero;
+    for (j = 0; j < Nmeasure; j++) {
+      if (measure[j].t == Timage) { 
+	Mabs = PhotCat (&measure[j]);
+	RD_to_XY (&X, &Y, Ra, Dec, &image[I].coords);
+	t = TimeValue (measure[j].t, TimeReference, TimeFormat);
+	gprint (GP_LOG, "%f %6.3f %7.2f %7.2f %5.3f\n", t, Mabs, X, Y, image[I].secz);
+      } 
+    }
+  }
+
+  dvo_catalog_free (&catalog);
+  free (image);
+  free (index);
+  SkyListFree (skylist);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/dvo/version.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/dvo/version.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/dvo/version.c	(revision 15879)
@@ -0,0 +1,18 @@
+# include "dvoshell.h"
+static char *name = "$Name: not supported by cvs2svn $";
+
+int version (int argc, char **argv) {
+
+  char *tmp;
+
+  gprint (GP_LOG, "\n");
+  gprint (GP_LOG, "dvo version: %s\n", (tmp = strip_version (name))); free (tmp);
+
+  gprint (GP_LOG, "opihi version: %s\n", (tmp = strip_version (opihi_version()))); free (tmp);
+  gprint (GP_LOG, "libohana version: %s\n", (tmp = strip_version (ohana_version()))); free (tmp);
+  gprint (GP_LOG, "libdvo version: %s\n", (tmp = strip_version (libdvo_version()))); free (tmp);
+  gprint (GP_LOG, "libfits version: %s\n", (tmp = strip_version (gfits_version()))); free (tmp);
+
+  gprint (GP_LOG, "compiled on %s %s\n", __DATE__, __TIME__);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/astro.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/astro.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/astro.h	(revision 15879)
@@ -0,0 +1,13 @@
+# include "external.h"
+# include "shell.h"
+# include "dvomath.h"
+# include "convert.h"
+# include "display.h"
+# include "data.h"
+
+# ifndef ASTRO_H
+# define ASTRO_H
+
+void InitAstro ();
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/basic.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/basic.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/basic.h	(revision 15879)
@@ -0,0 +1,7 @@
+# include "external.h"
+# include "shell.h"
+# include "dvomath.h"
+
+void cleanup ();
+void InitBasic ();
+void InitBasic_PantasksClient ();
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/convert.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/convert.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/convert.h	(revision 15879)
@@ -0,0 +1,25 @@
+# include "external.h"
+
+# ifndef CONVERT_H
+# define CONVERT_H
+
+/*** time/coord conversion functions not supplied by libohana ***/
+time_t        TimeRef               PROTO((double time, time_t TimeReference, int TimeFormat));
+double        TimeValue             PROTO((time_t time, time_t TimeReference, int TimeFormat));
+
+int           hh_hms                PROTO((double hh, int *hr, int *mn, double *sc));
+int           dd_dms                PROTO((double dd, int *dg, int *mn, double *sc));
+int           hms_format            PROTO((char *line, double value));
+int           dms_format            PROTO((char *line, double value));
+int           hh_hm                 PROTO((double hh, int *hr, double *mn));
+int           day_to_sec            PROTO((char *string, time_t *second));
+int           hms_to_sec            PROTO((char *string, time_t *second));
+char         *ohana_sec_to_hms      PROTO((time_t second));
+char         *ohana_sec_to_day      PROTO((time_t second));
+
+char         *meade_deg_to_str      PROTO((double deg));
+char         *meade_ra_to_str       PROTO((double deg));
+char         *meade_dec_to_str      PROTO((double deg));
+char         *strptime              PROTO((const char *s, const char *format, struct tm *tm));
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/data.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/data.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/data.h	(revision 15879)
@@ -0,0 +1,174 @@
+# include "external.h"
+# include "shell.h"
+# include "dvomath.h"
+# include "convert.h"
+# include "display.h"
+
+# ifndef DATA_H
+# define DATA_H
+
+/*** typedef structs used by math functions ***/
+typedef struct {
+  int   NLINES;
+  int   Nlines;
+  char **lines;
+  char  *name;
+} Queue;
+
+typedef struct {
+  char *name;
+  int NWORDS;
+  int Nwords;
+  char **words;
+  char **value;
+} Page;
+
+typedef struct {
+  char *name;
+  int NPAGES;
+  int Npages;
+  Page **pages;
+  int *index;
+  char **pageIDs;
+} Book;
+
+void InitData ();
+
+/* in book.c */
+void InitBooks ();
+void InitBook (Book *book, char *name);
+void FreeBook (Book *book);
+Book *FindBook (char *name);
+Book *GetBook (int where);
+Book *CreateBook (char *name);
+int DeleteBook (Book *book);
+void ListBooks ();
+
+/* in page.c */
+void InitPage (Page *page, char *name);
+void FreePage (Page *page);
+Page *FindPage (Book *book, char *name);
+Page *GetPage (Book *book, int where);
+Page *GetPageRestricted (Book *book, int where, char *keyName, char *keyValue);
+Page *CreatePage (Book *book, char *name);
+int DeletePage (Book *book, Page *page);
+void ListPages (Book *book);
+void ListWords (Page *page);
+int BookSetWord (Page *page, char *word, char *value);
+char *BookGetWord (Page *page, char *word);
+
+/* in queues.c */
+void InitQueues ();
+void ListQueues ();
+Queue *FindQueue (char *name);
+Queue *CreateQueue (char *name);
+void PushQueue (Queue *queue, char *line);
+void PushNamedQueue (char *name, char *line);
+char *PopQueue (Queue *queue);
+char *PopQueueMatch (Queue *queue, char *Key, char *value);
+void PushQueueUnique (Queue *queue, char *line, char *Key);
+void PushQueueReplace (Queue *queue, char *line, char *Key);
+int InitQueue (Queue *queue);
+int DeleteQueue (Queue *queue);
+int PrintQueue (Queue *queue);
+
+/* in sort.c */
+void sort (double *value, int N);
+void fsort (float *value, int N);
+void sortpair (double *value1, double *value2, int N);
+void fsortpair (float *X, float *Y, int N);
+void sortthree (float *X, float *Y, float *Z, int N);
+void sort_lists (float *X, float *Y, int *S, int N);
+void dsort_lists (double *X, double *Y, int *S, int N);
+void isort_pair (int *X, int *Y, int N);
+
+/* in fft.c */
+void fft (float *Data, int N, int isign);
+void fftold (float *Data, int N, int isign);
+void fftN (float *data, int *nn, int ndim, int isign);
+int IsBinary (int N);
+void fourn (float *data, int *nn, int ndim, int isign);
+
+/* in gaussj.c */
+int gaussj (double **a, int n, double **b, int m);
+int fgaussj (float **a, int n, float **b, int m);
+
+/* in svdcmp.c */
+int svdcmp (float *a, float *w, float *v, int Nx, int Ny);
+
+/* in spline.c */
+void spline (float *x, float *y, int N, float *y2);
+float splint (float *x, float *y, float *y2, int N, float X);
+
+/* mrqmin.c */
+float mrqcof (float *x, float *y, float *dy, int Npts, 
+	      float *par, int Npar, float **ta, float **tb, 
+	      float (funcs)(float, float *, int, float *));
+
+float mrqmin (float *x, float *y, float *dy, int Npts, 
+	      float *par, int Npar, 
+	      float (funcs)(float, float *, int, float *), int VERBOSE);
+
+float mrqinit (float *x, float *y, float *dy, int Npts, 
+	       float *par, int Npar, 
+	       float (funcs)(float, float *, int, float *), int VERBOSE);
+
+float **mrqcovar (int Npar);
+
+void mrqfree (int Npar);
+
+/* mrq2dmin.c */
+float mrq2dcof (float *x, float *t, float *y, float *dy, int Npts, 
+		float *par, int Npar, float **ta, float **tb, 
+		float (funcs)(float, float, float *, int, float *));
+
+float mrq2dmin (float *x, float *t, float *y, float *dy, int Npts, 
+		float *par, int Npar, 
+		float (funcs)(float, float, float *, int, float *), int VERBOSE);
+
+float mrq2dinit (float *x, float *t, float *y, float *dy, int Npts, 
+		 float *par, int Npar, 
+		 float (funcs)(float, float, float *, int, float *), int VERBOSE);
+
+float mrq2dchi (float *x, float *t, float *y, float *dy, int Npts, 
+		float *par, int Npar, 
+		float (funcs)(float, float, float *, int, float *));
+
+int mrq2dlimits (float *pmin, float *pmax, int Npar);
+
+float **mrq2dcovar (int Npar);
+
+void mrq2dfree (int Npar);
+
+/* powell.c */
+void powell (float *p, int Npar, float (func)() );
+
+/* gaussian.c */
+double gaussian (double x, double mean, double sigma);
+void gauss_init (int Nbin);
+double rnd_gauss (double mean, double sigma);
+
+/* starfuncs.c */
+double get_aperture_stats (Matrix *matrix, int X, int Y, int Npix, int Nborder, double max);
+int set_rough_radii (double Ra, double Ri, double Ro);
+int get_rough_star (float *data, int Nx, int Ny, int x, int y, float *xc, float *yc, float *sx, float *sy, float *sxy, float *zs, float *zp, float *sk);
+
+/* precess.c */
+double BtoJ (double in_epoch);
+double get_epoch (char *in_epoch, char mode);
+
+/* graphtools.c */
+void          SetLimits             PROTO((Vector *xvec, Vector *yvec, Graphdata *graphmode));
+void          SetLimitsRaw          PROTO((float *xvec, float *yvec, int Npts, Graphdata *graphmode));
+void          ApplyLimits           PROTO((int Xgraph, Graphdata *graphmode, int apply));
+int           style_args            PROTO((Graphdata *graphmode, int *argc, char **argv, int *kapa));
+
+int read_table_vectors (int argc, char **argv, char *extname);
+
+void *db_getConnection ();
+
+int bracket (double *list, int Nlist, int mode, double value);
+int ibracket (int *list, int Nlist, int mode, double value);
+
+# endif
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/dimm.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/dimm.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/dimm.h	(revision 15879)
@@ -0,0 +1,71 @@
+# include "external.h"
+# include "shell.h"
+# include "dvomath.h"
+# include "convert.h"
+# include "display.h"
+# include "sbig.h"
+
+void InitDIMM ();
+
+/* telescope.c */
+double distSky (double r1, double r2, double d1, double d2);
+int getRD (double *r, double *d) ;
+int gotoRD (double r, double d);
+int offset (char *direction, double distance);
+int toffset (char *direction, char *rate, double duration);
+int getXY (double *x, double *y);
+int setRD (double r, double d);
+int setSite (char *sitename, double lon, double lat);
+int setTime (char *lst);
+int getSite (double *lon, double *lat, double *lst);
+int ParkScope();
+int SleepScope();
+int WakeScope();
+
+/* Serial.c */
+int SerialVerbose (int mode);
+int SerialInit (char *port);
+int SerialOpen (char *port);
+int SerialBaudRate (int fdesc, int rate);
+int SerialParity (int fdesc, int parity); 
+int SerialDataBits(int fdesc, int bits); 
+int SerialStopBit(int fdesc, int stpbit); 
+void SerialStop (int fdesc);
+int SerialCommand (char *in, char **out, int wait);
+
+/* camera.c */
+int InitCamera (int port);
+void DumpCameraInfo ();
+void CameraFullSize (int *x, int *y);
+int SetTemperature (double temp);
+double GetTemperature ();
+int DumpCameraStatus ();
+int Exposure (double exptime);
+static int readout_callback (float percent);
+int ReadOut (int x, int y, int dx, int dy, int binning, unsigned short *buffer);
+int OpenShutter ();
+int CloseShutter ();
+
+  /* this image structure stuff is considered for further development */ 
+# if (0)
+/** this Image is incompatible with the DVO Image struct */
+typedef struct {
+
+  /* image data area */
+  int Nx, Ny;
+  char *buffer;
+  int Nbytes;
+
+  /* image metadata */
+  double ccdtemp;
+  double airtemp;
+  double ra, dec, airmass;
+  double exptime;
+  int binning;
+} Image;
+
+/* analysis.c */
+int subtractImage (Image *a, Image *b);
+void statsImage (Image *image, Stats *stats);
+void findStars (Image *image, Stars **stars, int *Nstars, double threshold);
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/display.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/display.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/display.h	(revision 15879)
@@ -0,0 +1,39 @@
+# include "external.h"
+# include "kapa.h"
+
+# ifndef DISPLAY_H
+# define DISPLAY_H
+
+/*** kapa graph functions ***/
+int           PlotVectorPair        PROTO((int kapa, int Npts, float *xValues, float *yValues, Graphdata *graphmode));
+int           PlotVectorTriplet     PROTO((int kapa, int Npts, float *xValues, float *yValues, float *zValues, Graphdata *graphmode));
+int           GetGraphData          PROTO((Graphdata *data, int *kapa, char *name));
+int           GetGraph              PROTO((Graphdata *data, int *kapa, char *name));
+int           SetGraph              PROTO((Graphdata *data));
+
+/*** kapa image functions */
+int           GetImageData          PROTO((KapaImageData *data, int *kapa, char *name));
+int           GetImage              PROTO((KapaImageData *data, int *kapa, char *name));
+int           SetImage              PROTO((KapaImageData *data));
+
+void	      QuitKapa              PROTO(());
+void	      InitKapa		    PROTO(());
+int 	      open_kapa		    PROTO((int entry));
+int 	      close_kapa	    PROTO((char *name));
+int 	      AddKapaDevice	    PROTO((char *name));
+int 	      DelKapaDevice	    PROTO((char *name));
+int 	      FindKapaDevice	    PROTO((char *name));
+char	     *GetKapaName	    PROTO(());
+
+/* calling program need to define a function 'get_variable' which
+ * returns the name of the executable for each of KAPA and KII
+ */
+char         *get_variable          PROTO((char *name));
+
+int SendLabel (char *string, int Xgraph, int mode);
+
+int SendGraphMessage (int device, char *format, ...);
+int SendGraphCommand (int device, int length, char *format, ...);
+int SendGraphCommandV (int device, int length, char *format, va_list argp);
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/dvomath.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/dvomath.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/dvomath.h	(revision 15879)
@@ -0,0 +1,120 @@
+/*** dvomath.h ***/
+
+# ifndef DVOMATH_H
+# define DVOMATH_H
+
+# define NCHARS 256
+
+enum {ANYVECTOR, NEWVECTOR, OLDVECTOR};
+enum {ANYBUFFER, NEWBUFFER, OLDBUFFER};
+
+typedef struct {			/* representation of a variable (0-D) */
+  char     *name;
+  char     *value;
+} Variable;
+
+typedef struct {			/* representation of a vector (1-D) */
+  char name[1024];
+  float *elements;
+  int Nelements;
+} Vector;
+
+typedef struct {			/* representation of buffer (image) */
+  char name[1024];
+  char file[1024];
+  Header header;
+  Matrix matrix;
+  int  bitpix, unsign;
+  double bscale, bzero;
+} Buffer;
+
+typedef struct {			/* math stack structure */
+  char   *name;
+  char    type;
+  float  *ptr;
+  Buffer *buffer;
+  Vector *vector;
+  float   Float;
+} StackVar;
+
+/* math functions */
+char         *dvomath               PROTO((int argc, char **argv, int *size, int maxsize));
+char        **isolate_elements      PROTO((int argc, char **argv, int *nstack));
+StackVar     *convert_to_RPN        PROTO((int argc, char **argv, int *nstack));
+int           check_stack           PROTO((StackVar *stack, int Nstack, int validsize));
+int           evaluate_stack        PROTO((StackVar *stack, int *Nstack));
+void          init_stack            PROTO((StackVar *stack));
+void          copy_stack	    PROTO((StackVar *stack1, StackVar *stack2));
+void          move_stack	    PROTO((StackVar *stack1, StackVar *stack2));
+void          clean_stack	    PROTO((StackVar *stack, int Nstack));
+void          delete_stack	    PROTO((StackVar *stack, int Nstack));
+void          clear_stack 	    PROTO((StackVar *stack));
+void          assign_stack 	    PROTO((StackVar *stack, char *name, int type));
+
+int           VV_binary             PROTO((StackVar *OUT, StackVar *V1, StackVar *V2, char *op));
+int           SV_binary             PROTO((StackVar *OUT, StackVar *V1, StackVar *V2, char *op));
+int           VS_binary             PROTO((StackVar *OUT, StackVar *V1, StackVar *V2, char *op));
+int           MV_binary             PROTO((StackVar *OUT, StackVar *V1, StackVar *V2, char *op));
+int           VM_binary             PROTO((StackVar *OUT, StackVar *V1, StackVar *V2, char *op));
+int           MM_binary             PROTO((StackVar *OUT, StackVar *V1, StackVar *V2, char *op));
+int           MS_binary             PROTO((StackVar *OUT, StackVar *V1, StackVar *V2, char *op));
+int           SM_binary             PROTO((StackVar *OUT, StackVar *V1, StackVar *V2, char *op));
+int           SS_binary             PROTO((StackVar *OUT, StackVar *V1, StackVar *V2, char *op));
+int           WW_binary             PROTO((StackVar *OUT, StackVar *V1, StackVar *V2, char *op));
+int           S_unary               PROTO((StackVar *OUT, StackVar *V1, char *op));
+int           V_unary               PROTO((StackVar *OUT, StackVar *V1, char *op));
+int           M_unary               PROTO((StackVar *OUT, StackVar *V1, char *op));
+
+/* variable handling */
+char         *get_variable          PROTO((char *name));
+char         *get_variable_ptr      PROTO((char *name));
+char         *get_local_variable_ptr PROTO((char *name));
+double        get_double_variable   PROTO((char *name, int *found));
+int           get_int_variable      PROTO((char *name, int *found));
+int           DeleteNamedScalar     PROTO((char *name));
+int           IsScalar              PROTO((char *name));
+int           set_variable          PROTO((char *name, double dvalue));
+int           set_int_variable      PROTO((char *name, int ivalue));
+int           set_str_variable      PROTO((char *name, char *value));
+int           set_local_variable    PROTO((char *name, char *value));
+void          InitVariables         PROTO((void));
+void          ListVariables         PROTO((void));
+float         get_variable_default  PROTO((char *name, float dvalue));
+int           SelectScalar          PROTO((char *string, double *value));
+
+/* vector handling */
+Vector       *InitVector            PROTO((void));
+void          InitVectors           PROTO((void));
+int           CopyVector            PROTO((Vector *out, Vector *in));
+int           MoveVector            PROTO((Vector *out, Vector *in));
+int           DeleteVector          PROTO((Vector *vec));
+int           CopyNamedVector       PROTO((char *out, char *in));
+int           MoveNamedVector       PROTO((char *out, char *in));
+int           DeleteNamedVector     PROTO((char *name));
+int           IsVector              PROTO((char *name));
+int           IsVectorPtr           PROTO((Vector *vec));
+int           ListVectors           PROTO((void));
+Vector       *SelectVector          PROTO((char *name, int mode, int verbose));
+
+/* buffer handling */
+Buffer       *InitBuffer            PROTO((void));
+void          InitBuffers           PROTO((void));
+int           CopyBuffer            PROTO((Buffer *out, Buffer *in));
+int           MoveBuffer            PROTO((Buffer *out, Buffer *in));
+int           DeleteBuffer          PROTO((Buffer *buf));
+int           CopyNamedBuffer       PROTO((char *out, char *in));
+int           MoveNamedBuffer       PROTO((char *out, char *in));
+int           DeleteNamedBuffer     PROTO((char *name));
+int           IsBuffer              PROTO((char *name));
+int           IsBufferPtr           PROTO((Buffer *buf));
+int           PrintBuffers          PROTO((int Long));
+int           CreateBuffer          PROTO((Buffer *buf, int Nx, int Ny, int bitpix, float bzero, float bscale));
+Buffer       *SelectBuffer          PROTO((char *name, int mode, int verbose));
+void          dump_buffers          PROTO((int n));  /* deprecated? */
+int           SelectOverlay         PROTO((char *name, int *number));
+
+/* why are these in here? */
+int           gfits_copy_matrix_info (Matrix *matrix1, Matrix *matrix2);
+int           GetTimeFormat         PROTO((time_t *TimeReference, int *TimeFormat));
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/dvoshell.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/dvoshell.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/dvoshell.h	(revision 15879)
@@ -0,0 +1,242 @@
+# include "data.h"
+# include "basic.h"
+# include "astro.h"
+
+# ifndef DVOSHELL_H
+# define DVOSHELL_H
+
+/* magnitude types */
+enum {MAG_NONE, 
+      MAG_INST, 
+      MAG_CAT, 
+      MAG_SYS, 
+      MAG_REL, 
+      MAG_CAL, 
+      MAG_AVE, 
+      MAG_REF, 
+      MAG_ERR, 
+      MAG_CHISQ,
+      MAG_NCODE,
+      MAG_NPHOT,
+};
+
+/* measure fields */
+enum {MEAS_ZERO, 
+      MEAS_RA, 
+      MEAS_DEC, 
+      MEAS_RA_AVE, 
+      MEAS_DEC_AVE,
+      MEAS_RA_AVE_ERR, 
+      MEAS_DEC_AVE_ERR, 
+      MEAS_U_RA, 
+      MEAS_U_DEC, 
+      MEAS_U_RA_ERR, 
+      MEAS_U_DEC_ERR, 
+      MEAS_PAR, 
+      MEAS_PAR_ERR, 
+      MEAS_RA_OFFSET, 
+      MEAS_DEC_OFFSET, 
+      MEAS_RA_OFFSET_ERR, 
+      MEAS_DEC_OFFSET_ERR, 
+      MEAS_XP, 
+      MEAS_NMEAS, 
+      MEAS_NMISS, 
+      MEAS_OBJFLAGS, 
+      MEAS_MAG, 
+      MEAS_MINST, 
+      MEAS_MCAT, 
+      MEAS_MSYS, 
+      MEAS_MREL, 
+      MEAS_MCAL, 
+      MEAS_EXPTIME, 
+      MEAS_AIRMASS, 
+      MEAS_ALT, 
+      MEAS_AZ, 
+      MEAS_PHOTCODE, 
+      MEAS_TIME, 
+      MEAS_FWHM, 
+      MEAS_FWHM_MAJ, 
+      MEAS_FWHM_MIN, 
+      MEAS_THETA, 
+      MEAS_DOPHOT, 
+      MEAS_DB_FLAGS, 
+      MEAS_PHOT_FLAGS, 
+      MEAS_XCCD, 
+      MEAS_YCCD, 
+      MEAS_XMOSAIC, 
+      MEAS_YMOSAIC, 
+      MEAS_SKY, 
+      MEAS_dSKY, 
+      MEAS_DET_ID, 
+      MEAS_OBJ_ID, 
+      MEAS_IMAGE_ID, 
+      MEAS_PSF_QF, 
+      MEAS_PSF_PROB, 
+      MEAS_CR_NSIGMA, 
+      MEAS_EXT_NSIGMA, 
+      MEAS_STARGAL, 
+};
+
+/* average fields */
+enum {AVE_ZERO, 
+      AVE_RA, 
+      AVE_DEC, 
+      AVE_RA_ERR, 
+      AVE_DEC_ERR, 
+      AVE_U_RA, 
+      AVE_U_DEC, 
+      AVE_U_RA_ERR, 
+      AVE_U_DEC_ERR, 
+      AVE_PAR, 
+      AVE_PAR_ERR, 
+      AVE_Xp, 
+      AVE_NMEAS, 
+      AVE_NMISS, 
+      AVE_NPHOT, 
+      AVE_NCODE, 
+      AVE_MAG, 
+      AVE_dMAG, 
+      AVE_Xm, 
+      AVE_FLAG, 
+      AVE_TYPE, 
+      AVE_TYPEFRAC,
+      AVE_OBJID
+};
+
+enum {DVO_TABLE_AVERAGE, DVO_TABLE_MEASURE};
+
+// options for selecting the ra,dec limits of the db selections
+typedef struct {
+  char *name;
+  char *list;
+  int useDisplay;
+  int useSkyregion;
+} SkyRegionSelection;
+
+// a single db field 
+typedef struct {
+  char *name;
+  int extract;
+  int table;
+  int ID;
+  int magMode;
+  PhotCode *photcode;
+} dbField;
+
+// db boolean operations
+typedef struct {
+  char   *name;
+  char    type;
+  int     field;
+  float   Float;
+} dbStack;
+
+typedef struct {
+  char name[64];
+  double RA0, RA1, DEC0, DEC1;
+} RegionFile;
+
+typedef struct {
+  double X;
+  double Y;
+  double R;
+  double D;
+  double M, dM;
+  char   dophot;
+  double sky;
+  double fx, fy, df;
+  double Mgal, Map;
+  int found;
+  short int code;
+  e_time t;
+} CMPstars;
+
+/*** dvo prototypes ***/
+int           DetermineTypeCode     PROTO((Average *average, Measure *measure, int code));
+double        DetermineTypefrac     PROTO((Average *average, Measure *measure, PhotCode *code));
+double        ExtractAverages       PROTO((PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int param));
+double       *ExtractByDMag         PROTO((PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param));
+double       *ExtractDMag           PROTO((PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist));
+double       *ExtractMagnitudes     PROTO((PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int *n));
+double       *ExtractMeasures       PROTO((PhotCode *code, int mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param));
+double       *ExtractMeasuresByDMag PROTO((PhotCode **code, int *mode, int use_first, Average *average, SecFilt *secfilt, Measure *measure, int *nlist, int param));
+double       *ExtractMeasuresDMag   PROTO((PhotCode **code, int *mode, Average *average, SecFilt *secfilt, Measure *measure, int *nlist));
+void          FreeImageSelection    PROTO(());
+void          FreeImageSelection    PROTO(());
+int           GetAverageParam       PROTO((char *parname));
+void          GetAverageParamHelp   PROTO(());
+int           GetMagMode            PROTO((char *string));
+double        GetMeasure            PROTO((int param, Average *average, Measure *measure, double mag));
+int           GetMeasureParam       PROTO((char *parname));
+int           GetMeasureTypeCode    PROTO((Measure *measure));
+int           GetPhotcodeInfo       PROTO((char *string, PhotCode **Code, int *Mode));
+int           GetSelectionParam     PROTO(());
+int           GetTimeSelection      PROTO((time_t *tz, time_t *te));
+void          InitDVO               PROTO(());
+int           InitPhotcodes         PROTO(());
+Image        *LoadImages            PROTO((int *Nimage));
+Image        *MatchImage            PROTO((unsigned int time, short int source));
+Coords       *MatchMosaic           PROTO((unsigned int time, short int source));
+int           Quality               PROTO((Measure *measure, int IsDophot));
+int           SelectMags            PROTO((int Nphot, int Tphot, int Ns, Average *average, Measure *measure, SecFilt *secfilt, int UL));
+
+SkyList      *SelectRegions         PROTO((SkyRegionSelection *selection));
+SkyList      *SkyListLoadFile       PROTO((char *filename));
+int           SetCATDIR             PROTO((char *path, int verbose));
+char *        GetCATDIR             PROTO(());
+SkyTable     *GetSkyTable           PROTO(());
+SkyList      *SkyListFromFile       PROTO((char *filename));
+SkyRegionSelection *SetRegionSelection    PROTO((int *argc, char **argv));
+
+int           SetImageSelection     PROTO((int mode, SkyRegionSelection *selection));
+int           SetPhotSelections     PROTO((int *argc, char **argv, int Nparams));
+int           SetSelectionParam     PROTO((int param));
+int           TestAverage           PROTO((PhotCode *code, Average *average, SecFilt *secfilt, Measure *measure));
+int           TestPhotSelections    PROTO((PhotCode **code, int *mode, int param));
+void          compare               PROTO((Catalog *catlog1, Catalog *catlog2, Vector *rvec,  Vector *dvec,  Vector *mvec, Vector *drvec, Vector *ddvec, Vector *dmvec, double radius));
+void          cprecess              PROTO((Average *average, int Naverage, double in_epoch, double out_epoch));
+void          image_subset          PROTO((Image *image, int Nimage, int **Subset, int *Nsubset, SkyRegionSelection *selection, unsigned long int tzero, double trange, int TimeSelect));
+int           match_image           PROTO((Image *image, int Nimage, unsigned int T, short int S));
+int           match_image_subset    PROTO((Image *image, int *subset, int Nsubset, unsigned int T, short int S));
+void          print_value           PROTO((double value, short int ival));
+void          sort_image_subset     PROTO((Image *image, int *subset, int N));
+void          sort_images           PROTO((Image *image, int N));
+void          sortave               PROTO((Average *ave, int N));
+CMPstars     *cmpReadFits           PROTO((FILE *f, int *nstars));
+CMPstars     *cmpReadText           PROTO((FILE *f, int *nstars));
+int           RD_to_XYpic           PROTO((double *x, double *y, double r, double d, Coords *coords, double Rmin, double Rmax, double Rmid, int *leftside));
+
+// dvo DB field functions
+dbField     *dbCmdlineFields        PROTO((int argc, char **argv, int table, int *last, int *nfields));
+dbStack     *dbRPN                  PROTO((int argc, char **argv, int *nstack));
+int          dbCheckStack           PROTO((dbStack *stack, int Nstack, int table, dbField **inFields, int *Nfields));
+int          dbBooleanCond          PROTO((dbStack *inStack, int NinStack, float *fields));
+void         dbInitStack            PROTO((dbStack *stack));
+void 	     dbFreeStack            PROTO((dbStack *stack, int Nstack));
+void 	     dbFreeEntry            PROTO((dbStack *stack));
+
+dbStack     *dbBinary               PROTO((dbStack *V1, dbStack *V2, char *op, float *fields));
+dbStack     *dbUnary                PROTO((dbStack *V1, char *op, float *fields));
+
+int          GetMagMode             PROTO((char *string));
+PhotCode    *ParsePhotcodeField     PROTO((char *field, int *mode, int def));
+int          ParseMeasureField      PROTO((dbField *field, char *fieldName));
+int          ParseAverageField      PROTO((dbField *field, char *fieldName));
+
+double       dbExtractAverages      PROTO((Average *average, SecFilt *secfilt, Measure *measure, dbField *field));
+double       dbExtractMeasures      PROTO((Average *average, SecFilt *secfilt, Measure *measure, dbField *field));
+void         dbExtractMeasuresInit  PROTO(());
+
+void 	     dbInitField            PROTO((dbField *field));
+void 	     dbFreeFields           PROTO((dbField *fields, int Nfields));
+int          dbAstroRegionLimits    PROTO((dbStack **stack, int *nstack, SkyRegionSelection *selection, int table));
+char        *strfloat               PROTO((float value));
+
+int get_skyregion (double *Rs, double *Re, double *Ds, double *De);
+int set_skyregion (double Rs, double Re, double Ds, double De);
+void FreeImageSelection ();
+
+void FreeSkyRegionSelection (SkyRegionSelection *selection);
+int wordhash (char *word);
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/external.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/external.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/external.h	(revision 15879)
@@ -0,0 +1,30 @@
+# include <signal.h>
+# include <unistd.h>
+# include <sys/uio.h>
+# include <fcntl.h>
+# include <sys/types.h>
+# include <sys/wait.h>
+# include <sys/socket.h>
+# include <sys/un.h>
+# include <sys/time.h>
+# include <time.h>
+# include <errno.h>
+# include <pthread.h>
+
+# include <netinet/ip.h>
+# include <netdb.h>
+# include <arpa/inet.h>
+
+# include <ohana.h>
+# include <dvo.h>
+
+/* provide missing external defines */
+# ifdef MISSING_SOCKET_INFO
+#   define F_SETFL         4   
+#   define O_NONBLOCK       0200000  
+#   define AF_UNIX         1          
+#   define SOCK_STREAM     1          
+#   define ENOENT          2 
+# endif
+
+# define strlen(A) ((int)strlen(A))
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/hstgsc.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/hstgsc.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/hstgsc.h	(revision 15879)
@@ -0,0 +1,27 @@
+
+static double BigDecBounds[] = {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,
+				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 *disk[] = {"disk 1", "disk 1", "disk 1", "disk 1", "disk 1", "disk 1", "disk 1", 
+		       "disk 1", "disk 1", "disk 1", "disk 1", "disk 1", "weirdness", 
+		       "disk 1", "disk 2", "disk 2", "disk 2", "disk 2", "disk 2", "disk 2", 
+		       "disk 2", "disk 2", "disk 2", "disk 2", "disk 2", "weirdness"};
+
+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};
+
+**/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/imfit.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/imfit.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/imfit.h	(revision 15879)
@@ -0,0 +1,20 @@
+# include "astro.h"
+
+int Npar;
+int Nfpar;
+float *par;
+float *fpar;
+float *sky;
+
+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 qfgauss_setup (char *name);
+void qrgauss_setup (char *name);
+void pgauss_psf_setup (char *name);
+void qgauss_psf_setup (char *name);
+void sgauss_psf_setup (char *name);
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/mana.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/mana.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/mana.h	(revision 15879)
@@ -0,0 +1,10 @@
+# include "data.h"
+# include "basic.h"
+# include "astro.h"
+
+# ifndef MANA_H
+
+void InitMana ();
+int *findrowpeaks (float *row, int Nrow, float threshold, int *npeaks);
+
+# endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/opihi.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/opihi.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/opihi.h	(revision 15879)
@@ -0,0 +1,5 @@
+# include "external.h"
+# include "shell.h"
+# include "dvomath.h"
+# include "convert.h"
+# include "display.h"
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/pantasks.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/pantasks.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/pantasks.h	(revision 15879)
@@ -0,0 +1,268 @@
+# include "data.h"
+# include "basic.h"
+# include "astro.h"
+
+# include <sys/time.h>
+# include <time.h>
+# include <zlib.h>
+
+# define DEBUG 0
+
+typedef enum {
+  JOB_NONE,
+  JOB_BUSY, 
+  JOB_EXIT, 
+  JOB_HUNG,
+  JOB_CRASH,
+  JOB_PENDING,
+} JobStat;
+
+typedef enum {
+  JOB_LOCAL, 
+  JOB_CONTROLLER, 
+} JobMode;
+
+typedef enum {
+  CONTROLLER_HUNG = -1,
+  CONTROLLER_DOWN = 0,
+  CONTROLLER_GOOD = 1,
+} ControllerStat;
+
+enum {RANGE_ABS, RANGE_DAY, RANGE_WEEK};
+enum {TIMER_ALLJOBS, TIMER_SUCCESS, TIMER_FAILURE};
+
+enum {TASK_NONE, 
+      TASK_EMPTY, 
+      TASK_COMMENT, 
+      TASK_NMAX, 
+      TASK_ACTIVE, 
+      TASK_TRANGE, 
+      TASK_END, 
+      TASK_HOST, 
+      TASK_STDOUT, 
+      TASK_STDERR, 
+      TASK_COMMAND, 
+      TASK_OPTIONS, 
+      TASK_PERIODS, 
+      TASK_NPENDING, 
+      TASK_EXIT, 
+      TASK_EXEC
+} TaskHashResults;
+
+typedef struct {
+  time_t start;
+  time_t stop;
+  char type;
+  char include;
+  int Nmax;
+  int Nrun;
+} TimeRange;
+
+/* a task is a description of the wrapping of a job */
+typedef struct {
+  Macro  *exec;				/* name is 'exec' */
+  Macro  *crash;			/* name is 'crash' */
+  Macro  *timeout;
+  Macro  *defexit;
+
+  int     NEXIT;
+  int     Nexit;
+  Macro **exit;				/* name is exit status */
+
+  int     argc;
+  char  **argv;
+
+  int     optc;
+  char  **optv;
+
+  char   *host;
+  int     host_required;
+
+  char   *name;
+
+  char   *stdout_dump;
+  char   *stderr_dump;
+
+  int       Nranges;
+  TimeRange *ranges;
+
+  int     Nmax;  // only construct Ntotal jobs for this task
+  int     Njobs;
+
+  int     Npending;  // number of currently pending jobs
+  int     NpendingMax;  // max number of pending jobs allowed
+
+  float   poll_period;
+  float   exec_period;
+  float   timeout_period;
+
+  struct timeval last;
+
+  int Nsuccess;
+  int Nfailure;
+  int Ntimeout;
+
+  double dtimeAve_alljobs, dtimeMin_alljobs, dtimeMax_alljobs;
+  double dtimeAve_success, dtimeMin_success, dtimeMax_success;
+  double dtimeAve_failure, dtimeMin_failure, dtimeMax_failure;
+
+  int active;
+
+} Task;
+
+// time period include/exclude periods: 
+// date ranges (e_time - e_time) 
+// time ranges (e_time - e_time) (use e_time % 86400)
+// time-of-week ranges  (e_time - e_time
+// -trange Mon Fri (inclusive on days -- end defaults to Fri@23:59:59)
+// -trange 08:00 - 17:00
+// -trange 2005/12/24 2005/12/31
+// be careful of HST!
+// type: day, week, date
+// keep: TRUE: perform action within this time period
+// keep: FALSE: do not perform action within this time period
+  
+typedef struct {
+  int JobID;				/* internal ID for job */
+  int pid;				/* external ID for job */
+
+  struct timeval last;
+  struct timeval start;
+  int state;
+  int exit_status;
+
+  int     argc;
+  char  **argv;
+
+  int     optc;
+  char  **optv;
+
+  Task   *task;
+
+  /* this cries out for another structure... */
+  IOBuffer    stdout_buff;    /* stdout storage buffer */
+  char       *stdout_dump;    // output target file for stdout
+  int         stdout_size;    /* size of pending stdout buffer (controller) */
+  int         stdout_fd;      /* stdout pipe (local only) */
+
+  IOBuffer    stderr_buff;    /* stderr storage buffer */
+  char       *stderr_dump;    // output target file for stderr
+  int         stderr_size;    /* size of pending stderr buffer (controller) */
+  int         stderr_fd;      /* stderr pipe (local only) */
+
+  JobMode     mode;			/* local or controller? */
+  char   *realhost;
+
+  double dtime;
+} Job;
+
+# define CONTROLLER_PROMPT "pcontrol:"
+
+/* scheduler prototypes */
+
+void InitPantasks ();
+void InitPantasksServer ();
+void InitPantasksClient ();
+void InitTasks ();
+Task *NextTask ();
+Task *FindTask (char *name);
+void ListTasks (int verbose);
+int ShowTask (char *name);
+int FreeTask (Task *task);
+Task *CreateTask (char *name);
+int ValidateTask (Task *task, int RequireStatic);
+int RegisterNewTask ();
+int DeleteNewTask ();
+Task *GetNewTask ();
+Task *GetActiveTask ();
+void SetTaskTimer (struct timeval *timer);
+double GetTaskTimer (struct timeval start, int verbose);
+void InitTaskTimers ();
+int TaskHash (char *input);
+int RemoveTask (Task *task);
+Task *SetNewTask (Task *task);
+void ListTaskStats (char *regex);
+void ResetTaskStats (char *regex);
+void UpdateTaskTimerStats (Task *task, int mode, double dtime);
+
+int NextJobID ();
+int InitJobIDs ();
+int FreeJobID (int ID);
+
+void InitJobs ();
+Job *NextJob ();
+Job *FindJob (int JobID);
+void ListJobs ();
+Job *CreateJob (Task *task);
+int SubmitJob (Job *job);
+int CheckJob (Job *job);
+int DeleteJob (Job *job);
+void FreeJob (Job *job);
+
+float CheckJobs ();
+float CheckTasks ();
+int CheckSystem ();
+int CheckController ();
+int CheckTimeRanges (TimeRange *ranges, int Nranges);
+int BumpTimeRanges (TimeRange *ranges, int Nranges);
+
+int GetJobOutput (char *channel, int pid, IOBuffer *buffer, int Nbytes);
+int CheckControllerJob (Job *job);
+int CheckControllerJobStatus (Job *job);
+int SubmitControllerJob (Job *job);
+int DeleteControllerJob (Job *job);
+Job *FindControllerJob (int JobID);
+int StartController ();
+int ControllerCommand (char *command, char *response, IOBuffer *buffer);
+int SubmitLocalJob (Job *job);
+int CheckLocalJob (Job *job);
+int CheckLocalJobStatus (Job *job);
+void InitTaskTimers ();
+CommandF *FindControllerCommand (char *cmd);
+int QuitController ();
+int StopController ();
+int VerboseMode ();
+int KillLocalJob (Job *job);
+int CheckControllerOutput ();
+int PrintControllerOutput ();
+
+int KillControllerJob (Job *job);
+int CheckControllerStatus ();
+void gotsignal (int signum);
+int client_shell (int argc, char **argv);
+
+void InitClients ();
+void AddNewClient (int client);
+int  DeleteClient (int client);
+void *ListenClients (void *data);
+
+// functions related to the server threads
+void CheckTasksSetState (int state);
+int CheckTasksGetState ();
+void *CheckTasksThread (void *data);
+
+void CheckJobsSetState (int state);
+int CheckJobsGetState ();
+void *CheckJobsThread (void *data);
+
+void CheckControllerSetState (int state);
+int CheckControllerGetState ();
+void *CheckControllerThread (void *data);
+
+void CheckInputsSetState (int state);
+int CheckInputsGetState ();
+void *CheckInputsThread (void *data);
+
+// functions related to the queue of input files
+void InitInputs ();
+void AddNewInput (char *input);
+int DeleteInput (char *input);
+void CheckInputs ();
+
+void SerialThreadLock ();
+void SerialThreadUnlock ();
+
+int InitPassword ();
+int CheckPassword (int BindSocket);
+
+int FlushJobs ();
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/pclient.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/pclient.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/pclient.h	(revision 15879)
@@ -0,0 +1,53 @@
+# include "data.h"
+# include "basic.h"
+
+/** pclient global data **/
+
+/** child status values **/
+enum {
+  PCLIENT_NONE,
+  PCLIENT_BUSY,  
+  PCLIENT_EXIT,
+  PCLIENT_CRASH,
+};
+
+int ChildPID;				/** current child PID **/
+int ChildStatus;			/** current status of child **/
+int ChildExitStatus;			/** recent exit status of child **/
+
+/** child may be in the following states:
+    
+PCLIENT_NONE
+PCLIENT_BUSY
+PCLIENT_EXIT
+PCLIENT_CRASH
+
+allowed transitions:
+
+PCLIENT_NONE  ->    PCLIENT_BUSY  (start a job)
+
+PCLIENT_BUSY  ->    PCLIENT_EXIT  (job complete)
+PCLIENT_BUSY  ->    PCLIENT_CRASH (job crashed)
+
+PCLIENT_EXIT  ->    PCLIENT_NONE  (cleanup)
+PCLIENT_CRASH ->    PCLIENT_NONE  (cleanup)
+
+**/
+
+/** file descriptors for child I/O **/
+int child_stdin_fd[2];
+int child_stdout_fd[2];
+int child_stderr_fd[2];
+
+/** buffers for I/O storage **/
+IOBuffer child_stdout;
+IOBuffer child_stderr;
+
+int InitChild ();
+int CheckChild ();
+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: /branches/eam_branch_20071222/Ohana/src/opihi/include/pcontrol.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/pcontrol.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/pcontrol.h	(revision 15879)
@@ -0,0 +1,225 @@
+# include "data.h"
+# include "basic.h"
+# define THREADED
+
+typedef struct timeval Ptime;
+typedef unsigned long long IDtype;
+
+/** job status values **/
+typedef enum {
+  PCONTROL_JOB_PENDING,
+  PCONTROL_JOB_BUSY,  
+  PCONTROL_JOB_HUNG,  
+  PCONTROL_JOB_DONE,  
+  PCONTROL_JOB_KILL,  
+  PCONTROL_JOB_EXIT,
+  PCONTROL_JOB_CRASH,
+} JobStat;
+
+/** job status values **/
+typedef enum {
+  PCONTROL_JOB_ANYHOST,
+  PCONTROL_JOB_WANTHOST,
+  PCONTROL_JOB_NEEDHOST,
+} JobMode;
+
+/** host status values **/
+typedef enum {
+  PCONTROL_HOST_IDLE,
+  PCONTROL_HOST_BUSY,  
+  PCONTROL_HOST_DOWN,
+  PCONTROL_HOST_DONE,
+  PCONTROL_HOST_OFF,
+} HostStat;
+
+typedef enum {
+  PCONTROL_RUN_UNKNOWN,
+  PCONTROL_RUN_NONE,
+  PCONTROL_RUN_HOSTS,
+  PCONTROL_RUN_REAP,
+  PCONTROL_RUN_ALL,
+} RunLevels;
+
+/* stack special positions */
+typedef enum {
+  STACK_TOP = 0,
+  STACK_BOTTOM = -1,
+} StackWhere;
+
+typedef enum {
+  PCLIENT_HUNG = -1,
+  PCLIENT_DOWN = 0,
+  PCLIENT_GOOD = 1,
+} PclientStat;
+
+typedef struct {
+  char *buffer;
+  int   Nalloc;
+  int   Nmaxread;
+  int   Nextra;
+  int   Nlast;
+  int   Nbuffer;
+} Fifo;
+
+/* data to define a job */
+typedef struct {
+  int          argc; 
+  char       **argv;
+  char        *hostname;
+  char        *realhost;
+  int          exit_status;
+  int          Reset;
+  int          stdout_size;
+  int          stderr_size;
+  JobMode      mode;
+  JobStat      state;
+  JobStat      stack;
+  IOBuffer     stdout_buff;
+  IOBuffer     stderr_buff;
+  Ptime        start;
+  Ptime        stop;
+  double       dtime;
+  int          pid;
+  IDtype       JobID;
+  struct Host *host;
+} Job;
+
+/* data to define a host machine */
+typedef struct {
+  char       *hostname;
+  int         stdin_fd;
+  int         stdout_fd;
+  int         stderr_fd;
+  int         markoff;
+  int         pid;
+  HostStat    stack;
+  Ptime       lasttry;
+  Ptime       nexttry;
+  IDtype      HostID;
+  struct Job *job;
+} Host;
+
+typedef struct {
+  void **object;
+  char **name;
+  int   *id;
+  int    Nobject;
+  int    NOBJECT;
+# ifdef THREADED    
+  pthread_mutex_t mutex;
+# endif
+} Stack;
+
+/* XXX if this is hard-wired, we can't change shell name in StartHost */
+# define PCLIENT_PROMPT "pclient:"
+
+// # define FREE(X) if (X != NULL) { free (X); }
+# define CLOSE(FD) { if (FD) close (FD); FD = 0; }
+# define DTIME(A,B) ((A.tv_sec - B.tv_sec) + 1e-6*(A.tv_usec - B.tv_usec))
+# define ZTIME(A) ((A.tv_sec == 0) && (A.tv_usec == 0))
+
+// # define ASSERT(TEST,STRING) { if (!(TEST)) { gprint (GP_ERR, "programming error: %s\n", STRING); abort (); }}
+// # define ABORT(STRING) { gprint (GP_ERR, "programming error: %s\n", STRING); abort (); }
+# define ASSERT(TEST,STRING) { if (!(TEST)) { gprint (GP_ERR, "programming error: %s\n", STRING); raise (SIGINT); exit (2); }}
+# define ABORT(STRING) { gprint (GP_ERR, "programming error: %s\n", STRING); raise (SIGINT); exit (2); }
+
+void InitPcontrol ();
+
+/*** StackOps.c ***/
+Stack *InitStack ();
+int    PushStack (Stack *stack, int where, void *object, int id, char *name);
+void  *PullStackByLocation (Stack *stack, int where);
+void  *PullStackByName (Stack *stack, char *name);
+void  *PullStackByID (Stack *stack, int id);
+int    RemoveStackEntry (Stack *stack, int where);
+void  *RemoveStackByID (Stack *stack, int id);
+void   LockStack (Stack *stack);
+void   UnlockStack (Stack *stack);
+
+// void  *FindStackByID (Stack *stack, int id);
+// void  *FindStackByName (Stack *stack, char *name);
+
+/*** CheckSystem.c ***/
+int   CheckSystem ();
+void *CheckSystem_Threaded (void *data);
+int   CheckBusyJobs (float delay);
+int   CheckDoneJobs (float delay);
+int   CheckKillJobs (float delay);
+int   CheckDoneHosts (float delay);
+int   CheckDownHosts (float delay);
+int   CheckIdleHosts (float delay);
+int   CheckLiveHosts (float delay);
+int   SetRunSystem (int state);
+RunLevels SetRunLevel (RunLevels level);
+
+/*** own files ***/
+int CheckHost (Host *host);
+int StartHost (Host *host);
+int CheckIdleHost (Host *host);
+int CheckDoneHost (Host *host);
+int CheckBusyJob (Job *job, Host *host);
+int CheckDoneJob (Job *job, Host *host);
+int KillJob (Job *job, Host *host);
+int StartJob (Job *job, Host *host);
+int ResetJob (Job *job);
+int GetJobOutput (char *command, Host *host, IOBuffer *buffer, int Nbytes);
+int PclientCommand (Host *host, char *command, char *response, IOBuffer *buffer);
+int rconnect (char *command, char *hostname, char *shell, int *stdio);
+
+/*** misc files ***/
+int    VerboseMode ();  // in verbose.c
+void   gotsignal (int signum); // in pcontrol.c
+
+/*** IDops.c ***/
+void InitIDs ();
+IDtype NextJobID ();
+IDtype NextHostID ();
+void PrintID (gpDest dest, IDtype ID);
+
+/*** CheckPoint.c ***/
+int SetCheckPoint ();
+int ClearCheckPoint ();
+int TestCheckPoint ();
+
+/*** HostOps.c ***/
+void   InitHostStacks ();
+Stack *GetHostStack (int StackID);
+char  *GetHostStackName (int StackID);
+Stack *GetHostStackByName (char *name);
+int    PutHost (Host *host, int StackID, int where);
+Host  *PullHostByID (IDtype HostID, int *StackID);
+Host  *PullHostByName (char *name, int *StackID);
+Host  *PullHostFromStackByID (int StackID, IDtype ID);
+Host  *PullHostFromStackByName (int StackID, char *name);
+IDtype AddHost (char *hostname);
+void   DelHost (Host *host);
+
+/*** StopHosts.c ***/
+void   DownHost (Host *host);
+void   OffHost (Host *host);
+int    DownHosts ();
+int    StopHost (Host *host);
+int    HarvestHost (int pid);
+
+/*** JobOps.c ***/
+void   InitJobStacks ();
+Stack *GetJobStack (int StackID);
+char  *GetJobStackName (int StackID);
+Stack *GetJobStackByName (char *name);
+int    PutJob (Job *job, int StackID, int where);
+int    PutJobSetState (Job *job, int StackID, int where, int state);
+Job   *PullJobByID (IDtype JobID, int *StackID);
+Job   *PullJobFromStackByID (int StackID, int ID);
+IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv);
+void   DelJob (Job *job);
+Host  *UnlinkJobAndHost (Job *job);
+void   LinkJobAndHost (Job *job, Host *host);
+
+void pcontrol_exit (int n);
+
+// Job   *FindJobByID (IDtype JobID, int *StackID);
+// Job   *FindJobInStackByID (int StackID, int ID);
+// Host  *FindHostByID (IDtype HostID, int *StackID);
+// Host  *FindHostByName (char *name, int *StackID);
+// Host  *FindHostInStackByID (int StackID, IDtype ID);
+// Host  *FindHostInStackByName (int StackID, char *name);
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/shell.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/shell.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/shell.h	(revision 15879)
@@ -0,0 +1,172 @@
+/*** shell.h ***/
+# include "external.h"
+
+# ifndef SHELL_H
+# define SHELL_H
+
+# define ISVAR(a) (isalnum (a) || (a == ':') || (a == '_'))
+# define ISWORD(a,q) ((q) ? (a != '"') : (isalnum(a) || (a == '/') || (a == '.') || (a == '_') || (a == '-')))
+# define ISNUM(c) (isdigit(c) || (c == '-') || (c == '.'))
+
+# define MACRO_STRING(s) #s
+# define MACRO_NAME(s) MACRO_STRING(s)
+
+/* enums used by gprint functions */
+typedef enum {GP_FILE, GP_BUFF} gpMode;
+typedef enum {GP_LOG, GP_ERR} gpDest;
+
+typedef int CommandF ();
+
+typedef struct sockaddr_in SockAddress;
+
+/*** typedef structs used by shell functions ***/
+typedef struct {			/* basic opihi command structure */
+  char     *name;
+  CommandF *func;    
+  char     *help;
+} Command;
+
+typedef struct {			/* a macro (collection of commands) */
+  char   *name;
+  char  **line;
+  int     Nlines;
+} Macro;
+
+typedef struct {			/* a list (macro/loop currently being executed) */
+  char **line;
+  int    n;
+  int    Nlines;
+  int    Nalloc;
+} List;
+
+/* structure used to represent the gprint i/o stream */
+typedef struct {
+  FILE *file;
+  char *name;
+  IOBuffer *buffer;
+  gpMode mode;
+  gpDest dest;
+  pthread_t thread;
+} gpStream;
+
+/*** globals used to track the shell language concepts  ***/
+int 	     interrupt;			/* true if C-C has been pressed */
+int 	     auto_break;		/* if true, zero exit status forces macros to escape */
+int 	     loop_next; 		/* set to true when next (or continue) is called */
+int 	     loop_last; 		/* set to true when last (or return) is called */
+int 	     loop_break;		/* set to true when break is called */
+int          is_script;                 /* being run within a shell script */
+
+/*** basic opihi shell functions ***/
+void          general_init            	PROTO((int *argc, char **argv));
+void          program_init            	PROTO((int *argc, char **argv));
+void          startup               	PROTO((int *argc, char **argv));
+int           opihi                     PROTO((int argc, char **argv));
+int           multicommand          	PROTO((char *line));
+void          multicommand_InitServer   PROTO((void));
+int           command               	PROTO((char *line, char **outline, int VERBOSE));
+char         *expand_vars           	PROTO((char *line));
+char         *expand_vectors        	PROTO((char *line));
+char         *parse                 	PROTO((char *line));
+char        **parse_commands        	PROTO((char *, int *));
+void          welcome                   PROTO(());
+
+int           add_listentry             PROTO((int ThisList, char *line));
+int           is_for_loop           	PROTO((char *line));
+int           is_if_block           	PROTO((char *line));
+int           is_list               	PROTO((char *line));
+int           is_loop               	PROTO((char *line));
+int           is_task               	PROTO((char *line));
+int           is_task_exit             	PROTO((char *line));
+int           is_task_exec             	PROTO((char *line));
+int           is_macro_create       	PROTO((char *line));
+void          InitLists                 PROTO(());
+int current_list_depth ();
+int increase_list_depth ();
+int decrease_list_depth ();
+char *get_next_listentry (int ThisList);
+
+void          InitCommands              PROTO(());
+void          AddCommand                PROTO((Command *new));
+int           DeleteCommand             PROTO((Command *command));
+Command      *MatchCommand              PROTO((char *name, int VERBOSE, int EXACT));
+void          sort_commands             PROTO((int *seq));
+
+void          SetCurrentMacroData	PROTO((char *name, int depth));
+Macro        *NewMacro			PROTO((char *name));
+int           DeleteMacro		PROTO((Macro *macro));
+Macro        *MatchMacro		PROTO((char *name, int VERBOSE, int EXACT));
+void          InitMacros                PROTO((void));
+char         *GetMacroName              PROTO((void));
+int           GetMacroDepth             PROTO((void));
+void          ListMacro                 PROTO((Macro *macro));
+void          ListMacros                PROTO(());
+void          FreeMacro                 PROTO((Macro *macro));
+CommandF     *find_macro_command        PROTO((char *name));
+
+int           exec_loop                 PROTO((Macro *loop));
+/* char         *get_next_listentry    	PROTO((int ThisList)); */
+/* char         *remove_listentry      	PROTO((int current)); */
+
+int           ConfigInit            	PROTO((int *argc, char **argv));
+char         *VarConfig             	PROTO((char *keyword, char *mode, void *ptr));
+char         *VarConfigEntry           	PROTO((char *keyword, char *mode, int entry, void *ptr));
+
+int           init_error                PROTO((void));
+int           push_error                PROTO((char *line));
+int           print_error               PROTO((void));
+void          handle_interrupt      	PROTO((int));
+char        **command_completer     	PROTO((const char *, int, int));
+char         *command_generator     	PROTO((const char *text, int state));
+char        **completion_matches    	PROTO((char *, rl_compentry_func_t *));
+void          print_commands            PROTO((FILE *f));
+void          InitCommands              PROTO((void));
+
+/* command line parsing */
+char         *thisword              	PROTO((char *));
+char         *nextword              	PROTO((char *));
+char         *lastword              	PROTO((char *, char *));
+char         *thisvar               	PROTO((char *));
+char         *aftervar              	PROTO((char *));
+char         *lastvar               	PROTO((char *, char *));
+char         *thiscomm              	PROTO((char *));
+char         *nextcomm              	PROTO((char *));
+char         *opihi_append              PROTO((char *output, int *Noutput, char *start, char *stop));
+void          interpolate_slash         PROTO((char *line));
+
+/* macro functions (mapped to commands) */
+int 	      macro_create 		PROTO((int, char **)); 
+int 	      macro_delete 		PROTO((int, char **)); 
+int 	      macro_edit   		PROTO((int, char **));
+int 	      macro_exec   		PROTO((int, char **));
+int 	      macro_list_f 		PROTO((int, char **));  /* "macro_list" is a readline func */
+int 	      macro_read   		PROTO((int, char **));
+int 	      macro_write   		PROTO((int, char **));
+
+char 	     *memstr        		PROTO((char *m1, char *m2, int n));
+int  	      write_fmt     		PROTO((int fd, char *format, ...));
+char 	     *opihi_version 		PROTO(());
+char 	     *strip_version 		PROTO((char *input));
+
+/* gprint functions */
+void          gprintInit      		PROTO(());
+gpStream     *gprintGetStream 		PROTO((gpDest dest));
+void          gprintSetBuffer 		PROTO((gpDest dest));
+IOBuffer     *gprintGetBuffer 		PROTO((gpDest dest));
+void          gprintSetFileAllThreads   PROTO((gpDest dest, char *filename));
+void          gprintSetFileThisThread   PROTO((gpDest dest, char *filename));
+void          gprintSetFile   		PROTO((gpStream *stream, gpDest dest, char *filename));
+FILE         *gprintGetFile   		PROTO((gpDest dest));
+char         *gprintGetName   		PROTO((gpDest dest));
+int           gprint          		PROTO((gpDest dest, char *format, ...));
+int           gwrite          		PROTO((char *buffer, int size, int N, gpDest dest));
+
+/* socket functions */
+int InitServerSocket (SockAddress *Address);
+int WaitServerSocket (int InitSocket, SockAddress *Address);
+int GetClientSocket (char *hostname);
+int InitServerSocket_Named (char *hostname, SockAddress *Address);
+int DefineValidIP ();
+
+# endif
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/include/user.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/include/user.h	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/include/user.h	(revision 15879)
@@ -0,0 +1,260 @@
+int abszero         PROTO((int, char **));
+int applyfit        PROTO((int, char **));
+int applyfit2d      PROTO((int, char **));
+int badimages       PROTO((int, char **));
+int box             PROTO((int, char **));
+int calextract      PROTO((int, char **));
+int calmextract     PROTO((int, char **));
+int cals            PROTO((int, char **));
+int catlog          PROTO((int, char **));
+int ccd             PROTO((int, char **));
+int ccdextract      PROTO((int, char **));
+int center          PROTO((int, char **));
+int cgrid           PROTO((int, char **));
+int clear           PROTO((int, char **));
+int cmatch          PROTO((int, char **));
+int cmd             PROTO((int, char **));
+int cmdextract      PROTO((int, char **));
+int cmpread         PROTO((int, char **));
+int concat          PROTO((int, char **));
+int contour         PROTO((int, char **));
+int cplot           PROTO((int, char **));
+int create          PROTO((int, char **));
+int csystem         PROTO((int, char **));
+int ctimes          PROTO((int, char **));
+int cursor          PROTO((int, char **));
+int czplot          PROTO((int, char **));
+int datafile        PROTO((int, char **));
+int date            PROTO((int, char **));
+int ddmagextract    PROTO((int, char **));
+int ddmags          PROTO((int, char **));
+int delete          PROTO((int, char **));
+int device          PROTO((int, char **));
+int dmagaves        PROTO((int, char **));
+int dmagextract     PROTO((int, char **));
+int dmagmeas        PROTO((int, char **));
+int dmags           PROTO((int, char **));
+int dmt             PROTO((int, char **));
+int dumpmags        PROTO((int, char **));
+int elixir          PROTO((int, char **));
+int extract         PROTO((int, char **));
+int file            PROTO((int, char **));
+int fit             PROTO((int, char **));
+int fit2d           PROTO((int, char **));
+int gaussjordan     PROTO((int, char **));
+int gcat            PROTO((int, char **));
+int gimages         PROTO((int, char **));
+int grid            PROTO((int, char **));
+int gstar           PROTO((int, char **));
+int gtypes          PROTO((int, char **));
+int histogram       PROTO((int, char **));
+int images          PROTO((int, char **));
+int imbox           PROTO((int, char **));
+int imdata          PROTO((int, char **));
+int imdense         PROTO((int, char **)); 
+int imextract       PROTO((int, char **));
+int imlist          PROTO((int, char **));
+int imphot          PROTO((int, char **));
+int imrough         PROTO((int, char **));
+int imsearch        PROTO((int, char **));
+int imstats         PROTO((int, char **));
+int interpolate     PROTO((int, char **));
+int jpeg            PROTO((int, char **));
+int labels          PROTO((int, char **));
+int lcat            PROTO((int, char **));
+int lcurve          PROTO((int, char **));
+int limits          PROTO((int, char **));
+int list_buffers    PROTO((int, char **));
+int list_vectors    PROTO((int, char **));
+int mcreate         PROTO((int, char **));
+int mextract        PROTO((int, char **));
+int mget            PROTO((int, char **));
+int mset            PROTO((int, char **));
+int pcat            PROTO((int, char **));
+int photcodes       PROTO((int, char **));
+int photresid       PROTO((int, char **));
+int plot            PROTO((int, char **));
+int pmeasure        PROTO((int, char **));
+int precess         PROTO((int, char **));
+int print           PROTO((int, char **));
+int procks          PROTO((int, char **));
+int ps              PROTO((int, char **));
+int rd              PROTO((int, char **));
+int read_vectors    PROTO((int, char **));
+int region          PROTO((int, char **));
+int resid           PROTO((int, char **));
+int resize          PROTO((int, char **));
+int section         PROTO((int, char **));
+int set             PROTO((int, char **));
+int simage          PROTO((int, char **));
+int sort_vectors    PROTO((int, char **));
+int sprintf_opihi   PROTO((int, char **));
+int stats           PROTO((int, char **));
+int style           PROTO((int, char **));
+int subpix          PROTO((int, char **));
+int subraster       PROTO((int, char **));
+int subset          PROTO((int, char **));
+int textline        PROTO((int, char **));
+int tv              PROTO((int, char **));
+int uniq            PROTO((int, char **));
+int vectobuf        PROTO((int, char **));
+int vstat           PROTO((int, char **));
+int wd              PROTO((int, char **));
+int write_vectors   PROTO((int, char **));
+int zap             PROTO((int, char **));
+int zeropts         PROTO((int, char **));
+int zplot           PROTO((int, char **));
+
+static Command user[] = {  
+  {"abszero", 	   abszero,       "find filter zeropts"},
+  {"applyfit",     applyfit,      "apply fit to new vector"},
+  {"applyfit2d",   applyfit2d,    "apply 2-d fit to new vector"},
+  {"badimages",    badimages,     "look for images with anomalous astrometry"},
+  {"badimages",    badimages,     "look for images with anomalous astrometry"},
+  {"box",     	   box,           "draw a box on the plot"},
+  {"calextract",   calextract,    "extract dmags"},
+  {"calextract",   calextract,    "extract dmags"},
+  {"calmextract",  calmextract,   "extract dmags"},
+  {"cals",    	   cals,          "plot calibration data"},
+  {"catalog", 	   catlog,        "plot catalog stars"},
+  {"catalog", 	   catlog,        "plot catalog stars"},
+  {"ccd",     	   ccd,           "plot color-color diagram"},
+  {"ccd",     	   ccd,           "plot color-color diagram"},
+  {"ccdextract",   ccdextract,    "extract star coords from color-color diagram"},
+  {"center",       center,        "center image on coords"},
+  {"center",       center,        "center image on coords"},
+  {"cgrid",   	   cgrid,         "plot sky coordinate grid"},
+  {"cgrid",   	   cgrid,         "plot sky coordinate grid"},
+  {"clear",   	   clear,         "erase plot"},
+  {"cmatch",  	   cmatch,        "match two catalogs"},
+  {"cmatch",  	   cmatch,        "match two catalogs"},
+  {"cmd",     	   cmd,           "plot cmd of stars in current region"},
+  {"cmd",     	   cmd,           "plot cmd of stars in current region"},
+  {"cmdextract",   cmdextract,    "extract stars based on cmd regions"},
+  {"cmpread",      cmpread,       "read data from cmp format files"},
+  {"cmpread",      cmpread,       "read data from cmp format files"},
+  {"concat",  	   concat,        "reduce vector dimension"},
+  {"contour", 	   contour,       "create contour from image"},
+  {"cplot",   	   cplot,         "plot vectors in sky coordinates"},
+  {"cplot",   	   cplot,         "plot vectors in sky coordinates"},
+  {"create",  	   create,        "create a new vector"},
+  {"csystem", 	   csystem,       "convert between coordinate systems"},
+  {"csystem", 	   csystem,       "convert between coordinate systems"},
+  {"ctimes",  	   ctimes,        "convert between time formats"},
+  {"ctimes",  	   ctimes,        "convert between time formats"},
+  {"cursor",  	   cursor,        "get coords from cursor"},
+  {"czplot",  	   czplot,        "plot scaled vectors in sky coordinates"},
+  {"czplot",  	   czplot,        "plot scaled vectors in sky coordinates"},
+  {"datafile",     datafile,      "define file to read vectors"},
+  {"date",    	   date,          "get current date"},
+  {"ddmagextr",    ddmagextract,  "plot magnitude differences"},
+  {"ddmags",       ddmags,        "plot magnitude differences"},
+  {"ddmags",       ddmags,        "plot magnitude differences"},
+  {"delete",  	   delete,        "delete vectors or matrices"},
+  {"device",  	   device,        "set / get current graphics device"},
+  {"dmagaves",     dmagaves,      "plot differential magnitudes between filters"},
+  {"dmagextract",  dmagextract,   "extract stars based on differential magnitudes between filters"},
+  {"dmagmeas",     dmagmeas,      "plot differential magnitudes between filters"},
+  {"dmags",   	   dmags,         "plot differential magnitudes between filters"},
+  {"dmags",   	   dmags,         "plot differential magnitudes between filters"},
+  {"dmt",          dmt,           "plot mag scatter"},
+  {"dmt",          dmt,           "plot mag scatter"},
+  {"dumpmags",     dumpmags,      "custom dB dumping thingy"},
+  {"dumpmags",     dumpmags,      "custom dB dumping thingy"},
+  {"elixir",       elixir,        "get status info from elixir"},
+  {"elixir",       elixir,        "get status info from elixir"},
+  {"extract", 	   extract,       "extract vectors from catalogs"},
+  {"file",    	   file,          "test for a file"},
+  {"fit",     	   fit,           "fit polynomial to vector pair"},
+  {"fit2d",        fit2d,         "fit 2-d polynomial to vector triplet"},
+  {"gaussj",  	   gaussjordan,   "solve Ax = B (N-D)"},
+  {"gcat",         gcat,          "get catalog at location"},
+  {"gcat",         gcat,          "get catalog at location"},
+  {"gimages",      gimages,       "get images at location"},
+  {"gimages",      gimages,       "get images at location"},
+  {"grid",    	   grid,          "plot cartesian grid"},
+  {"gstar",   	   gstar,         "get star statistics"},
+  {"gstar",   	   gstar,         "get star statistics"},
+  {"gtypes",       gtypes,        "get type fractions"},
+  {"gtypes",       gtypes,        "get type fractions"},
+  {"histogram",    histogram,     "generate histogram from vector"},
+  {"images",  	   images,        "plot image boxes"},
+  {"images",  	   images,        "plot image boxes"},
+  {"imbox",   	   imbox,         "plot expected image box"},
+  {"imbox",   	   imbox,         "plot expected image box"},
+  {"imdata",  	   imdata,        "extract data for specific images"},
+  {"imdata",  	   imdata,        "extract data for specific images"},
+  {"imdense", 	   imdense,       "image density plot"},
+  {"imdense", 	   imdense,       "image density plot"},
+  {"imextract",    imextract,     "extract vectors from catalogs"},
+  {"imextract",    imextract,     "extract vectors from catalogs"},
+  {"imlist",  	   imlist,        "list image info"},
+  {"imlist",  	   imlist,        "list image info"},
+  {"imphot",  	   imphot,        "image photometry info"},
+  {"imphot",  	   imphot,        "image photometry info"},
+  {"imrough",      imrough,       "get info from imruf database"},
+  {"imrough",      imrough,       "get info from imruf database"},
+  {"imsearch",     imsearch,      "get info from imreg database"},
+  {"imsearch",     imsearch,      "get info from imreg database"},
+  {"imstats", 	   imstats,       "plot image statistics"},
+  {"imstats", 	   imstats,       "plot image statistics"},
+  {"interpolate",  interpolate,   "interpolate between vector pairs"},
+  {"jpeg",         jpeg,          "write text line on graph"},
+  {"labels",  	   labels,        "define labels for plot"},
+  {"lcat",    	   lcat,          "list catalogs in region"},
+  {"lcat",    	   lcat,          "list catalogs in region"},
+  {"lcurve",  	   lcurve,        "plot lightcurve for a star"},
+  {"lcurve",  	   lcurve,        "plot lightcurve for a star"},
+  {"limits",  	   limits,        "define plot limits"},
+  {"buffers",      list_buffers,  "list the currently allocated buffers"},
+  {"vectors", 	   list_vectors,  "list vectors"},
+  {"local",  	   local,         "define local variables"},
+  {"mcreate", 	   mcreate,       "create a matrix"},
+  {"mextract",	   mextract,      "extract vectors from catalogs"},
+  {"mextract",	   mextract,      "extract vectors from catalogs"},
+  {"mget",    	   mget,          "extract a vector from a matrix"},
+  {"mset",    	   mset,          "insert a vector in a matrix"},
+  {"pcat",    	   pcat,          "plot catalog boundaries"},
+  {"pcat",    	   pcat,          "plot catalog boundaries"},
+  {"photcodes",    photcodes,     "list photometry codes"},
+  {"photcodes",    photcodes,     "list photometry codes"},
+  {"photresid",    photresid,     "plot photometry residuals"},
+  {"plot",    	   plot,          "plot a pair of vectors"},
+  {"pmeasure",	   pmeasure,      "plot individual measurements"},
+  {"pmeasure",	   pmeasure,      "plot individual measurements"},
+  {"precess", 	   precess,       "precess coordinates"},
+  {"precess", 	   precess,       "precess coordinates"},
+  {"print",   	   print,         "write vectors to file"},
+  {"print",   	   print,         "write vectors to file"},
+  {"procks",  	   procks,        "plot rocks"},
+  {"procks",  	   procks,        "plot rocks"},
+  {"ps",      	   ps,            "define labels for plot"},
+  {"rd",           rd,            "load fits image"},
+  {"read",         read_vectors,  "read vectors from datafile"},
+  {"region",  	   region,        "define sky region for plot"},
+  {"region",  	   region,        "define sky region for plot"},
+  {"resid",   	   resid,         "plot residuals"},
+  {"resize",  	   resize,        "set graphics/image window size"},
+  {"section", 	   section,       "define section of graph"},
+  {"set",     	   set,           "vector math"},
+  {"simage",  	   simage,        "plot stars in an image"},
+  {"simage",  	   simage,        "plot stars in an image"},
+  {"sort",    	   sort_vectors,  "sort list of vectors"},
+  {"sprintf", 	   sprintf_opihi, "formated print to variable"},
+  {"stats",   	   stats,         "give statistics on a portion of a buffer"},
+  {"style",   	   style,         "set the style for graph plots"},
+  {"subpix",  	   subpix,        "get subpixel positions"},
+  {"subpix",  	   subpix,        "get subpixel positions"},
+  {"subraster",    subraster,     "subraster of fits image"},
+  {"subset",  	   subset,        "expand vector dimension"},
+  {"textline",     textline,      "write text line on graph"},
+  {"tv",      	   tv,            "display an image on the Kii window"},
+  {"uniq",    	   uniq,          "create a uniq vector subset from a vector"},
+  {"vectobuf",     vectobuf,      "convert vector triplet to buffer"},
+  {"vstat",        vstat,         "get info from imreg database"},
+  {"wd",      	   wd,            "write an image to a file"},
+  {"write",   	   write_vectors, "write vectors to datafile"},
+  {"zap",     	   zap,           "delete pixels"},
+  {"zeropts", 	   zeropts,       "show filter zeropts"},
+  {"zplot",   	   zplot,         "plot x y with size scaled by z"},
+}; 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/Makefile	(revision 15879)
@@ -0,0 +1,61 @@
+default: libdata
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+SDIR    =       $(HOME)/lib.data
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+FULL_CFLAGS   = $(BASE_CFLAGS) -fPIC
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(BASE_LDFLAGS)
+
+# general numerical functions (libdata) #####################
+srcs = \
+$(SDIR)/book.$(ARCH).o                  \
+$(SDIR)/page.$(ARCH).o                  \
+$(SDIR)/sort.$(ARCH).o                  \
+$(SDIR)/fft.$(ARCH).o			\
+$(SDIR)/svdcmp.$(ARCH).o		\
+$(SDIR)/convert.$(ARCH).o		\
+$(SDIR)/bracket.$(ARCH).o		\
+$(SDIR)/spline.$(ARCH).o		\
+$(SDIR)/mrqmin.$(ARCH).o		\
+$(SDIR)/mrq2dmin.$(ARCH).o		\
+$(SDIR)/precess.$(ARCH).o		\
+$(SDIR)/starfuncs.$(ARCH).o		\
+$(SDIR)/gaussian.$(ARCH).o		\
+$(SDIR)/graphtools.$(ARCH).o            \
+$(SDIR)/queues.$(ARCH).o		\
+$(SDIR)/PlotVectors.$(ARCH).o		\
+$(SDIR)/open_kapa.$(ARCH).o             \
+$(SDIR)/style_args.$(ARCH).o
+
+#$(SDIR)/open_graph.$(ARCH).o            \
+#$(SDIR)/open_image.$(ARCH).o            \
+
+# dependancy rules for include files ########################
+incs = \
+$(INC)/opihi.h \
+$(INC)/external.h \
+$(INC)/shell.h \
+$(INC)/dvomath.h \
+$(INC)/convert.h \
+$(INC)/display.h 
+
+$(srcs): $(incs)
+
+$(LIB)/libdata.$(ARCH).a: $(srcs)
+$(LIB)/libdata.$(ARCH).$(DLLTYPE): $(srcs)
+
+$(DESTLIB)/libdata.a: $(LIB)/libdata.$(ARCH).a
+$(DESTLIB)/libdata.$(DLLTYPE): $(LIB)/libdata.$(ARCH).$(DLLTYPE)
+
+libdata: $(DESTLIB)/libdata.a $(DESTLIB)/libdata.$(DLLTYPE)
+
+uninstall:
+	rm -f $(DESTLIB)/libdata.a
+	rm -f $(DESTLIB)/libdata.$(DLLTYPE)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/PlotVectors.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/PlotVectors.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/PlotVectors.c	(revision 15879)
@@ -0,0 +1,20 @@
+# include "display.h"
+
+int PlotVectorPair (int kapa, int Npts, float *xValues, float *yValues, Graphdata *graphmode) {
+
+  KapaPrepPlot (kapa, Npts, graphmode);
+  KapaPlotVector (kapa, Npts, xValues, "x");
+  KapaPlotVector (kapa, Npts, yValues, "y");
+
+  return (TRUE);
+}
+
+int PlotVectorTriplet (int kapa, int Npts, float *xValues, float *yValues, float *zValues, Graphdata *graphmode) {
+
+  KapaPrepPlot   (kapa, Npts, graphmode);
+  KapaPlotVector (kapa, Npts, xValues, "x");
+  KapaPlotVector (kapa, Npts, yValues, "y");
+  KapaPlotVector (kapa, Npts, zValues, "z");
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/book.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/book.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/book.c	(revision 15879)
@@ -0,0 +1,116 @@
+# include "data.h"
+
+Book **books;   /* book to store the list of all books */
+int    Nbooks;   /* number of currently defined books */
+int    NBOOKS;   /* number of currently allocated books */
+
+void InitBooks () {
+  Nbooks = 0;
+  NBOOKS = 16;
+  ALLOCATE (books, Book *, NBOOKS); 
+}
+
+void InitBook (Book *book, char *name) {
+
+    book[0].name = strcreate (name);
+
+    book[0].Npages = 0;
+    book[0].NPAGES = 16;
+    ALLOCATE (book[0].pages, Page *, book[0].NPAGES);
+    ALLOCATE (book[0].pageIDs, char *, book[0].NPAGES);
+    ALLOCATE (book[0].index, int, book[0].NPAGES);
+}
+
+void FreeBook (Book *book) {
+
+    int i;
+
+    free (book[0].name);
+    for (i = 0; i < book[0].Npages; i++) {
+	FreePage (book[0].pages[i]);
+	free (book[0].pageIDs[i]);
+    }
+    free (book[0].pages);
+    free (book[0].pageIDs);
+    free (book[0].index);
+}
+
+/* return the given book */
+Book *GetBook (int where) {
+
+  if (where < 0) where += Nbooks;
+  if (where < 0) return NULL;
+  if (where >= Nbooks) return NULL;
+  return (books[where]);
+}
+
+/* return the given book */
+Book *FindBook (char *name) {
+
+  int i;
+
+  for (i = 0; i < Nbooks; i++) {
+    if (!strcmp (books[i][0].name, name)) {
+      return (books[i]);
+    }
+  }
+  return (NULL);
+}
+
+/* make a new named book */
+Book *CreateBook (char *name) {
+
+  int N;
+  Book *book;
+
+  book = FindBook (name);
+  if (book != NULL) return (book);
+
+  N = Nbooks;
+  Nbooks ++;
+  CHECK_REALLOCATE (books, Book *, NBOOKS, Nbooks, 16);
+  ALLOCATE (book, Book, 1);
+  InitBook (book, name);
+  books[N] = book;
+  return (book);
+}
+
+/* delete a book */
+int DeleteBook (Book *book) {
+
+  int i, N, NBOOKS_2;
+
+  /* find book in book list */
+  N = -1;
+  for (i = 0; i < Nbooks; i++) {
+    if (books[i] == book) {
+      N = i;
+      break;
+    }
+  }
+  if (N == -1) return (FALSE);
+
+  for (i = N; i < Nbooks - 1; i++) {
+    books[i] = books[i + 1];
+  }
+  Nbooks --;
+  NBOOKS_2 = MAX (16, NBOOKS / 2);
+  if (Nbooks < NBOOKS_2) {
+    NBOOKS = NBOOKS_2;
+    REALLOCATE (books, Book *, NBOOKS);
+  }
+
+  FreeBook (book);
+  return (TRUE);
+}
+
+/* list known books */
+void ListBooks () {
+
+  int i;
+
+  for (i = 0; i < Nbooks; i++) {
+    gprint (GP_ERR, "%-15s %3d\n", books[i][0].name, books[i][0].Npages);
+  }
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/bracket.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/bracket.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/bracket.c	(revision 15879)
@@ -0,0 +1,65 @@
+# include "data.h"
+
+/* fast operation to find an entry just below (0) or above (1) value */
+/* input list must be sorted */
+int bracket (double *list, int Nlist, int mode, double value) {
+
+  int Nlo, Nhi, N;
+
+  if (mode == 0) {
+    Nlo = 0; Nhi = Nlist;
+    while (Nhi - Nlo > 10) {
+      N = 0.5*(Nlo + Nhi);
+      if (list[N] < value) {
+	Nlo = N;
+      } else {
+	Nhi = N + 1;
+      }
+    }
+    return (Nlo);
+  }
+  if (mode == 1) {
+    Nlo = 0; Nhi = Nlist;
+    while (Nhi - Nlo > 10) {
+      N = 0.5*(Nlo + Nhi);
+      if (list[N] > value) {
+	Nhi = N;
+      } else {
+	Nlo = N - 1;
+      }
+    }
+    return (Nhi);
+  }
+  return (0);
+}
+
+int ibracket (int *list, int Nlist, int mode, double value) {
+
+  int Nlo, Nhi, N;
+
+  if (mode == 0) {
+    Nlo = 0; Nhi = Nlist;
+    while (Nhi - Nlo > 10) {
+      N = 0.5*(Nlo + Nhi);
+      if (list[N] < value) {
+	Nlo = N;
+      } else {
+	Nhi = N + 1;
+      }
+    }
+    return (Nlo);
+  }
+  if (mode == 1) {
+    Nlo = 0; Nhi = Nlist;
+    while (Nhi - Nlo > 10) {
+      N = 0.5*(Nlo + Nhi);
+      if (list[N] > value) {
+	Nhi = N;
+      } else {
+	Nlo = N - 1;
+      }
+    }
+    return (Nhi);
+  }
+  return (0);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/convert.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/convert.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/convert.c	(revision 15879)
@@ -0,0 +1,295 @@
+# include "convert.h"
+# define _XOPEN_SOURCE /* glibc2 (strptime) needs this */
+# include <time.h>
+
+/** additional time / coordinate conversions not supplied by libohana **/
+
+int hh_hms (double hh, int *hr, int *mn, double *sc) {
+
+  int flag;
+
+  flag = SIGN(hh);
+  hh *= flag;
+  hh = 24.0*(hh/24.0 - (int)(hh/24.0));
+  *sc = 60.0*(60.0*hh - (int)(60.0*hh));
+  *mn = 60.0*(hh - (int)hh);
+  *hr = (int) hh;
+  *hr *= flag;
+  return (TRUE);
+}
+ 
+int dd_dms (double dd, int *dg, int *mn, double *sc) {
+
+  int flag;
+
+  flag = SIGN(dd);
+  dd = fabs (dd);
+  *dg = (int) dd;
+  *mn = (int) 60*(dd - *dg);
+  *sc = 3600.0*(dd - *dg - *mn/60.0);
+  if (*sc > 59.99) {
+    *sc = 0;
+    *mn += 1.0;
+  }
+  *dg *= flag;
+  return (TRUE);
+}
+ 
+int hms_format (char *line, double value) {
+
+  int hr, mn;
+  double sc;
+
+  hh_hms (value, &hr, &mn, &sc);
+  hr = (int) value;
+  if (isnan (value))
+    sprintf (line, "xx:xx:xx.xx");
+  else {
+    if (value < 0) {
+      sprintf (line, "-%02d:%02d:%05.2f", abs(hr), mn, sc);
+    } else {
+      sprintf (line, "%02d:%02d:%05.2f", hr, mn, sc);
+    }
+  }      
+  return (TRUE);
+}
+
+int dms_format (char *line, double value) {
+
+  int dg, mn;
+  double sc;
+
+  dd_dms (value, &dg, &mn, &sc);
+  if (value < 0) {
+    sprintf (line, "-%02d:%02d:%05.2f", abs(dg), mn, sc);
+  } else {
+    sprintf (line, "%02d:%02d:%05.2f", dg, mn, sc);
+  }
+  return (TRUE);
+}
+
+/***** convert 00:00:00 or 00:00 to 0 - 86400 ****/
+int hms_to_sec (char *string, time_t *second) {
+  
+  char *p;
+  struct tm time;
+
+  p = strptime (string, "%H:%M:%S", &time);
+  if (p != NULL) goto valid;
+
+  p = strptime (string, "%H:%M", &time);
+  if (p != NULL) goto valid;
+
+  return (FALSE);
+    
+valid:
+  if (*p) return (FALSE);
+  *second = time.tm_hour*3600 + time.tm_min*60 + time.tm_sec;
+  return (TRUE);
+}
+
+/***** convert Mon[@00:00:00] or 00:00 to 0 - 86400*7 ****/
+int day_to_sec (char *string, time_t *second) {
+  
+  char *p;
+  struct tm time;
+
+  bzero (&time, sizeof(time));
+  p = strptime (string, "%A@%H:%M:%S", &time);
+  if (p != NULL) goto valid;
+
+  p = strptime (string, "%A@%H:%M", &time);
+  if (p != NULL) goto valid;
+
+  p = strptime (string, "%A@%H", &time);
+  if (p != NULL) goto valid;
+
+  p = strptime (string, "%A", &time);
+  if (p != NULL) goto valid;
+
+  return (FALSE);
+
+valid:
+  if (*p) return (FALSE);
+  *second = time.tm_wday*86400 + time.tm_hour*3600 + time.tm_min*60 + time.tm_sec;
+  return (TRUE);
+}
+
+/***** convert seconds to HH:MM:SS ****/
+char *ohana_sec_to_hms (time_t second) {
+  
+  struct tm *gmt;
+  char *line;
+
+  ALLOCATE (line, char, 64);
+  gmt   = gmtime (&second);
+  sprintf (line, "%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec); 
+  return (line);
+}
+
+/***** convert seconds to Day@HH:MM:SS ****/
+char *ohana_sec_to_day (time_t second) {
+  
+  struct tm *gmt;
+  char *line;
+
+  ALLOCATE (line, char, 64);
+  gmt   = gmtime (&second);
+  switch (gmt[0].tm_wday) {
+    case 0:
+      sprintf (line, "Sun@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec); 
+      break;
+    case 1:
+      sprintf (line, "Mon@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec); 
+      break;
+    case 2:
+      sprintf (line, "Tue@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec); 
+      break;
+    case 3:
+      sprintf (line, "Wed@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec); 
+      break;
+    case 4:
+      sprintf (line, "Thu@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec); 
+      break;
+    case 5:
+      sprintf (line, "Fri@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec); 
+      break;
+    case 6:
+      sprintf (line, "Sat@%02d:%02d:%02d", gmt[0].tm_hour, gmt[0].tm_min, gmt[0].tm_sec); 
+      break;
+  }
+  return (line);
+}
+
+int hh_hm (double hh, int *hr, double *mn) {
+
+  int flag;
+
+  flag = SIGN(hh);
+  hh = fabs (hh);
+
+  *mn = 60.0*(hh - (int)hh);
+  *hr = (int) hh;
+  *hr *= flag;
+  return (TRUE);
+}
+
+char *meade_deg_to_str (double deg) {
+
+  int hr;
+  double mn;
+  char *line;
+
+  ALLOCATE (line, char, 16);
+
+  hh_hm (deg, &hr, &mn);
+
+  sprintf (line, "%03d:%04.1f", abs(hr), mn);
+  return (line);
+}
+
+char *meade_ra_to_str (double deg) {
+
+  int hr;
+  double mn;
+  char *line;
+
+  ALLOCATE (line, char, 16);
+
+  hh_hm (deg/15.0, &hr, &mn);
+
+  sprintf (line, "%02d:%04.1f", abs(hr), mn);
+  return (line);
+}
+
+char *meade_dec_to_str (double deg) {
+
+  int hr;
+  double mn;
+  char *line;
+
+  ALLOCATE (line, char, 16);
+
+  hh_hm (deg, &hr, &mn);
+
+  if (deg < 0) {
+    sprintf (line, "-%02d:%04.1f", abs(hr), mn);
+  } else {
+    sprintf (line, "+%02d:%04.1f", hr, mn);
+  }      
+  return (line);
+}
+
+/* convert UNIX time to a value referenced to the TimeReference in the given unit */
+double TimeValue (time_t time, time_t TimeReference, int TimeFormat) {
+
+  double value, dt;
+
+  dt = (time > TimeReference) ? (time - TimeReference) : -1 * (double)(TimeReference - time);
+  switch (TimeFormat) {
+  case TIME_JD:
+    value = time / 86400.0 + 2440587.5;
+    break;
+  case TIME_MJD:
+    value = time / 86400.0 + 40587.0;
+    break;
+  case TIME_DAYS:
+    value = dt / 86400.0;
+    break;
+  case TIME_HOURS:
+    value = dt / 3600.0;
+    break;
+  case TIME_MINUTES:
+    value = dt / 60.0;
+    break;
+  case TIME_SECONDS:
+  default:
+    value = dt;
+    break;
+  }
+  return (value);
+}
+  
+/* convert time value referenced to the TimeReference in the given unit to UNIX time */
+time_t TimeRef (double value, time_t TimeReference, int TimeFormat) {
+
+  int dt;
+  time_t time;
+
+  switch (TimeFormat) {
+  case TIME_JD:
+    time = (value -  2440587.5) * 86400.0;
+    return (time);
+    break;
+  case TIME_MJD:
+    time = (value -  40587.0) * 86400.0;
+    return (time);
+    break;
+  case TIME_DAYS:
+    dt = value * 86400.0;
+    break;
+  case TIME_HOURS:
+    dt = value * 3600.0;
+    break;
+  case TIME_MINUTES:
+    dt = value * 60.0;
+    break;
+  case TIME_SECONDS:
+  default:
+    dt = value;
+    break;
+  }
+
+  time = TimeReference + dt;
+  return (time);
+}
+
+/* times may be in forms as:
+ * 20040200450s (N seconds since 1970.0)
+ * 2440900.232j (julian date)
+ * 99/02/23,03:22:18 (date string)
+ * (separators may be anything except space, +, -)
+ * 99:02:15:12:23:30
+ * 99:02:15:12h23m30s
+ */
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/fft.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/fft.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/fft.c	(revision 15879)
@@ -0,0 +1,270 @@
+# include "data.h"
+
+#define FSWAP(a,b) tempr=(a);(a)=(b);(b)=tempr
+
+void fft (float *Data, int N, int isign) {
+
+  int n,mmax,m,j,istep,i;
+  double wtemp,wr,wpr,wpi,wi,theta;
+  float tempr,tempi, *data;
+
+  data = Data;
+  n = N << 1;
+  j = 0;
+
+  for (i = 0; i < n; i+=2) {
+    if (j > i) {
+      FSWAP (data[j], data[i]);
+      FSWAP (data[j+1], data[i+1]);
+    }
+    m = n >> 1;
+    while (m >= 2 && j >= m) {
+      j -= m;
+      m >>= 1;
+    }
+    j += m;
+  }
+  mmax = 2;
+  while (n > mmax) {
+    istep = 2*mmax;
+    theta = 6.28318530717959 / (isign*mmax);
+    wtemp = sin(0.5*theta);
+    wpr = -2.0*wtemp*wtemp;
+    wpi = sin(theta);
+    wr = 1.0;
+    wi = 0.0;
+    for (m = 0; m < mmax; m+=2) {
+      for (i = m; i < n; i+=istep) {
+	j = i + mmax;
+	tempr = wr*data[j] - wi*data[j+1];
+	tempi = wr*data[j+1] + wi*data[j];
+	data[j] = data[i] - tempr;
+	data[j+1] = data[i+1] - tempi;
+	data[i] += tempr;
+	data[i+1] += tempi;
+      }
+      wr = (wtemp = wr)*wpr - wi*wpi+wr;
+      wi = wi*wpr + wtemp*wpi + wi;
+    }
+    mmax = istep;
+  }
+}
+
+void fftold (float *Data, int N, int isign) {
+
+  int n,mmax,m,j,istep,i;
+  double wtemp,wr,wpr,wpi,wi,theta;
+  float tempr,tempi, *data;
+
+  data = Data - 1;
+  n = N << 1;
+  j = 1;
+
+  for (i = 1; i < n; i+=2) {
+    if (j > i) {
+      FSWAP (data[j], data[i]);
+      FSWAP (data[j+1], data[i+1]);
+    }
+    m = n >> 1;
+    while (m >= 2 && j > m) {
+      j -= m;
+      m >>= 1;
+    }
+    j += m;
+  }
+  mmax = 2;
+  while (n > mmax) {
+    istep = 2*mmax;
+    theta = 6.28318530717959 / (isign*mmax);
+    wtemp = sin(0.5*theta);
+    wpr = -2.0*wtemp*wtemp;
+    wpi = sin(theta);
+    wr = 1.0;
+    wi = 0.0;
+    for (m = 1; m < mmax; m+=2) {
+      for (i = m; i <= n; i+=istep) {
+	j = i + mmax;
+	tempr = wr*data[j] - wi*data[j+1];
+	tempi = wr*data[j+1] + wi*data[j];
+	data[j] = data[i] - tempr;
+	data[j+1] = data[i+1] - tempi;
+	data[i] += tempr;
+	data[i+1] += tempi;
+      }
+      wr = (wtemp = wr)*wpr - wi*wpi+wr;
+      wi = wi*wpr + wtemp*wpi + wi;
+    }
+    mmax = istep;
+  }
+}
+
+/* convert indices to zero reference */
+void fftN (float *data, int *nn, int ndim, int isign) {
+
+  int i1,i2,i3,i2rev,i3rev,ip1,ip2,ip3,ifp1,ifp2;
+  int ibit,idim,k1,k2,n,nprev,nrem,ntot;
+  float tempi,tempr;
+  double theta,wi,wpi,wpr,wr,wtemp;
+
+  ntot = 1;
+  for (idim = 0; idim < ndim; idim++) ntot *= nn[idim];
+
+  nprev = 1;
+  for (idim = ndim - 1; idim >= 0; idim--) {
+    n  =  nn[idim];
+    nrem = ntot / (n*nprev);
+    ip1 = nprev << 1;
+    ip2 = ip1*n;
+    ip3 = ip2*nrem;
+    i2rev = 0;
+    for (i2 = 0; i2 < ip2; i2+=ip1) {
+      if (i2 < i2rev) {
+	for (i1 = i2; i1 <= i2+ip1-2; i1+=2) {
+	  for (i3 = i1; i3 < ip3; i3+=ip2) {	
+	    i3rev = i2rev+i3-i2;
+	    FSWAP(data[i3],data[i3rev]);
+	    FSWAP(data[i3+1],data[i3rev+1]);
+	  }
+	}
+      }
+      ibit = ip2 >> 1;
+      while (ibit >= ip1 && i2rev >= ibit) {
+	i2rev -= ibit;
+	ibit >>= 1;
+      }
+      i2rev += ibit;
+    }
+    ifp1 = ip1;
+    while (ifp1 < ip2) {
+      ifp2 = ifp1 << 1;
+      theta = isign*6.28318530717959/(ifp2/ip1);
+      wtemp = sin(0.5*theta);
+      wpr = -2.0*wtemp*wtemp;
+      wpi = sin(theta);
+      wr = 1.0;
+      wi = 0.0;
+      for (i3 = 0; i3 < ifp1; i3+=ip1) {
+	for (i1 = i3; i1 <= i3+ip1-2; i1+=2) {
+	  for (i2 = i1; i2 < ip3; i2+=ifp2) {
+	    k1 = i2;
+	    k2 = k1+ifp1;
+	    tempr = wr*data[k2]-wi*data[k2+1];
+	    tempi = wr*data[k2+1]+wi*data[k2];
+	    data[k2] = data[k1]-tempr;
+	    data[k2+1] = data[k1+1]-tempi;
+	    data[k1] += tempr;
+	    data[k1+1] += tempi;
+	  }
+	}
+	wr = (wtemp = wr)*wpr-wi*wpi+wr;
+	wi = wi*wpr+wtemp*wpi+wi;
+      }
+      ifp1 = ifp2;
+    }
+    nprev *= n;
+  }
+}
+
+#undef FSWAP
+
+/* based on the PRESS routine, this fft takes an array from data[0] to data[2N-1] */
+/* this function takes Data = h(t) and replaces it in situ with H(F) or vice versa.
+   There are assumed to be 2*N input values with 
+   Data[0,2,4,...] the real and Data[1,3,5,...] the imaginary ones.
+   the output is ordered the same.  
+
+   for h(t), values are in time sequence order.
+   for H(F), values are in order F = 0, 1/N, ... 1/2 - 1/N, +/- 1/2, -1/2 + 1/N, ... -1/N 
+
+   no normalization is performed, so a signal of amplitude A sin (w_k * t) will be 
+      give an H(F) value of 0.5 * A * N, and the DC term will have H(0) = A * N.
+
+*/ 
+
+int IsBinary (int N) {
+
+  int i, nbit;
+
+  /* check if number is a binary number */
+  nbit = 0;
+  for (i = 0; i < 8*sizeof(N); i++) {
+    nbit += (N & 0x01);
+    N = (N >> 1);
+  }
+  if (nbit == 1) { 
+    return (1); 
+  } else { 
+    return (0); 
+  }
+
+}  
+
+#define FSWAP(a,b) tempr=(a);(a)=(b);(b)=tempr
+
+void fourn (float *data, int *nn, int ndim, int isign) {
+
+  int i1,i2,i3,i2rev,i3rev,ip1,ip2,ip3,ifp1,ifp2;
+  int ibit,idim,k1,k2,n,nprev,nrem,ntot;
+  float tempi,tempr;
+  double theta,wi,wpi,wpr,wr,wtemp;
+
+  ntot = 1;
+  for (idim = 1; idim <= ndim; idim++)
+    ntot *= nn[idim];
+  nprev = 1;
+  for (idim = ndim; idim >= 1; idim--) {
+    n = nn[idim];
+    nrem = ntot/(n*nprev);
+    ip1 = nprev << 1;
+    ip2 = ip1*n;
+    ip3 = ip2*nrem;
+    i2rev = 1;
+    for (i2 = 1; i2 <= ip2; i2+=ip1) {
+      if (i2 < i2rev) {
+	for (i1 = i2; i1 <= i2+ip1-2; i1+=2) {
+	  for (i3 = i1; i3 <= ip3;i3+=ip2) {
+	    i3rev = i2rev+i3-i2;
+	    FSWAP(data[i3],data[i3rev]);
+	    FSWAP(data[i3+1],data[i3rev+1]);
+	  }
+	}
+      }
+      ibit = ip2 >> 1;
+      while (ibit >= ip1 && i2rev > ibit) {
+	i2rev -=  ibit;
+	ibit >>= 1;
+      }
+      i2rev += ibit;
+    }
+    ifp1 = ip1;
+    while (ifp1 < ip2) {
+      ifp2 = ifp1 << 1;
+      theta = isign*6.28318530717959/(ifp2/ip1);
+      wtemp = sin(0.5*theta);
+      wpr  =  -2.0*wtemp*wtemp;
+      wpi = sin(theta);
+      wr = 1.0;
+      wi = 0.0;
+      for (i3 = 1;i3<=ifp1;i3+=ip1) {
+	for (i1 = i3;i1<=i3+ip1-2;i1+=2) {
+	  for (i2 = i1;i2<=ip3;i2+=ifp2) {
+	    k1 = i2;
+	    k2 = k1+ifp1;
+	    tempr = wr*data[k2]-wi*data[k2+1];
+	    tempi = wr*data[k2+1]+wi*data[k2];
+	    data[k2] = data[k1]-tempr;
+	    data[k2+1] = data[k1+1]-tempi;
+	    data[k1] += tempr;
+	    data[k1+1] += tempi;
+	  }
+	}
+	wr = (wtemp = wr)*wpr-wi*wpi+wr;
+	wi = wi*wpr+wtemp*wpi+wi;
+      }
+      ifp1 = ifp2;
+    }
+    nprev *= n;
+  }
+}
+
+#undef FSWAP
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/gaussian.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/gaussian.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/gaussian.c	(revision 15879)
@@ -0,0 +1,75 @@
+# include "data.h"
+
+static int Ngaussint = 0;
+static double *gaussint;
+
+extern double drand48();
+
+double gaussian (double x, double mean, double sigma) {
+
+  double f;
+
+  f = exp (-0.5 * SQ(x - mean) / SQ(sigma)) / sqrt(2 * M_PI * SQ(sigma));
+
+  return (f);
+
+}
+
+/* integrate a gaussian from -5 sigma to +5 sigma */
+void gauss_init (int Nbin) {
+ 
+  int i;
+  long A, B;
+  double val, x, dx, dx1, dx2, dx3, df;
+  double mean, sigma;
+ 
+  /* no need to generate this if it already exists */
+  if (Ngaussint == Nbin) return;
+
+  A = time(NULL);
+  for (B = 0; A == time(NULL); B++);
+  srand48(B);
+ 
+  Ngaussint = Nbin;
+  ALLOCATE (gaussint, double, Ngaussint + 1);
+
+  val = 0;
+  dx = 1.0 / Ngaussint;
+  dx1 = dx / 3.0;
+  dx2 = 2.0*dx/3.0;
+  dx3 = dx;
+  mean = 0.0;
+  sigma = 1.0;
+ 
+  for (i = 0, x = -7.0; (i < Ngaussint) && (x < 7.0); x += dx)  {
+    df = (3.0*gaussian(x    , mean, sigma) + 
+          9.0*gaussian(x+dx1, mean, sigma) +
+          9.0*gaussian(x+dx2, mean, sigma) + 
+          3.0*gaussian(x+dx3, mean, sigma)) * (dx1/8.0);
+    val += df;
+    if (val > (i + 0.5) / (double) Ngaussint) {
+      gaussint[i] = x + dx / 2.0;
+      i++;
+    }
+  }
+}
+
+double rnd_gauss (double mean, double sigma) {
+ 
+  int i;
+  double y;
+ 
+  y = drand48();
+  i = Ngaussint*y;
+  y = gaussint[i]*sigma + mean;
+ 
+  return (y);
+ 
+}
+ 
+double int_gauss (int i) {
+  double y;
+  y = gaussint[i];
+  return (y);
+}
+ 
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/graphtools.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/graphtools.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/graphtools.c	(revision 15879)
@@ -0,0 +1,81 @@
+# include "data.h"
+
+void SetLimits (Vector *xvec, Vector *yvec, Graphdata *graphmode) {
+
+  double maxX, minX, maxY, minY, range;
+  int i;
+
+  if (xvec != NULL) {
+    maxX = minX = xvec[0].elements[0];
+    for (i = 1; i < xvec[0].Nelements; i++) {
+      if (!finite(xvec[0].elements[i])) continue;
+      maxX = MAX (maxX, xvec[0].elements[i]);
+      minX = MIN (minX, xvec[0].elements[i]);
+    }
+    range = maxX - minX;
+    if (range == 0) range = 0.001 * maxX;
+    if (range == 0) range = 0.001;
+    graphmode[0].xmin = minX - 0.05*range;
+    graphmode[0].xmax = maxX + 0.05*range;
+  }
+
+  if (yvec != NULL) {
+    maxY = minY = yvec[0].elements[0];
+    for (i = 1; i < yvec[0].Nelements; i++) {
+      if (!finite(yvec[0].elements[i])) continue;
+      maxY = MAX (maxY, yvec[0].elements[i]);
+      minY = MIN (minY, yvec[0].elements[i]);
+    }
+    range = maxY - minY;
+    if (range == 0) range = 0.0011 * maxY;
+    if (range == 0) range = 0.0011;
+    graphmode[0].ymin = minY - 0.05*range;
+    graphmode[0].ymax = maxY + 0.05*range;
+  }
+  SetGraph (graphmode);
+
+  set_variable ("XMIN", graphmode[0].xmin);
+  set_variable ("XMAX", graphmode[0].xmax);
+  set_variable ("YMIN", graphmode[0].ymin);
+  set_variable ("YMAX", graphmode[0].ymax);
+}
+
+void SetLimitsRaw (float *xvec, float *yvec, int Nelements, Graphdata *graphmode) {
+
+  double maxX, minX, maxY, minY, range;
+  int i;
+
+  if (xvec != NULL) {
+    maxX = minX = xvec[0];
+    for (i = 1; i < Nelements; i++) {
+      if (!finite(xvec[i])) continue;
+      maxX = MAX (maxX, xvec[i]);
+      minX = MIN (minX, xvec[i]);
+    }
+    range = maxX - minX;
+    if (range == 0) range = 0.001 * maxX;
+    if (range == 0) range = 0.001;
+    graphmode[0].xmin = minX - 0.05*range;
+    graphmode[0].xmax = maxX + 0.05*range;
+  }
+
+  if (yvec != NULL) {
+    maxY = minY = yvec[0];
+    for (i = 1; i < Nelements; i++) {
+      if (!finite(yvec[i])) continue;
+      maxY = MAX (maxY, yvec[i]);
+      minY = MIN (minY, yvec[i]);
+    }
+    range = maxY - minY;
+    if (range == 0) range = 0.0011 * maxY;
+    if (range == 0) range = 0.0011;
+    graphmode[0].ymin = minY - 0.05*range;
+    graphmode[0].ymax = maxY + 0.05*range;
+  }
+  SetGraph (graphmode);
+
+  set_variable ("XMIN", graphmode[0].xmin);
+  set_variable ("XMAX", graphmode[0].xmax);
+  set_variable ("YMIN", graphmode[0].ymin);
+  set_variable ("YMAX", graphmode[0].ymax);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/hashes.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/hashes.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/hashes.c	(revision 15879)
@@ -0,0 +1,49 @@
+
+/* I need a structure which will be appropriate to carry the psMetadataConfig data.  the main 
+   requirements are:
+
+   - name-based components
+   - string-indexing on columns
+
+   basic elements:
+
+   container->item->element->value
+
+   element: name, value (type?)
+   item->name, Nelement, elements
+   container->items, Nitems
+
+   user interactions
+
+   blob list
+   blob listitems (blob)
+   blob create (blob)
+   blob delete (blob)
+   blob listkeys (blob.item)
+
+   blob getvalue (blob.item.key) -var word
+   blob setvalue (blob.item.key) value
+
+   blob getitem (blob.item)  : list all key/value pairs
+   blob newitem (blob.item)
+   blob delitem (blob.item)
+   blob popitem (blob)
+
+   blob readqueue (queue)    : convert queue in MDC format to blob
+   *** this needs to be able to match by keys against existing items
+   
+   need equivalents to:
+   queuepush -uniq key
+   queuepop -
+   queuesize
+   
+
+   items should be sorted by name so we can lookup an item quickly
+
+
+
+   other related opihi data concepts
+   
+   $a = @function (output of function set to value?)
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/mrq2dmin.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/mrq2dmin.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/mrq2dmin.c	(revision 15879)
@@ -0,0 +1,210 @@
+# include "data.h"  /* only needed for the ALLOCATE def */
+
+/* need to pass in a function of the form:
+   funcs (x, t, a, Npar, dy/da) 
+   returns y (x,t) for Npar parameters a along with dy/da at (x,t)
+   dy carries 1/sig^2 
+*/
+
+# define VERY_VERBOSE 0
+
+static float **alpha, **talpha;
+static float **beta, **tbeta;
+static float *partry, *dyda;
+static float ochisq, lambda;
+
+static float *parmin = NULL;
+static float *parmax = NULL;
+
+float mrq2dcof (float *x, float *t, float *y, float *dy, int Npts, 
+	      float *par, int Npar, float **ta, float **tb, 
+	      float (funcs)(float, float, float *, int, float *)) {
+
+  int k, j, i;
+  float ydiff, wt, chisq;
+
+  for (j = 0; j < Npar; j++) {
+    for (k = 0; k <= j; k++) ta[j][k] = 0.0;
+    tb[j][0] = 0.0;
+  }
+
+  chisq = 0.0;
+  for (i = 0; i < Npts; i++) {
+
+    ydiff = funcs (x[i], t[i], par, Npar, dyda) - y[i];
+    chisq += SQ(ydiff) * dy[i];
+    
+    for (j = 0; j < Npar; j++) {
+      wt = dyda[j] * dy[i];
+      for (k = 0; k <= j; k++) ta[j][k] += wt * dyda[k];
+      tb[j][0] += wt * ydiff;
+    }
+  }
+
+  for (j = 1; j < Npar; j++)
+    for (k = 0; k < j; k++)
+      ta[k][j] = ta[j][k];
+      
+# if (VERY_VERBOSE)
+  for (j = 0; j < Npar; j++) {
+    for (k = 0; k < Npar; k++) {
+      gprint (GP_ERR, "%9.3e  ", ta[j][k]);
+    }
+    gprint (GP_ERR, "    :   %9.3e  ", tb[j][0]);
+    gprint (GP_ERR, "\n");
+  }
+# endif
+
+  return (chisq);
+
+}
+
+float mrq2dchi (float *x, float *t, float *y, float *dy, int Npts, 
+		float *par, int Npar, 
+		float (funcs)(float, float, float *, int, float *)) {
+
+  int i;
+  float ydiff, chisq;
+
+  chisq = 0.0;
+  for (i = 0; i < Npts; i++) {
+    ydiff = funcs (x[i], t[i], par, Npar, dyda) - y[i];
+    chisq += SQ(ydiff) * dy[i];
+  }
+  return (chisq);
+}
+
+float mrq2dmin (float *x, float *t, float *y, float *dy, int Npts, 
+	      float *par, int Npar, 
+	      float (funcs)(float, float, float *, int, float *), int VERBOSE) {
+
+  int j, k;
+  float chisq;
+
+  /* set up test matrixes for this run */
+  for (j = 0; j < Npar; j++) {
+    for (k = 0; k < Npar; k++) talpha[j][k] = alpha[j][k];
+    talpha[j][j] = alpha[j][j] * (1.0 + lambda);
+    tbeta[j][0] = beta[j][0];
+  }
+
+  /* keep this test in here? */
+  if (!fgaussj (talpha, Npar, tbeta, 1)) {
+    lambda *= 10.0;
+    return (ochisq);
+  }
+
+  for (j = 0; j < Npar; j++) {
+    partry[j] = par[j] - tbeta[j][0];
+    /*
+    if (parmin != NULL) partry[j] = MAX (parmin[j], partry[j]);
+    if (parmax != NULL) partry[j] = MIN (parmax[j], partry[j]);
+    */
+  }
+
+  chisq = mrq2dcof (x, t, y, dy, Npts, partry, Npar, talpha, tbeta, funcs);
+  if (VERBOSE) { 
+    gprint (GP_ERR, "chisq: %f  ", chisq);
+    gprint (GP_ERR, "lambda: %f  ", lambda);
+    for (j = 0; j < Npar; j++) {
+      gprint (GP_ERR, "%f ", partry[j]);
+    }
+    gprint (GP_ERR, "\n");
+  }
+
+  /* if good, save temp values */
+  if (chisq < ochisq) {
+    lambda *= 0.1;
+    ochisq = chisq;
+    for (j = 0; j < Npar; j++) {
+      for (k = 0; k < Npar; k++) alpha[j][k] = talpha[j][k];
+      beta[j][0] = tbeta[j][0];
+      par[j] = partry[j];
+    }
+  } else {
+    lambda *= 10.0;
+    chisq = ochisq;
+  }
+
+  return (chisq);
+
+}
+
+int mrq2dlimits (float *pmin, float *pmax, int Npar) {
+
+  int i;
+
+  ALLOCATE (parmin, float, Npar);
+  ALLOCATE (parmax, float, Npar);
+  for (i = 0; i < Npar; i++) {
+    parmin[i] = pmin[i];
+    parmax[i] = pmax[i];
+  }
+  return (TRUE);
+}
+
+float mrq2dinit (float *x, float *t, float *y, float *dy, int Npts, 
+	      float *par, int Npar, 
+	      float (funcs)(float, float, float *, int, float *), int VERBOSE) {
+
+  int i;
+
+  ALLOCATE (dyda, float, Npar);
+  ALLOCATE (partry, float, Npar);
+  ALLOCATE (alpha, float *, Npar);
+  ALLOCATE (beta, float *, Npar);
+  ALLOCATE (talpha, float *, Npar);
+  ALLOCATE (tbeta, float *, Npar);
+  for (i = 0; i < Npar; i++) {
+    ALLOCATE (alpha[i], float, Npar);
+    ALLOCATE (beta[i], float, Npar);
+    ALLOCATE (talpha[i], float, Npar);
+    ALLOCATE (tbeta[i], float, Npar);
+  }
+
+  
+  lambda = 0.001;
+  
+  ochisq = mrq2dcof (x, t, y, dy, Npts, par, Npar, alpha, beta, funcs);
+  if (VERBOSE) {
+    gprint (GP_ERR, "chisq: %f  ", ochisq);
+    gprint (GP_ERR, "lambda: %f  ", lambda);
+    for (i = 0; i < Npar; i++) {
+      gprint (GP_ERR, "%f ", par[i]);
+    }
+    gprint (GP_ERR, "\n");
+  }
+
+  return (ochisq);
+
+}
+
+/* don't invoke this in the middle of a run, only near the end */ 
+float **mrq2dcovar (int Npar) {
+
+  fgaussj (alpha, Npar, beta, 1);
+  return (alpha);
+
+} 
+
+void mrq2dfree (int Npar) {
+
+  int i;
+
+  for (i = 0; i < Npar; i++) {
+    free (alpha[i]);
+    free (talpha[i]);
+    free (beta[i]);
+    free (tbeta[i]);
+  }
+  free (alpha);
+  free (talpha);
+  free (beta);
+  free (tbeta);
+  free (partry);
+  free (dyda);
+
+  if (parmin != NULL) free (parmin);
+  if (parmax != NULL) free (parmax);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/mrqmin.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/mrqmin.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/mrqmin.c	(revision 15879)
@@ -0,0 +1,159 @@
+# include "data.h"  /* only needed for the ALLOCATE def */
+
+/* need to pass in a function of the form:
+   funcs (x, a, Npar, dyda) 
+   returns f (x) for Npar parameters a, also df/da at x 
+   dy carries 1/sig^2 
+*/
+
+static float **alpha, **talpha;
+static float **beta, **tbeta;
+static float *partry, *dyda;
+static float ochisq, lambda;
+
+float mrqcof (float *x, float *y, float *dy, int Npts, 
+	      float *par, int Npar, float **ta, float **tb, 
+	      float (funcs)(float, float *, int, float *)) {
+
+  int k, j, i;
+  float ydiff, wt, chisq;
+
+  for (j = 0; j < Npar; j++) {
+    for (k = 0; k <= j; k++) ta[j][k] = 0.0;
+    tb[j][0] = 0.0;
+  }
+
+  chisq = 0.0;
+  for (i = 0; i < Npts; i++) {
+
+    ydiff = funcs (x[i], par, Npar, dyda) - y[i];
+    chisq += SQ(ydiff) * dy[i];
+
+    for (j = 0; j < Npar; j++) {
+      wt = dyda[j] * dy[i];
+      for (k = 0; k <= j; k++) ta[j][k] += wt * dyda[k];
+      tb[j][0] += wt * ydiff;
+    }
+  }
+
+  for (j = 1; j < Npar; j++)
+    for (k = 0; k < j; k++) 
+      ta[k][j] = ta[j][k];
+
+  return (chisq);
+
+}
+
+float mrqmin (float *x, float *y, float *dy, int Npts, 
+	      float *par, int Npar, 
+	      float (funcs)(float, float *, int, float *), int VERBOSE) {
+
+  int j, k;
+  float chisq;
+  float rho, dX, dL;
+
+  /* set up test matrixes for this run */
+  for (j = 0; j < Npar; j++) {
+    for (k = 0; k < Npar; k++) talpha[j][k] = alpha[j][k];
+    talpha[j][j] = alpha[j][j] * (1.0 + lambda);
+    tbeta[j][0] = beta[j][0];
+  }
+
+  fgaussj (talpha, Npar, tbeta, 1);
+
+  for (j = 0; j < Npar; j++) partry[j] = par[j] - tbeta[j][0];
+
+  /* get linear model prediction */
+  dL = 0;
+  for (j = 0; j < Npar; j++) {
+      dL += 0.5*lambda*SQ(tbeta[j][0]) + tbeta[j][0]*beta[j][0];
+  }
+
+  chisq = mrqcof (x, y, dy, Npts, partry, Npar, talpha, tbeta, funcs);
+  if (VERBOSE) { 
+    gprint (GP_ERR, "chisq: %f  ", chisq);
+    gprint (GP_ERR, "lambda: %f  ", lambda);
+    for (j = 0; j < Npar; j++) {
+      gprint (GP_ERR, "%f ", partry[j]);
+    }
+    gprint (GP_ERR, "\n");
+  }
+
+  /* compare linear model with actual */
+  dX = ochisq - chisq;
+  rho = dX / dL;
+
+  /* if good, save temp values */
+  if (rho > 0) {
+    lambda *= 0.1;
+    ochisq = chisq;
+    for (j = 0; j < Npar; j++) {
+      for (k = 0; k < Npar; k++) alpha[j][k] = talpha[j][k];
+      beta[j][0] = tbeta[j][0];
+      par[j] = partry[j];
+    }
+  } else {
+    lambda *= 10.0;
+    chisq = ochisq;
+  }
+
+  return (chisq);
+
+}
+
+float mrqinit (float *x, float *y, float *dy, int Npts, 
+	      float *par, int Npar, 
+	      float (funcs)(float, float *, int, float *), int VERBOSE) {
+
+  int i;
+
+  ALLOCATE (dyda, float, Npar);
+  ALLOCATE (partry, float, Npar);
+  ALLOCATE (alpha, float *, Npar);
+  ALLOCATE (beta, float *, Npar);
+  ALLOCATE (talpha, float *, Npar);
+  ALLOCATE (tbeta, float *, Npar);
+  for (i = 0; i < Npar; i++) {
+    ALLOCATE (alpha[i], float, Npar);
+    ALLOCATE (beta[i], float, Npar);
+    ALLOCATE (talpha[i], float, Npar);
+    ALLOCATE (tbeta[i], float, Npar);
+  }
+  
+  lambda = 0.01;
+  
+  ochisq = mrqcof (x, y, dy, Npts, par, Npar, alpha, beta, funcs);
+  if (VERBOSE) {
+    gprint (GP_ERR, "chisq: %f  ", ochisq);
+    gprint (GP_ERR, "lambda: %f  ", lambda);
+    for (i = 0; i < Npar; i++) {
+      gprint (GP_ERR, "%f ", par[i]);
+    }
+    gprint (GP_ERR, "\n");
+  }
+  return (ochisq);
+}
+
+/* don't invoke this in the middle of a run, only near the end */ 
+float **mrqcovar (int Npar) {
+  fgaussj (alpha, Npar, beta, 1);
+  return (alpha);
+} 
+
+void mrqfree (int Npar) {
+
+  int i;
+
+  for (i = 0; i < Npar; i++) {
+    free (alpha[i]);
+    free (talpha[i]);
+    free (beta[i]);
+    free (tbeta[i]);
+  }
+  free (alpha);
+  free (talpha);
+  free (beta);
+  free (tbeta);
+  free (partry);
+  free (dyda);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/open_graph.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/open_graph.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/open_graph.c	(revision 15879)
@@ -0,0 +1,176 @@
+# include "display.h"
+# include "shell.h"
+# define DEBUG 0
+
+/* we have space for several kapa windows */
+# define NXGRAPH 5
+
+static int       Active;
+static int       Xgraph[NXGRAPH];  
+static Graphdata graphdata[NXGRAPH];
+
+void QuitGraph () {
+
+  int i;
+  
+  for (i = 0; i < NXGRAPH; i++) {
+    KiiClose (Xgraph[i]);
+  }
+}
+
+void InitGraph () {
+
+  int i;
+
+  Active = 0;
+  for (i = 0; i < NXGRAPH; i++) {
+    Xgraph[i] = -1;
+
+    graphdata[i].xmin = graphdata[i].ymin = 0.0;
+    graphdata[i].xmax = graphdata[i].ymax = 1.0;
+    graphdata[i].style = graphdata[i].ptype = 0;
+    graphdata[i].ltype = graphdata[i].color = 0;
+    graphdata[i].etype = graphdata[i].ebar = 0;
+    graphdata[i].lweight = graphdata[i].size = 1.0;
+    
+    graphdata[i].coords.pc1_1 = graphdata[i].coords.pc2_2 = 1.0;
+    graphdata[i].coords.pc1_2 = graphdata[i].coords.pc2_1 = 0.0;
+    strcpy (graphdata[i].coords.ctype, "RA---LIN");
+    graphdata[i].coords.crval1 = 0.0;
+    graphdata[i].coords.crval2 = 0.0;
+    graphdata[i].coords.crpix1 = 0.0;
+    graphdata[i].coords.crpix2 = 0.0;
+    graphdata[i].coords.cdelt1 = graphdata[i].coords.cdelt2 = 1.0;
+    graphdata[i].flipeast = TRUE;
+    graphdata[i].flipnorth = FALSE;
+    strcpy (graphdata[i].axis, "2222");
+    strcpy (graphdata[i].ticks, "2222");
+    strcpy (graphdata[i].labels, "2222");
+  }
+}
+
+/* set SIGPIPE to this function to close cleanly */ 
+void XGraphDead (int input) {
+  signal (SIGPIPE, XGraphDead);
+  gprint (GP_ERR, "kapa is dead, must restart\n");
+  Xgraph[Active] = -1;
+}
+
+/** start socketed connection */
+int open_graph (int N) {
+
+  int fd;
+  char *kapa_exec, name[16];
+  
+  kapa_exec = get_variable ("KAPA");
+  if (kapa_exec == (char *) NULL) {
+    gprint (GP_ERR, "variable KAPA not found\n");
+    return (FALSE);
+  }
+
+  snprintf (name, 16, "[%d]", N);
+  fd = KiiOpen (kapa_exec, name);
+  free (kapa_exec);
+
+  if (fd < 0) {
+    gprint (GP_ERR, "error starting kapa\n");
+    return (FALSE);
+  } 
+
+  Xgraph[N] = fd;
+  return (TRUE);
+}
+
+int close_graph (int N) {
+
+  if (N <  0) return (FALSE);
+  if (N >= NXGRAPH) return (FALSE);
+
+  KiiClose (Xgraph[N]); 
+  Xgraph[N] = -1;
+  return (TRUE);
+}
+
+/* return pointers for current Xgraph, set if desired, test, open if needed */
+int GetGraph (Graphdata *data, int *socket, int *N) {
+
+  int i, n;
+  char buffer[70];
+
+  SetImageDevice (FALSE);
+  if (N == (int *) NULL) {
+    n = Active;
+  } else {
+    if (*N >= NXGRAPH) {
+      gprint (GP_ERR, "invalid Xgraph window %d\n", *N); 
+      return (FALSE);
+    }
+    if (*N < 0) {
+      *N = n = Active;
+    } else {
+      Active = n = *N;
+    }
+  }
+  
+  /* test Xgraph[0], flush junk from pipe */
+  signal (SIGPIPE, XGraphDead);
+  fcntl (Xgraph[n], F_SETFL,  O_NONBLOCK); 
+  for (i = 0; (read (Xgraph[n], buffer, 64) > 0) && (i < 20); i++);
+  fcntl (Xgraph[n], F_SETFL, !O_NONBLOCK); 
+  
+  if (Xgraph[n] < 1) {
+    if (!open_graph(n)) {
+      return (FALSE);
+    }
+  }
+
+  if (data != (Graphdata *) NULL) *data  = graphdata[n];
+  if (socket != (int *) NULL) *socket = Xgraph[n];
+
+  return (TRUE);
+
+}
+
+/* return pointers for given Xgraph, don't set or open */
+int GetGraphData (Graphdata *data, int *sock, int *N) {
+
+  int n;
+
+  if (N == (int *) NULL) {
+    n = Active;
+  } else {
+    if (*N >= NXGRAPH) {
+      gprint (GP_ERR, "invalid Xgraph window %d\n", *N); 
+      return (FALSE);
+    }
+    if (*N < 0) {
+      n = Active;
+    } else {
+      n = *N;
+    }
+  }
+  
+  if (data != (Graphdata *) NULL) *data  = graphdata[n];
+  if (sock != (int *) NULL) *sock = Xgraph[n];
+
+  return (TRUE);
+
+}
+
+/* assign given values to current Xgraph */
+void SetGraph (Graphdata data) {
+  graphdata[Active] = data;
+}
+
+/** internal tracking of current active device type **/
+
+static int       IsImage = FALSE;
+
+int GetCurrentDevice () {
+  return (IsImage);
+}
+
+void SetImageDevice (int state) {
+  IsImage = state;
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/open_image.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/open_image.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/open_image.c	(revision 15879)
@@ -0,0 +1,133 @@
+# include "display.h"
+# include "shell.h"
+# define DEBUG 0
+
+/* we have space for several kii windows */
+# define NXIMAGE 5
+
+static int       Active;
+static int       Ximage[NXIMAGE];  
+static char      Ximbuffer[NXIMAGE][512];
+static double    Xzero[NXIMAGE];
+static double    Xrange[NXIMAGE];
+
+void QuitImage () {
+
+  int i;
+  
+  for (i = 0; i < NXIMAGE; i++) {
+    KiiClose (Ximage[i]);
+  }
+}
+
+void InitImage () {
+
+  int i;
+
+  Active = 0;
+  for (i = 0; i < NXIMAGE; i++) {
+    Ximage[i] = -1;
+    Xzero[i] = 0;
+    Xrange[i] = 1024;
+    strcpy (Ximbuffer[i], "none");
+  }
+}
+
+/* set SIGPIPE to this function to close cleanly */ 
+void XImageDead (int input) {
+  signal (SIGPIPE, XImageDead);
+  gprint (GP_ERR, "kii is dead, must restart\n");
+  Ximage[Active] = -1;
+}
+
+/** start socketed connection */
+int open_image (int N) {
+
+  int fd;
+  char *kii_exec, name[16];
+
+  kii_exec = get_variable ("KII");
+  if (kii_exec == (char *) NULL) {
+    gprint (GP_ERR, "variable KII not found\n");
+    return (FALSE);
+  }
+
+  snprintf (name, 16, "[%d]", N);
+  fd = KiiOpen (kii_exec, name);
+  free (kii_exec);
+
+  if (fd < 0) {
+    gprint (GP_ERR, "error starting kii\n");
+    return (FALSE);
+  } 
+
+  Ximage[N] = fd;
+  return (TRUE);
+}
+
+int close_image (int N) {
+
+  if (N <  0) return (FALSE);
+  if (N >= NXIMAGE) return (FALSE);
+
+  KiiClose (Ximage[N]); 
+  Ximage[N] = -1;
+  return (TRUE);
+}
+
+/* return pointers for current Ximage, set if desired, test, open if needed */
+int GetImage (int *socket, int *N) {
+
+  int i, n;
+  char buffer[70];
+
+  SetImageDevice (TRUE);
+  if (N == (int *) NULL) {
+    n = Active;
+  } else {
+    if (*N >= NXIMAGE) {
+      gprint (GP_ERR, "invalid Ximage window %d\n", *N); 
+      return (FALSE);
+    }
+    if (*N < 0) {
+      *N = n = Active;
+    } else {
+      Active = n = *N;
+    }
+  }
+  
+  /* test Ximage[0], flush junk from pipe */
+  signal (SIGPIPE, XImageDead);
+  fcntl (Ximage[n], F_SETFL,  O_NONBLOCK); 
+  for (i = 0; (read (Ximage[n], buffer, 64) > 0) && (i < 20); i++);
+  fcntl (Ximage[n], F_SETFL, !O_NONBLOCK); 
+  
+  if (Ximage[n] < 1) {
+    if (!open_image(n)) {
+      return (FALSE);
+    }
+  }
+
+  if (socket != (int *) NULL) *socket = Ximage[n];
+
+  return (TRUE);
+
+}
+
+void SetImageName (char *name) {
+  strcpy (Ximbuffer[Active], name);
+}
+
+char *GetImageName () {
+  return (Ximbuffer[Active]);
+}
+ 
+// leave this information on kapa, request when needed? 
+void SetImageScale (double zero, double range) {
+  Xzero[Active] = zero;
+  Xrange[Active] = range;
+}
+void GetImageScale (double *zero, double *range) {
+  *zero = Xzero[Active];
+  *range = Xrange[Active];
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/open_kapa.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/open_kapa.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/open_kapa.c	(revision 15879)
@@ -0,0 +1,286 @@
+# include "display.h"
+# include "shell.h"
+# include <assert.h>
+
+
+/* kapa support for the new version of kapa (v2.0), which has both graph and image
+ * elements merged into a single display device.  The user may now open an arbitrary
+ * number of kapa windows, and the display information is retrieved from kapa across the
+ * socket when it is needed.  Communication is now via an INET socket (not a UNIX socket).
+ */
+
+/* list of available socket connections */
+static int        Active;        // currently active socket entry (index value, not socket value)
+static int       *Socket = NULL; // list of available sockets
+static char     **Device = NULL; // list of device names for each socket
+static int       Ndevice = 0;    // number of available sockets / devices
+
+void InitKapa () {
+
+  Active  = -1;					  // -1 is the INVALID entry
+  Ndevice = 0;					  // number of defined sockets
+  ALLOCATE (Device, char *, 1);			  // for future REALLOCATE calls
+  ALLOCATE (Socket, int, 1);			  // for future REALLOCATE calls
+}
+
+// add new device name if not found
+int AddKapaDevice (char *name) {
+
+  int N;
+
+  N = FindKapaDevice (name);
+  if (N != -1) return (N);
+  N = Ndevice;
+  Ndevice ++;
+  REALLOCATE (Device, char *, Ndevice);
+  REALLOCATE (Socket, int, Ndevice);
+  Device[N] = strcreate (name);
+  Socket[N] = -1;
+  return (N);
+}
+
+// delete device by name, close if not closed
+int DelKapaDevice (char *name) {
+
+  int i, N;
+
+  N = FindKapaDevice (name);
+  if (N == -1) return (FALSE);
+
+  if (Socket[N] != -1) close (Socket[N]);
+  free (Device[N]);
+  for (i = N; i < Ndevice - 1; i++) {
+    Device[i] = Device[i+1];
+    Socket[i] = Socket[i+1];
+  }
+
+  if (N == Active) {
+    Active = -1;
+  }
+
+  Ndevice --;
+  REALLOCATE (Device, char *, Ndevice);
+  REALLOCATE (Socket, int, Ndevice);
+
+  return (TRUE);
+}
+
+// returns the entry of the requested device, or -1 if not found
+int FindKapaDevice (char *name) {
+
+  int i;
+
+  if (name == NULL) return (-1); 
+
+  for (i = 0; i < Ndevice; i++) {
+    if (!strcmp(Device[i], name)) return (i);
+  }
+  return (-1);
+}
+
+// set the active device to the given device, open if needed
+int open_kapa (int entry) {
+
+  int fd;
+  char *kapa_exec, *kapa_name;
+
+  // find the given device number, or create. set this to active
+  assert (entry >= 0);
+  assert (entry <  Ndevice);
+
+  // if the (now) active socket is not open, open it
+  if (Socket[entry] < 0) {
+    kapa_exec = get_variable ("KAPA");
+    if (kapa_exec == (char *) NULL) {
+      gprint (GP_ERR, "variable KAPA not found\n");
+      return (FALSE);
+    }
+
+    // KAPA may be either kapa://host or /path/to/program
+    ALLOCATE (kapa_name, char, strlen(Device[entry]) + 5);
+    snprintf (kapa_name, strlen(Device[entry]) + 5, "[%s]", Device[entry]);
+
+    if (!strncmp (kapa_exec, "unix://", 7)) {
+        fd = KapaOpenNamedSocket (&kapa_exec[7], "psphot");
+    } else {
+	fd = KapaOpen (kapa_exec, kapa_name);
+    }
+
+    free (kapa_exec);
+    free (kapa_name);
+
+    if (fd < 0) {
+      gprint (GP_ERR, "error starting kapa device %s\n", Device[entry]);
+      return (FALSE);
+    } 
+    Socket[entry] = fd;
+  } 
+  Active = entry;
+  return (TRUE);
+}
+
+/**************** graph specific ops *******************/
+
+// return the current device name, if set 
+char *GetKapaName () {
+  if (Active < 0) return NULL;
+  return Device[Active];
+}
+
+/* return pointers for named device or current; open if needed */
+// if fd == NULL, don't return the value
+// if name == NULL, use the currently active device
+int GetGraph (Graphdata *data, int *fd, char *name) {
+
+  int entry;
+
+  if (name == NULL) {
+    if (Active < 0) {
+      entry = AddKapaDevice ("0");
+    } else {
+      entry = Active;
+    }
+  } else {
+    entry = AddKapaDevice (name);
+  }
+  
+  if (!open_kapa (entry)) {
+    return (FALSE);
+  }
+  
+  if (data != NULL) KapaGetGraphData (Socket[Active], data);
+  if (fd != NULL) *fd = Socket[Active];
+
+  return (TRUE);
+}
+
+/* return pointers for given kapa, don't set or open */
+int GetGraphData (Graphdata *data, int *fd, char *name) {
+
+  int entry;
+
+  if (name == NULL) {
+    if (Active < 0) {
+      gprint (GP_ERR, "no active kapa window\n"); 
+      return (FALSE);
+    }
+    entry = Active;
+  } else {
+    entry = FindKapaDevice (name);
+    if (entry < 0) {
+      gprint (GP_ERR, "invalid kapa window %s\n", name); 
+      return (FALSE);
+    }
+  }
+
+  if (fd != NULL) *fd = Socket[entry];
+  if (data != NULL) KapaGetGraphData (Socket[entry], data);
+  return (TRUE);
+}
+
+/* assign given values to current kapa */
+int SetGraph (Graphdata *data) {
+  if (Active < 0) {
+    gprint (GP_ERR, "no active kapa window\n"); 
+    return (FALSE);
+  }
+  if (Socket[Active] == -1) {
+    gprint (GP_ERR, "no active kapa window\n"); 
+    return (FALSE);
+  }
+  KapaSetGraphData (Socket[Active], data);
+  return (TRUE);
+}
+
+/************* image ops ***********/
+
+/* return pointers for current Ximage, set if desired, test, open if needed */
+int GetImage (KapaImageData *data, int *fd, char *name) {
+
+  int entry;
+
+  if (name == NULL) {
+    if (Active < 0) {
+      entry = AddKapaDevice ("0");
+    } else {
+      entry = Active;
+    }
+  } else {
+    entry = AddKapaDevice (name);
+  }
+  
+  if (!open_kapa (entry)) {
+    return (FALSE);
+  }
+  
+  if (data != NULL) KapaGetImageData (Socket[Active], data);
+  if (fd != NULL) *fd = Socket[Active];
+
+  return (TRUE);
+}
+
+/* return pointers for given kapa, don't set or open */
+int GetImageData (KapaImageData *data, int *fd, char *name) {
+
+  int entry;
+
+  if (name == NULL) {
+    if (Active < 0) {
+      gprint (GP_ERR, "no active kapa window\n"); 
+      return (FALSE);
+    }
+    entry = Active;
+  } else {
+    entry = FindKapaDevice (name);
+    if (entry < 0) {
+      gprint (GP_ERR, "invalid kapa window %s\n", name); 
+      return (FALSE);
+    }
+  }
+
+  if (fd != NULL) *fd = Socket[entry];
+  if (data != NULL) KapaGetImageData (Socket[entry], data);
+  return (TRUE);
+}
+
+/* assign given values to current kapa */
+int SetImage (KapaImageData *data) {
+  if (Active < 0) {
+    gprint (GP_ERR, "no active kapa window\n"); 
+    return (FALSE);
+  }
+  if (Socket[Active] == -1) {
+    gprint (GP_ERR, "no active kapa window\n"); 
+    return (FALSE);
+  }
+  KapaSetImageData (Socket[Active], data);
+  return (TRUE);
+}
+
+int close_kapa (char *name) {
+
+  int N;
+
+  N = FindKapaDevice (name);
+  if (N == -1) {
+    if (Active < 0) return (FALSE);
+    name = Device[Active];
+  }
+  DelKapaDevice (name);
+  return (TRUE);
+}
+
+void QuitKapa () {
+
+  int i;
+  
+  for (i = 0; i < Ndevice; i++) {
+    if (Socket[i] != -1) close (Socket[i]);
+    if (Device[i] != NULL) free (Device[i]);
+  }
+  REALLOCATE (Socket, int, 1);
+  REALLOCATE (Device, char *, 1);
+
+  Ndevice = 0;
+  Active = -1;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/page.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/page.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/page.c	(revision 15879)
@@ -0,0 +1,209 @@
+# include "data.h"
+
+void InitPage (Page *page, char *name) {
+
+    page[0].name = strcreate (name);
+
+    page[0].Nwords = 0;
+    page[0].NWORDS = 16;
+    ALLOCATE (page[0].words, char *, page[0].NWORDS);
+    ALLOCATE (page[0].value, char *, page[0].NWORDS);
+}
+
+void FreePage (Page *page) {
+
+    int i;
+
+    free (page[0].name);
+    for (i = 0; i < page[0].Nwords; i++) {
+      free (page[0].words[i]);
+      free (page[0].value[i]);
+    }
+    free (page[0].words);
+    free (page[0].value);
+}
+
+/* return the given page */
+Page *GetPage (Book *book, int where) {
+
+  if (where < 0) where += book[0].Npages;
+  if (where < 0) return NULL;
+  if (where >= book[0].Npages) return NULL;
+  return (book[0].pages[where]);
+}
+
+/* return the given page with key restrictions */
+Page *GetPageRestricted (Book *book, int where, char *keyName, char *keyValue) {
+
+  int i;
+  int N, Nout;
+  char *value;
+
+  if (where < 0) where += book[0].Npages;
+  if (where < 0) return NULL;
+  if (where >= book[0].Npages) return NULL;
+
+  Nout = -1;
+  if (where >= 0) {
+    N = -1;
+    for (i = 0; (i < book[0].Npages) && (N < where); i++) {
+      value = BookGetWord (book[0].pages[i], keyName);
+      if ((value == NULL) && !strcmp (keyValue, "NULL")) {
+	N++;
+	Nout = i;
+      } 
+      if ((value != NULL) && !strcmp (keyValue, value)) {
+	N++;
+	Nout = i;
+      }
+    }
+  } else {
+    N = 0;
+    for (i = book[0].Npages - 1; (i >= 0) && (N > where); i--) {
+      value = BookGetWord (book[0].pages[i], keyName);
+      if ((value == NULL) && !strcmp (keyValue, "NULL")) {
+	N--;
+      } 
+      if ((value != NULL) && !strcmp (keyValue, value)) {
+	N--;
+      }
+    }
+  }
+
+  if (N != where) return NULL;
+
+  return (book[0].pages[Nout]);
+}
+
+/* return the given page */
+/* XXX use index to find more quickly */
+Page *FindPage (Book *book, char *name) {
+
+  int i;
+
+  for (i = 0; i < book[0].Npages; i++) {
+    if (!strcmp (book[0].pages[i][0].name, name)) {
+      return (book[0].pages[i]);
+    }
+  }
+  return (NULL);
+}
+
+/* make a new named page */
+Page *CreatePage (Book *book, char *name) {
+
+  int N;
+  Page *page;
+
+  page = FindPage (book, name);
+  if (page != NULL) return (page);
+
+  N = book[0].Npages;
+  book[0].Npages ++;
+  if (book[0].Npages >= book[0].NPAGES) {
+    book[0].NPAGES += 16;
+    REALLOCATE (book[0].pages, Page *, book[0].NPAGES);
+    REALLOCATE (book[0].pageIDs, char *, book[0].NPAGES);
+    REALLOCATE (book[0].index, int, book[0].NPAGES);
+  }
+  ALLOCATE (page, Page, 1);
+  InitPage (page, name);
+  book[0].pages[N] = page;
+  book[0].pageIDs[N] = strcreate(name);
+  book[0].index[N] = N;
+  
+  /* at this point, I should sort the index */
+
+  return (page);
+}
+
+/* delete a page in a book */
+int DeletePage (Book *book, Page *page) {
+
+  char *pageID;
+  int i, N, NPAGES_2;
+
+  /* find page in page list */
+  N = -1;
+  for (i = 0; i < book[0].Npages; i++) {
+    if (book[0].pages[i] == page) {
+      N = i;
+      break;
+    }
+  }
+  if (N == -1) return (FALSE);
+
+  pageID = book[0].pageIDs[i];
+
+  for (i = N; i < book[0].Npages - 1; i++) {
+    book[0].pages[i] = book[0].pages[i + 1];
+    book[0].pageIDs[i] = book[0].pageIDs[i + 1];
+    book[0].index[i] = book[0].index[i + 1];
+  }
+  book[0].Npages --;
+  NPAGES_2 = MAX (16, book[0].NPAGES / 2);
+  if (book[0].Npages < NPAGES_2) {
+    book[0].NPAGES = NPAGES_2;
+    REALLOCATE (book[0].pages, Page *, book[0].NPAGES);
+    REALLOCATE (book[0].pageIDs, char *, book[0].NPAGES);
+    REALLOCATE (book[0].index, int, book[0].NPAGES);
+  }
+
+  FreePage (page);
+  free (pageID);
+  return (TRUE);
+}
+
+void ListPages (Book *book) {
+
+  int i;
+
+  for (i = 0; i < book[0].Npages; i++) {
+    gprint (GP_ERR, "%-15s %3d\n", book[0].pages[i][0].name, book[0].pages[i][0].Nwords);
+  }
+  return;
+}
+
+void ListWords (Page *page) {
+
+  int i;
+
+  for (i = 0; i < page[0].Nwords; i++) {
+    gprint (GP_ERR, "%-15s %15s\n", page[0].words[i], page[0].value[i]);
+  }
+  return;
+}
+
+int BookSetWord (Page *page, char *word, char *value) {
+
+  int i;
+
+  for (i = 0; i < page[0].Nwords; i++) {
+    if (!strcmp (page[0].words[i], word)) {
+      free (page[0].value[i]);
+      page[0].value[i] = strcreate (value);
+      return TRUE;
+    }
+  }
+
+  page[0].Nwords ++;
+  if (page[0].Nwords >= page[0].NWORDS) {
+    page[0].NWORDS += 16;
+    REALLOCATE (page[0].words, char *, page[0].NWORDS);
+    REALLOCATE (page[0].value, char *, page[0].NWORDS);
+  }      
+  page[0].words[i] = strcreate (word);
+  page[0].value[i] = strcreate (value);
+  return (TRUE);
+}
+
+char *BookGetWord (Page *page, char *word) {
+  int i;
+
+  for (i = 0; i < page[0].Nwords; i++) {
+    if (!strcmp (page[0].words[i], word)) {
+      return (page[0].value[i]);
+    }
+  }
+  return NULL;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/powell.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/powell.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/powell.c	(revision 15879)
@@ -0,0 +1,126 @@
+# include "data.h"
+
+# define FTOL 0.001
+# define ITMAX 200
+
+void linmin (float *p, float *xi, int n, float *fret, float (*func)());
+
+/*** not well tested yet !! ***/
+
+void powell (float *p, int Npar, float (func)() ) {
+  
+  int i, ibig, j, Niter;
+  float t, fptt, fp, del;
+  float *pt, *ptt, *xit, **xi;
+  float ftemp;
+
+  ALLOCATE (pt, float, Npar);
+  ALLOCATE (ptt, float, Npar);
+
+  ALLOCATE (xi, float *, Npar);
+  for (i = 0; i < Npar; i++) {
+    ALLOCATE (xi[i], float, Npar);
+    bzero (xi[i], Npar * sizeof (float));
+    xi[i][i] = 1;
+  }
+  ALLOCATE (xit, float, Npar);
+  
+  ftemp = func (p);
+
+  for (j = 0; j < Npar; j++) pt[j] = p[j];
+
+  for (Niter = 0; Niter < ITMAX; Niter++) {
+    fp = ftemp;
+    ibig = 0;
+    del = 0.0;
+
+    for (i = 0; i < Npar; i++) {
+      for (j = 0; j < Npar; j++) xit[j] = xi[j][i];
+
+      fptt = ftemp;
+      linmin (p, xit, Npar, &ftemp, func);
+
+      if (fabs (fptt - ftemp) > del) {
+	del = fabs (fptt - ftemp);
+	ibig = i;
+      }
+    }
+
+    if (fabs (fp - ftemp) <= 0.5*FTOL*(fabs(fp) + fabs(ftemp))) {
+      free (xit);
+      free (ptt);
+      free (pt);
+      for (i = 0; i < Npar; i++) free (xi[i]);
+      free (xi);
+      return;
+    }
+
+    for (j = 0; j < Npar; j++) {
+      ptt[j] = 2.0*p[j] - pt[j];
+      xit[j] = p[j] - pt[j];
+      pt[j]  = p[j];
+    }
+
+    fptt = func (ptt);
+
+    if (fptt < fp) {
+      t = 2.0*(fp - 2.0*ftemp + fptt) * SQ(fp - ftemp - del) - del * SQ(fp - fptt);
+      if (t < 0.0) {
+	linmin (p, xit, Npar, &ftemp, func);
+	for (j = 0; j < Npar; j++) xi[j][ibig] = xit[j];
+      }
+    }
+  }
+
+  if (Niter == ITMAX) {
+    gprint (GP_ERR, "Too many iterations in routine POWELL\n");
+    return;
+  }
+
+}
+
+#undef ITMAX
+
+/* 
+   function has N parameters
+   p is the initial guess for the N parameters 
+   xi are the N unit vectors - x[i][j] = delta(i,j)
+   Npar = N parameters
+   
+   FTOL - ending tolerance
+*/
+   
+#define TOL 2.0e-4
+
+int ncom=0;	/* defining declarations */
+float *pcom=0,*xicom=0,(*nrfunc)();
+
+void linmin (float *p, float *xi, int n, float *fret, float (*func)()) {
+
+	int j;
+	float xx,xmin,fx,fb,fa,bx,ax;
+	float brent(),f1dim(),*vector();
+	void mnbrak(),free_vector();
+
+	ncom=n;
+	pcom=vector(1,n);
+	xicom=vector(1,n);
+	nrfunc=func;
+	for (j=1;j<=n;j++) {
+		pcom[j]=p[j];
+		xicom[j]=xi[j];
+	}
+	ax=0.0;
+	xx=1.0;
+	bx=2.0;
+	mnbrak(&ax,&xx,&bx,&fa,&fx,&fb,f1dim);
+	*fret=brent(ax,xx,bx,f1dim,TOL,&xmin);
+	for (j=1;j<=n;j++) {
+		xi[j] *= xmin;
+		p[j] += xi[j];
+	}
+	free_vector(xicom,1,n);
+	free_vector(pcom,1,n);
+}
+
+#undef TOL
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/precess.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/precess.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/precess.c	(revision 15879)
@@ -0,0 +1,49 @@
+# include "data.h"
+    
+double get_epoch (char *in_epoch, char mode) {
+
+  int done;
+  double epoch;
+
+  epoch = 2000.0;
+  done = FALSE;
+  if (in_epoch[0] == 'B') {
+    epoch = BtoJ(atof(&in_epoch[1]));
+    done = TRUE;
+  }
+
+  if (in_epoch[0] == 'J') {
+    epoch = atof(&in_epoch[1]);
+    done = TRUE;
+  }
+
+  if (!done && (mode == 'B')) {
+    epoch = BtoJ(atof(in_epoch));
+    done = TRUE;
+  }
+    
+  if (!done && (mode == 'J')) {
+    epoch = atof(in_epoch);
+    done = TRUE;
+  }
+
+  if (!done) {
+    gprint (GP_ERR, "error finding epoch %s\n", in_epoch);
+    exit (0);
+  }
+  
+  return (epoch);
+
+}
+
+  
+double BtoJ (double in_epoch) {
+
+  double JD, out_epoch;
+
+  JD = (in_epoch - 1900.0)*365.242198781 + 2415020.31352;
+  out_epoch = 2000.0 + (JD - 2451545.0)/365.25;
+
+  return (out_epoch);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/queues.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/queues.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/queues.c	(revision 15879)
@@ -0,0 +1,384 @@
+# include "data.h"
+# define DEBUG 0
+
+Queue **queues;   /* queue to store the list of all queues */
+int    Nqueues;   /* number of currently defined queues */
+int    NQUEUES;   /* number of currently allocated queues */
+
+void InitQueues () {
+  Nqueues = 0;
+  NQUEUES = 16;
+  ALLOCATE (queues, Queue *, NQUEUES); 
+}
+
+/* list known queues */
+void ListQueues () {
+
+  int i;
+
+  for (i = 0; i < Nqueues; i++) {
+    gprint (GP_LOG, "%-15s %3d\n", queues[i][0].name, queues[i][0].Nlines);
+  }
+  return;
+}
+
+/* return the given queue */
+Queue *FindQueue (char *name) {
+
+  int i;
+
+  for (i = 0; i < Nqueues; i++) {
+    if (!strcmp (queues[i][0].name, name)) {
+      return (&queues[i][0]);
+    }
+  }
+  return (NULL);
+}
+
+/* make a new named queue */
+int InitQueue (Queue *queue) {
+
+  int i;
+
+  for (i = 0; i < queue[0].Nlines; i++) {
+    free (queue[0].lines[i]);
+  }
+  queue[0].Nlines = 0;
+  queue[0].NLINES = 16;
+  REALLOCATE (queue[0].lines, char *, queue[0].NLINES);
+
+  if (DEBUG) fprintf (stderr, "init: %s (%zx) : %d of %d\n", queue[0].name, (size_t) queue, queue[0].Nlines, queue[0].NLINES);
+  
+  return (TRUE);
+}
+
+/* make a new named queue */
+Queue *CreateQueue (char *name) {
+
+  int N;
+  Queue *queue;
+
+  queue = FindQueue (name);
+  if (queue != NULL) return (queue);
+
+  N = Nqueues;
+  Nqueues ++;
+  CHECK_REALLOCATE (queues, Queue *, NQUEUES, Nqueues, 16);
+  ALLOCATE (queue, Queue, 1);
+  queue[0].Nlines = 0;
+  queue[0].NLINES = 16;
+  queue[0].name = strcreate (name);
+  ALLOCATE (queue[0].lines, char *, queue[0].NLINES);
+  queues[N] = queue;
+  return (queue);
+}
+
+/* delete a queue */
+int DeleteQueue (Queue *queue) {
+
+  int i, N, NQUEUES_2;
+
+  /* find queue in queue list */
+  N = -1;
+  for (i = 0; i < Nqueues; i++) {
+    if (queues[i] == queue) {
+      N = i;
+      break;
+    }
+  }
+  if (N == -1) return (FALSE);
+
+  for (i = N; i < Nqueues - 1; i++) {
+    queues[i] = queues[i + 1];
+  }
+  Nqueues --;
+  NQUEUES_2 = MAX (16, NQUEUES / 2);
+  if (Nqueues < NQUEUES_2) {
+    NQUEUES = NQUEUES_2;
+    REALLOCATE (queues, Queue *, NQUEUES);
+  }
+
+  free (queue[0].name);
+  for (i = 0; i < queue[0].Nlines; i++) {
+    free (queue[0].lines[i]);
+  }
+  free (queue[0].lines);
+  free (queue);
+  return (TRUE);
+}
+
+void PushNamedQueue (char *name, char *line) {
+
+  Queue *queue;
+  
+  queue = FindQueue (name);
+  if (queue == NULL) {
+    queue = CreateQueue (name);
+  }
+  PushQueue (queue, line);
+  return;
+}
+
+/* push line onto queue.  return chars create new lines */
+void PushQueue (Queue *queue, char *line) {
+
+  int N;
+  char *p, *q;
+
+  p = line;
+  q = strchr (line, '\n');
+  N = queue[0].Nlines;
+  while (q != NULL) {
+    queue[0].lines[N] = strncreate (p, q - p);
+    N++;
+    CHECK_REALLOCATE (queue[0].lines, char *, queue[0].NLINES, N, 16);
+    p = q + 1;
+    q = strchr (p, '\n');
+  }    
+  if (*p) {
+    queue[0].lines[N] = strcreate (p);
+    N++;
+    CHECK_REALLOCATE (queue[0].lines, char *, queue[0].NLINES, N, 16);
+  }
+  queue[0].Nlines = N;
+  return;
+}
+
+// return a newly allocated string containing the requested key value
+char *ChooseSingleKey (char *line, int Key) {
+
+  int i;
+  char *key, *p;
+
+  if (Key == -1) {
+    key = strcreate (line);
+    return (key);
+  }
+
+  key = line;
+  for (i = 0; (i < Key) && (key != NULL); i++) {
+    p = nextword (key);
+    key = p;
+  }
+  key = thisword (key);
+  return (key);
+}
+
+/* construct merged key given keylist of the form K:N:M */ 
+char *ChooseKey (char *line, char *keylist) {
+
+  char *output, *entry, *key, *p, *q;
+  int first, keynum;
+
+  if (line == NULL) return (NULL);
+  if (keylist == NULL) return (line);
+
+  ALLOCATE (output, char, strlen(line) + 1);
+  memset (output, 0, strlen(line) + 1);
+
+  first = TRUE;
+  p = q = keylist;
+  while (q != NULL) {
+    q = strchr (p, ':');
+    if (q == NULL) {
+      entry = strcreate (p);
+    } else {
+      entry = strncreate (p, q - p);
+    }
+    keynum = atoi (entry);
+    free (entry);
+
+    key = ChooseSingleKey (line, keynum);
+
+    if (!first) strcat (output, ":");
+    if (key) {
+	strcat (output, key);
+	free (key);
+    }
+
+    if (q != NULL) p = q + 1;
+    first = FALSE;
+  }
+  return (output);
+}
+
+/* push line onto queue, skipping existing matches (optionally by key) */
+void PushQueueUnique (Queue *queue, char *line, char *Key) {
+
+  int i, j, N, found;
+  char *p, *q, *key1, *key2;
+  Queue tmp;
+
+  /* init tmp queue */
+  tmp.Nlines = 0;
+  tmp.NLINES = 16;
+  ALLOCATE (tmp.lines, char *, tmp.NLINES);
+
+  /* push entries on tmp queue */
+  p = line;
+  q = strchr (line, '\n');
+  N = tmp.Nlines;
+  while (q != NULL) {
+    tmp.lines[N] = strncreate (p, q - p);
+    N++;
+    CHECK_REALLOCATE (tmp.lines, char *, tmp.NLINES, N, 16);
+    p = q + 1;
+    q = strchr (p, '\n');
+  }    
+  if (*p) {
+    tmp.lines[N] = strcreate (p);
+    N++;
+    CHECK_REALLOCATE (tmp.lines, char *, tmp.NLINES, N, 16);
+  }
+  tmp.Nlines = N;
+
+  /* add unique entries in tmp to queue */
+  for (i = 0; i < tmp.Nlines; i++) {
+    key1 = ChooseKey (tmp.lines[i], Key);
+    if (key1 == NULL) continue;
+    found = FALSE;
+    for (j = 0; !found && (j < queue[0].Nlines); j++) {
+      key2 = ChooseKey (queue[0].lines[j], Key);
+      if (key2 == NULL) continue;
+      found = !strcmp (key1, key2);
+      free (key2);
+    }      
+    if (!found) PushQueue (queue, tmp.lines[i]);
+    free (key1);
+  }
+  for (i = 0; i < tmp.Nlines; i++) {
+    free (tmp.lines[i]);
+  } 
+  free (tmp.lines);
+  return;
+}
+
+/* push line onto queue, replacing matches (optionally by Key) */
+void PushQueueReplace (Queue *queue, char *line, char *Key) {
+
+  int i, j, N, found;
+  char *p, *q, *key1, *key2;
+  Queue tmp;
+
+  /* init tmp queue */
+  tmp.Nlines = 0;
+  tmp.NLINES = 16;
+  ALLOCATE (tmp.lines, char *, tmp.NLINES);
+
+  /* push entries on tmp queue */
+  p = line;
+  q = strchr (line, '\n');
+  N = tmp.Nlines;
+  while (q != NULL) {
+    tmp.lines[N] = strncreate (p, q - p);
+    N++;
+    CHECK_REALLOCATE (tmp.lines, char *, tmp.NLINES, N, 16);
+    p = q + 1;
+    q = strchr (p, '\n');
+  }    
+  if (*p) {
+    tmp.lines[N] = strcreate (p);
+    N++;
+    CHECK_REALLOCATE (tmp.lines, char *, tmp.NLINES, N, 16);
+  }
+  tmp.Nlines = N;
+
+  /* add unique entries in tmp to queue */
+  for (i = 0; i < tmp.Nlines; i++) {
+    key1 = ChooseKey (tmp.lines[i], Key);
+    if (key1 == NULL) continue;
+    found = FALSE;
+    for (j = 0; !found && (j < queue[0].Nlines); j++) {
+      key2 = ChooseKey (queue[0].lines[j], Key);
+      if (key2 == NULL) continue;
+      found = !strcmp (key1, key2);
+      if (found) {
+	// XXX do I need to free queue[0].lines[j]??
+	queue[0].lines[j] = strcreate (tmp.lines[i]);
+      }
+      free (key2);
+    }      
+    if (!found) PushQueue (queue, tmp.lines[i]);
+    free (key1);
+  }
+  for (i = 0; i < tmp.Nlines; i++) {
+    free (tmp.lines[i]);
+  } 
+  free (tmp.lines);
+  return;
+}
+
+char *PopQueue (Queue *queue) {
+
+  int i, NLINES_2;
+  char *line;
+
+  if (queue[0].Nlines == 0) return (NULL);
+  line = queue[0].lines[0];
+
+  for (i = 0; i < queue[0].Nlines - 1; i++) {
+    queue[0].lines[i] = queue[0].lines[i+1];
+  }
+  queue[0].Nlines --;
+
+  /* shrink queue allocation if small enough */
+  NLINES_2 = MAX (16, queue[0].NLINES / 2);
+  if (queue[0].Nlines < NLINES_2) {
+    queue[0].NLINES = NLINES_2;
+    REALLOCATE (queue[0].lines, char *, queue[0].NLINES);
+  }    
+  return (line);
+}
+
+/* pop the first entry which for which the key matches */
+char *PopQueueMatch (Queue *queue, char *Key, char *value) {
+
+  int i, choice, NLINES_2;
+  char *line, *test;
+
+  if (queue[0].Nlines == 0) return (NULL);
+
+  /* find the matching key */
+  choice = -1;
+  for (i = 0; (i < queue[0].Nlines) && (choice == -1); i++) {
+      test = ChooseKey (queue[0].lines[i], Key);
+      if (test == NULL) continue;
+      if (strcmp (value, test)) { 
+	free (test);
+	continue;
+      }
+      free (test);
+      choice = i;
+  }
+  if (choice == -1) return NULL;
+
+  line = queue[0].lines[choice];
+
+  for (i = choice; i < queue[0].Nlines - 1; i++) {
+    queue[0].lines[i] = queue[0].lines[i+1];
+  }
+  queue[0].Nlines --;
+
+  /* shrink queue allocation if small enough */
+  NLINES_2 = MAX (16, queue[0].NLINES / 2);
+  if (queue[0].Nlines < NLINES_2) {
+    queue[0].NLINES = NLINES_2;
+    REALLOCATE (queue[0].lines, char *, queue[0].NLINES);
+  }    
+  return (line);
+}
+
+int PrintQueue (Queue *queue) {
+
+  int i;
+
+  if (queue[0].Nlines == 0) return (TRUE);
+
+  if (DEBUG) fprintf (stderr, "print: %s (%zx) : %d of %d\n", queue[0].name, (size_t) queue, queue[0].Nlines, queue[0].NLINES);
+
+  for (i = 0; i < queue[0].Nlines; i++) {
+    gprint (GP_LOG, "%s\n", queue[0].lines[i]);
+  }
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/sort.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/sort.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/sort.c	(revision 15879)
@@ -0,0 +1,334 @@
+# include "data.h"
+
+void sort (double *value, int N) {
+
+  int l,j,ir,i;
+  double temp;
+  
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      temp = value[--l];
+    }
+    else {
+      temp = value[ir];
+      value[ir] = value[0];
+      if (--ir == 0) {
+	value[0] = temp;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && value[j] < value[j+1]) ++j;
+      if (temp < value[j]) {
+	value[i]=value[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    value[i] = temp;
+  }
+}
+
+void fsort (float *value, int N) {
+
+  int l,j,ir,i;
+  float temp;
+  
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      temp = value[--l];
+    }
+    else {
+      temp = value[ir];
+      value[ir] = value[0];
+      if (--ir == 0) {
+	value[0] = temp;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && value[j] < value[j+1]) ++j;
+      if (temp < value[j]) {
+	value[i]=value[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    value[i] = temp;
+  }
+}
+
+void sortpair (double *value1, double *value2, int N) {
+
+  int l,j,ir,i;
+  double temp1, temp2;
+  
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      l--;
+      temp1 = value1[l];
+      temp2 = value2[l];
+    }
+    else {
+      temp1 = value1[ir];
+      temp2 = value2[ir];
+      value1[ir] = value1[0];
+      value2[ir] = value2[0];
+      if (--ir == 0) {
+	value1[0] = temp1;
+	value2[0] = temp2;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && value1[j] < value1[j+1]) ++j;
+      if (temp1 < value1[j]) {
+	value1[i]=value1[j];
+	value2[i]=value2[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    value1[i] = temp1;
+    value2[i] = temp2;
+  }
+}
+
+void fsortpair (float *X, float *Y, int N) {
+
+  int l,j,ir,i;
+  float tX, tY;
+  
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      l--;
+      tX = X[l];
+      tY = Y[l];
+    }
+    else {
+      tX = X[ir];
+      X[ir] = X[0];
+      tY = Y[ir];
+      Y[ir] = Y[0];
+      if (--ir == 0) {
+	X[0] = tX;
+	Y[0] = tY;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && X[j] < X[j+1]) j++;
+      if (tX < X[j]) {
+	X[i] = X[j];
+	Y[i] = Y[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    X[i] = tX;
+    Y[i] = tY;
+  }
+}
+
+void sortthree (float *X, float *Y, float *Z, int N) {
+
+  int l,j,ir,i;
+  float tX, tY, tZ;
+  
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      l--;
+      tX = X[l];
+      tY = Y[l];
+      tZ = Z[l];
+    }
+    else {
+      tX = X[ir];
+      X[ir] = X[0];
+      tY = Y[ir];
+      Y[ir] = Y[0];
+      tZ = Z[ir];
+      Z[ir] = Z[0];
+      if (--ir == 0) {
+	X[0] = tX;
+	Y[0] = tY;
+	Z[0] = tZ;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && X[j] < X[j+1]) j++;
+      if (tX < X[j]) {
+	X[i] = X[j];
+	Y[i] = Y[j];
+	Z[i] = Z[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    X[i] = tX;
+    Y[i] = tY;
+    Z[i] = tZ;
+  }
+}
+
+void sort_lists (float *X, float *Y, int *S, int N) {
+
+  int l,j,ir,i;
+  double tX, tY, tS;
+  
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      l--;
+      tX = X[l];
+      tY = Y[l];
+      tS = S[l];
+    }
+    else {
+      tX = X[ir];
+      X[ir] = X[0];
+      tY = Y[ir];
+      Y[ir] = Y[0];
+      tS = S[ir];
+      S[ir] = S[0];
+      if (--ir == 0) {
+	X[0] = tX;
+	Y[0] = tY;
+	S[0] = tS;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && X[j] < X[j+1]) j++;
+      if (tX < X[j]) {
+	X[i] = X[j];
+	Y[i] = Y[j];
+	S[i] = S[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    X[i] = tX;
+    Y[i] = tY;
+    S[i] = tS;
+  }
+}
+
+void dsort_lists (double *X, double *Y, int *S, int N) {
+
+  int l,j,ir,i;
+  double tX, tY, tS;
+  
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      l--;
+      tX = X[l];
+      tY = Y[l];
+      tS = S[l];
+    }
+    else {
+      tX = X[ir];
+      X[ir] = X[0];
+      tY = Y[ir];
+      Y[ir] = Y[0];
+      tS = S[ir];
+      S[ir] = S[0];
+      if (--ir == 0) {
+	X[0] = tX;
+	Y[0] = tY;
+	S[0] = tS;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && X[j] < X[j+1]) j++;
+      if (tX < X[j]) {
+	X[i] = X[j];
+	Y[i] = Y[j];
+	S[i] = S[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    X[i] = tX;
+    Y[i] = tY;
+    S[i] = tS;
+  }
+}
+
+// sort two int vectors by first vector
+void isort_pair (int *X, int *Y, int N) {
+
+  int l,j,ir,i;
+  int tX, tY;
+  
+  if (N < 2) return;
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      l--;
+      tX = X[l];
+      tY = Y[l];
+    }
+    else {
+      tX = X[ir];
+      X[ir] = X[0];
+      tY = Y[ir];
+      Y[ir] = Y[0];
+      if (--ir == 0) {
+	X[0] = tX;
+	Y[0] = tY;
+	return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && X[j] < X[j+1]) j++;
+      if (tX < X[j]) {
+	X[i] = X[j];
+	Y[i] = Y[j];
+	j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    X[i] = tX;
+    Y[i] = tY;
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/spline.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/spline.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/spline.c	(revision 15879)
@@ -0,0 +1,58 @@
+# include "data.h"
+
+/* construct the natural spline for x, y in y2 */
+void spline (float *x, float *y, int N, float *y2) {
+
+  int i;
+  float dy, dx, *tmp;
+  
+  ALLOCATE (tmp, float, N);
+
+  y2[0] = tmp[0] = 0.0;
+  
+  for (i = 1; i < N-1; i++) {
+    dx = (x[i+0] - x[i-1]) / (x[i+1] - x[i-1]);
+    dy = dx * y2[i-1] + 2.0;
+    y2[i] = (dx - 1.0) / dy;
+    tmp[i] = (y[i+1] - y[i+0]) / (x[i+1] - x[i+0]) - (y[i+0] - y[i-1]) / (x[i+0] - x[i-1]);
+    tmp[i] = (6.0 * tmp[i] / (x[i+1] - x[i-1]) - dx*tmp[i-1]) / dy;
+  }
+  
+  y2[N-1] = 0;
+  for (i = N-2; i >= 1; i--)
+    y2[i] = y2[i]*y2[i+1] + tmp[i];
+
+  free (tmp);
+}
+
+/* evaluate spline for x, y, y2 at X */
+float splint (float *x, float *y, float *y2, int N, float X) {
+
+  int i, lo, hi;
+  float dx, a, b, value;
+  
+  /* find correct element in array (x must be sorted) */
+  lo = 0;
+  hi = N-1;
+  while (hi - lo > 1) {
+    i = (hi+lo) >> 1;
+    if (x[i] > X) 
+      hi = i;
+    else 
+      lo = i;
+  }
+
+  /* error condition: duplicate abssisca */
+  dx = x[hi] - x[lo];
+  if (dx == 0.0) {
+    return (HUGE_VAL);
+  }
+
+  /* evaluate spline */
+  a = (x[hi] - X) / dx;
+  b = (X - x[lo]) / dx;
+
+  value = a*y[lo] + b*y[hi] + ((a*a*a - a)*y2[lo] + (b*b*b - b)*y2[hi])*(dx*dx) / 6.0;
+  return (value);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/starfuncs.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/starfuncs.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/starfuncs.c	(revision 15879)
@@ -0,0 +1,251 @@
+# include "data.h"
+
+double get_aperture_stats (Matrix *matrix, int X, int Y, int Npix, int Nborder, double max) {
+
+  double *ring;
+  double x, y, x2, y2, xy, I, sky, FWHMx, FWHMy, value, mag, Sxy;
+  int i, j, n, Npix2, Nring, Nmax;
+  double Npts, gain, dsky2, dmag, peak, offset;
+  char *string;
+  
+  string = get_variable ("GAIN");
+  if (string == (char *) NULL) {
+    gprint (GP_ERR, "assuming a value of 1.0\n");
+    gain = 1.0;
+  } else {
+    gain = atof (string);
+  }
+  Nborder = MAX (1, Nborder);
+  Nborder = MIN (1000, Nborder);
+  
+  Npix2 = (int)(0.5*Npix);
+  Npix = 2 * Npix2 + 1;
+  Nring = 4*Nborder*(Nborder + Npix);
+  ALLOCATE (ring, double, Nring);
+  bzero (ring, sizeof(double)*Nring);
+
+  n = 0;  
+  for (j = 0; j < Nborder; j++) {
+    for (i = X - Npix2 - Nborder; i < X + Npix2 + Nborder + 1; i++, n+=2) {
+      ring[n]   = gfits_get_matrix_value (matrix, i, (int)(Y - Npix2 - j));
+      ring[n+1] = gfits_get_matrix_value (matrix, i, (int)(Y + Npix2 + j));
+    }
+    for (i = Y - Npix2; i < Y + Npix2 + 1; i++, n+=2) {
+      ring[n]   = gfits_get_matrix_value (matrix, (int)(X - Npix2 - j), i);
+      ring[n+1] = gfits_get_matrix_value (matrix, (int)(X + Npix2 + j), i);
+    }
+  }
+  sort (ring, Nring);
+  for (Npts = sky = dsky2 = 0, i = 0.25*Nring; i < 0.75*Nring; i++, Npts += 1.0) {
+    sky += ring[i];
+    dsky2 += ring[i]*ring[i];
+  }
+  sky = sky / Npts;
+  dsky2 = dsky2 / Npts - sky*sky;
+  free (ring);
+
+  peak = 0;
+  Npts = Nmax = 0;
+  x = y = x2 = y2 = xy = I = 0;
+  for (i = X - Npix2; i < X + Npix2 + 1; i++) {
+    for (j = Y - Npix2; j < Y + Npix2 + 1; j++) {
+      value = gfits_get_matrix_value (matrix, i, j);
+      offset = value - sky;
+      x  += i*offset;
+      y  += j*offset;
+      x2 += i*i*offset;
+      y2 += j*j*offset;
+      xy += i*j*offset;
+      I  += offset;
+      Npts ++;
+      if (value > max) {
+	Nmax ++;
+      }
+      if (value > peak) peak = value;
+    }
+  }
+
+  x = x / I;
+  y = y / I;
+  FWHMx = 2.355*sqrt (fabs(x2 / I - x*x));
+  FWHMy = 2.355*sqrt (fabs(y2 / I - y*y));
+  Sxy   = xy / I - x*y;
+  mag = -2.5*log10(I);
+  dmag = sqrt (fabs(1.0 / (gain*I) + Npts*dsky2 / (I*I)));
+  x = x + 1;
+  y = y + 1;
+  
+  set_variable ("Xg", x);
+  set_variable ("Yg", y);
+  set_variable ("SXg", FWHMx);
+  set_variable ("SYg", FWHMy);
+  set_variable ("SXYg", Sxy);
+  set_variable ("Sg", sky);
+  set_variable ("dSg", sqrt (fabs (dsky2)));
+  set_variable ("Zg", mag);
+  set_variable ("dZg", dmag);
+  set_variable ("Zcg", I);
+  set_variable ("Zpk", peak);
+  set_int_variable ("Nsat", Nmax);
+  
+  gprint (GP_LOG, "%f %f %f %f %f %f %f %f\n", x, y, FWHMx, FWHMy, sky, I, mag, dmag);
+
+  return (mag);
+
+}
+
+static double Raper  =  5;
+static double Rinner = 10;
+static double Router = 15;
+static double *sky = NULL;
+
+int set_rough_radii (double Ra, double Ri, double Ro) {
+
+  Raper = Ra;
+  Rinner = Ri;
+  Router = Ro;
+  if (sky == NULL) {
+    ALLOCATE (sky, double, SQ(2*Router + 1));
+  } else {
+    REALLOCATE (sky, double, SQ(2*Router + 1));
+  }
+  return (TRUE);
+}
+
+/* use a circular aperture */
+int get_rough_star (float *data, int Nx, int Ny, int x, int y,
+		    float *xc, float *yc, 
+		    float *sx, float *sy, float *sxy,
+		    float *zs, float *zp, float *sk) {
+
+  double Ra2, Ri2, Ro2, rad2;
+  int i, j, Npts, Nsky;
+  int Xs, Xe, Ys, Ye, off, Xc, Yc;
+  double peak, fsky, value;
+  double Sx, Sy, Sx2, Sy2, Sxy, Sum;
+  
+  /* define circular boundaries */
+  Ra2 = SQ(Raper);
+  Ri2 = SQ(Rinner);
+  Ro2 = SQ(Router);
+
+  /* measure the sky level */
+  /* boundaries for the outer sky region */
+  Xs = MAX (x - Router, 0);
+  Xe = MIN (x + Router + 1, Nx);
+  Ys = MAX (y - Router, 0);
+  Ye = MIN (y + Router + 1, Ny);
+
+/* this sample uses a circular aperture */
+# if (0)
+  Nsky = 0;  
+  for (j = Ys; j < Ye; j++) {
+    off = j*Nx;
+    for (i = Xs; i < Xe; i++) { 
+      rad2 = SQ(i - x) + SQ(j - y);
+      if (rad2 > Ro2) continue;
+      if (rad2 < Ri2) continue;
+      sky[Nsky] = data[i+off];
+      Nsky ++;
+    }
+  }
+  sort (sky, Nsky);
+  for (Npts = fsky = 0, i = 0.25*Nsky; i < 0.75*Nsky; i++, Npts += 1.0) {
+    fsky += sky[i];
+  }
+  fsky = fsky / Npts;
+# else
+
+/* this sample uses a square outer annulus, without loop if tests */
+  Nsky = 0;  
+  Xs = MAX (x - Router, 0);
+  Xe = MIN (x - Rinner + 1, Nx);
+  Ys = MAX (y - Rinner, 0);
+  Ye = MIN (y + Rinner + 1, Ny);
+  for (j = Ys; j < Ye; j++) {
+    off = j*Nx;
+    for (i = Xs; i < Xe; i++) { 
+      sky[Nsky] = data[i+off];
+      Nsky ++;
+    }
+  }
+  Xs = MAX (x + Rinner, 0);
+  Xe = MIN (x + Router + 1, Nx);
+  for (j = Ys; j < Ye; j++) {
+    off = j*Nx;
+    for (i = Xs; i < Xe; i++) { 
+      sky[Nsky] = data[i+off];
+      Nsky ++;
+    }
+  }
+  Xs = MAX (x - Rinner, 0);
+  Xe = MIN (x - Rinner + 1, Nx);
+  Ys = MAX (y - Router, 0);
+  Ye = MIN (y - Rinner + 1, Ny);
+  for (j = Ys; j < Ye; j++) {
+    off = j*Nx;
+    for (i = Xs; i < Xe; i++) { 
+      sky[Nsky] = data[i+off];
+      Nsky ++;
+    }
+  }
+  Ys = MAX (y + Rinner, 0);
+  Ye = MIN (y + Router + 1, Ny);
+  for (j = Ys; j < Ye; j++) {
+    off = j*Nx;
+    for (i = Xs; i < Xe; i++) { 
+      sky[Nsky] = data[i+off];
+      Nsky ++;
+    }
+  }
+  sort (sky, Nsky);
+  for (Npts = fsky = 0, i = 0.25*Nsky; i < 0.75*Nsky; i++, Npts += 1.0) {
+    fsky += sky[i];
+  }
+  fsky = fsky / Npts;
+# endif
+
+  /* boundaries for the star region */
+  Xs = MAX (x - Raper, 0);
+  Xe = MIN (x + Raper + 1, Nx);
+  Ys = MAX (y - Raper, 0);
+  Ye = MIN (y + Raper + 1, Ny);
+
+  /** note that this will fail on negative flux objects */
+  peak = Npts = 0;
+  Sx = Sy = Sx2 = Sy2 = Sxy = Sum = 0;
+  for (j = Ys; j < Ye; j++) {
+    off = j*Nx;
+    Yc = j - y;
+    for (i = Xs; i < Xe; i++) {
+      Xc = i - x;
+      rad2 = SQ(Xc) + SQ(Yc);
+      if (rad2 > Ro2) continue;
+      value = data[i+off] - fsky;
+      Sx  += Xc*value;
+      Sy  += Yc*value;
+      Sx2 += Xc*Xc*value;
+      Sy2 += Yc*Yc*value;
+      Sxy += Xc*Yc*value;
+      Sum += value;
+      Npts ++;
+      if (value > peak) peak = value;
+    }
+  }
+
+  *xc = Sx / Sum;
+  *yc = Sy / Sum;
+  *sx = sqrt (fabs (Sx2 / Sum - SQ(*xc)));
+  *sy = sqrt (fabs (Sy2 / Sum - SQ(*yc)));
+  *sxy = Sxy / Sum;
+  *xc += x;
+  *yc += y;
+  *zs = Sum;
+  *zp = peak;
+  *sk = fsky;
+  /* note sigma is rough: round-off errors can introduce errors */
+  /* using values relative to x,y should minimize this effect */
+
+  return (Npts);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/style_args.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/style_args.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/style_args.c	(revision 15879)
@@ -0,0 +1,70 @@
+# include "data.h"
+# include "display.h"
+
+int style_args (Graphdata *graphmode, int *argc, char **argv, int *kapa) {
+  
+  int N;
+  char *colorName;
+  char *kapaName;
+
+  kapaName = NULL;
+  if ((N = get_argument (*argc, argv, "-n"))) {
+    remove_argument (N, argc, argv);
+    kapaName = strcreate (argv[N]);
+    remove_argument (N, argc, argv);
+  }
+  if (!GetGraph (graphmode, kapa, kapaName)) return (FALSE);
+  FREE (kapaName);
+
+  if (*argc == 1) {
+    kapaName = GetKapaName();
+    colorName = KapaColorName (graphmode[0].color);
+    gprint (GP_ERR, "current style (%s): -x %d -c %s -pt %d -lt %d -lw %f -sz %f\n", kapaName,
+	     graphmode[0].style, colorName, graphmode[0].ptype, 
+	     graphmode[0].ltype, graphmode[0].lweight,
+	     graphmode[0].size);
+    return (TRUE);
+  }
+
+  if ((N = get_argument (*argc, argv, "-lt"))) {
+    remove_argument (N, argc, argv);
+    graphmode[0].ltype = atof(argv[N]);
+    remove_argument (N, argc, argv);
+  }
+  if ((N = get_argument (*argc, argv, "-lw"))) {
+    remove_argument (N, argc, argv);
+    graphmode[0].lweight = atof(argv[N]);
+    remove_argument (N, argc, argv);
+  }
+  if ((N = get_argument (*argc, argv, "-pt"))) {
+    remove_argument (N, argc, argv);
+    graphmode[0].ptype = atof(argv[N]);
+    remove_argument (N, argc, argv);
+  }
+  if ((N = get_argument (*argc, argv, "+eb"))) {
+    remove_argument (N, argc, argv);
+    graphmode[0].ebar = TRUE;
+  }
+  if ((N = get_argument (*argc, argv, "-eb"))) {
+    remove_argument (N, argc, argv);
+    graphmode[0].ebar = FALSE;
+  }
+  if ((N = get_argument (*argc, argv, "-sz"))) {
+    remove_argument (N, argc, argv);
+    graphmode[0].size = atof(argv[N]);
+    remove_argument (N, argc, argv);
+  }
+  if ((N = get_argument (*argc, argv, "-c"))) {
+    remove_argument (N, argc, argv);
+    graphmode[0].color = KapaColorByName (argv[N]);
+    if (graphmode[0].color == -1) return (FALSE);
+    remove_argument (N, argc, argv);
+  }
+  if ((N = get_argument (*argc, argv, "-x"))) {
+    remove_argument (N, argc, argv);
+    graphmode[0].style = atof(argv[N]);
+    remove_argument (N, argc, argv);
+  }
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/svdcmp.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/svdcmp.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.data/svdcmp.c	(revision 15879)
@@ -0,0 +1,211 @@
+# include "data.h"
+
+/*
+  static float at,bt,ct;
+  #define PYTHAG(a,b) ((at=fabs(a)) > (bt=fabs(b)) ? \
+  (ct=bt/at,at*sqrt(1.0+ct*ct)) : (bt ? (ct=at/bt,bt*sqrt(1.0+ct*ct)): 0.0))
+  pythag -> hypot (check on roundoff errors) 
+*/
+
+/* use simple max? */
+#define FSIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a))
+
+/* n == Nx, m == Ny */
+int svdcmp (float *a, float *w, float *v, int Nx, int Ny) {
+
+  int flag, i, its, j, jj, k, l, nm, status;
+  float c, f, h, s, x, y, z;
+  float anorm=0.0, g = 0.0, scale = 0.0;
+  float *rv1;
+
+  if (Ny < Nx) return (0);
+
+  l = nm = 0;
+  ALLOCATE (rv1, float, Nx);
+  for (i = 0; i < Nx; i++) {
+    l = i + 1;
+    rv1[i] = scale*g;
+    g = s = scale = 0.0;
+    if (i < Ny) {
+      for (k = i; k < Ny; k++) scale += fabs(a[k*Nx + i]);
+      if (scale) {
+	for (k = i; k < Ny; k++) {
+	  a[k*Nx + i] /= scale;
+	  s += a[k*Nx + i]*a[k*Nx + i];
+	}
+	f = a[i*Nx + i];
+	g  = -FSIGN(sqrt(s), f);
+	h = f*g - s;
+	a[i*Nx + i] = f-g;
+	if (i != Nx - 1) {
+	  for (j = l; j < Nx; j++) {
+	    for (s = 0.0, k = i; k < Ny; k++) s += a[k*Nx + i]*a[k*Nx + j];
+	    f = s/h;
+	    for (k = i; k < Ny; k++) a[k*Nx + j] += f*a[k*Nx + i];
+	  }
+	}
+	for (k = i; k < Ny; k++) a[k*Nx + i] *= scale;
+      }
+    }
+    w[i] = scale*g;
+    g = s = scale = 0.0;
+    if ((i < Ny) && (i != (Nx - 1))) {
+      for (k = l; k < Nx; k++) scale += fabs(a[i*Nx + k]);
+      if (scale) {
+	for (k = l; k < Nx; k++) {
+	  a[i*Nx + k] /= scale;
+	  s += a[i*Nx + k]*a[i*Nx + k];
+	}
+	f = a[i*Nx + l];
+	g = -FSIGN(sqrt(s), f);
+	h = f*g - s;
+	a[i*Nx + l] = f-g;
+	for (k = l; k < Nx; k++) rv1[k] = a[i*Nx + k]/h;
+	if (i != Ny - 1) {
+	  for (j = l; j < Ny; j++) {
+	    for (s = 0.0, k = l; k < Nx; k++) s += a[j*Nx + k]*a[i*Nx + k];
+	    for (k = l; k < Nx; k++) a[j*Nx + k] += s*rv1[k];
+	  }
+	}
+	for (k = l; k < Nx; k++) a[i*Nx + k] *= scale;
+      }
+    }
+    anorm = MAX(anorm, (fabs(w[i]) + fabs(rv1[i])));
+  }
+
+  for (i = Nx - 1; i >= 0; i--) {
+    if (i < Nx - 1) {
+      if (g) {
+	/* isn't l == n to start?? */
+	for (j = l; j < Nx; j++) v[j*Nx + i] = (a[i*Nx + j]/a[i*Nx + l])/g;
+	for (j = l; j < Nx; j++) {
+	  for (s = 0.0, k = l; k < Nx; k++) s += a[i*Nx + k]*v[k*Nx + j];
+	  for (k = l; k < Nx; k++) v[k*Nx + j] += s*v[k*Nx + i];
+	}
+      }
+      for (j = l; j < Nx; j++) v[i*Nx + j] = v[j*Nx + i] = 0.0;
+    }
+    v[i*Nx + i] = 1.0;
+    g = rv1[i];
+    l = i;
+  }
+  for (i = Nx - 1; i >= 0; i--) {
+    l = i + 1;
+    g = w[i];
+    if (i < Nx - 1)
+      for (j = l; j < Nx; j++) a[i*Nx + j] = 0.0;
+    if (g) {
+      g = 1.0/g;
+      if (i != Nx - 1) {
+	for (j = l; j < Nx; j++) {
+	  for (s = 0.0, k = l; k < Ny; k++) s += a[k*Nx + i]*a[k*Nx + j];
+	  f = (s/a[i*Nx + i])*g;
+	  for (k = i; k < Ny; k++) a[k*Nx + j] += f*a[k*Nx + i];
+	}
+      }
+      for (j = i; j < Ny; j++) a[j*Nx + i] *= g;
+    } else {
+      for (j = i; j < Ny; j++) a[j*Nx + i] = 0.0;
+    }
+    ++a[i*Nx + i];
+  }
+
+  status = 1;
+  for (k = Nx - 1; k >= 0; k--) {
+    for (its = 0; its < 30; its++) {
+      flag = 1;
+      for (l = k; l >= 0; l--) {
+	nm = l - 1;
+	if (fabs(rv1[l])+anorm == anorm) {
+	  flag = 0;
+	  break;
+	}
+	if (fabs(w[nm])+anorm == anorm) break;
+      }
+      if (flag) {
+	c = 0.0;
+	s = 1.0;
+	for (i = l; i < k; i++) {
+	  f = s*rv1[i];
+	  if (fabs(f)+anorm != anorm) {
+	    g = w[i];
+	    h = hypot (f, g);
+	    w[i] = h;
+	    h = 1.0/h;
+	    c = g*h;
+	    s = (-f*h);
+	    for (j = 0; j < Ny; j++) {
+	      y = a[j*Nx + nm];
+	      z = a[j*Nx + i];
+	      a[j*Nx + nm] = y*c + z*s;
+	      a[j*Nx + i] = z*c - y*s;
+	    }
+	  }
+	}
+      }
+      z = w[k];
+      if (l == k) {
+	if (z < 0.0) {
+	  w[k] = -z;
+	  for (j = 0; j < Nx; j++) v[j*Nx + k] = (-v[j*Nx + k]);
+	}
+	break;
+      }
+      if (its == 29) status = 0;
+      x = w[l];
+      nm = k-1;
+      y = w[nm];
+      g = rv1[nm];
+      h = rv1[k];
+      f = ((y-z)*(y+z) + (g-h)*(g+h))/(2.0*h*y);
+      g = hypot (f, 1.0);
+      f = ((x-z)*(x+z) + h*((y/(f+FSIGN(g, f)))-h))/x;
+      c = s = 1.0;
+      for (j = l; j < nm; j++) {
+	i = j+1;
+	g = rv1[i];
+	y = w[i];
+	h = s*g;
+	g = c*g;
+	z = hypot (f, h);
+	rv1[j] = z;
+	c = f/z;
+	s = h/z;
+	f = x*c+g*s;
+	g = g*c-x*s;
+	h = y*s;
+	y = y*c;
+	for (jj = 0; jj < Nx; jj++) {
+	  x = v[jj*Nx + j];
+	  z = v[jj*Nx + i];
+	  v[jj*Nx + j] = x*c+z*s;
+	  v[jj*Nx + i] = z*c-x*s;
+	}
+	z = hypot(f, h);
+	w[j] = z;
+	if (z) {
+	  z = 1.0/z;
+	  c = f*z;
+	  s = h*z;
+	}
+	f = (c*g) + (s*y);
+	x = (c*y) - (s*g);
+	for (jj = 0; jj < Ny; jj++) {
+	  y = a[jj*Nx + j];
+	  z = a[jj*Nx + i];
+	  a[jj*Nx + j] = y*c+z*s;
+	  a[jj*Nx + i] = z*c-y*s;
+	}
+      }
+      rv1[l] = 0.0;
+      rv1[k] = f;
+      w[k] = x;
+    }
+  }
+  free(rv1);
+  return (1);
+}
+
+#undef FSIGN
+#undef MAX
+#undef PYTHAG
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/BufferOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/BufferOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/BufferOps.c	(revision 15879)
@@ -0,0 +1,236 @@
+# include "opihi.h"
+
+static Buffer **buffers;
+static int     Nbuffers;
+
+void InitBuffers () {
+  Nbuffers = 0;
+  ALLOCATE (buffers, Buffer *, 1);
+}
+
+Buffer *InitBuffer () {
+  Buffer *buf;
+
+  ALLOCATE (buf, Buffer, 1);
+  bzero (buf[0].name, 1024);
+  bzero (buf[0].file, 1024);
+  ALLOCATE (buf[0].matrix.buffer, char, 1);
+  ALLOCATE (buf[0].header.buffer, char, 1);
+  return (buf);
+}
+
+int IsBuffer (char *name) {
+ 
+  int i;
+
+  if (name == NULL) return (FALSE);
+
+  for (i = 0; (i < Nbuffers) && (strcmp(buffers[i][0].name, name)); i++);
+  if (i == Nbuffers) return (FALSE);
+  return (TRUE);
+}
+
+int IsBufferPtr (Buffer *buf) {
+ 
+  int i;
+
+  if (buf == NULL) return (FALSE);
+
+  for (i = 0; (i < Nbuffers) && (buffers[i] != buf); i++);
+  if (i == Nbuffers) return (FALSE);
+  return (TRUE);
+}
+
+Buffer *SelectBuffer (char *name, int mode, int verbose) {
+
+  int i;
+
+  if (name == NULL) goto error;
+  if (ISNUM(name[0])) goto error;
+  if (IsVector(name)) goto error;
+
+  for (i = 0; (i < Nbuffers) && (strcmp(buffers[i][0].name, name)); i++);
+  /* is a new buffer */
+  if (i == Nbuffers) { 
+    if (mode == OLDBUFFER) goto error;
+    Nbuffers += 1;
+    REALLOCATE (buffers, Buffer *, Nbuffers);
+    buffers[i] = InitBuffer ();
+    strcpy (buffers[i][0].name, name);
+    return (buffers[i]);
+  } 
+  /* is an old buffer */
+  if (mode == NEWBUFFER) goto error;
+  return (buffers[i]);
+
+ error:
+  if (verbose) gprint (GP_ERR, "invalid matrix %s\n", name);
+  return (NULL);
+}
+
+int CreateBuffer (Buffer *buf, int Nx, int Ny, int bitpix, float bzero, float bscale) {
+
+  /* store the default output values */
+  gfits_init_header (&buf[0].header);
+
+  /* assign the necessary internal values */
+  buf[0].header.bitpix   = -32;
+  buf[0].header.Naxes = 2;
+  buf[0].header.Naxis[0] = Nx;
+  buf[0].header.Naxis[1] = Ny;
+
+  buf[0].bitpix = bitpix;
+  buf[0].bzero  = bzero;
+  buf[0].bscale = bscale;
+  
+  /* make some test of the validity of the values */
+
+  /* create the appropriate header and matrix */
+  gfits_create_header (&buf[0].header);
+  gfits_create_matrix (&buf[0].header, &buf[0].matrix);
+
+  return (TRUE);
+}
+  
+/* copy data from in to out - new memory space */
+int CopyNamedBuffer (char *out, char *in) {
+  Buffer *In, *Out;
+  if ((In  = SelectBuffer (in,  OLDBUFFER, FALSE)) == NULL) return (FALSE);
+  if ((Out = SelectBuffer (out, ANYBUFFER, FALSE)) == NULL) return (FALSE);
+  CopyBuffer (Out, In);
+  return (TRUE);
+}
+
+int CopyBuffer (Buffer *out, Buffer *in) {
+  free (out[0].matrix.buffer);
+  free (out[0].header.buffer);
+  out[0].bitpix = in[0].bitpix;
+  out[0].unsign = in[0].unsign;
+  out[0].bscale = in[0].bscale;
+  out[0].bzero  = in[0].bzero;
+  strcpy (out[0].file, in[0].file);
+  gfits_copy_matrix (&in[0].matrix, &out[0].matrix);
+  gfits_copy_header (&in[0].header, &out[0].header);
+  return (TRUE);
+}
+
+/* move data from in to out - use old memory space */
+int MoveNamedBuffer (char *out, char *in) {
+  Buffer *In, *Out;
+  if ((In  = SelectBuffer (in,  OLDBUFFER, FALSE)) == NULL) return (FALSE);
+  if ((Out = SelectBuffer (out, ANYBUFFER, FALSE)) == NULL) return (FALSE);
+  MoveBuffer (Out, In);
+  return (TRUE);
+}
+int MoveBuffer (Buffer *out, Buffer *in) {
+  int i, j;
+
+  free (out[0].matrix.buffer);
+  free (out[0].header.buffer);
+  out[0].bitpix = in[0].bitpix;
+  out[0].unsign = in[0].unsign;
+  out[0].bscale = in[0].bscale;
+  out[0].bzero  = in[0].bzero;
+  out[0].matrix = in[0].matrix;
+  out[0].header = in[0].header;
+  strcpy (out[0].file, in[0].file);
+
+  /* delete buffer entry from buffer list, if it exists */
+  for (i = 0; (i < Nbuffers) && (in != buffers[i]); i++);
+  if (i == Nbuffers) {
+    free (in);
+    return (TRUE);
+  }
+
+  free (in);
+  for (j = i; j < Nbuffers - 1; j++) buffers[j] = buffers[j + 1];
+  Nbuffers -= 1;
+  REALLOCATE (buffers, Buffer *, MAX (Nbuffers, 1));
+  return (TRUE);
+}
+
+/* delete by ptr */
+int DeleteBuffer (Buffer *buf) {
+
+  int i, j;
+
+  if (buf == NULL) return (FALSE);
+  for (i = 0; (i < Nbuffers) && (buf != buffers[i]); i++);
+  if (i == Nbuffers) return (FALSE);
+
+  gfits_free_header (&buffers[i][0].header);
+  gfits_free_matrix (&buffers[i][0].matrix);
+  free (buffers[i]);
+
+  for (j = i; j < Nbuffers - 1; j++) buffers[j] = buffers[j + 1];
+
+  Nbuffers -= 1;
+  REALLOCATE (buffers, Buffer *, MAX (Nbuffers, 1));
+  return (TRUE);
+}
+  
+/* delete by name */
+int DeleteNamedBuffer (char *name) {
+
+  int i, j;
+
+  if (name == NULL) return (FALSE);
+  for (i = 0; (i < Nbuffers) && (strcmp(buffers[i][0].name, name)); i++);
+  if (i == Nbuffers) return (FALSE);
+
+  gfits_free_header (&buffers[i][0].header);
+  gfits_free_matrix (&buffers[i][0].matrix);
+  free (buffers[i]);
+
+  for (j = i; j < Nbuffers - 1; j++) buffers[j] = buffers[j + 1];
+
+  Nbuffers -= 1;
+  REALLOCATE (buffers, Buffer *, MAX (Nbuffers, 1));
+  return (TRUE);
+}
+
+void dump_buffers (int n) {
+
+  int i;
+
+  gprint (GP_ERR, "try %d\n", n);
+  for (i = 0; i < Nbuffers; i++) {
+    gprint (GP_ERR, "%d  %lx\n", i, (long) buffers[i]);
+    gprint (GP_ERR, "%d  %lx  %s\n", i, (long) buffers[i][0].name, buffers[i][0].name);
+    gprint (GP_ERR, "%d  %lx  %s\n", i, (long) buffers[i][0].file, buffers[i][0].file);
+    gprint (GP_ERR, "%d  %lx  %lx\n", i, (long) &buffers[i][0].header, (long) buffers[i][0].header.buffer);
+    gprint (GP_ERR, "%d  %lx  %lx\n", i, (long) &buffers[i][0].matrix, (long) buffers[i][0].matrix.buffer);
+    gprint (GP_ERR, "%d  %d  %d  %f %f\n", i, buffers[i][0].bitpix, buffers[i][0].unsign, buffers[i][0].bscale, buffers[i][0].bzero);
+  }
+}
+
+int PrintBuffers (int Long) {
+
+  int i;
+
+  if (Nbuffers == 0) {
+    gprint (GP_ERR, "No allocated buffers\n");
+    return (TRUE);
+  }
+  
+  if (Long) {
+    gprint (GP_LOG, "    N       name                      file     X     Y    bytes BP  U   bzero     bscale  \n");
+    for (i = 0; i < Nbuffers; i++) {
+      gprint (GP_LOG, "%5d %10s %25s %5d %5d %10d %3d %1d %10.4e %10.4e\n",
+	       i, buffers[i][0].name, buffers[i][0].file, 
+	       buffers[i][0].header.Naxis[0], buffers[i][0].header.Naxis[1],
+	       buffers[i][0].header.size + buffers[i][0].matrix.size, buffers[i][0].bitpix, 
+	       buffers[i][0].unsign, buffers[i][0].bzero, buffers[i][0].bscale);
+    }
+    return (TRUE);
+  }
+
+  gprint (GP_LOG, "    N       name                      file     X     Y    bytes\n");
+  for (i = 0; i < Nbuffers; i++) {
+    gprint (GP_LOG, "%5d %10s %25s %5d %5d %10d\n",
+	     i, buffers[i][0].name, buffers[i][0].file, 
+	     buffers[i][0].header.Naxis[0], buffers[i][0].header.Naxis[1],
+	     buffers[i][0].header.size + buffers[i][0].matrix.size);
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/CommandOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/CommandOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/CommandOps.c	(revision 15879)
@@ -0,0 +1,181 @@
+# include "opihi.h"
+
+// if the user has installed the libedit version of readline, we need to modify a couple symbols:
+# ifndef RL_READLINE_VERSION
+# define rl_completion_matches(A,B) completion_matches(A,B)
+# endif
+
+static Command  *commands;
+static int      Ncommands;
+static int      NCOMMANDS;
+
+void InitCommands () {
+  NCOMMANDS = 20;
+  Ncommands = 0;
+  ALLOCATE (commands, Command, NCOMMANDS);
+}
+
+void AddCommand (Command *new) {
+  
+  commands[Ncommands] = *new;
+  Ncommands ++;
+  if (Ncommands == NCOMMANDS) {
+    NCOMMANDS += 20;
+    REALLOCATE (commands, Command, NCOMMANDS);
+  }
+}
+
+int DeleteCommand (Command *command) {
+
+  int i, Nc;
+
+  Nc = -1;
+  for (i = 0; i < Ncommands; i++) {
+    if (command == &commands[i]) {
+      Nc = i;
+      break;
+    }
+  }
+  if (Nc == -1) {
+    gprint (GP_ERR, "programming error: command not found\n");
+    return (FALSE);
+  }
+
+  free (commands[Nc].name);
+  for (i = Nc + 1; i < Ncommands; i++)
+    commands[i - 1] = commands[i];
+  Ncommands --;
+  REALLOCATE (commands, Command, Ncommands);
+  return (TRUE);
+}
+
+/* return command which unambiguously matches name */
+Command *MatchCommand (char *name, int VERBOSE, int EXACT) {
+
+  int i, match[10], Nmatch;
+
+  /* try for an exact match first */
+  for (i = 0; i < Ncommands; i++) {
+    if (!strcmp (commands[i].name, name)) {
+      return (&commands[i]);
+    }
+  }
+  if (EXACT) {
+    if (VERBOSE) gprint (GP_ERR, "no exact match to %s\n", name);
+    return (NULL);
+  }
+
+  /* not found as complete command, try partial */
+  Nmatch = 0;
+  for (i = 0; (Nmatch < 10) && (i < Ncommands); i++) {
+    if (!strncmp (commands[i].name, name, strlen(name))) {  /* found a command */
+      match[Nmatch] = i;
+      Nmatch ++;
+    }
+  }
+  if (Nmatch == 1) return (&commands[match[0]]);
+
+  if (Nmatch > 1) {
+    if (VERBOSE) {
+      gprint (GP_ERR, "ambiguous command: %s ( ", name);
+      for (i = 0; i < Nmatch; i++) {
+	gprint (GP_ERR, "%s ", commands[match[i]].name);
+      }
+      gprint (GP_ERR, ")\n");
+    }
+    return (NULL);
+  }
+  if (VERBOSE) gprint (GP_ERR, "%s: Command not found.\n", name);
+  return (NULL);
+}  
+
+/* generate a command completion list for readline */
+/**** these probably do not interact well with OHANA memory!!! ****/
+char *command_generator (const char *text, int state) {
+
+  /* i must be remembered from call to call */
+  static int i, len;
+
+  /* On first call, state is set to 0: initial the state */
+  if (!state) {
+    i = -1;  
+    len = strlen (text);
+  }
+
+  /* Return the next partial match from the command list */
+  for (i++; i < Ncommands; i++) {
+    if (!len) 
+      return (strcreate(commands[i].name));
+    if (!strncmp (commands[i].name, text, len)) {
+      return (strcreate(commands[i].name));
+    }
+  }
+
+  /* If no names matched, then return NULL. */
+  return ((char *)NULL);
+}
+
+/* tell readline to use out command_generator rather than basic completion */
+char **command_completer (const char *text, int start, int end) {
+  
+  char **matches;
+
+  matches = (char **) NULL;
+  
+  if (start == 0) {
+    matches = rl_completion_matches (text, command_generator);
+  }
+
+  return (matches);
+}
+
+void print_commands (FILE *f) {
+
+  int i, *seq;
+
+  ALLOCATE (seq, int, Ncommands);
+  sort_commands (seq);
+  for (i = 0; i < Ncommands; i++) {
+    fprintf (f, "%-25s -- %s\n", commands[seq[i]].name, commands[seq[i]].help);
+  }
+  free (seq);
+
+  return;
+}
+
+void sort_commands (int *seq) {
+
+  int l,j,ir,i, N;
+  int temp;
+  
+  N = Ncommands;
+  for (i = 0; i < N; i++) 
+    seq[i] = i;
+  
+  l = N >> 1;
+  ir = N - 1;
+  for (;;) {
+    if (l > 0) {
+      temp = seq[--l];
+    }
+    else {
+      temp = seq[ir];
+      seq[ir] = seq[0];
+      if (--ir == 0) {
+        seq[0] = temp;
+        return;
+      }
+    }
+    i = l;
+    j = (l << 1) + 1;
+    while (j <= ir) {
+      if (j < ir && (strcmp (commands[seq[j]].name, commands[seq[j+1]].name) < 0)) ++j;
+      if (strcmp (commands[temp].name, commands[seq[j]].name) < 0) {
+        seq[i]=seq[j];
+        j += (i=j) + 1;
+      }
+      else j = ir + 1;
+    }
+    seq[i] = temp;
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/ConfigInit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/ConfigInit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/ConfigInit.c	(revision 15879)
@@ -0,0 +1,65 @@
+# include "opihi.h"
+
+static char *GlobalConfig;
+
+int ConfigInit (int *argc, char **argv) {
+
+  char *config, *file;
+
+  /*** load configuration info ***/
+  file = SelectConfigFile (argc, argv, "ptolemy");
+  config = LoadConfigFile (file);
+  if (config == (char *) NULL) {
+    if (file != (char *) NULL) free (file);
+    return (FALSE);
+  }
+
+  GlobalConfig = config;
+
+  free (file);
+  return (TRUE);
+}
+
+char *VarConfig (char *keyword, char *mode, void *ptr) {
+
+  char *answer;
+
+  answer = get_variable (keyword);
+  if (answer == (char *) NULL) {
+    answer = ScanConfig (GlobalConfig, keyword, mode, 0, ptr);
+    return (answer);
+  }
+
+  if (!strcmp (mode, "%s"))  strcpy ((char *) ptr, answer);
+  if (!strcmp (mode, "%d"))  *(int *) ptr       = atoi (answer);
+  if (!strcmp (mode, "%u"))  *(unsigned *) ptr  = atoi (answer);
+  if (!strcmp (mode, "%ld")) *(long *) ptr      = atoi (answer);
+  if (!strcmp (mode, "%hd")) *(short *) ptr     = atoi (answer);
+  if (!strcmp (mode, "%f"))  *(float *) ptr     = atof (answer);
+  if (!strcmp (mode, "%lf")) *(double *) ptr    = atof (answer);
+
+  free (answer);
+  return (ptr);
+}
+
+char *VarConfigEntry (char *keyword, char *mode, int entry, void *ptr) {
+
+  char *answer;
+
+  answer = get_variable (keyword);
+  if (answer == (char *) NULL) {
+    answer = ScanConfig (GlobalConfig, keyword, mode, entry, ptr);
+    return (answer);
+  }
+
+  if (!strcmp (mode, "%s"))  strcpy ((char *) ptr, answer);
+  if (!strcmp (mode, "%d"))  *(int *) ptr       = atoi (answer);
+  if (!strcmp (mode, "%u"))  *(unsigned *) ptr  = atoi (answer);
+  if (!strcmp (mode, "%ld")) *(long *) ptr      = atoi (answer);
+  if (!strcmp (mode, "%hd")) *(short *) ptr     = atoi (answer);
+  if (!strcmp (mode, "%f"))  *(float *) ptr     = atof (answer);
+  if (!strcmp (mode, "%lf")) *(double *) ptr    = atof (answer);
+
+  free (answer);
+  return (ptr);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/ListOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/ListOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/ListOps.c	(revision 15879)
@@ -0,0 +1,257 @@
+# include "opihi.h"
+# include "macro.h"
+
+/*** local static variables used to track the command lists  ***/
+static List *lists;			/* variable to store the list of all lists */
+static int  Nlists;			/* number of currently available lists */
+
+void InitLists () {
+  Nlists = 0;
+  ALLOCATE (lists, List, 1); 
+  return;
+}
+
+int current_list_depth () {
+  return Nlists;
+}
+
+int increase_list_depth () {
+  Nlists ++;
+  REALLOCATE (lists, List, MAX (Nlists + 1, 0) + 1);
+  ALLOCATE (lists[Nlists].line, char *, 16);
+  lists[Nlists].Nalloc = 16;
+  lists[Nlists].Nlines = 0;
+  lists[Nlists].n = 0;
+  return Nlists;
+}
+
+int decrease_list_depth () {
+  
+  int i;
+
+  for (i = 0; i < lists[Nlists].Nlines; i++) {
+    free (lists[Nlists].line[i]);
+  }
+  free (lists[Nlists].line);
+  Nlists --;
+  REALLOCATE (lists, List, MAX (Nlists + 1, 0) + 1);
+  return Nlists;
+}
+
+/* return a new string consisting of the next line in the current list */
+char *get_next_listentry (int ThisList) {
+
+  int Nline;
+  char *output;
+
+  Nline = lists[ThisList].n;
+
+  if (Nline >= lists[ThisList].Nlines) return (NULL);
+
+  output = strcreate (lists[ThisList].line[Nline]);
+  lists[ThisList].n ++;
+  
+  return (output);
+}
+
+# if (0)
+char *remove_listentry (int current) {
+
+  int i;
+  char *output;
+
+  if ((current + 1) >= lists[Nlists].Nlines) 
+    return ((char *) NULL);
+
+  output = lists[Nlists].line[current + 1];
+  
+  for (i = current + 1; i < lists[Nlists].Nlines - 1; i++) {
+    lists[Nlists].line[i] = lists[Nlists].line[i + 1];
+  }
+
+  lists[Nlists].Nlines --;
+  return (output);
+
+}
+# endif 
+
+int add_listentry (int ThisList, char *line) {
+
+  int Nlines;
+
+  Nlines = lists[ThisList].Nlines;
+  lists[ThisList].line[Nlines] = strcreate (line);
+  lists[ThisList].Nlines ++;
+
+  if (lists[ThisList].Nlines == lists[ThisList].Nalloc) {
+    lists[ThisList].Nalloc += 16;
+    REALLOCATE (lists[ThisList].line, char *, lists[ThisList].Nalloc);
+  }
+    
+  return (lists[ThisList].Nlines);
+}
+
+int is_for_loop (char *line) {
+
+  int status;
+  char *comm;
+
+  comm = thisword (line);
+  if (comm == (char *) NULL) return (FALSE);
+  
+  status = !strcmp (comm, "for");
+  free (comm);
+  return (status);
+}
+
+int is_macro_create (char *line) {
+
+  int status;
+  char *comm;
+  char *this_macro;
+  CommandF *cmd;
+
+  comm = thisword (line);
+  if (comm == NULL) return (FALSE);
+
+  status = !strcmp (comm, "macro");
+  free (comm);
+  if (!status) return (FALSE);
+  
+  this_macro = thisword (nextword (line));
+  if (this_macro == NULL) return (FALSE);
+
+  cmd = find_macro_command (this_macro);
+  free (this_macro);
+
+  if (cmd == NULL) {
+    return (FALSE);
+  }
+
+  return (TRUE);
+}
+
+int is_if_block (char *line) {
+
+  char *comm, *temp;
+
+  temp = thisword (nextword (nextword (line)));
+  comm = thisword (line);
+
+  if (comm == NULL) goto escape;
+
+  if (strcmp (comm, "if")) goto escape;
+
+  /* if (cond) (command) does not define a complete block */
+  if (temp != NULL) goto escape;
+
+  if (temp != NULL) free (temp);
+  if (comm != NULL) free (comm);
+  return (TRUE);
+
+escape: 
+  if (comm != NULL) free (comm);
+  if (temp != NULL) free (temp);
+  return (FALSE);
+}
+
+// list (word) : nested list
+// list (word) -x : not nested list
+// list (word) -split : not nested list
+int is_list_data (char *line) {
+
+  char *comm, *temp;
+
+  temp = thisword (nextword (nextword (line)));
+  comm = thisword (line);
+
+  if (comm == NULL) goto escape;
+
+  if (strcmp (comm, "list")) goto escape;
+
+  /* if (cond) (command) does not define a complete block */
+  if (temp != NULL) {
+      if (!strcmp (temp, "-x")) goto escape;
+      if (!strcmp (temp, "-split")) goto escape;
+      if (!strcmp (temp, "-add")) goto escape;
+      if (!strcmp (temp, "-del")) goto escape;
+  }
+
+  if (temp != NULL) free (temp);
+  if (comm != NULL) free (comm);
+  return (TRUE);
+
+escape: 
+  if (comm != NULL) free (comm);
+  if (temp != NULL) free (temp);
+  return (FALSE);
+}
+
+int is_loop (char *line) {
+
+  int status;
+  char *comm;
+
+  comm = thisword (line);
+  if (comm == (char *) NULL) return (FALSE);
+
+  status = !strcmp (comm, "while");
+  free (comm);
+  return (status);
+}
+
+int is_task (char *line) {
+
+  int status;
+  char *comm;
+
+  comm = thisword (line);
+  if (comm == (char *) NULL) return (FALSE);
+
+  status = !strcmp (comm, "task");
+  free (comm);
+  return (status);
+}
+
+int is_task_exit (char *line) {
+
+  int status;
+  char *comm;
+
+  comm = thisword (line);
+  if (comm == (char *) NULL) return (FALSE);
+
+  status = !strcmp (comm, "task.exit");
+  free (comm);
+  return (status);
+}
+
+int is_task_exec (char *line) {
+
+  int status;
+  char *comm;
+
+  comm = thisword (line);
+  if (comm == (char *) NULL) return (FALSE);
+
+  status = !strcmp (comm, "task.exec");
+  free (comm);
+  return (status);
+}
+
+int is_list (char *line) {
+  
+  int status;
+
+  status = is_if_block (line);
+  status |= is_macro_create (line);
+  status |= is_for_loop (line);
+  status |= is_list_data (line);
+  status |= is_loop (line);
+  status |= is_task (line);
+  status |= is_task_exit (line);
+  status |= is_task_exec (line);
+
+  return (status);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/MacroOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/MacroOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/MacroOps.c	(revision 15879)
@@ -0,0 +1,143 @@
+# include "opihi.h"
+
+static char dot[] = ".";
+
+static Macro *macros;
+static int   Nmacros;
+static int   NMACROS;
+
+static char *MacroName = dot;
+static int   MacroDepth = 0;
+
+void InitMacros () {
+  NMACROS = 20;
+  Nmacros = 0;
+  ALLOCATE (macros, Macro, NMACROS);
+  MacroName = dot;
+  MacroDepth = 0;
+}
+
+void SetCurrentMacroData (char *name, int depth) {
+  MacroName = name;
+  MacroDepth = depth;
+}
+
+char *GetMacroName () {
+  return (MacroName);
+}
+
+int GetMacroDepth () {
+  return (MacroDepth);
+}
+
+Macro *NewMacro (char *name) {
+  
+  macros[Nmacros].name = strcreate (name);;
+  macros[Nmacros].Nlines = 0;
+  ALLOCATE (macros[Nmacros].line, char *, 1);
+  Nmacros ++;
+  if (Nmacros == NMACROS) {
+    NMACROS += 20;
+    REALLOCATE (macros, Macro, NMACROS);
+  }
+  return (&macros[Nmacros-1]);
+}
+
+void ListMacro (Macro *macro) {
+
+  int i;
+
+  if ((macro == NULL) || (macro[0].Nlines == 0)) {
+    gprint (GP_ERR, "  macro not defined\n");
+    return;
+  }
+  for (i = 0; i < macro[0].Nlines; i++) {
+    gprint (GP_ERR, "  %s\n", macro[0].line[i]);
+  }
+  return;
+}
+
+void ListMacros () {
+  int i;
+  for (i = 0; i < Nmacros; i++) {
+    gprint (GP_ERR, "%s\n", macros[i].name);
+  }
+}
+
+void FreeMacro (Macro *macro) {
+  
+  int i;
+
+  if (macro == NULL) return;
+
+  for (i = 0; i < macro[0].Nlines; i++) {
+    free (macro[0].line[i]);
+  }
+  free (macro[0].line);
+  free (macro[0].name);
+  return;
+}
+
+int DeleteMacro (Macro *macro) {
+
+  int i, Nm;
+
+  Nm = -1;
+  for (i = 0; i < Nmacros; i++) {
+    if (macro == &macros[i]) {
+      Nm = i;
+      break;
+    }
+  }
+  if (Nm == -1) {
+    gprint (GP_ERR, "programming error: macro not found\n");
+    return (FALSE);
+  }
+
+  FreeMacro (&macros[Nm]);
+  for (i = Nm + 1; i < Nmacros; i++)
+    macros[i - 1] = macros[i];
+  Nmacros --;
+  return (TRUE);
+}
+
+/* return macro which unambiguously matches name */
+Macro *MatchMacro (char *name, int VERBOSE, int EXACT) {
+
+  int i, match[10], Nmatch;
+
+  /* try for an exact match first */
+  for (i = 0; i < Nmacros; i++) {
+    if (!strcmp (macros[i].name, name)) {
+      return (&macros[i]);
+    }
+  }
+  if (EXACT) {
+    if (VERBOSE) gprint (GP_ERR, "no exact match to %s\n", name);
+    return (NULL);
+  }
+      
+  /* not found as complete macro, try partial */
+  Nmatch = 0;
+  for (i = 0; (Nmatch < 10) && (i < Nmacros); i++) {
+    if (!strncmp (macros[i].name, name, strlen(name))) {  /* found a macro */
+      match[Nmatch] = i;
+      Nmatch ++;
+    }
+  }
+  if (Nmatch == 1) return (&macros[match[0]]);
+
+  if (Nmatch > 1) {
+    if (VERBOSE) {
+      gprint (GP_ERR, "ambiguous macro: %s ( ", name);
+      for (i = 0; i < Nmatch; i++) {
+	gprint (GP_ERR, "%s ", macros[match[i]].name);
+      }
+      gprint (GP_ERR, ")\n");
+    }
+    return (NULL);
+  }
+  if (VERBOSE) gprint (GP_ERR, "%s: Macro not found.\n", name);
+  return (NULL);
+}  
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/Makefile	(revision 15879)
@@ -0,0 +1,78 @@
+default: libshell
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+SDIR    =       $(HOME)/lib.shell
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+FULL_CFLAGS   = $(BASE_CFLAGS) -fPIC
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(BASE_LDFLAGS)
+
+# opihi shell functions (libopihi) ########################
+shell = \
+$(SDIR)/ConfigInit.$(ARCH).o		\
+$(SDIR)/ListOps.$(ARCH).o	   	\
+$(SDIR)/command.$(ARCH).o               \
+$(SDIR)/CommandOps.$(ARCH).o		\
+$(SDIR)/errors.$(ARCH).o		\
+$(SDIR)/expand_vars.$(ARCH).o           \
+$(SDIR)/expand_vectors.$(ARCH).o        \
+$(SDIR)/exec_loop.$(ARCH).o             \
+$(SDIR)/interrupt.$(ARCH).o	        \
+$(SDIR)/MacroOps.$(ARCH).o		\
+$(SDIR)/macro_create.$(ARCH).o          \
+$(SDIR)/macro_delete.$(ARCH).o          \
+$(SDIR)/macro_edit.$(ARCH).o            \
+$(SDIR)/macro_funcs.$(ARCH).o           \
+$(SDIR)/macro_exec.$(ARCH).o            \
+$(SDIR)/macro_list.$(ARCH).o            \
+$(SDIR)/macro_read.$(ARCH).o            \
+$(SDIR)/macro_write.$(ARCH).o		\
+$(SDIR)/memstr.$(ARCH).o                \
+$(SDIR)/multicommand.$(ARCH).o          \
+$(SDIR)/parse.$(ARCH).o                 \
+$(SDIR)/parse_commands.$(ARCH).o	\
+$(SDIR)/startup.$(ARCH).o		\
+$(SDIR)/string.$(ARCH).o                \
+$(SDIR)/timeformat.$(ARCH).o            \
+$(SDIR)/BufferOps.$(ARCH).o             \
+$(SDIR)/SocketOps.$(ARCH).o             \
+$(SDIR)/VectorOps.$(ARCH).o             \
+$(SDIR)/check_stack.$(ARCH).o           \
+$(SDIR)/convert_to_RPN.$(ARCH).o	\
+$(SDIR)/evaluate_stack.$(ARCH).o  	\
+$(SDIR)/isolate_elements.$(ARCH).o 	\
+$(SDIR)/dvomath.$(ARCH).o               \
+$(SDIR)/stack_math.$(ARCH).o		\
+$(SDIR)/variable.$(ARCH).o	   	\
+$(SDIR)/version.$(ARCH).o	   	\
+$(SDIR)/gprint.$(ARCH).o		\
+$(SDIR)/opihi.$(ARCH).o
+
+# dependancy rules for include files ########################
+incs = \
+$(INC)/opihi.h \
+$(INC)/external.h \
+$(INC)/shell.h \
+$(INC)/dvomath.h \
+$(INC)/convert.h \
+$(INC)/display.h 
+
+$(shell) : $(incs)
+
+$(LIB)/libshell.$(ARCH).a: $(shell)
+$(LIB)/libshell.$(ARCH).$(DLLTYPE): $(shell)
+
+$(DESTLIB)/libshell.a: $(LIB)/libshell.$(ARCH).a
+$(DESTLIB)/libshell.$(DLLTYPE): $(LIB)/libshell.$(ARCH).$(DLLTYPE)
+
+libshell: $(DESTLIB)/libshell.a $(DESTLIB)/libshell.$(DLLTYPE)
+
+uninstall:
+	rm -f $(DESTLIB)/libshell.a
+	rm -f $(DESTLIB)/libshell.$(DLLTYPE)
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/SocketOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/SocketOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/SocketOps.c	(revision 15879)
@@ -0,0 +1,284 @@
+# include "shell.h"
+
+# define MY_PORT 2000
+# define MY_WAIT 500
+# define DEBUG 0
+
+static int NVALID;
+static int Nvalid;
+static int *VALID;
+
+int InitServerSocket (SockAddress *Address) {
+
+  int status, InitSocket, length;
+
+# if (0)
+  struct hostent  *host;
+  char tmpline[80], hostip[80];
+
+  host = gethostbyname (hostname);
+  bzero (hostip, 80);
+  for (i = 0; i < host[0].h_length; i++) {
+    sprintf (tmpline, "%u", (0xff & host[0].h_addr[i]));
+    strcat (hostip, tmpline);
+    if (i < host[0].h_length - 1) strcat (hostip, ".");
+  }
+# endif
+  
+  Address[0].sin_family = AF_INET;
+  Address[0].sin_port   = MY_PORT;
+  Address[0].sin_addr.s_addr = INADDR_ANY; // use this line to bind any address / port?
+
+retry_server:
+
+# if (0)  
+  status = inet_aton (hostip, &Address[0].sin_addr);
+  if (!status) {
+    gprint (GP_ERR, "invalid address\n");
+    exit (2);
+  }
+# endif
+
+  length = sizeof(Address[0]);
+
+  InitSocket = socket (PF_INET, SOCK_STREAM, 0);
+  if (InitSocket == -1) {
+    perror ("socket: ");
+    exit (2);
+  }
+
+  if (DEBUG) gprint (GP_ERR, "init sock: %d, len: %d\n", InitSocket, length);
+  status = bind (InitSocket, (struct sockaddr *) Address, length);
+  if (status == -1) {
+
+# if 0
+    fprintf (stderr, "errno: %d\n", errno);
+    fprintf (stderr, "EACCES: %d\n", EACCES);
+    fprintf (stderr, "EBADF: %d\n", EBADF);
+    fprintf (stderr, "EINVAL: %d\n", EINVAL);
+    fprintf (stderr, "ENOTSOCK: %d\n", ENOTSOCK);
+    fprintf (stderr, "EFAULT: %d\n", EFAULT);
+    fprintf (stderr, "ELOOP: %d\n", ELOOP);
+    fprintf (stderr, "ENAMETOOLONG: %d\n", ENAMETOOLONG);
+    fprintf (stderr, "ENOENT: %d\n", ENOENT);
+    fprintf (stderr, "ENOMEM: %d\n", ENOMEM);
+    fprintf (stderr, "ENOTDIR: %d\n", ENOTDIR);
+    fprintf (stderr, "EROFS: %d\n", EROFS);
+    fprintf (stderr, "EADDRNOTAVAIL: %d\n", EADDRNOTAVAIL);
+    fprintf (stderr, "EADDRINUSE: %d\n", EADDRINUSE);
+    fprintf (stderr, "ENOSR: %d\n", ENOSR);
+# endif
+
+    if (errno == EADDRINUSE) {
+	Address[0].sin_port ++;
+	if (Address[0].sin_port > MY_PORT + 10) exit (2);
+	goto retry_server;
+    }
+    perror ("bind: ");
+    exit (2);
+  }
+  /* repeated starts of the server are limited by xinetd or something:
+     requires 60sec timeout of the selected socket */
+
+  fprintf (stderr, "bound to port: %d\n", Address[0].sin_port);
+  status = listen (InitSocket, 10);
+  if (status == -1) {
+    perror ("listen: ");
+    exit (2);
+  }
+  return (InitSocket);
+}
+
+int WaitServerSocket (int InitSocket, SockAddress *Address) {
+
+  int i, BindSocket;
+  SockAddress Address_in;
+  socklen_t length;
+  u_int32_t addr;
+
+  Address_in = Address[0];
+
+  length = sizeof(Address_in);
+
+  /* this is a blocking wait; use in a separate thread */
+  fcntl (InitSocket, F_SETFL, !O_NONBLOCK); 
+
+  if (DEBUG) gprint (GP_ERR, "init sock: %d, len: %d\n", InitSocket, length);
+  BindSocket = accept (InitSocket, (struct sockaddr *) &Address_in, &length);
+  if (DEBUG) gprint (GP_ERR, "bind sock: %d\n", BindSocket);
+  if (BindSocket == -1) {
+    perror ("accept: ");
+    exit (2);
+  }
+
+  addr = Address_in.sin_addr.s_addr;
+  if (DEBUG) {
+    gprint (GP_ERR, "incoming connection from: ");
+    gprint (GP_ERR, " %u", (0xff & (addr >>  0)));
+    gprint (GP_ERR, ".%u", (0xff & (addr >>  8)));
+    gprint (GP_ERR, ".%u", (0xff & (addr >> 16)));
+    gprint (GP_ERR, ".%u", (0xff & (addr >> 24)));
+    gprint (GP_ERR, "\n");
+  }
+
+  if (Nvalid == 0) goto accepted;
+
+  for (i = 0; i < Nvalid; i++) {
+    /* valid IP addresses may be machines (120.90.121.142) or 
+       class C networks (120.90.121.0) */
+       
+    /* for machine, address must match */
+    if ((0xff & (VALID[i] >> 24)) != 0) {
+      if (addr == VALID[i]) goto accepted;
+    }
+
+    /* for network, lower three bytes of address must match */
+    if ((0xff & (VALID[i] >> 24)) == 0) {
+      if ((0x00ffffff & addr) == VALID[i]) goto accepted;
+    }
+  }
+
+  if (DEBUG) gprint (GP_ERR, "connection rejected\n");
+  close (BindSocket);
+  return (-1);
+
+accepted:
+  if (DEBUG) gprint (GP_ERR, "connection accepted\n");
+  fcntl (BindSocket, F_SETFL, O_NONBLOCK); 
+  return (BindSocket);
+}
+
+int GetClientSocket (char *hostname) {
+
+  int i, status, InitSocket, length;
+  SockAddress Address;
+  struct hostent  *host;
+  char tmpline[80], hostip[80];
+
+  host = gethostbyname (hostname);
+  bzero (hostip, 80);
+  for (i = 0; i < host[0].h_length; i++) {
+    sprintf (tmpline, "%u", (0xff & host[0].h_addr[i]));
+    strcat (hostip, tmpline);
+    if (i < host[0].h_length - 1) strcat (hostip, ".");
+  }
+
+  if (DEBUG) {
+    gprint (GP_ERR, "trying %s (%s:%d)...", host[0].h_name, hostip, MY_PORT);
+  }
+
+  Address.sin_family = AF_INET;
+  Address.sin_port   = MY_PORT;
+
+retry_client:
+  status = inet_aton (hostip, &Address.sin_addr);
+  if (!status) {
+    gprint (GP_ERR, "invalid address\n");
+    exit (2);
+  }
+
+  length = sizeof(Address);
+
+  InitSocket = socket (PF_INET, SOCK_STREAM, 0);
+  if (InitSocket == -1) {
+    perror ("socket: ");
+    exit (2);
+  }
+
+  status = connect (InitSocket, (struct sockaddr *) &Address, length);
+  if (status == -1) {
+    if (errno == ECONNREFUSED) {
+      Address.sin_port ++;
+      if (Address.sin_port > MY_PORT + 10) exit (2);
+      goto retry_client;
+    }
+    perror ("connect: ");
+    exit (2);
+  }
+
+  if (DEBUG) gprint (GP_ERR, "connected on port: %d\n", Address.sin_port);
+  if (DEBUG) gprint (GP_ERR, "connected\n");
+  fcntl (InitSocket, F_SETFL, O_NONBLOCK); 
+  return (InitSocket);
+}
+
+int InitServerSocket_Named (char *hostname, SockAddress *Address) {
+
+  int i, status, InitSocket, length;
+  struct hostent  *host;
+  char tmpline[80], hostip[80];
+
+  host = gethostbyname (hostname);
+  bzero (hostip, 80);
+  for (i = 0; i < host[0].h_length; i++) {
+    sprintf (tmpline, "%u", (0xff & host[0].h_addr[i]));
+    strcat (hostip, tmpline);
+    if (i < host[0].h_length - 1) strcat (hostip, ".");
+  }
+  
+  Address[0].sin_family = AF_INET;
+  Address[0].sin_port   = MY_PORT;
+  status = inet_aton (hostip, &Address[0].sin_addr);
+  if (!status) {
+    gprint (GP_ERR, "invalid address\n");
+    exit (2);
+  }
+
+  length = sizeof(Address[0]);
+
+  InitSocket = socket (PF_INET, SOCK_STREAM, 0);
+  if (InitSocket == -1) {
+    perror ("socket: ");
+    exit (2);
+  }
+
+  if (DEBUG) gprint (GP_ERR, "init sock: %d, len: %d\n", InitSocket, length);
+  status = bind (InitSocket, (struct sockaddr *) Address, length);
+  if (status == -1) {
+    perror ("bind: ");
+    exit (2);
+  }
+
+  status = listen (InitSocket, 10);
+  if (status == -1) {
+    perror ("listen: ");
+    exit (2);
+  }
+
+  if (DEBUG) gprint (GP_ERR, "socket listening on %s (%s:%d)\n", host[0].h_name, hostip, MY_PORT);
+  return (InitSocket);
+}
+
+/* load valid ip list */
+int DefineValidIP () {
+
+  int i, Nvalid, ip1, ip2, ip3, ip4, test, status;
+  char string[80];
+
+  Nvalid = 0;
+  NVALID = 10;
+  ALLOCATE (VALID, int, NVALID);
+  for (i = 0; VarConfigEntry ("VALID_IP", "%s", i, string) != NULL; i++) {
+    status = sscanf (string, "%d.%d.%d.%d", &ip1, &ip2, &ip3, &ip4);
+    test = TRUE;
+    test &= (status == 4);
+    test &= ((ip1 > 0) && (ip1 < 256)); 
+    test &= ((ip2 > 0) && (ip2 < 256)); 
+    test &= ((ip3 > 0) && (ip3 < 256)); 
+    test &= ((ip4 >=0) && (ip4 < 256)); 
+    if (!test) {
+      gprint (GP_ERR, "invalid IP address %s\n", string);
+      exit (2);
+    }
+    VALID[Nvalid] = ip1 | (ip2 << 8) | (ip3 << 16) | (ip4 << 24);
+    Nvalid ++;
+    CHECK_REALLOCATE (VALID, int, NVALID, Nvalid, 10);
+  }
+  NVALID = Nvalid;
+  REALLOCATE (VALID, int, NVALID);
+  if (NVALID == 0) {
+    free (VALID);
+    VALID = NULL;
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/VectorOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/VectorOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/VectorOps.c	(revision 15879)
@@ -0,0 +1,168 @@
+# include "opihi.h"
+
+static Vector **vectors;
+static int     Nvectors;
+  
+void InitVectors () {
+  Nvectors = 0;
+  ALLOCATE (vectors, Vector *, 1);
+}
+
+Vector *InitVector () {
+  Vector *vec;
+
+  ALLOCATE (vec, Vector, 1);
+  ALLOCATE (vec[0].elements, float, 1);
+  bzero (vec[0].name, 1024);
+  vec[0].Nelements = 0;
+  return (vec);
+}
+
+int IsVector (char *name) {
+ 
+  int i;
+
+  if (name == NULL) return (FALSE);
+
+  for (i = 0; (i < Nvectors) && (strcmp(vectors[i][0].name, name)); i++);
+  if (i == Nvectors) return (FALSE);
+  return (TRUE);
+}
+
+int IsVectorPtr (Vector *vec) {
+ 
+  int i;
+
+  if (vec == NULL) return (FALSE);
+
+  for (i = 0; (i < Nvectors) && (vectors[i] != vec); i++);
+  if (i == Nvectors) return (FALSE);
+  return (TRUE);
+}
+
+Vector *SelectVector (char *name, int mode, int verbose) {
+
+  int i;
+
+  if (name == NULL) goto error;
+  if (ISNUM(name[0])) goto error;
+  if (IsBuffer(name)) goto error;
+
+  for (i = 0; (i < Nvectors) && (strcmp(vectors[i][0].name, name)); i++);
+  /* is a new vector */
+  if (i == Nvectors) { 
+    if (mode == OLDVECTOR) goto error;
+    Nvectors += 1;
+    REALLOCATE (vectors, Vector *, Nvectors);
+    vectors[i] = InitVector ();
+    strcpy (vectors[i][0].name, name);
+    return (vectors[i]);
+  } 
+  /* is an old vector */
+  if (mode == NEWVECTOR) goto error;
+  return (vectors[i]);
+
+ error:
+  if (verbose) gprint (GP_ERR, "invalid vector %s\n", name);
+  return (NULL);
+}
+  
+/* delete by pointer */
+int DeleteVector (Vector *vec) {
+
+  int i, j;
+
+  if (vec == NULL) return (FALSE);
+
+  for (i = 0; (i < Nvectors) && (vec != vectors[i]); i++);
+  if (i == Nvectors) return (FALSE);
+
+  free (vectors[i][0].elements);
+  free (vectors[i]);
+  for (j = i; j < Nvectors - 1; j++) vectors[j] = vectors[j + 1];
+
+  Nvectors -= 1;
+  REALLOCATE (vectors, Vector *, MAX (Nvectors, 1));
+  return (TRUE);
+}
+  
+/* delete by name */
+int DeleteNamedVector (char *name) {
+
+  int i, j;
+
+  if (name == NULL) return (FALSE);
+  for (i = 0; (i < Nvectors) && (strcmp(vectors[i][0].name, name)); i++);
+  if (i == Nvectors) return (FALSE);
+
+  free (vectors[i][0].elements);
+  free (vectors[i]);
+  for (j = i; j < Nvectors - 1; j++) vectors[j] = vectors[j + 1];
+
+  Nvectors -= 1;
+  REALLOCATE (vectors, Vector *, MAX (Nvectors, 1));
+  return (TRUE);
+}
+
+/* copy data from in to out - new memory space */
+int CopyNamedVector (char *out, char *in) {
+  Vector *In, *Out;
+  if ((In  = SelectVector (in,  OLDVECTOR, FALSE)) == NULL) return (FALSE);
+  if ((Out = SelectVector (out, ANYVECTOR, FALSE)) == NULL) return (FALSE);
+  CopyVector (Out, In);
+  return (TRUE);
+}
+int CopyVector (Vector *out, Vector *in) {
+  free (out[0].elements);
+  out[0].Nelements = in[0].Nelements;
+  ALLOCATE (out[0].elements, float, out[0].Nelements);
+  memcpy (out[0].elements, in[0].elements, out[0].Nelements*sizeof(float));
+  return (TRUE);
+}
+
+/* move data from in to out - use old memory space */
+int MoveNamedVector (char *out, char *in) {
+  Vector *In, *Out;
+  if ((In  = SelectVector (in,  OLDVECTOR, FALSE)) == NULL) return (FALSE);
+  if ((Out = SelectVector (out, ANYVECTOR, FALSE)) == NULL) return (FALSE);
+  MoveVector (Out, In);
+  return (TRUE);
+}
+int MoveVector (Vector *out, Vector *in) {
+  int i, j;
+
+  free (out[0].elements);
+  out[0].Nelements = in[0].Nelements;
+  out[0].elements =  in[0].elements;
+
+  /* delete vector entry from vector list, if it exists */
+  for (i = 0; (i < Nvectors) && (in != vectors[i]); i++);
+  if (i == Nvectors) {
+    free (in);
+    return (TRUE);
+  }
+
+  for (j = i; j < Nvectors - 1; j++) vectors[j] = vectors[j + 1];
+  Nvectors -= 1;
+  REALLOCATE (vectors, Vector *, MAX (Nvectors, 1));
+  free (in);
+  return (TRUE);
+}
+
+int ListVectors () {
+
+  int i;
+
+  if (Nvectors == 0) {
+    gprint (GP_ERR, "No defined vectors\n");
+    return (FALSE);
+  }
+
+  gprint (GP_LOG, "    N       name      size\n");
+  for (i = 0; i < Nvectors; i++) {
+    gprint (GP_LOG, "%5d %10s %10d\n",
+	     i, vectors[i][0].name, vectors[i][0].Nelements);
+  }
+  return (TRUE);
+}
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/check_stack.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/check_stack.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/check_stack.c	(revision 15879)
@@ -0,0 +1,84 @@
+# include "opihi.h"
+
+int check_stack (StackVar *stack, int Nstack, int validsize) {
+
+  int i, Nx, Ny, Nv, size;
+  char *c;
+
+  Nv = Nx = Ny = -1;
+
+  for (i = 0; i < Nstack; i++) {
+    if (stack[i].type == 'X') {
+
+      /** if this is a number, put it on the list of scalers and move on **/
+      stack[i].Float = strtod (stack[i].name, &c);
+      if (c == stack[i].name + strlen (stack[i].name)) {
+	stack[i].ptr   = &(stack[i].Float);
+	stack[i].type  = 'S';
+	continue;
+      } 
+
+      /** if this is a matrix, find the dimensions and check with existing values **/
+      if (IsBuffer (stack[i].name)) {
+	stack[i].buffer = SelectBuffer (stack[i].name, OLDBUFFER, TRUE);
+	stack[i].ptr    = (float *) stack[i].buffer[0].matrix.buffer;
+	stack[i].type   = 'M';
+	if (Nx == -1) {
+	  Nx = stack[i].buffer[0].matrix.Naxis[0];
+	  Ny = stack[i].buffer[0].matrix.Naxis[1];
+	} 
+	if ((Nx != stack[i].buffer[0].matrix.Naxis[0]) && (Ny != stack[i].buffer[0].matrix.Naxis[1])) {
+	  push_error ("dimensions don't match");
+	  return (-1);
+	}	
+	if (Nv != -1) {
+	  if ((Nv != Nx) && (Nv != Ny)) {
+	    push_error ("dimensions don't match");
+	    return (-1);
+	  }
+	}	
+	continue;
+      }
+
+      /** if this is a vector, find the dimensions and check with existing values **/
+      if (IsVector (stack[i].name)) {
+	stack[i].vector = SelectVector (stack[i].name, OLDVECTOR, FALSE);
+	stack[i].ptr    = (float *) stack[i].vector[0].elements;
+	stack[i].type   = 'V';
+
+	if (Nv == -1) Nv = stack[i].vector[0].Nelements;
+	if (Nv != stack[i].vector[0].Nelements) {
+	  push_error ("dimensions don't match");
+	  return (-1);
+	}
+	if (Nx != -1) {
+	  if ((Nx != Nv) && (Ny != Nv)) {
+	    push_error ("dimensions don't match");
+	    return (-1);
+	  }
+	}	
+	continue;
+      }
+
+      /* this is not a scalar, vector, or matrix.  must be string */
+      stack[i].type  = 'W';
+    }
+  }
+
+  /* return object dimensions */
+  size = 0;
+  if (Nv != -1) size = 1;
+  if (Nx != -1) size = 2;
+  if (validsize == -1)   return (size);
+  if (validsize != size) return (-1);
+  return (size);
+}
+
+/* check stack identifies the data elements as scalar, vector, matrix, or word.
+   operators have already been identified.  
+   check stack returns the total stack dimensionality (0,1,2)
+   on error, check stack returns -1
+   possible errors:
+     - mismatch with requested dimensionality
+     - mismatch in data dimensions
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/command.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/command.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/command.c	(revision 15879)
@@ -0,0 +1,72 @@
+# include "opihi.h"
+# define DEBUG 0
+
+int command (char *line, char **outline, int VERBOSE) {
+
+  int i, status, argc;
+  char **argv, **targv;
+  Command *cmd;
+
+  /* force a space between ! and first word: !ls becomes ! ls */
+  if (line[0] == '!') {
+    REALLOCATE (line, char, strlen(line) + 5);
+    memmove (&line[2], &line[1], strlen(&line[1]) + 1);
+    line[1] = ' ';
+  }
+
+  /* expand anything of the form $fred or $fred$sam, etc */ 
+  line = expand_vars (line);     /* line is freed here, new one allocated */
+  /* expand anything of the form fred[N] */ 
+  line = expand_vectors (line);  /* line is freed here, new one allocated */
+  /* solve math expresions, assign variable, if needed */
+  line = parse (line);        /* line is freed here, new one allocated */
+  /* any entry in line of the form {foo} returns value or tmp vector / buffer */
+
+  /* we may have reallocated line, return new pointer */
+  *outline = line;
+  
+  # if (DEBUG) 
+  fprintf (stderr, "line: %s\n", line);
+  # endif
+
+  argv = parse_commands (line, &argc);
+  if (argc == 0) return (TRUE);  /* empty command or assignment */
+
+  /* save the original values of argv since command may modify the array */
+  ALLOCATE (targv, char *, argc);
+  for (i = 0; i < argc; i++) targv[i] = argv[i];
+
+  cmd = MatchCommand (argv[0], VERBOSE, FALSE);
+  if (cmd == NULL) {
+    status = -1;
+  } else {
+    free (argv[0]);
+    argv[0] = strcreate (cmd[0].name);
+    targv[0] = argv[0];
+    status = (*cmd[0].func) (argc, argv);
+  }
+  for (i = 0; i < argc; i++) free (targv[i]);
+  free (targv);
+  free (argv);
+
+  if (!status) {
+    char *msg;
+    msg = get_variable_ptr ("ERRORMSG");
+    if (msg != (char *) NULL) gprint (GP_ERR, "%s\n", msg);
+  }
+
+  set_int_variable ("STATUS", status);
+
+  # if (DEBUG) 
+  gprint (GP_ERR, "command: %s, status: %d\n", line, status);
+  # endif
+
+  return (status);
+}
+
+/* parse the input line, search for the corresponding command, and execute it
+   if no match is found, return -1; this is used above to distinguish between
+   a command error and an unknown command.  if VERBOSE is true, unknown commands
+   result in an error message.  The input line is freed and the resulting parsed
+   line is returned on 'outline'
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/convert_to_RPN.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/convert_to_RPN.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/convert_to_RPN.c	(revision 15879)
@@ -0,0 +1,207 @@
+# include "opihi.h"
+# define DUMPSTACK 0
+
+StackVar *convert_to_RPN (int argc, char **argv, int *nstack) {
+  
+  int type, Nx, Ny;
+  int i, j, Nstack, Nop_stack, NSTACK;
+  StackVar *stack, *op_stack;
+
+  /* max total stack size is argc, though should be less, this is safe */
+  NSTACK = argc + 5;
+  ALLOCATE (stack, StackVar, NSTACK);
+  ALLOCATE (op_stack, StackVar, NSTACK);
+  for (i = 0; i < NSTACK; i++) {
+    init_stack (&stack[i]);
+    init_stack (&op_stack[i]);
+  }
+  
+  Nx = Ny = Nstack = Nop_stack = 0;
+  for (i = 0; i < argc; i++) {
+    
+    /* decide on priority of object */
+    type = 0;
+    /* unary operations */
+    if (!strcmp (argv[i], "abs"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "int"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "exp"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "ten"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "log"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "ln"))     { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "sqrt"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "erf"))    { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "sinh"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "cosh"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "asinh"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "acosh"))  { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "sin"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "cos"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "tan"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dsin"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dcos"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dtan"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "asin"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "acos"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "atan"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dasin"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "dacos"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "datan"))  { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "lgamma")) { type = 9; goto gotit; }
+
+    if (!strcmp (argv[i], "rnd"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "xramp"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "yramp"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "ramp"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "zero"))   { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "--"))     { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "not"))    { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "isinf"))  { type = 9; goto gotit; }
+    if (!strcmp (argv[i], "isnan"))  { type = 9; goto gotit; }
+
+    /* binary operations */
+    if (!strcmp (argv[i], "^"))      { type = 8; goto gotit; }
+
+    if (!strcmp (argv[i], "@"))      { type = 7; goto gotit; }
+    if (!strcmp (argv[i], "/"))      { type = 7; goto gotit; }
+    if (!strcmp (argv[i], "*"))      { type = 7; goto gotit; }
+    if (!strcmp (argv[i], "%"))      { type = 7; goto gotit; }
+
+    if (!strcmp (argv[i], "+"))      { type = 6; goto gotit; }
+    if (!strcmp (argv[i], "-"))      { type = 6; goto gotit; }
+	
+    if (!strcmp (argv[i], "&"))      { type = 5; goto gotit; }
+    if (!strcmp (argv[i], "|"))      { type = 5; goto gotit; }
+
+    if (!strcmp (argv[i], "<"))      { type = 4; goto gotit; }
+    if (!strcmp (argv[i], ">"))      { type = 4; goto gotit; }
+    if (!strcmp (argv[i], "=="))     { type = 4; strcpy (argv[i], "E"); goto gotit; }
+    if (!strcmp (argv[i], "!="))     { type = 4; strcpy (argv[i], "N"); goto gotit; }
+    if (!strcmp (argv[i], "<="))     { type = 4; strcpy (argv[i], "L"); goto gotit; }
+    if (!strcmp (argv[i], ">="))     { type = 4; strcpy (argv[i], "G"); goto gotit; }
+    if (!strcmp (argv[i], ">>"))     { type = 4; strcpy (argv[i], "U"); goto gotit; }
+    if (!strcmp (argv[i], "<<"))     { type = 4; strcpy (argv[i], "D"); goto gotit; }
+
+    if (!strcmp (argv[i], "&&"))     { type = 3; strcpy (argv[i], "A"); goto gotit; }
+    if (!strcmp (argv[i], "||"))     { type = 3; strcpy (argv[i], "O"); goto gotit; }
+
+    if (!strcmp (argv[i], "("))      { type = 2; goto gotit; }
+    if (!strcmp (argv[i], ")"))      { type = 1; goto gotit; }
+
+  gotit:
+    /* choose how to deal with object */
+    switch (type) {
+      case 8:  /* exponentiation: 2^2^3 = 64 != 256 (precedence is right-to-left, not left-to-right!) */
+	/* pop previous, higher operators from OP stack to stack */
+	for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type > type); j--) {
+	  move_stack (&stack[Nstack], &op_stack[j]);
+	  Nstack ++;
+	  Nop_stack --;
+	}
+	/* push operator on OP stack */
+	assign_stack (&op_stack[Nop_stack], argv[i], type);
+	Nop_stack ++;
+	break;
+      case 9: /* unary OPs */
+      case 7: /* binary OPs */
+      case 6:
+      case 5: 
+      case 4: 
+      case 3: 
+	/* pop previous, higher or equal operators from OP stack to stack */
+	for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type >= type); j--) {
+	  move_stack (&stack[Nstack], &op_stack[j]);
+	  Nstack ++;
+	  Nop_stack --;
+	}
+	/* push operator on OP stack */
+	assign_stack (&op_stack[Nop_stack], argv[i], type);
+	Nop_stack ++;
+	break;
+      case 2:  
+	/* push operator on OP stack */
+	assign_stack (&op_stack[Nop_stack], argv[i], type);
+	Nop_stack ++;
+	break;
+      case 1: 
+	/* pop rest of operators from OP stack to stack, looking for '(' */
+	for (j = Nop_stack - 1; (j >= 0) && (op_stack[j].type != 2); j--) {
+	  move_stack (&stack[Nstack], &op_stack[j]);
+	  Nstack ++;
+	  Nop_stack --;
+	}
+	if ((j == -1) || (op_stack[j].type != 2)) {
+	  push_error ("syntax error: mismatched parenthesis");
+	  Nstack = 0;
+	  goto cleanup;
+	}
+	Nop_stack --;
+	break;
+      case 0:
+	/* place the value (number or vector/matrix name) on stack */
+	/* value of 'X' is used as sentinel until we sort out values */
+	assign_stack (&stack[Nstack], argv[i], 'X');
+	Nstack ++;
+	break;
+    }
+  }
+
+  /* dump remaining operators on stack, checking for ')' */
+  for (j = Nop_stack - 1; j >= 0; j--) {
+    if (op_stack[j].type == 2) {
+      push_error ("syntax error: mismatched parenthesis");
+      Nstack = 0;
+      goto cleanup;
+    }
+    move_stack (&stack[Nstack],  &op_stack[j]);
+    Nstack ++;
+  }
+
+cleanup: 
+  /*** free up unused stack space ***/
+
+  // XXX there should not be any un-freed op_stacks at this point
+  // clean_stack (op_stack, NSTACK);
+  free (op_stack);
+
+  // XXX there should not be any data on higher stack entries
+  // clean_stack (&stack[Nstack], NSTACK - Nstack);
+  REALLOCATE (stack, StackVar, MAX (Nstack, 1));
+  *nstack = Nstack;
+
+  for (i = 0; i < argc; i++) {
+    free (argv[i]);
+  }
+  free (argv);
+
+# if (DUMPSTACK)
+  for (i = 0; i < Nstack; i++) {
+    gprint (GP_ERR, "%s ", stack[i].name);
+  }
+  if (Nstack > 0) gprint (GP_ERR, "\n");
+  for (i = 0; i < Nstack; i++) {
+    gprint (GP_ERR, "%d ", stack[i].type);
+  }
+  if (Nstack > 0) gprint (GP_ERR, "\n");
+# endif
+
+  return (stack);
+
+}
+
+/* here are the rules for parsing a math AOL line to RPN:
+
+1) if object is a number, push on stack
+2) if object is a third order operand (exp, sin, cos), push on op stack
+3) if object is an open paren, push on op stack,
+4) if object is a second order operand, push on stack
+5) if object is a first order operand, pop all second order operands from stack 
+until paren, push on stack
+6) if object is an end paren, pop all objects from stack until paren, 
+pop next stack, if third order op
+7) if end of line, pop all remaining objects, second order first, etc.
+   
+*/
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/dvomath.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/dvomath.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/dvomath.c	(revision 15879)
@@ -0,0 +1,103 @@
+# include "opihi.h"
+
+/* return value on success is temp vector/buffer name or scalar value return value on error is NULL, all
+   internals freed.  errors are sent to error stack.  may be printed by calling function */
+
+/* XXX this function breaks the elements of the line into objects, numbers, and operators.  it
+ * then converts the list to an RPN expresssion.  it then evaluates the expression.  if an
+ * expression is not a valid math expression (string - string), it results in an error.  The
+ * problem is that elements of a valid expression may be invalid as expressions on their own
+ * (eg, string consisting of word-word).  this function probably should be somewhat smarter
+ * about breaking down items into strings and objects.  for the time being, the user must
+ * protect string items with double quotes for safety.
+ */
+   
+char *dvomath (int argc, char **argv, int *size, int validsize) {
+  
+  int  i, Nstack, Ncstack;
+  char   **cstack, *outname;
+  StackVar *stack;
+  Buffer *buf;
+  Vector *vec;
+
+  buf = NULL;
+  vec = NULL;
+  ALLOCATE (outname, char, 256);
+
+  /* take char array with expression, convert to important elements */
+  cstack = isolate_elements (argc, argv, &Ncstack); 
+
+  /* generate RPN stack from cstack arguments */
+  stack = convert_to_RPN (Ncstack, cstack, &Nstack);
+  if (Nstack < 1) goto error;
+
+  /* distinguish scalar, vector, matrix, check dimensions */
+  *size = check_stack (stack, Nstack, validsize);
+  if (*size < 0) goto error;
+
+  switch (*size) {
+    case 0:
+      break;
+    case 1:  /* allocate temp vector */
+      vec = NULL;
+      for (i = 0; (i < 1000) && (vec == NULL); i++) {
+	sprintf (outname, "tmp%03d", i);
+	vec = SelectVector (outname, NEWVECTOR, FALSE);
+      }
+      if (vec == NULL) { 
+	push_error ("too many tmp vectors");
+	goto error;
+      }
+      break;
+    case 2:  /* allocate temp buffer */
+      buf = NULL;
+      for (i = 0; (i < 1000) && (buf == NULL); i++) {
+	sprintf (outname, "tmp%03d", i);
+	buf = SelectBuffer (outname, NEWBUFFER, FALSE);
+      }
+      if (buf == NULL) {
+	push_error ("too many tmp buffers");
+	goto error;
+      }
+      break;
+    default:
+      goto error;
+  }
+
+  /* evaluate operations, free stack on error */
+  Ncstack = Nstack;
+  if (!evaluate_stack (stack, &Nstack)) {
+    if (*size == 1) DeleteVector (vec);
+    if (*size == 2) DeleteBuffer (buf);
+    goto error;
+  }
+
+  switch (*size) {
+    case 0:
+      if (Ncstack == 1) {
+	  /* use exact input work */
+	  sprintf (outname, "%s", stack[0].name);
+      } else {
+	  sprintf (outname, "%.12g", stack[0].Float);
+      }
+      break;
+
+    case 1:
+      MoveVector (vec, stack[0].vector);
+      break;
+  
+    case 2:
+      MoveBuffer (buf, stack[0].buffer);
+      break;
+  }
+
+  clean_stack (stack, Nstack);
+  free (stack);
+  return (outname);
+
+error:  
+  clean_stack (stack, Nstack);
+  free (stack);
+  free (outname);
+  return (NULL);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/errors.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/errors.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/errors.c	(revision 15879)
@@ -0,0 +1,22 @@
+# include "opihi.h"
+
+static char errorline[1024];
+
+int init_error () {
+
+  bzero (errorline, 1024);
+  return (TRUE);
+}
+
+int push_error (char *line) {
+
+  bzero (errorline, 1024);
+  strncpy (errorline, line, 1023);
+  return (TRUE);
+}
+
+int print_error () {
+
+  gprint (GP_ERR, "%s\n", errorline);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/evaluate_stack.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/evaluate_stack.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/evaluate_stack.c	(revision 15879)
@@ -0,0 +1,209 @@
+# include "opihi.h"
+# define VERBOSE 0
+
+# define TWO_OP(A,B,FUNC) \
+  if (!strncasecmp (&stack[i - 2].type, A, 1) && !strncasecmp (&stack[i - 1].type, B, 1)) \
+    status = FUNC (&tmp_stack, &stack[i - 2], &stack[i - 1], stack[i].name); 
+
+# define ONE_OP(A,FUNC) \
+  if (!strncasecmp (&stack[i - 1].type, A, 1)) \
+    status = FUNC (&tmp_stack, &stack[i - 1], stack[i].name); 
+
+int evaluate_stack (StackVar *stack, int *Nstack) {
+  
+  int i, j, Nvar, Nout, status;
+  char line[512];
+  StackVar tmp_stack;
+  Nout = Nvar = 0;
+
+  status = TRUE;
+  init_stack (&tmp_stack);
+
+  if (*Nstack == 1) {
+    if (stack[0].type == 'S') {
+      clear_stack (&tmp_stack);
+      return (TRUE);
+    }
+    if (stack[0].type == 'V') {
+      /* need to make a copy so we set output value? */
+      V_unary (&tmp_stack, &stack[0], "=");
+      move_stack (&stack[0], &tmp_stack);
+      return (TRUE);
+    }
+    if (stack[0].type == 'M') {
+      /* need to make a copy so we set output value? */
+      M_unary (&tmp_stack, &stack[0], "=");
+      move_stack (&stack[0], &tmp_stack);
+      return (TRUE);
+    }
+    push_error ("syntax error: not a math expression");
+    clear_stack (&tmp_stack);
+    return (FALSE);
+  }      
+    
+  for (i = 0; i < *Nstack; i++) {
+
+    if (VERBOSE) {
+      gprint (GP_ERR, "%d: ", i);
+      for (j = 0; j < *Nstack; j++) {
+	gprint (GP_ERR, "%s ", stack[j].name);
+      }
+      if (*Nstack > 0) gprint (GP_ERR, "\n");
+      gprint (GP_ERR, "%d: ", i);
+      for (j = 0; j < *Nstack; j++) {
+	gprint (GP_ERR, "%d ", stack[j].type);
+      }
+      if (*Nstack > 0) gprint (GP_ERR, "\n");
+    }
+
+    /***** binary operators *****/
+    if ((stack[i].type >= 3) && (stack[i].type <= 8)) {
+
+      if (i < 2) {  /* need two variables to operate on */
+	sprintf (line, "syntax error: binary operator with one operand: %s\n", stack[i].name);
+	push_error (line);
+	clear_stack (&tmp_stack);
+	return (FALSE);
+      }
+
+      status = FALSE;
+      TWO_OP ("M","M",MM_binary);
+      TWO_OP ("M","V",MV_binary);
+      TWO_OP ("M","S",MS_binary);
+      TWO_OP ("V","M",VM_binary);
+      TWO_OP ("V","V",VV_binary);
+      TWO_OP ("V","S",VS_binary);
+      TWO_OP ("S","M",SM_binary);
+      TWO_OP ("S","V",SV_binary);
+      TWO_OP ("S","S",SS_binary);      
+      TWO_OP ("W","W",WW_binary);      
+      TWO_OP ("W","S",WW_binary);      
+      TWO_OP ("S","W",WW_binary);      
+      
+      if (!status) {
+	sprintf (line, "syntax error: invalid operand for binary operation: %s or %s\n", stack[i-1].name, stack[i-2].name);
+	push_error (line);
+	clear_stack (&tmp_stack);
+	return (FALSE);
+      }
+      move_stack (&stack[i-2], &tmp_stack);
+      delete_stack (&stack[i-1], 2);
+      for (j = i + 1; j < *Nstack; j++) {
+	move_stack (&stack[j - 2], &stack[j]);
+      }
+      *Nstack -= 2;
+      i -= 2;
+      init_stack (&tmp_stack);
+      continue;
+    }
+
+    /***** unary operators **/
+    if (stack[i].type == 9) {
+
+      if (i < 1) {  /* need one variable to operate on */
+	push_error ("syntax error: unary operator with no operand");
+	clear_stack (&tmp_stack);
+	return (FALSE);
+      }
+
+      ONE_OP ("M", M_unary);
+      ONE_OP ("V", V_unary);
+      ONE_OP ("S", S_unary);
+
+      /* there are no valid unary string operators */
+      if (!strncasecmp (&stack[i - 1].type, "W", 1)) {
+	push_error ("syntax error: no valid string unary ops");
+	clear_stack (&tmp_stack);
+	return (FALSE);
+      }
+
+      move_stack (&stack[i-1], &tmp_stack);
+      delete_stack (&stack[i], 1);
+      for (j = i + 1; j < *Nstack; j++) {
+	move_stack (&stack[j - 1], &stack[j]);
+      }
+      init_stack (&tmp_stack);
+      *Nstack -= 1;
+      i -= 1;
+      continue;
+    } 
+  }
+  clear_stack (&tmp_stack);
+
+  if (*Nstack > 1) {
+    push_error ("syntax error in evaluation");
+    return (FALSE);
+  }
+  return (TRUE);
+}
+
+/* copy data to new stack variable */
+void copy_stack (StackVar *stack1, StackVar *stack2) {
+  stack1[0].name   = stack2[0].name  ;
+  stack1[0].type   = stack2[0].type  ;
+  stack1[0].ptr    = stack2[0].ptr   ;
+  stack1[0].buffer = stack2[0].buffer;
+  stack1[0].vector = stack2[0].vector;
+  stack1[0].Float  = stack2[0].Float ;
+  if (!strncasecmp (&stack1[0].type, "S", 1)) {
+    stack1[0].ptr    = &stack1[0].Float;
+  }
+}
+
+/* replace data with new stack variable */
+void move_stack (StackVar *stack1, StackVar *stack2) {
+  clear_stack (stack1);
+  copy_stack (stack1, stack2);
+  stack2[0].name = NULL;
+}
+
+/* delete name and data */
+void clean_stack (StackVar *stack, int Nstack) {
+
+  int i;
+
+  for (i = 0; i < Nstack; i++) {
+    if (IsBufferPtr (stack[i].buffer) && (stack[i].type == 'm')) {
+      if (VERBOSE) gprint (GP_ERR, "free %s (buff) (%lx)\n", stack[i].name, (long) stack[i].buffer);
+      free (stack[i].buffer[0].header.buffer);
+      free (stack[i].buffer[0].matrix.buffer);
+      free (stack[i].buffer);
+      stack[i].buffer = NULL;
+    }	
+    if (IsVectorPtr (stack[i].vector) && (stack[i].type == 'v')) {
+      if (VERBOSE) gprint (GP_ERR, "free %s (vect) (%lx)\n", stack[i].name, (long) stack[i].vector);
+      free (stack[i].vector[0].elements);
+      free (stack[i].vector);
+      stack[i].vector = NULL;
+    }	
+    if (VERBOSE) gprint (GP_ERR, "free %s (name) (%d) (%lx)\n", stack[i].name, i, (long) stack[i].name);
+    clear_stack (&stack[i]);
+  }
+
+}
+
+/* delete name only, not data */
+void delete_stack (StackVar *stack, int Nstack) {
+  int i;
+  for (i = 0; i < Nstack; i++) {
+    clear_stack (&stack[i]);
+  }
+}
+
+void init_stack (StackVar *stack) {
+  stack[0].buffer = NULL;
+  stack[0].vector = NULL;
+  stack[0].name = NULL;
+}
+
+void assign_stack (StackVar *stack, char *name, int type) {
+  stack->name = strcreate (name);
+  stack->type = type;
+}
+
+void clear_stack (StackVar *stack) {
+  if (stack->name == NULL) return;
+  free (stack->name);
+  stack->name = NULL;
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/exec_loop.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/exec_loop.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/exec_loop.c	(revision 15879)
@@ -0,0 +1,44 @@
+# include "opihi.h"
+
+int exec_loop (Macro *loop) {
+
+  void *Signal;
+  int j, status, ThisList;
+  char *line;
+  
+  /* increase the shell level (Nlists) by one */
+  ThisList = increase_list_depth();
+  if (ThisList == 0) abort();
+
+  /* copy the macro to the current list */
+  for (j = 0; j < loop[0].Nlines; j++) {
+    add_listentry (ThisList, loop[0].line[j]);
+  }
+
+  /* set up interrupts */
+  Signal = signal (SIGINT, handle_interrupt);
+  interrupt = FALSE;
+
+  /* process the list */
+  loop_next = loop_break = loop_last = FALSE;
+  status = TRUE;
+
+  while (!interrupt) {
+    line = get_next_listentry (ThisList);
+    if (line == NULL) break;
+    status = multicommand (line);
+    free (line);
+    if (auto_break && !status) loop_break = TRUE;
+    if (loop_break || loop_last || loop_next) break;
+  }
+  signal (SIGINT, Signal);
+
+  /* free remaining lines on the list, free the list, decrement the shell level */
+  /*** can we free a list which is not the bottom lists? */
+  decrease_list_depth();
+
+  if (loop_break) return (FALSE);
+  return (TRUE);
+}
+
+/** note that the list number runs from 1 - Nlists+1 **/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/expand_vars.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/expand_vars.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/expand_vars.c	(revision 15879)
@@ -0,0 +1,145 @@
+# include "opihi.h"
+
+char *expand_vars (char *line) {
+
+  char *L, *N, *V0, *V1, *Val, *newline, *c, found;
+  int done, MacroDepth, NLINE, Noff;
+
+  if (line == NULL) return (NULL);
+  MacroDepth = GetMacroDepth ();
+
+  found = FALSE;
+  NLINE = MAX (128, strlen(line));
+  ALLOCATE (newline, char, NLINE);  /* WARNING: this limits the length of the input line */
+
+  V0 = thiscomm (line);
+  if (V0 && !strncmp ("while", V0, strlen(V0))) {
+      // special case: don't expand variables in while () statement
+      strcpy (newline, line);
+      free (line);
+      return (newline);
+  }
+  free (V0);
+
+  /* look for form $a$b..$n and expand only the last ones */
+  for (L = line, N = newline; *L != 0; N++, L++) {  /* loop until end of line */
+    for (done = FALSE; !done;) {
+      if (*L == 0) done = TRUE;
+      if (*L == '$') {
+	V1 = aftervar(L);
+	if ((V1 != NULL) && (*V1 != '$')) done = TRUE;
+	if (V1 == NULL) done = TRUE;
+      }
+      if (!done) { 
+	*N = *L;
+	 L++; 
+	 N++;
+	 if (N - newline >= NLINE - 5) {
+	   Noff = N - newline;
+	   NLINE += 128;
+	   REALLOCATE (newline, char, NLINE);
+	   N = newline + Noff;
+	 }
+      }
+    }
+
+    if (*L == 0) break;
+
+    V1 = aftervar (L);           /* V1 points to the first non-WHITESPACE after the variable */
+    V0 = thisvar (L);            /* V0 points to the name of the var */
+    /* note: V1 points to a fraction of L, it does not need to be freed */
+
+    /* no variable name */
+    if (V0 == NULL) {
+      *N = *L;
+      if (N - newline >= NLINE - 5) {
+	Noff = N - newline;
+	NLINE += 128;
+	REALLOCATE (newline, char, NLINE);
+	N = newline + Noff;
+      }
+      continue;
+    }
+
+    /* variable assignment (skip these variables) */
+    if ((L == line) && (V1 != NULL)) {
+      if ((*V1 == '=') || !strcmp (V1, "++") || !strcmp (V1, "--")) {
+	*N = *L;
+	free (V0);
+	if (N - newline >= NLINE - 5) {
+	  Noff = N - newline;
+	  NLINE += 128;
+	  REALLOCATE (newline, char, NLINE);
+	  N = newline + Noff;
+	}
+	continue;
+      }
+    }
+
+    found = TRUE;
+    for (c = V0; isdigit(*c); c++); /* test if this is a macro argument variable (ie, $1.2) */
+    if (*c == 0) {  /* all digit var == macro parameter */
+      if (!MacroDepth) {
+	gprint (GP_ERR, "not in a macro\n");
+	goto error;
+      } else { /* if we are executing a macro, attach the list depth to the front, pass on down the line */
+	// XXX this is limiting!!!
+	ALLOCATE (c, char, 1024);
+	sprintf (c, "%d.%s", MacroDepth, V0);
+	free (V0);
+	V0 = c;
+      }
+    }
+
+    Val = get_variable_ptr (V0);
+    if (Val == NULL) {   /* var was not found! */
+      gprint (GP_ERR, "variable %s not found\n", V0);
+      goto error;
+    }
+    for (; *Val != 0; N++, Val++)  {
+      *N = *Val; /* place the value of the variable in the newline */
+      if (N - newline >= NLINE - 5) {
+	Noff = N - newline;
+	NLINE += 128;
+	REALLOCATE (newline, char, NLINE);
+	N = newline + Noff;
+      }
+    }
+    N--; /* we overshoot on last loop */
+
+    /* skip past the variable in the source line */
+    /* L currently points at $ */
+    L++;
+    if (*L == '?') L++;  /* skip past ? in $?name */
+
+    while (ISVAR(*L)) L++;
+    L--; /* we overshoot */
+
+    if (V0 != NULL) free (V0);
+  }
+
+  *N = 0;
+  free (line);
+  REALLOCATE (newline, char, strlen (newline) + 1);
+  if (found) { /* try again for new variables */
+    newline = expand_vars (newline);
+  }
+  return (newline);
+
+error:
+  free (line);
+  free (V0);
+  free (newline);
+  return (NULL);
+}
+
+
+  /************************
+    we go through the line looking for the dollar signs ($) marking the 
+    variables.  We don't expand a variable if it is the first thing on the line 
+    AND it is followed by an equals sign.  
+    that is, don't expand if:
+    V0 = NULL ($ is last non-blank char on line -- no variable) or
+    V1[0] is = (assignment of variable value), AND L == line (ie, at beginning of line)
+    *************************/
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/expand_vectors.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/expand_vectors.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/expand_vectors.c	(revision 15879)
@@ -0,0 +1,117 @@
+# include "opihi.h"
+
+char *expand_vectors (char *line) {
+
+  char *newline, *tmpline, strValue[128], *val;
+  char *L, *N, *p, *q, *w;
+  int n, I, size, showLength, NLINE, Noff;
+  double f1;
+  Vector *vec;
+
+  if (line == NULL) return (NULL);
+
+  NLINE = MAX (128, strlen(line));
+  ALLOCATE (newline, char, NLINE);
+
+  /* look for form fred[stuff] */
+  /* skip first word (command) */
+  L = nextword (line);
+  if (L == NULL) {
+    free (newline);
+    return (line);
+  }
+
+  n = L - line;
+  strncpy (newline, line, n);
+  N = newline + n;
+  while (1) {
+    /* find vector subscript */
+    p = strchr (L, '[');
+    q = strchr (L, ']');
+    if ((p == NULL) && (q != NULL)) goto dumpline;
+    if ((p != NULL) && (q == NULL)) goto dumpline;
+    if ((p == NULL) && (q == NULL)) goto dumpline;
+    if (p > q) goto dumpline; /* odd state: unmatched pair: ][ */
+    n = (int) (q - p - 1);
+    val = NULL;
+    showLength = FALSE;
+    if (n == 0) {
+      showLength = TRUE;
+    } else {
+      tmpline = strncreate (p+1, n);
+      val = dvomath (1, &tmpline, &size, 0);
+      free (tmpline);
+      if (val == NULL) goto dumpline; /* not a valid vector subscript */
+    }
+    I = 0; 
+    if (val != NULL) {
+      I = atoi (val);
+      free (val);
+    }      
+
+    /* find vector name */
+    for (w = p - 1; (w >= line) && !OHANA_WHITESPACE(*w) && (isalnum(*w) || (*w == ':') || (*w == '_')); w--);
+    w ++;
+    n = (int)(p - w);
+    tmpline = strncreate (w, n);
+    if ((vec = SelectVector (tmpline, OLDVECTOR, TRUE)) == NULL) goto dumpline;
+    free (tmpline);
+
+    /* find vector element */
+    if ((I >= vec[0].Nelements) || (I < -1*vec[0].Nelements)) {
+      gprint (GP_ERR, "vector subscript out of range\n"); 
+      goto escape;
+    }
+    if (showLength) {
+      f1 = vec[0].Nelements;
+    } else {
+      if (I < 0) {
+	f1 = vec[0].elements[vec[0].Nelements+I];
+      } else {
+	f1 = vec[0].elements[I];
+      }
+    }
+    if ((int)f1 == f1) 
+      snprintf (strValue, 128, "%.0f", f1);
+    else
+      snprintf (strValue, 128, "%.9g", f1);
+
+    /* interpolate vector element into newline (being accumulated) */
+    size = (N - newline) + (w - L) + strlen(strValue);
+    if (size >= NLINE) {
+      Noff = N - newline;
+      NLINE += 128 + strlen(strValue) + (w - L);
+      REALLOCATE (newline, char, NLINE);
+      N = newline + Noff;
+    }
+
+    n = (int) (w - L);
+    strncpy (N, L, n);
+    N += n;
+    n = strlen (strValue);
+    strncpy (N, strValue, n);
+    N += n;
+    L = q + 1;
+  }
+
+dumpline:
+  size = (N - newline) + strlen(L);
+  if (size >= NLINE) {
+    Noff = N - newline;
+    NLINE += 128 + strlen(L);
+    REALLOCATE (newline, char, NLINE);
+    N = newline + Noff;
+  }
+
+  n = strlen (L);
+  strncpy (N, L, n);
+  N[n] = 0;
+  free (line);
+  return (newline);
+  
+escape:
+  free (line);
+  free (newline);
+  return (NULL);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/gprint.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/gprint.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/gprint.c	(revision 15879)
@@ -0,0 +1,269 @@
+# include "shell.h"
+
+/* we need to control the output destinations a bit carefully
+   in the pantasks_server mode.  The server needs to be able to 
+   send the output to a specific output device (eg, logging file)
+   of to save it within an internal buffer */
+
+/* further notes:
+   gprintf (int destination, char *format, ...);
+
+   the destination may be GP_LOG or GP_ERR.  by default, these go to stdout and
+   stderr.  either one may be redirected to another file or to a buffer.  as a
+   stand-along program, the outfile command redirects the GP_LOG output to an
+   alternate output file.  in the server mode, we redirect LOG to a standard log
+   file and ERR to a standard error file for server messages.  Commands executed
+   by the client have both streams returned to the client in turn, and are in
+   turn sent to stderr or the current stdout destination.
+
+   each thread has an independently set output destination.
+
+   option 1: NULL for invalid element:
+
+     a stream is either set to a FILE or an IOBuffer.  when it is set to a FILE,
+     the IOBuffer is freed and set to NULL.  when it is an IOBuffer, the file
+     pointer is closed and set to NULL.  setting a new FILE results in the 
+     IObuffer being freed and an already opened FILE to be flushed and closed.
+*/
+
+static gpStream *streams = NULL;
+static int Nstreams = 0;
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+void gprintInit () {
+
+  int N;
+  pthread_t id;
+
+  /* need to use a mutex to prevent two threads from initing simultaneously */
+  pthread_mutex_lock (&mutex);
+
+  if (streams == NULL) {
+    Nstreams = 2;
+    ALLOCATE (streams, gpStream, Nstreams);
+  } else {
+    Nstreams += 2;
+    REALLOCATE (streams, gpStream, Nstreams);
+  }
+
+  /* create two output streams for this thread: LOG and ERR */
+  id = pthread_self();
+
+  N = Nstreams - 2;
+  streams[N].dest = GP_LOG;
+  streams[N].file = stdout;
+  streams[N].name = strcreate ("stdout");
+
+  ALLOCATE (streams[N].buffer, IOBuffer, 1);
+  InitIOBuffer (streams[N].buffer, 64);
+  streams[N].mode = GP_FILE;
+  streams[N].thread = id;
+
+  N = Nstreams - 1;
+  streams[N].dest = GP_ERR;
+  streams[N].file = stderr;
+  streams[N].name = strcreate ("stderr");
+
+  ALLOCATE (streams[N].buffer, IOBuffer, 1);
+  InitIOBuffer (streams[N].buffer, 64);
+  streams[N].mode = GP_FILE;
+  streams[N].thread = id;
+
+  pthread_mutex_unlock (&mutex);
+}
+
+gpStream *gprintGetStream (gpDest dest) {
+
+  int i;
+  pthread_t id;
+
+  id = pthread_self();
+
+  /* find the existing output stream which matches */
+  for (i = 0; i < Nstreams; i++) {
+    if (streams[i].dest != dest) continue;
+    if (!pthread_equal (streams[i].thread, id)) continue;
+    return (&streams[i]);
+  }
+  fprintf (stderr, "programming error: gprintInit not called for thread\n");
+  abort ();
+}
+
+void gprintSetBuffer (gpDest dest) {
+
+  gpStream *stream;
+
+  stream = gprintGetStream (dest);
+
+  /* if we have an open file: flush it, close it, null it */
+  if (stream[0].file != NULL) {
+    fflush (stream[0].file);
+    if (stream[0].file == stdout) goto skip_close;
+    if (stream[0].file == stderr) goto skip_close;
+    fclose (stream[0].file);
+
+  skip_close:
+    stream[0].file = NULL;
+  }
+  
+  if (stream[0].buffer == NULL) {
+    ALLOCATE (stream[0].buffer, IOBuffer, 1);
+    InitIOBuffer (stream[0].buffer, 64);
+  } else {
+    FlushIOBuffer (stream[0].buffer);
+  }
+  
+  /* this element may be redundant with the NULL state of file and buffer */
+  stream[0].mode = GP_BUFF;
+}
+
+IOBuffer *gprintGetBuffer (gpDest dest) {
+
+  gpStream *stream;
+  stream = gprintGetStream (dest);
+  return (stream[0].buffer);
+}
+
+void gprintSetFileAllThreads (gpDest dest, char *filename) {
+
+  int i;
+
+  for (i = 0; i < Nstreams; i++) {
+    if (streams[i].dest != dest) continue;
+    gprintSetFile (&streams[i], dest, filename);
+  }
+  return;
+}
+
+void gprintSetFileThisThread (gpDest dest, char *filename) {
+
+  gpStream *stream;
+  stream = gprintGetStream (dest);
+
+  gprintSetFile (stream, dest, filename);
+  return;
+}
+
+void gprintSetFile (gpStream *stream, gpDest dest, char *filename) {
+
+  /* if we have an open buffer, free it and null it */
+  if (stream[0].buffer != NULL) {
+    FreeIOBuffer (stream[0].buffer);
+    free (stream[0].buffer);
+    stream[0].buffer = NULL;
+  }
+
+  /* if we have an open file, flush it and close it */
+  if (stream[0].file != NULL) {
+    fflush (stream[0].file);
+    if (stream[0].file == stdout) goto skip_close;
+    if (stream[0].file == stderr) goto skip_close;
+    fclose (stream[0].file);
+  }
+skip_close:
+
+  // if NULL, reuse exising stream name
+  if (filename != NULL) {
+    free (stream[0].name);
+    stream[0].name = strcreate (filename);
+  }
+
+  /* we allow the user to set stdout to ERR and stderr to LOG if they want */
+  if (!strcmp (stream[0].name, "stdout")) {
+    stream[0].file = stdout;
+    goto skip_open;
+  }
+  if (!strcmp (stream[0].name, "stderr")) {
+    stream[0].file = stderr;
+    goto skip_open;
+  }
+  
+  /* open the file */
+  stream[0].file = fopen (stream[0].name, "a");
+  if (stream[0].file == NULL) {
+    fprintf (stderr, "cannot open file %s\n", stream[0].name);
+    free (stream[0].name);
+    stream[0].file = (dest == GP_LOG) ? stdout : stderr;
+    stream[0].name = (dest == GP_LOG) ? strcreate ("stdout") : strcreate("stderr");
+  }
+
+skip_open:
+  stream[0].mode = GP_FILE;
+  return;
+}
+
+FILE *gprintGetFile (gpDest dest) {
+
+  gpStream *stream;
+  stream = gprintGetStream (dest);
+  return (stream[0].file);
+}
+
+char *gprintGetName (gpDest dest) {
+
+  gpStream *stream;
+  stream = gprintGetStream (dest);
+  return (stream[0].name);
+}
+
+int gprint (gpDest dest, char *format, ...) {
+
+  int status;
+  gpStream *stream;
+  va_list argp;  
+
+  stream = gprintGetStream (dest);
+
+  va_start (argp, format);
+  
+  // gprint (GP_ERR, "GP_FILE: %d\n", GP_FILE);
+  // gprint (GP_ERR, "GP_BUFF: %d\n", GP_BUFF);
+  // gprint (GP_ERR, "mode: %d\n", stream[0].mode);
+
+  if (stream[0].mode == GP_FILE) {
+    // gprint (GP_ERR, "printing to FILE\n");
+    status = vfprintf (stream[0].file, format, argp);
+    if (status < 0) {
+      abort();
+    }
+  } else {
+    // gprint (GP_ERR, "printing to BUFFER\n");
+    vPrintIOBuffer (stream[0].buffer, format, argp);
+  }
+  va_end (argp);
+  return (TRUE);
+}
+
+int gwrite (char *buffer, int size, int N, gpDest dest) {
+
+  int Nbyte;
+  IOBuffer *outbuff;
+  gpStream *stream;
+
+  stream = gprintGetStream (dest);
+
+  if (stream[0].mode == GP_FILE) {
+    fwrite (buffer, size, N, stream[0].file);
+  } else {
+    outbuff = stream[0].buffer;
+    Nbyte = size * N;
+    if (outbuff[0].Nbuffer + Nbyte >= outbuff[0].Nalloc) {
+      outbuff[0].Nalloc = outbuff[0].Nbuffer + Nbyte + 64;
+      REALLOCATE (outbuff[0].buffer, char, outbuff[0].Nalloc);
+    }
+    memcpy (&outbuff[0].buffer[outbuff[0].Nbuffer], buffer, Nbyte);
+    outbuff[0].Nbuffer += Nbyte;
+  }
+  return (TRUE);
+}
+
+/* I'm going to need to have different output targets for different threads
+   we can do this with these functions:
+
+   pthread_t pthread_self(void);
+   int pthread_equal(pthread_t thread1, pthread_t thread2);
+   // returns TRUE if equal, FALSE if not
+   
+*/
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/interrupt.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/interrupt.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/interrupt.c	(revision 15879)
@@ -0,0 +1,53 @@
+# include "opihi.h"
+
+static int Nint = 0;
+
+/* return FALSE if we are called many times in a row 
+   without a valid answer or any answer */
+
+void handle_interrupt (int input) {
+  
+  char string[64];
+  int Nask;
+
+  signal (SIGINT, SIG_IGN);
+
+  Nask = 0;
+  Nint ++;
+
+  // 3 ctrl-c in a row will interrupt regardless
+  if (Nint > 3) { 
+    interrupt = TRUE;
+    return;
+  }
+  if (Nint > 100) { 
+    exit (3);
+  }
+  
+  while (1) {
+    gprint (GP_ERR, "operation halted, continue? (y/n) ");
+    fscanf (stdin, "%s", string);
+    
+    if ((string[0] == 'y') || (string[0] == 'Y')) {
+      interrupt = FALSE;
+      signal (SIGINT, handle_interrupt);
+      Nint = 0;
+      return;
+    }
+
+    if ((string[0] == 'n') || (string[0] == 'N')) {
+      interrupt = TRUE;
+      signal (SIGINT, handle_interrupt);
+      Nint = 0;
+      return;
+    }
+    Nask ++;
+    if (Nask > 3) {
+      interrupt = TRUE;
+      signal (SIGINT, handle_interrupt);
+      Nint = 0;
+      return;
+    }
+  }  
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/isolate_elements.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/isolate_elements.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/isolate_elements.c	(revision 15879)
@@ -0,0 +1,206 @@
+# include "opihi.h"
+
+/* local private functions */
+void InsertValue (char c);
+void EndOfString (void);
+int IsAnOp (char *c);
+int IsTwoOp (char *c);
+
+/* local private static variables */
+int NCHAR, Nchar, Nout, NOUT;
+char **myOutput;
+
+char **isolate_elements (int Nin, char **in, int *nout) {
+  
+  int i, j, minus, negate, plus, posate, OpStat, SciNotation;
+
+  NOUT = Nin;
+  Nchar = Nout = 0;
+  NCHAR = 256;
+  ALLOCATE (myOutput, char *, NOUT);
+  ALLOCATE (myOutput[Nout], char, NCHAR);
+
+  for (i = 0; i < Nin; i++) {
+    for (j = 0; j < strlen(in[i]); j++) {
+      SciNotation = FALSE;
+      /* identify 'negate' or 'minus' ops */
+      negate = minus = FALSE;
+      if (in[i][j] == '-') { 
+	minus = TRUE;  
+	/* if - is first thing on line, must be a negator */
+	if ((Nout == 0) && (Nchar == 0)) {  
+	  minus = FALSE;
+	  negate = TRUE;
+	  goto skip1;
+	}
+	/* check previous entry on line */
+	if (Nchar) {
+	  OpStat = IsAnOp (myOutput[Nout]);
+	  if (myOutput[Nout][0] == ')') OpStat = FALSE;
+	} else {
+	  OpStat = IsAnOp (myOutput[Nout-1]);
+	  if (myOutput[Nout-1][0] == ')') OpStat = FALSE;
+	}
+	/* if - follows an operator, must be negator */
+	if (OpStat) {
+	  minus = FALSE;
+	  negate = TRUE;
+	  goto skip1;
+	}
+	/* if - follows 'e' is part of 1e-5 */
+	if (j == 0) goto skip1;
+	if ((in[i][j-1] == 'e') || (in[i][j-1] == 'E')) {
+	  SciNotation = TRUE;
+	  negate = minus = FALSE;
+	}
+      }
+    skip1:
+      /* idenfity 'posate' or 'plus' ops */
+      posate = plus = FALSE;
+      if (in[i][j] == '+') { 
+	plus = TRUE;  
+	/* if + is first thing on line, must be a posator */
+	if ((Nout == 0) && (Nchar == 0)) {  
+	  plus = FALSE;
+	  posate = TRUE;
+	  goto skip2;
+	}
+	/* check previous entry on line */
+	if (Nchar) {
+	  OpStat = IsAnOp (myOutput[Nout]);
+	  if (myOutput[Nout][0] == ')') OpStat = FALSE;
+	} else {
+	  OpStat = IsAnOp (myOutput[Nout-1]);
+	  if (myOutput[Nout-1][0] == ')') OpStat = FALSE;
+	}
+	/* if + follows an operator, must be posator */
+	if (OpStat) {
+	  plus = FALSE;
+	  posate = TRUE;
+	  goto skip2;
+	}
+	/* if + follows 'e' is part of 1e+5 */
+	if (j == 0) goto skip2;
+	if ((in[i][j-1] == 'e') || (in[i][j-1] == 'E')) {
+	  SciNotation = TRUE;
+	  posate = plus = FALSE;
+	}
+      }
+    skip2:
+      /* operators */
+      if (negate || minus || posate || plus || (IsAnOp (&in[i][j]) && !SciNotation)) {
+	if (posate) continue;
+	EndOfString ();
+	/* copy operator to myOutput[Nout] */
+	InsertValue (in[i][j]);
+	if (negate) InsertValue ('-');
+
+	if (IsTwoOp (&in[i][j])) {
+	  InsertValue (in[i][j+1]);
+	  j++;
+	} 
+	EndOfString ();
+	continue;
+      }
+      /* quoted string */
+      if (in[i][j] == '"') {
+	InsertValue (in[i][j]);
+	j++;
+	while ((j < strlen(in[i])) && (in[i][j] != '"')) {
+	  InsertValue (in[i][j]);
+	  j++;
+	}
+	if (in[i][j] != '"') continue;
+	/* 
+	  gprint (GP_ERR, "mismatched quotes\n");
+	  return (FALSE);
+	}
+	*/
+	InsertValue (in[i][j]);
+	EndOfString ();
+	continue;
+      }
+      /* not an operator, not a quoted string */
+      if (!OHANA_WHITESPACE (in[i][j])) {
+	InsertValue (in[i][j]);
+      } else {
+	EndOfString ();
+      }
+    }
+    EndOfString ();
+  }
+
+  /* one extra entry is allocated, free here */
+  free (myOutput[Nout]);
+  *nout = Nout;
+  return (myOutput);
+
+}
+
+void InsertValue (char c) {
+  myOutput[Nout][Nchar] = c;
+  Nchar ++;
+  if (Nchar >= NCHAR - 2) {
+    NCHAR += 256;
+    REALLOCATE (myOutput[Nout], char, NCHAR);
+  }
+  myOutput[Nout][Nchar] = 0;
+}
+
+void EndOfString () {
+  if (Nchar > 0) {
+    myOutput[Nout][Nchar] = 0;
+    Nout ++;
+    Nchar = 0;
+    
+    if (Nout >= NOUT - 1) {
+      NOUT += 10; 
+      REALLOCATE (myOutput, char *, NOUT); 
+    } 
+    NCHAR = 256;
+    ALLOCATE (myOutput[Nout], char, NCHAR); 
+  }
+}
+
+int IsAnOp (char *c) {
+
+  if (!strncmp (c, "*",  1)) return (TRUE);
+  if (!strncmp (c, "/",  1)) return (TRUE);
+  if (!strncmp (c, "+",  1)) return (TRUE);
+  if (!strncmp (c, "-",  1)) return (TRUE);
+  if (!strncmp (c, "^",  1)) return (TRUE);
+  if (!strncmp (c, "@",  1)) return (TRUE);
+  if (!strncmp (c, "(",  1)) return (TRUE);
+  if (!strncmp (c, ")",  1)) return (TRUE);
+  if (!strncmp (c, "&",  1)) return (TRUE);
+  if (!strncmp (c, "|",  1)) return (TRUE);
+  if (!strncmp (c, ">",  1)) return (TRUE);
+  if (!strncmp (c, "<",  1)) return (TRUE);
+  if (!strncmp (c, "<",  1)) return (TRUE);
+  if (!strncmp (c, "<<", 2)) return (TRUE);
+  if (!strncmp (c, ">>", 2)) return (TRUE);
+  if (!strncmp (c, "&&", 2)) return (TRUE);
+  if (!strncmp (c, "||", 2)) return (TRUE);
+  if (!strncmp (c, "==", 2)) return (TRUE);
+  if (!strncmp (c, "!=", 2)) return (TRUE);
+  if (!strncmp (c, "<=", 2)) return (TRUE);
+  if (!strncmp (c, ">=", 2)) return (TRUE);
+
+  return (FALSE);
+
+}
+
+int IsTwoOp (char *c) {
+
+  if (!strncmp (c, "<<", 2)) return (TRUE);
+  if (!strncmp (c, ">>", 2)) return (TRUE);
+  if (!strncmp (c, "&&", 2)) return (TRUE);
+  if (!strncmp (c, "||", 2)) return (TRUE);
+  if (!strncmp (c, "==", 2)) return (TRUE);
+  if (!strncmp (c, "!=", 2)) return (TRUE);
+  if (!strncmp (c, "<=", 2)) return (TRUE);
+  if (!strncmp (c, ">=", 2)) return (TRUE);
+
+  return (FALSE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_create.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_create.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_create.c	(revision 15879)
@@ -0,0 +1,114 @@
+# include "opihi.h"
+# define D_NLINES 100
+# define prompt "> "
+int macro_exec   PROTO((int, char **));
+
+static char helpline[] = "(macro)";
+
+int macro_create (int argc, char **argv) {
+
+  int ThisList, depth, i, done, NLINES, N;
+  char *input, *help;
+  Command *cmd;
+  Macro *macro;
+
+  help = helpline;
+  if ((N = get_argument (argc, argv, "-c"))) {
+    remove_argument (N, &argc, argv);
+    help = strcreate(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: macro <name> [-c \"comment line\"]\n");
+    gprint (GP_ERR, "  (enter commands, end with the word 'END')\n");
+    return (FALSE);
+  }
+
+  /**** Check for existence of this macro ****/
+  cmd = MatchCommand (argv[1], FALSE, TRUE);
+  macro = MatchMacro (argv[1], FALSE, TRUE);
+  
+  if ((macro == NULL) && (cmd != NULL)) {
+    gprint (GP_ERR, "cannot redefine inherent command %s\n", argv[1]);
+    return (FALSE);
+  }
+  if ((macro != NULL) && (cmd == NULL)) {
+    gprint (GP_ERR, "programming error: macro not in command list (%s)\n", argv[1]);
+    return (FALSE);
+  }
+
+  if (macro == NULL) { /**** New Macro ****/
+    ALLOCATE (cmd, Command, 1);
+    cmd[0].name = strcreate (argv[1]);
+    cmd[0].help = help;
+    cmd[0].func = macro_exec;
+    AddCommand (cmd);
+    free (cmd);
+    macro = NewMacro (argv[1]);
+  } else { /**** Old Macro ****/
+    /* replace existing command help with new value */
+    if (cmd[0].help != helpline) 
+      free (cmd[0].help);
+    cmd[0].help = help;
+  }
+
+  /* reallocate space for macro lines */
+  NLINES = D_NLINES;
+  for (i = 0; i < macro[0].Nlines; i++) free (macro[0].line[i]);
+  REALLOCATE (macro[0].line, char *, NLINES);
+
+  /* read in macro
+     If we are entering at the keyboard (ThisList == 0), use readline.
+     Otherwise, read from the current list
+     End when we hit the final "END" (the true END -- we count macro defines!!) */
+     
+  depth = 0;
+  ThisList = current_list_depth();
+  for (i = 0, done = FALSE; !done; ) {
+
+    /* get the next line (from correct place) */
+    if (ThisList == 0) 
+      input = readline (prompt);
+    else 
+      input = get_next_listentry (ThisList);
+
+    if ((ThisList == 0) && (input == (char *) NULL)) {
+      gprint (GP_ERR, "end macro with 'END'\n");
+      continue;
+    }
+    if (ThisList == 0) ohana_memregister (input);
+
+    if ((ThisList > 0) && (input == (char *) NULL)) {
+      gprint (GP_ERR, "missing 'END' in macro definition\n");
+      input = strcreate ("end");
+    }
+
+    stripwhite (input);
+
+    /* test for new macro (or other list, in the future?) */
+    if (is_list (input)) depth ++;
+
+    /* test for end of nested list -- if not nested, END refers to this macro */
+    if (!strncasecmp (input, "END", 3)) {
+      depth --;
+      if (depth < 0) { /* we hit the last "END", macro is done */
+	free (input);
+	macro[0].Nlines = i;
+	if (macro[0].Nlines == 0) i = 1;
+	REALLOCATE (macro[0].line, char *, i);
+	return (TRUE);
+      }
+    }
+
+    if (*input) { 
+      macro[0].line[i] = input;
+      i++;
+      if (i == NLINES - 1) {
+	NLINES += D_NLINES;
+	REALLOCATE (macro[0].line, char *, NLINES);
+      }
+    }
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_delete.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_delete.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_delete.c	(revision 15879)
@@ -0,0 +1,28 @@
+# include "opihi.h"
+
+int macro_delete (int argc, char **argv) {
+
+  Command *cmd;
+  Macro *macro;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: macro delete <macro>\n");
+    return (FALSE);
+  }
+
+  macro = MatchMacro (argv[1], FALSE, TRUE);
+  if (macro == NULL) {
+    gprint (GP_ERR, "Macro %s not found\n", argv[1]);
+    return (FALSE);
+  }
+  cmd = MatchCommand (argv[1], FALSE, TRUE);
+  if (cmd == NULL) {
+    gprint (GP_ERR, "programming error: macro exists but not command\n");
+    return (FALSE);
+  }
+
+  DeleteMacro (macro);
+  DeleteCommand (cmd);
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_edit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_edit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_edit.c	(revision 15879)
@@ -0,0 +1,9 @@
+# include "opihi.h"
+
+int macro_edit (int argc, char **argv) {
+
+  gprint (GP_ERR, "this function is not implemented yet\n");
+  return (FALSE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_exec.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_exec.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_exec.c	(revision 15879)
@@ -0,0 +1,47 @@
+# include "opihi.h"
+
+int macro_exec (int argc, char **argv) {
+
+  int i, status, MacroDepth;
+  char *PreviousName, **params, tmp[1024];
+  Macro *macro;
+  
+  macro = MatchMacro (argv[0], FALSE, TRUE);
+  if (macro == NULL) {
+    gprint (GP_ERR, "%s: Command not found.\n", argv[0]);
+    return (FALSE);
+  }
+
+  /* increase MacroDepth by one - governs macro args */
+  PreviousName = GetMacroName ();
+  MacroDepth = GetMacroDepth ();
+  MacroDepth ++;
+  SetCurrentMacroData (macro[0].name, MacroDepth);
+
+  ALLOCATE (params, char *, argc);
+  sprintf (tmp, "%d.%d", MacroDepth, 0);
+  params[0] = strcreate (tmp);
+  sprintf (tmp, "%d", argc);
+  set_str_variable (params[0], tmp);
+  for (i = 1; i < argc; i++) {
+    sprintf (tmp, "%d.%d", MacroDepth, i);
+    params[i] = strcreate (tmp);
+    set_str_variable (params[i], argv[i]);
+  }
+
+  /* process this list */
+  status = exec_loop (&macro[0]);
+  loop_last = loop_next = FALSE; 
+  /* 'last' and 'next' should only affect one loop */
+
+  /* clear out the command line variables */
+  for (i = 0; i < argc; i++) {
+    DeleteNamedScalar (params[i]);
+    free (params[i]);
+  }
+  free (params);
+  
+  MacroDepth --;
+  SetCurrentMacroData (PreviousName, MacroDepth);
+  return (status);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_funcs.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_funcs.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_funcs.c	(revision 15879)
@@ -0,0 +1,26 @@
+# include "basic.h"
+
+static Command macro_command[] = {
+  {"create", macro_create, "create a macro *"},
+  {"delete", macro_delete, "delete a macro *"},
+  {"list",   macro_list_f, "list a macro *"},
+  {"edit",   macro_edit,   "edit a macro <not working yet!> *"},
+  {"read",   macro_read,   "read a macro from a file <not working yet!> *"},
+  {"write",  macro_write,  "write a macro to a file <not working yet!> *"}
+};
+
+CommandF *find_macro_command (char *name) {
+
+  int i, N;
+
+  N = sizeof (macro_command) / sizeof (Command);
+
+  /* find the macro sub-command which matches from the list. */
+  for (i = 0; i < N; i++) {
+    if (!strcmp (macro_command[i].name, name)) {
+      return (macro_command[i].func);
+    }
+  }
+
+  return NULL;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_list.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_list.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_list.c	(revision 15879)
@@ -0,0 +1,23 @@
+# include "opihi.h"
+
+int macro_list_f (int argc, char **argv) {
+
+  int i;
+  Macro *macro;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: macro list <macro>\n");
+    return (FALSE);
+  }
+
+  macro = MatchMacro (argv[0], FALSE, TRUE);
+  if (macro == NULL) {
+    gprint (GP_ERR, "%s: Macro not found\n", argv[1]);
+    return (FALSE);
+  }
+
+  for (i = 0; i < macro[0].Nlines; i++) {
+    gprint (GP_ERR, "%s\n", macro[0].line[i]);
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_read.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_read.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_read.c	(revision 15879)
@@ -0,0 +1,9 @@
+# include "opihi.h"
+
+int macro_read (int argc, char **argv) {
+
+  gprint (GP_ERR, "this function is not implemented yet\n");
+  return (FALSE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_write.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_write.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/macro_write.c	(revision 15879)
@@ -0,0 +1,9 @@
+# include "opihi.h"
+
+int macro_write (int argc, char **argv) {
+
+  gprint (GP_ERR, "this function is not implemented yet\n");
+  return (FALSE);
+
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/memstr.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/memstr.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/memstr.c	(revision 15879)
@@ -0,0 +1,35 @@
+# include "shell.h"
+
+/* memstr returns a view, not an allocated string : don't free */
+/* 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);
+
+}
+
+/* formatted write statement, with intelligent allocation */
+int write_fmt (int fd, char *format, ...) {
+
+  int Nbyte, status;
+  char tmp, *line;
+  va_list argp;  
+
+  va_start (argp, format);
+  Nbyte = vsnprintf (&tmp, 0, format, argp);
+  va_end (argp);
+
+  va_start (argp, format);
+  ALLOCATE (line, char, Nbyte + 1);
+  vsnprintf (line, Nbyte + 1, format, argp);
+  status = write (fd, line, strlen(line));
+  va_end (argp);
+
+  free (line);
+  return (status);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/multicommand.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/multicommand.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/multicommand.c	(revision 15879)
@@ -0,0 +1,135 @@
+# include "opihi.h"
+
+static int server = 0;
+
+// XXX this is rather pantasks-specific...
+void multicommand_InitServer () {
+
+  char hostname[256], PASSWORD[256];
+
+  if (server != 0) {
+    /* check if down? */
+    fprintf (stderr, "error: server fd already defined\n");
+    exit (1);
+  }
+
+  /* find the defined server hostname */
+  if (VarConfig ("PANTASKS_SERVER", "%s", hostname) == NULL) {
+    gprint (GP_ERR, "pantasks server host undefined\n");
+    exit (2);
+  }
+
+  /* attempt to connect to the server */
+  server = GetClientSocket (hostname);
+
+  /* here we can perform the security handshaking */
+  VarConfig ("PASSWORD", "%s", PASSWORD);
+  SendCommand (server, strlen(PASSWORD), PASSWORD);
+  
+  return;
+}
+
+/* take input line and split into multiple lines
+   at the semi-colons.  send these to 'command' */
+
+int multicommand (char *line) {
+ 
+  int done, status, verbose;
+  char *p, *q, *tmpline, *outline;
+  IOBuffer message;
+
+  /* if no server is defined, use 'verbose' mode for 'command' */ 
+  verbose = (server == 0);
+
+  p = line; 
+  done = FALSE;
+  status = TRUE;
+  while (!done) {
+    q = strchr (p, ';');
+    if (q == NULL) {
+      q = p + strlen(p);
+      done = TRUE;
+    }
+    tmpline = strncreate (p, q - p);
+    stripwhite (tmpline);
+    if (*tmpline) {
+
+      status = command (tmpline, &outline, verbose);
+
+      if (status == -1) {
+	if (server) {
+	  // send the command to the server instead
+	  if (!SendMessage (server, outline)) {
+	    switch (errno) {
+	      case EPIPE:
+		gprint (GP_ERR, "server connection has died\n");
+		exit (1);
+	      default:
+		gprint (GP_ERR, "I/O error sending server message\n");
+		exit (2);
+	    }
+	  }
+
+	  // receive the command exit status
+	  if (ExpectMessage (server, 2.0, &message)) {
+	    switch (errno) {
+	      case EPIPE:
+		gprint (GP_ERR, "server connection has died\n");
+		exit (1);
+	      default:
+		gprint (GP_ERR, "I/O error sending server message\n");
+		exit (2);
+	    }
+	  } else {
+	    sscanf (message.buffer, "STATUS %d", &status);
+	  }
+
+	  // receive the resulting stderr
+	  if (ExpectMessage (server, 2.0, &message)) {
+	    switch (errno) {
+	      case EPIPE:
+		gprint (GP_ERR, "server connection has died\n");
+		exit (1);
+	      default:
+		gprint (GP_ERR, "I/O error sending server message\n");
+		exit (2);
+	    }
+	  } else {
+	    gwrite (message.buffer, 1, message.Nbuffer, GP_ERR);
+	  }
+
+	  // receive the resulting stdout
+	  if (ExpectMessage (server, 2.0, &message)) {
+	    switch (errno) {
+	      case EPIPE:
+		gprint (GP_ERR, "server connection has died\n");
+		exit (1);
+	      default:
+		gprint (GP_ERR, "I/O error sending server message\n");
+		exit (2);
+	    }
+	  } else {
+	    gwrite (message.buffer, 1, message.Nbuffer, GP_LOG);
+	  }
+	} else {
+	  // if no server is defined, we treat an unknown command as an error
+	  status = FALSE;
+	}	
+      }
+
+      if (outline != NULL) free (outline);
+      if (!status && auto_break) done = TRUE;
+    }
+    p = q + 1;
+  }
+  return (status);
+}
+
+/* should skip ; surrounded by "" */
+
+/* commands which are not found are sent to the server socket if 
+   defined. commands executed by the server return their stderr
+   and stdout streams.  server commands should probably not block
+   the server for very long or multiple clients will interfere
+   with each other.  
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/opihi.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/opihi.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/opihi.c	(revision 15879)
@@ -0,0 +1,63 @@
+# include "opihi.h"
+
+/******************/
+int opihi (int argc, char **argv) {
+
+  int Nbad, status;
+  char *line, *prompt, *history;
+  pid_t ppid;
+
+  general_init (&argc, argv);
+  program_init (&argc, argv);
+  startup (&argc, argv);
+  prompt = get_variable("PROMPT");
+  history = get_variable("HISTORY");
+  welcome ();
+
+  Nbad = 0;
+  while (1) {  /** must exit with command "exit" or "quit" */
+    if (Nbad == 10) exit (3);
+
+    line = readline (prompt);
+
+    if (line == NULL) { 
+      
+      ppid = getppid();
+      if (ppid == 1) {
+	gprint (GP_ERR, "caught parent shutdown\n");
+	exit (2);
+      }
+      if (!isatty (STDIN_FILENO)) exit (2);
+      gprint (GP_LOG, "Use \"quit\" to exit\n");
+      Nbad ++;
+      continue;
+    }
+
+    Nbad = 0;
+    ohana_memregister (line);
+
+    stripwhite (line);
+    if (*line) {
+      status = multicommand (line);
+      add_history (line);
+
+// the libedit version of readline does not support an incremental write to history file
+# ifdef RL_READLINE_VERSION
+      if (history != NULL) append_history (1, history);
+# endif
+
+    }
+    free (line);
+    line = (char *) NULL;
+  }
+}
+
+/* 
+   startup sequence:
+
+   - general_init
+   - program_init
+   - startup (exit if non-interactive)
+   - welcome
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/parse.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/parse.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/parse.c	(revision 15879)
@@ -0,0 +1,262 @@
+# include "opihi.h"
+
+char *parse (char *line) {
+
+  double fval;
+  char *newline, *N, *L, *val, *B, *V, *V0, *V1, *c1, *c2, *p;
+  int Nval, Nbytes, status, size, NLINE;
+  FILE *f;
+  Vector *vec;
+
+  val = V0 = NULL;
+
+  if (line == (char *) NULL) goto error;
+
+  /* case 1: $var = expression */
+  if (line[0] == '$') {  
+    /* find the target variable name and the rest of the line */
+    interpolate_slash (line);
+    V0 = thisvar (line);
+    if (V0 == NULL) goto error;
+    V1 = aftervar (line);
+    if (V1 == NULL) goto error;
+ 
+    /* increment operator */
+    if (!strcmp (V1, "++")) {
+      val = get_variable (V0);
+      if (val == NULL) {
+	fval = 1.0;
+      } else {
+	fval = atof (val) + 1.0;
+      }
+      set_variable (V0, fval);
+      goto escape;
+    }
+
+    /* decrement operator */
+    if (!strcmp (V1, "--")) {
+      val = get_variable (V0);
+      if (val == NULL) {
+	fval = -1.0;
+      } else {
+	fval = atof (val) - 1.0;
+      }
+      set_variable (V0, fval);
+      goto escape;
+    }
+
+    /* not an assignement, syntax error */
+    if (*V1 != '=') goto error;
+
+    /* find first non-WHITESPACE character after = */
+    V1 ++;
+    while (isspace (*V1)) V1++;
+    if (*V1 == 0) goto error;
+
+    /* command replacement.  execute the line, place answer in val. */
+    if (*V1 == '`') {
+
+      /* look for end of line, must be ` */
+      B = V1 + strlen (V1) - 1;
+      if (*B != '`') goto error;
+
+      /* val will hold the result */
+      // XXX this is limiting!!!
+      ALLOCATE (val, char, 1024);
+
+      /* B is the command to be executed */
+      B = strncreate (V1 + 1, strlen(V1) - 2);
+      f = popen (B, "r");
+      Nbytes = fread (val, 1, 1023, f);
+      val[Nbytes] = 0;
+      status = pclose (f);
+      free (B);
+
+      if (status) gprint (GP_ERR, "warning: exit status of command %d\n", status);
+
+      /* convert all but last return to ' '.  drop last return */
+      for (B = val; *B != 0; B++) {
+	if (*B == '\n') {
+	  if (B[1]) {
+	    *B = ' ';
+	  } else {
+	    *B = 0;
+	  }
+	}
+      }
+    } 
+
+    /* simple variable assignment */
+    if (*V1 != '`') {
+      /* dvomath returns a new string, or NULL, with the result of the expression */
+      val = dvomath (1, &V1, &size, 0);
+      if (val == NULL) { 
+	while (OHANA_WHITESPACE (*V1)) V1++;
+	val = strcreate (V1);
+      } 
+    }
+    /* both dvomath and command replacement create (char *) val */
+    set_str_variable (V0, val);
+    goto escape;  /* frees temp variables */
+  }
+
+  /* case 2: vect[N] = value */
+  V0 = thiscomm (line);
+  if (strchr(V0, '[') != (char *) NULL) { 
+    /* get vector name (left in V0) */
+    N = strchr (V0, '[');
+    if (N == V0) goto error;
+
+    /* get bracket contents (left in V) */
+    L = strchr (V0, ']');
+    if (L == (char *) NULL) goto error;
+    if (L != V0 + strlen (V0) - 1) goto error;
+
+    *N = 0;
+    V = strncreate (N+1, L - N - 1);
+
+    /* expand value in brackets */
+    val = dvomath (1, &V, &size, 0);
+    if (val == NULL) {
+      print_error ();
+      goto error;
+    }
+    Nval = atoi (val);
+    free (val); val = NULL;
+    free (V);
+
+    /* find vector */
+    if ((vec = SelectVector (V0, OLDVECTOR, TRUE)) == NULL) goto error;
+    free (V0); V0 = (char *) NULL;
+    if (Nval >= vec[0].Nelements) {
+      gprint (GP_ERR, "no element %d\n", Nval);
+      goto escape;
+    }
+
+    /* find value for assignment */
+    V1 = nextcomm (line);
+    if (V1 == (char *) NULL) goto error;
+    if (V1[0] != '=') goto error;
+    V1 ++;
+
+    /*** assign vector element to value ***/
+    val = dvomath (1, &V1, &size, 0); 
+    if (val == (char *) NULL) {
+      print_error ();
+      goto error;
+    }
+    vec[0].elements[Nval] = atof (val);
+    goto escape;
+  }
+  free (V0); V0 = (char *) NULL;
+
+  /* case 3: {expression} */
+  NLINE = MAX (128, strlen (line));
+  ALLOCATE (newline, char, NLINE);
+  memset (newline, 0, NLINE);
+  for (L = line; *L != 0; ) { 
+
+    // copy elements from L (line) to newline up to first '{'
+    p = strchr (L, '{');
+    newline = opihi_append (newline, &NLINE, L, p);
+    if (p == NULL) break;
+    L = p + 1;
+
+    // check for \{ at this point, replace \ in newline with {
+    if ((p > line) && (*(p - 1) == 0x5c)) {
+      N = newline + strlen(newline) - 1;
+      *N = '{'; // replace \ with {
+      continue;
+    }
+
+    /* check on the syntax of the line */
+    L = p + 1;
+    c1 = strchr (L, '}');
+    if (c1 == NULL) {
+      gprint (GP_ERR, "no close brackets!\n");
+      goto escape;
+    }
+    c2 = strchr (L, '{');
+    if ((c2 != NULL) && (c2 < c1)) {
+      gprint (GP_ERR, "can't nest brackets!\n");
+      goto escape;
+    }
+    *c1 = 0;
+
+    /* value in brackets must be a math expression of some sort.
+       isolated words are not valid here */
+    val = dvomath (1, &L, &size, -1);
+    if (val == NULL) {
+      print_error ();
+      goto escape;
+    } 
+
+    /* interpolate vector element into newline (being accumulated) */
+    newline = opihi_append (newline, &NLINE, val, NULL);
+
+    /* copy val to outline */
+    L = c1 + 1;
+    free (val); val = (char *) NULL;
+  }
+
+  free (line); line = (char *) NULL;
+
+  /* \ protects next character */
+  interpolate_slash (newline);
+  
+  REALLOCATE (newline, char, strlen (newline) + 1);
+  return (newline); 
+
+error:
+  gprint (GP_ERR, "syntax error\n");
+
+escape:
+  if (line != (char *) NULL) free (line);
+  if (val != (char *) NULL) free (val);
+  if (V0 != (char *) NULL) free (V0);
+  return (NULL);
+}
+
+/* this routine looks for math and/or logic expressions that 
+   need to be evaluated and passes them on to "parenthesis",
+   which evaluates the expression */
+
+/* There are two situations now which define an expression to 
+   be evaluated:
+   1) $var = expression   -- everything after the = must be a math expression or a string
+   2) {expression}        -- everything within the {} must be a math expression
+*/
+
+/* case 1: $var = expression.  test that
+   a) there is a $ as the first character
+   b) the variable defined by that $ is not null
+   c) there is an = sign following the variable
+   d) there is something following the = sign
+*/
+  
+/* case 2: vect[N] = expression. check syntax:
+   a) last char must be ]
+   b) word must contain [
+   c) between [ & ] must be an integer
+   d) vector must exist
+   e) there is an = sign following the first word
+   f) there is something following the = sign
+*/
+     
+
+/* case 3: we hunt for '{', and then the first '}' and pass everything
+   inbetween.  no nested {{}}s are allowed! */
+  
+/* thisword ALLOCATES
+   thisvar  ALLOCATES
+   thiscomm ALLOCATES
+   
+   nextword !ALLOCATE
+   nextcomm !ALLOCATE
+   
+   lastword !ALLOCATE
+   lastvar !ALLOCATE
+   
+   aftervar !ALLOCATE
+*/   
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/parse_commands.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/parse_commands.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/parse_commands.c	(revision 15879)
@@ -0,0 +1,56 @@
+# include "opihi.h"
+# define D_NARG 10
+
+char **parse_commands (char *line, int *argc) {
+
+  int i, NARG;
+  char *c;
+  char **argv;
+
+  NARG = D_NARG;
+  ALLOCATE (argv, char *, NARG);
+
+  argv[0] = thisword (line);
+  if (argv[0] == (char *) NULL) {
+    free (argv);
+    *argc = 0;
+    return ((char **) NULL);
+  }
+
+  c = nextword (line);
+  for (i = 1; c != (char *) NULL; i++) {
+    argv[i] = thisword (c);
+
+    /* if one of the words does not parse (eg, ""), skip it */
+    if (argv[i] == NULL) i--;
+
+    c = nextword (c);
+    if (i == NARG - 1) {
+      NARG += D_NARG;
+      REALLOCATE (argv, char *, NARG);
+    }
+  }
+  REALLOCATE (argv, char *, i);
+  *argc = i;
+
+  return (argv);
+
+}
+
+  /* parse out the command line into (char **argv).  line looks like:
+     command word word word ... */
+
+  /* argv[0] and argv[1..argc-1] are handled differently because
+     the syntax of a valid command and a valid word are slighly 
+     different (not that this is obviously wanted...) */
+
+
+
+/* old code:
+      for (j = 0; j < i; j++) 
+	free (argv[i]);
+      free (argv);
+      *argc = 0;
+      return (argv);
+    }
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/stack_math.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/stack_math.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/stack_math.c	(revision 15879)
@@ -0,0 +1,1454 @@
+# include "opihi.h"
+
+/* the result of a matrix operation must go into a temp variable,
+   labeled by "m". if one of the input matrices is already a temp variable, we 
+   can continue using it this round 
+   */
+
+int VV_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
+
+  int i, Nx;
+  float *out, *M1, *M2;
+  char line[512];
+  
+  Nx = V1[0].vector[0].Nelements;
+  if (Nx != V2[0].vector[0].Nelements) {
+    return (FALSE);
+  }
+
+  if (V1[0].type == 'v') {  /** use V1 as temp buffer **/
+    OUT[0].vector = V1[0].vector;
+    V1[0].type = 'V'; /* prevent it from being freed below */
+  } else {
+    if (V2[0].type == 'v') { /** use V2 as temp buffer, but header of V1 **/
+      OUT[0].vector = V2[0].vector;
+      V2[0].type = 'V'; /* prevent it from being freed below */
+    } else {  /* no spare temp buffer */
+      OUT[0].vector = InitVector ();
+      CopyVector (OUT[0].vector, V1[0].vector);
+    }
+  }
+  OUT[0].type = 'v'; /*** <<--- says this is a temporary matrix ***/
+
+  M1  = V1[0].ptr;
+  M2  = V2[0].ptr;
+  out = OUT[0].ptr = (float *)OUT[0].vector[0].elements;
+
+  switch (op[0]) { 
+  case '+': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++)
+      *out = *M1 + *M2;
+    break; 
+  case '-': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++)
+      *out = *M1 - *M2;
+    break; 
+  case '*': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++)
+      *out = *M1 * *M2;
+    break; 
+  case '/': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++)
+      *out = *M1 / *M2;
+    break; 
+  case '%': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++)
+      *out = (int) *M1 % (int) *M2;
+    break; 
+  case 0x5e: 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = pow (*M1, *M2);
+    break; 
+  case '@': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = DEG_RAD*atan2 (*M1, *M2);
+    break; 
+  case 'D': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = MIN (*M1, *M2);
+    break; 
+  case 'U': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = MAX (*M1, *M2);
+    break; 
+  case '<': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = (*M1 < *M2) ? 1 : 0;
+    break; 
+  case '>': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = (*M1 > *M2) ? 1 : 0;
+    break; 
+  case '&': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = ((int)*M1 & (int)*M2);
+    break; 
+  case '|': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = ((int)*M1 | (int)*M2);
+    break; 
+  case 'E': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = (*M1 == *M2) ? 1 : 0;
+    break; 
+  case 'N': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = (*M1 != *M2) ? 1 : 0;
+    break; 
+  case 'L': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = (*M1 <= *M2) ? 1 : 0;
+    break; 
+  case 'G': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = (*M1 >= *M2) ? 1 : 0;
+    break; 
+  case 'A': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = (*M1 && *M2) ? 1 : 0;
+    break; 
+  case 'O': 
+    for (i = 0; i < Nx; i++, out++, M1++, M2++) 
+      *out = (*M1 || *M2) ? 1 : 0;
+    break; 
+  default:
+    sprintf (line, "error: op %c not defined!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+
+  /** free up any temporary buffers: **/
+
+  if (V1[0].type == 'v') {
+    free (V1[0].vector[0].elements);
+    free (V1[0].vector);
+  }
+  if (V2[0].type == 'v') {
+    free (V2[0].vector[0].elements);
+    free (V2[0].vector);
+  }
+  /* at the end, V1 and V2 are deleted only if they were temporary */
+
+  clear_stack (V1);
+  clear_stack (V2);
+  return (TRUE);
+
+}
+
+int SV_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
+
+  int i, Nx;
+  float *out, *M1, *M2;
+  char line[512];
+  
+  Nx = V2[0].vector[0].Nelements;
+
+  if (V2[0].type == 'v') { /** use V2 as temp buffer, but header of V1 **/
+    OUT[0].vector = V2[0].vector;
+    V2[0].type = 'V'; /* prevent it from being freed below */
+  } else {  /* no spare temp buffer */
+    OUT[0].vector = InitVector ();
+    CopyVector (OUT[0].vector, V2[0].vector);
+  }
+  OUT[0].type = 'v';   /*** <<--- says this is a temporary matrix ***/
+
+  M1  = V1[0].ptr;
+  M2  = V2[0].ptr;
+  out = OUT[0].ptr = (float *)OUT[0].vector[0].elements;
+
+  switch (op[0]) { 
+  case '+': 
+    for (i = 0; i < Nx; i++, out++, M2++)
+      *out = *M1 + *M2;
+    break; 
+  case '-': 
+    for (i = 0; i < Nx; i++, out++, M2++)
+      *out = *M1 - *M2;
+    break; 
+  case '*': 
+    for (i = 0; i < Nx; i++, out++, M2++)
+      *out = *M1 * *M2;
+    break; 
+  case '/': 
+    for (i = 0; i < Nx; i++, out++, M2++)
+      *out = *M1 / *M2;
+    break; 
+  case '%': 
+    for (i = 0; i < Nx; i++, out++, M2++)
+      *out = (int) *M1 % (int) *M2;
+    break; 
+  case 0x5e: 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = pow (*M1, *M2);
+    break; 
+  case '@': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = DEG_RAD*atan2 (*M1, *M2);
+    break; 
+  case 'D': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = MIN (*M1, *M2);
+    break; 
+  case 'U': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = MAX (*M1, *M2);
+    break; 
+  case '<': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = (*M1 < *M2) ? 1 : 0;
+    break; 
+  case '>': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = (*M1 > *M2) ? 1 : 0;
+    break; 
+  case '&': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = ((int)*M1 & (int)*M2);
+    break; 
+  case '|': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = ((int)*M1 | (int)*M2);
+    break; 
+  case 'E': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = (*M1 == *M2) ? 1 : 0;
+    break; 
+  case 'N': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = (*M1 != *M2) ? 1 : 0;
+    break; 
+  case 'L': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = (*M1 <= *M2) ? 1 : 0;
+    break; 
+  case 'G': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = (*M1 >= *M2) ? 1 : 0;
+    break; 
+  case 'A': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = (*M1 && *M2) ? 1 : 0;
+    break; 
+  case 'O': 
+    for (i = 0; i < Nx; i++, out++, M2++) 
+      *out = (*M1 || *M2) ? 1 : 0;
+    break; 
+  default:
+    sprintf (line, "error: op %c not defined!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+
+  /** free up any temporary buffers: **/
+  if (V2[0].type == 'v') {
+    free (V2[0].vector[0].elements);
+    free (V2[0].vector);
+  }
+
+  clear_stack (V1);
+  clear_stack (V2);
+
+  /* at the end, V1 and V2 are deleted only if they were temporary */
+  return (TRUE);
+
+}
+
+int VS_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
+
+  int i, Nx;
+  float *out, *M1, *M2;
+  char line[512];
+  
+  Nx = V1[0].vector[0].Nelements;
+
+  if (V1[0].type == 'v') { /** use V1 as temp buffer **/
+    OUT[0].vector = V1[0].vector;
+    V1[0].type = 'V'; /* prevent it from being freed below */
+  } else {  /* no spare temp buffer */
+    OUT[0].vector = InitVector ();
+    CopyVector (OUT[0].vector, V1[0].vector);
+  }
+  OUT[0].type = 'v';   /*** <<--- says this is a temporary matrix ***/
+
+  M1  = V1[0].ptr;
+  M2  = V2[0].ptr;
+  out = OUT[0].ptr = (float *)OUT[0].vector[0].elements;
+
+  switch (op[0]) { 
+  case '+': 
+    for (i = 0; i < Nx; i++, out++, M1++)
+      *out = *M1 + *M2;
+    break; 
+  case '-': 
+    for (i = 0; i < Nx; i++, out++, M1++)
+      *out = *M1 - *M2;
+    break; 
+  case '*': 
+    for (i = 0; i < Nx; i++, out++, M1++)
+      *out = *M1 * *M2;
+    break; 
+  case '/': 
+    for (i = 0; i < Nx; i++, out++, M1++)
+      *out = *M1 / *M2;
+    break; 
+  case '%': 
+    for (i = 0; i < Nx; i++, out++, M1++)
+      *out = (int) *M1 % (int) *M2;
+    break; 
+  case 0x5e: 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = pow (*M1, *M2);
+    break; 
+  case '@': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = DEG_RAD*atan2 (*M1, *M2);
+    break; 
+  case 'D': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = MIN (*M1, *M2);
+    break; 
+  case 'U': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = MAX (*M1, *M2);
+    break; 
+  case '<': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = (*M1 < *M2) ? 1 : 0;
+    break; 
+  case '>': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = (*M1 > *M2) ? 1 : 0;
+    break; 
+  case '&': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = ((int)*M1 & (int)*M2);
+    break; 
+  case '|': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = ((int)*M1 | (int)*M2);
+    break; 
+  case 'E': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = (*M1 == *M2) ? 1 : 0;
+    break; 
+  case 'N': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = (*M1 != *M2) ? 1 : 0;
+    break; 
+  case 'L': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = (*M1 <= *M2) ? 1 : 0;
+    break; 
+  case 'G': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = (*M1 >= *M2) ? 1 : 0;
+    break; 
+  case 'A': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = (*M1 && *M2) ? 1 : 0;
+    break; 
+  case 'O': 
+    for (i = 0; i < Nx; i++, out++, M1++) 
+      *out = (*M1 || *M2) ? 1 : 0;
+    break; 
+  default:
+    sprintf (line, "error: op %c not defined!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+
+  /** free up any temporary buffers: **/
+
+  if (V1[0].type == 'v') {
+    free (V1[0].vector[0].elements);
+    free (V1[0].vector);
+  }
+
+  clear_stack (V1);
+  clear_stack (V2);
+
+  /* at the end, V1 and V2 are deleted only if they were temporary */
+  return (TRUE);
+
+}
+
+int MV_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
+
+  int i, j, Nx, Ny;
+  float *out, *M1, *M2;
+  char line[512];
+ 
+  Nx = V1[0].buffer[0].matrix.Naxis[0];
+  Ny = V1[0].buffer[0].matrix.Naxis[1];
+  if (Ny != V2[0].vector[0].Nelements) {
+    push_error ("dimension mismatch");
+    return (FALSE);
+  }
+
+  /* if possible, use V1 as temp buffer, otherwise create new one */
+  if (V1[0].type == 'm') {  
+    OUT[0].buffer = V1[0].buffer;
+    V1[0].type = 'M'; /* prevent it from being freed below */
+  } else {  
+    /* do buffer.matrix.buffer and buffer.header.buffer get correctly zeroed? */
+    OUT[0].buffer = InitBuffer ();
+    CopyBuffer (OUT[0].buffer, V1[0].buffer);
+  }
+  OUT[0].type = 'm'; /*** <<--- says this is a temporary matrix ***/
+
+  M1  = V1[0].ptr;
+  M2  = V2[0].ptr;
+  out = OUT[0].ptr = (float *)OUT[0].buffer[0].matrix.buffer;
+
+  switch (op[0]) { 
+  case '+': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++)
+        *out = *M1 + *M2;
+    }
+    break; 
+  case '-': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++)
+        *out = *M1 - *M2;
+    }
+    break; 
+  case '*': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++)
+        *out = *M1 * *M2;
+    }
+    break; 
+  case '/': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++)
+        *out = *M1 / *M2;
+    }
+    break; 
+  case '%': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++)
+        *out = (int) *M1 % (int) *M2;
+    }
+    break; 
+  case 0x5e: 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = pow (*M1, *M2);
+    }
+    break; 
+  case '@': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = DEG_RAD*atan2 (*M1, *M2);
+    }
+    break; 
+  case 'D': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = MIN (*M1, *M2);
+    }
+    break; 
+  case 'U': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = MAX (*M1, *M2);
+    }
+    break; 
+  case '<': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = (*M1 < *M2) ? 1 : 0;
+    }
+    break; 
+  case '>': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = (*M1 > *M2) ? 1 : 0;
+    }
+    break; 
+  case '&': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = ((int)*M1 & (int)*M2);
+    }
+    break; 
+  case '|': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = ((int)*M1 | (int)*M2);
+    }
+    break; 
+  case 'E': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = (*M1 == *M2) ? 1 : 0;
+    }
+    break; 
+  case 'N': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = (*M1 != *M2) ? 1 : 0;
+    }
+    break; 
+  case 'L': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = (*M1 <= *M2) ? 1 : 0;
+    }
+    break; 
+  case 'G': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = (*M1 >= *M2) ? 1 : 0;
+    }
+    break; 
+  case 'A': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = (*M1 && *M2) ? 1 : 0;
+    }
+    break; 
+  case 'O': 
+    for (i = 0; i < Ny; i++, M2++) {
+      for (j = 0; j < Nx; j++, out++, M1++) 
+        *out = (*M1 || *M2) ? 1 : 0;
+    }
+    break; 
+  default:
+    sprintf (line, "error: op %c not defined!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+
+  /** free up any temporary buffers: **/
+
+  if (V1[0].type == 'm') {
+    free (V1[0].buffer[0].header.buffer);
+    free (V1[0].buffer[0].matrix.buffer);
+    free (V1[0].buffer);
+  }
+  if (V2[0].type == 'v') {
+    free (V2[0].vector[0].elements);
+    free (V2[0].vector);
+  }
+
+  clear_stack (V1);
+  clear_stack (V2);
+
+  /* at the end, V1 and V2 are deleted only if they were temporary */
+  return (TRUE);
+
+}
+
+
+int VM_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
+
+  int i, j, Nx, Ny;
+  float *out, *M1, *M2;
+  char line[512];
+  
+  Nx = V2[0].buffer[0].matrix.Naxis[0];
+  Ny = V2[0].buffer[0].matrix.Naxis[1];
+  if (Nx != V1[0].vector[0].Nelements) {
+    return (FALSE);
+  }
+
+  /* if possible, use V2 as temp buffer, otherwise create new one */
+  if (V2[0].type == 'm') {
+    OUT[0].buffer = V2[0].buffer;
+    V2[0].type = 'M'; /* prevent it from being freed below */
+  } else {  /* no spare temp buffer */
+    OUT[0].buffer = InitBuffer ();
+    CopyBuffer (OUT[0].buffer, V2[0].buffer);
+  }
+  OUT[0].type = 'm'; /*** <<--- says this is a temporary matrix ***/
+
+  M1  = V1[0].ptr;
+  M2  = V2[0].ptr;
+  out = OUT[0].ptr = (float *)OUT[0].buffer[0].matrix.buffer;
+
+  switch (op[0]) { 
+  case '+': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++)
+        *out = *M1 + *M2;
+    }
+    break; 
+  case '-': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++)
+        *out = *M1 - *M2;
+    }
+    break; 
+  case '*': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++)
+        *out = *M1 * *M2;
+    }
+    break; 
+  case '/': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++)
+        *out = *M1 / *M2;
+    }
+    break; 
+  case '%': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++)
+        *out = (int) *M1 % (int) *M2;
+    }
+    break; 
+  case 0x5e: 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = pow (*M1, *M2);
+    }
+    break; 
+  case '@': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = DEG_RAD*atan2 (*M1, *M2);
+    }
+    break; 
+  case 'D': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = MIN (*M1, *M2);
+    }
+    break; 
+  case 'U': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = MAX (*M1, *M2);
+    }
+    break; 
+  case '<': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = (*M1 < *M2) ? 1 : 0;
+    }
+    break; 
+  case '>': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = (*M1 > *M2) ? 1 : 0;
+    }
+    break; 
+  case '&': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = ((int)*M1 & (int)*M2);
+    }
+    break; 
+  case '|': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = ((int)*M1 | (int)*M2);
+    }
+    break; 
+  case 'E': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = (*M1 == *M2) ? 1 : 0;
+    }
+    break; 
+  case 'N': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = (*M1 != *M2) ? 1 : 0;
+    }
+    break; 
+  case 'L': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = (*M1 <= *M2) ? 1 : 0;
+    }
+    break; 
+  case 'G': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = (*M1 >= *M2) ? 1 : 0;
+    }
+    break; 
+  case 'A': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = (*M1 && *M2) ? 1 : 0;
+    }
+    break; 
+  case 'O': 
+    for (i = 0; i < Ny; i++) {
+      M1 = V1[0].ptr;
+      for (j = 0; j < Nx; j++, out++, M1++, M2++) 
+        *out = (*M1 || *M2) ? 1 : 0;
+    }
+    break; 
+  default:
+    sprintf (line, "error: op %c not defined!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+
+  /** free up any temporary buffers: **/
+
+  if (V1[0].type == 'v') {
+    free (V1[0].vector[0].elements);
+    free (V1[0].vector);
+  }
+  if (V2[0].type == 'm') {
+    free (V2[0].buffer[0].header.buffer);
+    free (V2[0].buffer[0].matrix.buffer);
+    free (V2[0].buffer);
+  }
+
+  clear_stack (V1);
+  clear_stack (V2);
+
+  /* at the end, V1 and V2 are deleted only if they were temporary */
+  return (TRUE);
+
+}
+
+int MM_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
+
+  int i, Nx, Ny;
+  float *out, *M1, *M2;
+  char line[512];
+  
+  Nx = V1[0].buffer[0].matrix.Naxis[0];
+  Ny = V1[0].buffer[0].matrix.Naxis[1];
+
+  if (V1[0].type == 'm') {  /** use V1 as temp buffer **/
+    OUT[0].buffer = V1[0].buffer;
+    V1[0].type = 'M'; /* prevent it from being freed below */
+  } else {
+    if (V2[0].type == 'm') { /** use V2 as temp buffer, but header of V1 **/
+      OUT[0].buffer = V2[0].buffer;
+      V2[0].type = 'M'; /* prevent it from being freed below */
+    } else {  /* no spare temp buffer */
+      OUT[0].buffer = InitBuffer ();
+      CopyBuffer (OUT[0].buffer, V1[0].buffer);
+    }
+  }
+  OUT[0].type = 'm'; /*** <<--- says this is a temporary matrix ***/
+
+  M1  = V1[0].ptr;
+  M2  = V2[0].ptr;
+  out = OUT[0].ptr = (float *)OUT[0].buffer[0].matrix.buffer;
+
+  switch (op[0]) { 
+  case '+': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++)
+      *out = *M1 + *M2;
+    break; 
+  case '-': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++)
+      *out = *M1 - *M2;
+    break; 
+  case '*': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++)
+      *out = *M1 * *M2;
+    break; 
+  case '/': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++)
+      *out = *M1 / *M2;
+    break; 
+  case '%': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++)
+      *out = (int) *M1 % (int) *M2;
+    break; 
+  case 0x5e: 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = pow (*M1, *M2);
+    break; 
+  case '@': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = DEG_RAD*atan2 (*M1, *M2);
+    break; 
+  case 'D': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = MIN (*M1, *M2);
+    break; 
+  case 'U': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = MAX (*M1, *M2);
+    break; 
+  case '<': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = (*M1 < *M2) ? 1 : 0;
+    break; 
+  case '>': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = (*M1 > *M2) ? 1 : 0;
+    break; 
+  case '&': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = ((int)*M1 & (int)*M2);
+    break; 
+  case '|': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = ((int)*M1 | (int)*M2);
+    break; 
+  case 'E': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = (*M1 == *M2) ? 1 : 0;
+    break; 
+  case 'N': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = (*M1 != *M2) ? 1 : 0;
+    break; 
+  case 'L': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = (*M1 <= *M2) ? 1 : 0;
+    break; 
+  case 'G': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = (*M1 >= *M2) ? 1 : 0;
+    break; 
+  case 'A': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = (*M1 && *M2) ? 1 : 0;
+    break; 
+  case 'O': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++, M2++) 
+      *out = (*M1 || *M2) ? 1 : 0;
+    break; 
+  default:
+    sprintf (line, "error: op %c not defined!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+
+  /** free up any temporary buffers: **/
+
+  if (V1[0].type == 'm') {
+    free (V1[0].buffer[0].header.buffer);
+    free (V1[0].buffer[0].matrix.buffer);
+    free (V1[0].buffer);
+  }
+  if (V2[0].type == 'm') {
+    free (V2[0].buffer[0].header.buffer);
+    free (V2[0].buffer[0].matrix.buffer);
+    free (V2[0].buffer);
+  }
+
+  clear_stack (V1);
+  clear_stack (V2);
+
+  /* at the end, V1 and V2 are deleted only if they were temporary */
+  return (TRUE);
+
+}
+
+
+int MS_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
+
+  int i, Nx, Ny;
+  float *out, *M1, *M2;
+  char line[512];
+  
+  Nx = V1[0].buffer[0].matrix.Naxis[0];
+  Ny = V1[0].buffer[0].matrix.Naxis[1];
+
+  /* if possible, use V1 as temp buffer, otherwise create new one */
+  if (V1[0].type == 'm') {
+    OUT[0].buffer = V1[0].buffer;
+    V1[0].type = 'M'; /* prevent it from being freed below */
+  } else {
+    OUT[0].buffer = InitBuffer ();
+    CopyBuffer (OUT[0].buffer, V1[0].buffer);
+  }
+  OUT[0].type = 'm';      /*** <<--- says this is a temporary matrix ***/
+
+  M1  = V1[0].ptr;
+  M2  = V2[0].ptr;
+  out = OUT[0].ptr = (float *)OUT[0].buffer[0].matrix.buffer;
+
+  switch (op[0]) { 
+  case '+': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++)
+      *out = *M1 + *M2;
+    break; 
+  case '-': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++)
+      *out = *M1 - *M2;
+    break; 
+  case '*': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++)
+      *out = *M1 * *M2;
+    break; 
+  case '/': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++)
+      *out = *M1 / *M2;
+    break; 
+  case '%': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++)
+      *out = (int) *M1 % (int) *M2;
+    break; 
+  case 0x5e: 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = pow (*M1, *M2);
+    break; 
+  case '@': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = DEG_RAD*atan2 (*M1, *M2);
+    break; 
+  case 'D': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = MIN (*M1, *M2);
+    break; 
+  case 'U': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = MAX (*M1, *M2);
+    break; 
+  case '<': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = (*M1 < *M2) ? 1 : 0;
+    break; 
+  case '>': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = (*M1 > *M2) ? 1 : 0;
+    break; 
+  case '&': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = ((int)*M1 & (int)*M2);
+    break; 
+  case '|': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = ((int)*M1 | (int)*M2);
+    break; 
+  case 'E': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = (*M1 == *M2) ? 1 : 0;
+    break; 
+  case 'N': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = (*M1 != *M2) ? 1 : 0;
+    break; 
+  case 'L': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = (*M1 <= *M2) ? 1 : 0;
+    break; 
+  case 'G': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = (*M1 >= *M2) ? 1 : 0;
+    break; 
+  case 'A': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = (*M1 && *M2) ? 1 : 0;
+    break; 
+  case 'O': 
+    for (i = 0; i < Nx*Ny; i++, out++, M1++) 
+      *out = (*M1 || *M2) ? 1 : 0;
+    break; 
+  default:
+    sprintf (line, "error: op %c not defined!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+
+  if (V1[0].type == 'm') {
+    free (V1[0].buffer[0].header.buffer);
+    free (V1[0].buffer[0].matrix.buffer);
+    free (V1[0].buffer);
+  }
+  clear_stack (V1);
+  clear_stack (V2);
+
+  return (TRUE);
+
+}
+
+
+int SM_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
+
+  int i, Nx, Ny;
+  float *out, *M1, *M2;
+  char line[512];
+  
+  Nx = V2[0].buffer[0].matrix.Naxis[0];
+  Ny = V2[0].buffer[0].matrix.Naxis[1];
+
+  if (V2[0].type == 'm') {  /* V2[0] is NOT temporary, we can't use it for storage */
+    OUT[0].buffer = V2[0].buffer;
+    V2[0].type = 'M'; /* prevent it from being freed below */
+  } else {
+    OUT[0].buffer = InitBuffer ();
+    CopyBuffer (OUT[0].buffer, V2[0].buffer);
+  }
+  OUT[0].type = 'm'; /*** <<--- says this is a temporary matrix ***/
+
+  M1  = V1[0].ptr;
+  M2  = V2[0].ptr;
+  out = OUT[0].ptr = (float *)OUT[0].buffer[0].matrix.buffer;
+
+  switch (op[0]) { 
+  case '+': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++)
+      *out = *M1 + *M2;
+    break; 
+  case '-': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++)
+      *out = *M1 - *M2;
+    break; 
+  case '*': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++)
+      *out = *M1 * *M2;
+    break; 
+  case '/': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++)
+      *out = *M1 / *M2;
+    break; 
+  case '%': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++)
+      *out = (int) *M1 % (int) *M2;
+    break; 
+  case 0x5e: 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++)
+      *out = pow (*M1, *M2);
+    break; 
+  case '@': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = DEG_RAD*atan2 (*M1, *M2);
+    break; 
+  case 'D': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = MIN (*M1, *M2);
+    break; 
+  case 'U': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = MAX (*M1, *M2);
+    break; 
+  case '<': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = (*M1 < *M2) ? 1 : 0;
+    break; 
+  case '>': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = (*M1 > *M2) ? 1 : 0;
+    break; 
+  case '&': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = ((int)*M1 & (int)*M2);
+    break; 
+  case '|': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = ((int)*M1 | (int)*M2);
+    break; 
+  case 'E': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = (*M1 == *M2) ? 1 : 0;
+    break; 
+  case 'N': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = (*M1 != *M2) ? 1 : 0;
+    break; 
+  case 'L': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = (*M1 <= *M2) ? 1 : 0;
+    break; 
+  case 'G': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = (*M1 >= *M2) ? 1 : 0;
+    break; 
+  case 'A': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = (*M1 && *M2) ? 1 : 0;
+    break; 
+  case 'O': 
+    for (i = 0; i < Nx*Ny; i++, out++, M2++) 
+      *out = (*M1 || *M2) ? 1 : 0;
+    break; 
+  default:
+    sprintf (line, "error: op %c not defined!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+
+  if (V2[0].type == 'm') {
+    free (V2[0].buffer[0].header.buffer);
+    free (V2[0].buffer[0].matrix.buffer);
+    free (V2[0].buffer);
+  }
+  clear_stack (V1);
+  clear_stack (V2);
+
+  return (TRUE);
+
+}
+
+
+int SS_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
+
+  float *M1, *M2, *out;
+  char line[512];
+
+  M1  = V1[0].ptr;
+  M2  = V2[0].ptr;
+  OUT[0].ptr = V1[0].ptr;
+  out = OUT[0].ptr;
+
+
+  switch (op[0]) { 
+  case '+': 
+    *out = *M1 + *M2;
+    break;    
+  case '-': 
+    *out = *M1 - *M2;
+    break;    
+  case '*': 
+    *out = *M1 * *M2;
+    break;    
+  case '/': 
+    *out = *M1 / *M2;
+    break; 
+  case '%': 
+    *out = (int) *M1 % (int) *M2;
+    break; 
+  case 0x5e: 
+    *out = pow (*M1, *M2);
+    break; 
+  case '@': 
+    *out = DEG_RAD*atan2 (*M1, *M2);
+    break; 
+  case 'D': 
+    *out = MIN (*M1, *M2);
+    break; 
+  case 'U': 
+    *out = MAX (*M1, *M2);
+    break; 
+  case '<': 
+    *out = (*M1 < *M2) ? 1 : 0;
+    break; 
+  case '>': 
+    *out = (*M1 > *M2) ? 1 : 0;
+    break; 
+  case '&': 
+    *out = ((int)*M1 & (int)*M2);
+    break; 
+  case '|': 
+    *out = ((int)*M1 | (int)*M2);
+    break; 
+  case 'E': 
+    *out = (*M1 == *M2) ? 1 : 0;
+    break; 
+  case 'N': 
+    *out = (*M1 != *M2) ? 1 : 0;
+    break; 
+  case 'L': 
+    *out = (*M1 <= *M2) ? 1 : 0;
+    break; 
+  case 'G': 
+    *out = (*M1 >= *M2) ? 1 : 0;
+    break; 
+  case 'A': 
+    *out = (*M1 && *M2) ? 1 : 0;
+    break; 
+  case 'O': 
+    *out = (*M1 || *M2) ? 1 : 0;
+    break; 
+  default:
+    sprintf (line, "error: op %c not defined!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+  OUT[0].Float = *(OUT[0].ptr);
+  OUT[0].type = 'S';
+
+  clear_stack (V1);
+  clear_stack (V2);
+
+  return (TRUE);
+
+}
+
+int WW_binary (StackVar *OUT, StackVar *V1, StackVar *V2, char *op) {
+
+  int value;
+  char line[512];
+
+  /* only 'N' and 'E' are allowed for WW_binary operations. anything else is either a
+   syntax error or is a string which looks like a math expression. */
+
+  if ((op[0] != 'N') && (op[0] != 'E')) {
+    sprintf (line, "error: op %c not defined for string operations!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+
+  /* evaluate stack will only call WW_binary with one numerical value,
+     and only in the case that the string did not parse to a number 
+     thus: string == number -> false */
+
+  if (!strncasecmp (&V1[0].type, "S", 1)) {
+    value = (op[0] == 'N');
+    goto escape;
+  }
+  if (!strncasecmp (&V2[0].type, "S", 1)) {
+    value = (op[0] == 'N');
+    goto escape;
+  }
+
+  switch (op[0]) { 
+  case 'E': 
+    value = strcmp (V1[0].name, V2[0].name) ? 0 : 1;
+    break; 
+  case 'N': 
+    value = strcmp (V1[0].name, V2[0].name) ? 1 : 0;
+    break; 
+  default:
+    sprintf (line, "error: op %c not defined for string operations!", op[0]);
+    push_error (line);
+    return (FALSE);
+  }
+
+escape:
+  OUT[0].Float = value;
+  OUT[0].type = 'S';
+  OUT[0].ptr = &OUT[0].Float;
+
+  clear_stack (V1);
+  clear_stack (V2);
+  return (TRUE);
+
+}
+
+
+int S_unary (StackVar *OUT, StackVar *V1, char *op) {
+
+  float *out, *M1;
+  
+  out = OUT[0].ptr = V1[0].ptr;
+  M1  = V1[0].ptr;
+
+  if (!strcmp (op, "="))     {    }
+  if (!strcmp (op, "abs"))   {    *out = fabs(*M1);           }
+  if (!strcmp (op, "int"))   {    *out = (float)(int)(*M1);   }
+  if (!strcmp (op, "exp"))   {    *out = exp (*M1);           }
+  if (!strcmp (op, "ten"))   {    *out = pow (10.0,*M1);      }
+  if (!strcmp (op, "log"))   {    *out = log10 (*M1);         }
+  if (!strcmp (op, "ln"))    {    *out = log (*M1);           }
+  if (!strcmp (op, "sqrt"))  {    *out = sqrt (*M1);          }
+  if (!strcmp (op, "erf"))   {    *out = erf (*M1);           }
+
+  if (!strcmp (op, "sinh"))  {    *out = sinh (*M1);          }
+  if (!strcmp (op, "cosh"))  {    *out = cosh (*M1);          }
+  if (!strcmp (op, "asinh")) {    *out = asinh (*M1);         }
+  if (!strcmp (op, "acosh")) {    *out = acosh (*M1);         }
+  if (!strcmp (op, "lgamma")) {   *out = lgamma (*M1);        }
+
+  if (!strcmp (op, "sin"))   {    *out = sin (*M1);           }
+  if (!strcmp (op, "cos"))   {    *out = cos (*M1);           }
+  if (!strcmp (op, "tan"))   {    *out = tan (*M1);           }
+  if (!strcmp (op, "dsin"))  {    *out = sin (*M1*RAD_DEG);   }
+  if (!strcmp (op, "dcos"))  {    *out = cos (*M1*RAD_DEG);   }
+  if (!strcmp (op, "dtan"))  {    *out = tan (*M1*RAD_DEG);   }
+  if (!strcmp (op, "asin"))  {    *out = asin (*M1);          }
+  if (!strcmp (op, "acos"))  {    *out = acos (*M1);          }
+  if (!strcmp (op, "atan"))  {    *out = atan (*M1);          }
+  if (!strcmp (op, "dasin")) {    *out = asin (*M1)*DEG_RAD;  }
+  if (!strcmp (op, "dacos")) {    *out = acos (*M1)*DEG_RAD;  }
+  if (!strcmp (op, "datan")) {    *out = atan (*M1)*DEG_RAD;  }
+  if (!strcmp (op, "rnd"))   {    *out = drand48();           }
+  if (!strcmp (op, "not"))   {    *out = !(*M1);              }
+  if (!strcmp (op, "--"))    {    *out = - (*M1);             }
+  if (!strcmp (op, "isinf")) {    *out = !finite(*M1);        }
+  if (!strcmp (op, "isnan")) {    *out = isnan(*M1);          } 
+
+  OUT[0].Float = *out;
+  OUT[0].type = 'S';
+
+  clear_stack (V1);
+  return (TRUE);
+
+}
+
+int V_unary (StackVar *OUT, StackVar *V1, char *op) {
+
+  int i, Nx;
+  float *out, *M1;
+  
+  Nx = V1[0].vector[0].Nelements;
+ 
+  if (V1[0].type == 'v') {  /** use V1 as temp buffer **/
+    OUT[0].vector = V1[0].vector;
+    V1[0].type = 'V'; /* prevent it from being freed below */
+  } else {  /* no spare temp buffer */
+    OUT[0].vector = InitVector ();
+    CopyVector (OUT[0].vector, V1[0].vector);
+  }
+  OUT[0].type = 'v'; /*** <<--- says this is a temporary matrix ***/
+  M1  = V1[0].ptr;
+  out = OUT[0].ptr = (float *)OUT[0].vector[0].elements;
+
+  if (!strcmp (op, "="))     { } /* already set equal */
+  if (!strcmp (op, "abs"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = fabs(*M1);         }}
+  if (!strcmp (op, "int"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = (float)(int)(*M1); }}
+  if (!strcmp (op, "exp"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = exp(*M1);          }}
+  if (!strcmp (op, "ten"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = pow(10.0,*M1);     }}
+  if (!strcmp (op, "log"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = log10(*M1);        }}
+  if (!strcmp (op, "ln"))    { for (i = 0; i < Nx; i++, out++, M1++) { *out = log(*M1);          }}
+  if (!strcmp (op, "sqrt"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = sqrt(*M1);         }}
+  if (!strcmp (op, "erf"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = erf(*M1);          }}
+
+  if (!strcmp (op, "sinh"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = sinh(*M1);        }}
+  if (!strcmp (op, "cosh"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = cosh(*M1);        }}
+  if (!strcmp (op, "asinh"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = asinh(*M1);       }}
+  if (!strcmp (op, "acosh"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = acosh(*M1);       }}
+  if (!strcmp (op, "lgamma")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = lgamma(*M1);      }}
+
+  if (!strcmp (op, "sin"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = sin(*M1);          }}
+  if (!strcmp (op, "cos"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = cos(*M1);          }}
+  if (!strcmp (op, "tan"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = tan(*M1);          }}
+  if (!strcmp (op, "dsin"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = sin(*M1*RAD_DEG);  }}
+  if (!strcmp (op, "dcos"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = cos(*M1*RAD_DEG);  }}
+  if (!strcmp (op, "dtan"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = tan(*M1*RAD_DEG);  }}
+  if (!strcmp (op, "asin"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = asin(*M1);         }}
+  if (!strcmp (op, "acos"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = acos(*M1);         }}
+  if (!strcmp (op, "atan"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = atan(*M1);         }}
+  if (!strcmp (op, "dasin")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = asin(*M1)*DEG_RAD; }}
+  if (!strcmp (op, "dacos")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = acos(*M1)*DEG_RAD; }}
+  if (!strcmp (op, "datan")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = atan(*M1)*DEG_RAD; }}
+  if (!strcmp (op, "rnd"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = drand48();         }}
+  if (!strcmp (op, "ramp"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = i;                 }}
+  if (!strcmp (op, "zero"))  { for (i = 0; i < Nx; i++, out++, M1++) { *out = 0;                 }}
+  if (!strcmp (op, "not"))   { for (i = 0; i < Nx; i++, out++, M1++) { *out = !(*M1);            }}
+  if (!strcmp (op, "--"))    { for (i = 0; i < Nx; i++, out++, M1++) { *out = -(*M1);            }}
+  if (!strcmp (op, "isinf")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = !finite(*M1);      }}
+  if (!strcmp (op, "isnan")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = isnan(*M1);        }}
+
+  /* xramp and yramp only make sense in for matrices. for vectors, xramp = ramp, yramp = zero */
+  if (!strcmp (op, "xramp")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = i;                 }}
+  if (!strcmp (op, "yramp")) { for (i = 0; i < Nx; i++, out++, M1++) { *out = 0;                 }}
+
+  if (V1[0].type == 'v') {
+    free (V1[0].vector[0].elements);
+    free (V1[0].vector);
+    V1[0].vector = NULL;
+  }  
+
+  clear_stack (V1);
+  return (TRUE);
+
+}
+
+int M_unary (StackVar *OUT, StackVar *V1, char *op) {
+
+  int i, j, Nx, Ny;
+  float *out, *M1;
+  
+  Nx = V1[0].buffer[0].matrix.Naxis[0];
+  Ny = V1[0].buffer[0].matrix.Naxis[1];
+
+  if (V1[0].type == 'm') {
+    OUT[0].buffer = V1[0].buffer;
+    V1[0].type = 'M'; /* prevent it from being freed below */
+  } else {
+    OUT[0].buffer = InitBuffer ();
+    CopyBuffer (OUT[0].buffer, V1[0].buffer);
+  }
+  OUT[0].type = 'm';      /*** <<--- says this is a temporary matrix ***/
+  M1  = V1[0].ptr;
+  out = OUT[0].ptr = (float *)OUT[0].buffer[0].matrix.buffer;
+
+  if (!strcmp (op, "="))     { }
+  if (!strcmp (op, "abs"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = fabs(*M1);         }}
+  if (!strcmp (op, "int"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = (float)(int)(*M1); }}
+  if (!strcmp (op, "exp"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = exp(*M1);          }}
+  if (!strcmp (op, "ten"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = pow(10.0,*M1);     }}
+  if (!strcmp (op, "log"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = log10(*M1);        }}
+  if (!strcmp (op, "ln"))    { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = log(*M1);          }}
+  if (!strcmp (op, "sqrt"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = sqrt(*M1);         }}
+  if (!strcmp (op, "erf"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = erf(*M1);          }}
+
+  if (!strcmp (op, "sinh"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = sinh(*M1);         }}
+  if (!strcmp (op, "cosh"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = cosh(*M1);         }}
+  if (!strcmp (op, "asinh")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = asinh(*M1);        }}
+  if (!strcmp (op, "acosh")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = acosh(*M1);        }}
+  if (!strcmp (op, "lgamma")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = lgamma(*M1);      }}
+
+  if (!strcmp (op, "sin"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = sin(*M1);          }}
+  if (!strcmp (op, "cos"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = cos(*M1);          }}
+  if (!strcmp (op, "tan"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = tan(*M1);          }}
+  if (!strcmp (op, "dsin"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = sin(*M1*RAD_DEG);  }}
+  if (!strcmp (op, "dcos"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = cos(*M1*RAD_DEG);  }}
+  if (!strcmp (op, "dtan"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = tan(*M1*RAD_DEG);  }}
+  if (!strcmp (op, "asin"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = asin(*M1);         }}
+  if (!strcmp (op, "acos"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = acos(*M1);         }}
+  if (!strcmp (op, "atan"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = atan(*M1);         }}
+  if (!strcmp (op, "dasin")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = asin(*M1)*DEG_RAD; }}
+  if (!strcmp (op, "dacos")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = acos(*M1)*DEG_RAD; }}
+  if (!strcmp (op, "datan")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = atan(*M1)*DEG_RAD; }}
+  if (!strcmp (op, "not"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = !(*M1);            }}
+  if (!strcmp (op, "--"))    { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = -(*M1);            }}
+  if (!strcmp (op, "rnd"))   { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = drand48();         }}
+  if (!strcmp (op, "ramp"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = i;                 }}
+  if (!strcmp (op, "zero"))  { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = 0;                 }}
+  if (!strcmp (op, "isinf")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = !finite(*M1);      }}
+  if (!strcmp (op, "isnan")) { for (i = 0; i < Nx*Ny; i++, out++, M1++) { *out = isnan(*M1);        }}
+
+  /* xrm and yrm only make sense in for matrices. see special meaning for vectors */
+  if (!strcmp (op, "xramp")) {
+    for (j = 0; j < Ny; j++) {
+      for (i = 0; i < Nx; i++, out++, M1++) {
+        *out = i;
+      }
+    }
+  }
+  if (!strcmp (op, "yramp")) {
+    for (j = 0; j < Ny; j++) {
+      for (i = 0; i < Nx; i++, out++, M1++) {
+        *out = j;
+      }
+    }
+  }
+  
+  if (V1[0].type == 'm') {
+    free (V1[0].buffer[0].header.buffer);
+    free (V1[0].buffer[0].matrix.buffer);
+    free (V1[0].buffer);
+  }
+
+  clear_stack (V1);
+  return (TRUE);
+
+}
+
+/*********************** fits copy header ***********************************/
+int gfits_copy_matrix_info (Matrix *matrix1, Matrix *matrix2) {
+
+  int i;
+
+  /* copy all but the matrix */
+
+  matrix2[0].unsign = matrix1[0].unsign;
+  matrix2[0].bitpix = matrix1[0].bitpix;
+  matrix2[0].size   = matrix1[0].size;
+  matrix2[0].bzero  = matrix1[0].bzero;
+  matrix2[0].bscale = matrix1[0].bscale;
+  matrix2[0].Naxes  = matrix1[0].Naxes;
+  for (i = 0; i < FT_MAX_NAXES; i++) 
+    matrix2[0].Naxis[i] = matrix1[0].Naxis[i];
+
+
+  return (TRUE);
+}       
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/startup.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/startup.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/startup.c	(revision 15879)
@@ -0,0 +1,158 @@
+# include "opihi.h"
+
+/* program-independent initialization
+ * these steps do not depend on the opihi implementation
+ * (ie, the supplied commands or data structures)
+ */
+
+void general_init (int *argc, char **argv) {
+
+  /* init srand for rnd numbers elsewhere */
+  long A, B;
+  A = time(NULL);
+  for (B = 0; A == time(NULL); B++);
+  srand48(B);
+ 
+  /* set signals */
+  signal (SIGINT, SIG_IGN);
+
+  /* init for main (or only) thread */
+  gprintInit ();
+
+  init_error ();
+
+  /* load config data (.ptolemyrc) */
+  if (!ConfigInit (argc, argv)) {
+    gprint (GP_ERR, "can't find config file. some functions will be unavailable\n");
+  }
+
+  return;
+}
+
+void startup (int *argc, char **argv) {
+    
+    int i, N, status, ONLY_INPUT, LOAD_RC;
+    char *line, *home, *outline, *varname;
+    char *rcfile, **list;
+    int Nlist, NLIST;
+   
+    /* load in interesting environment variables */
+    ALLOCATE (line, char, 1024);
+    
+    home = getenv ("HOME");
+    if (home == NULL) 
+      set_str_variable ("HOME", ".");
+    else 
+      set_str_variable ("HOME", home);
+    set_str_variable ("KAPA", "kapa");
+    set_variable ("PID", getpid());
+
+    set_int_variable ("UNSIGN", 0);
+    gfits_set_unsign_mode (FALSE);
+    
+  /* check history file permission */
+  {
+    FILE *f;
+    char *opihi_history;
+
+    opihi_history = get_variable ("HISTORY");
+    if (opihi_history && *opihi_history) {
+      f = fopen (opihi_history, "a");
+      if (f == NULL) /* no current history file here */
+	gprint (GP_ERR, "can't save history.\n");
+      else
+	fclose (f);
+      stifle_history (200);
+      read_history (opihi_history);
+    }
+  }
+
+  if (0) {
+    /* fix the history list to remove the timestamp */
+    char *c;
+    int i;
+    HIST_ENTRY **entry;
+    
+    entry = history_list ();
+    if (entry != (HIST_ENTRY **) NULL) {
+      for (i = 0; entry[i]; i++) {
+	if ((strlen (entry[i][0].line) > 19) &&
+	    (entry[i][0].line[2] == '/') && 
+	    (entry[i][0].line[5] == '/') && 
+	    (entry[i][0].line[11] == ':') && 
+	    (entry[i][0].line[14] == ':') && 
+	    (entry[i][0].line[17] == ':')) {
+	  c = entry[i][0].line + 19;
+	  memmove (entry[i][0].line, c, strlen(c) + 1);
+	}
+      }
+    }
+  }
+
+    LOAD_RC = TRUE;
+    if ((N = get_argument (*argc, argv, "--norc"))) {
+      remove_argument (N, argc, argv);
+      LOAD_RC = FALSE;
+    }
+    
+    ONLY_INPUT = FALSE;
+    if ((N = get_argument (*argc, argv, "--only"))) {
+      remove_argument (N, argc, argv);
+      ONLY_INPUT = TRUE;
+    }
+
+    /* load cmdline files */
+    Nlist = 0;
+    NLIST = 10;
+    ALLOCATE (list, char *, NLIST);
+    while ((N = get_argument (*argc, argv, "--load"))) {
+      remove_argument (N, argc, argv);
+      list[Nlist] = strcreate (argv[N]);
+      remove_argument (N, argc, argv);
+      Nlist++;
+      if (Nlist == NLIST) {
+	NLIST += 10;
+	REALLOCATE (list, char *, NLIST);
+      }
+    }
+
+    is_script = TRUE;
+    if (*argc == 1) is_script = FALSE;
+    set_int_variable ("SCRIPT", is_script);
+
+    if (LOAD_RC && !is_script) {
+      rcfile = get_variable ("RCFILE");
+      sprintf (line, "input %s/%s", home, rcfile);
+      status = command (line, &outline, TRUE);
+      if (outline != (char *) NULL) free (outline);
+    }
+      
+    set_int_variable ("argv:n", 0);
+    if (is_script) {
+      /* first argument in input script, rest are argv */
+      list[Nlist] = strcreate (argv[1]);
+      Nlist ++;
+      /* generate list argv:0 - argv:n from arguments */
+      ALLOCATE (varname, char, 256);
+      for (i = 2; i < *argc; i++) {
+	sprintf (varname, "argv:%d", i - 2);
+	set_str_variable (varname, argv[i]);
+      }
+      set_int_variable ("argv:n", i - 2);
+      free (varname);
+    }
+
+    /* execute command-line entries */
+    for (i = 0; i < Nlist; i++) {
+      ALLOCATE (line, char, 1024);
+      sprintf (line, "input %s", list[i]);
+      status = command (line, &outline, TRUE);
+      if (outline != (char *) NULL) free (outline);
+    }
+    free (list);
+
+    /* if this is not an interactive session, exit here */
+    if (ONLY_INPUT) exit (2);
+    if (is_script) exit (2);
+    return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/string.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/string.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/string.c	(revision 15879)
@@ -0,0 +1,289 @@
+# include "opihi.h"
+
+/**********************************************************************/
+/* returns a pointer to an isolated string containing the first word,
+   removing leading WHITESPACE.  A "word" is a contiguous set of 
+   characters from the set: alphanumerics, and any of: / . _ -
+   Any other single, non-WHITESPACE characters are considered to be 
+   complete words in themselves.  Any characters surrounded by quotes 
+   make a single word 
+*/
+
+char *thisword (char *string) {
+
+  int i, j, N;
+  char *word;
+
+  if (string == (char *) NULL) return ((char *) NULL);
+
+  for (i = 0; OHANA_WHITESPACE (string[i]); i++);
+  if (string[i] == 0) return ((char *)NULL);
+  if (string[i] == ';') {
+    word = strncreate (&string[i], 1);
+    return (word);
+  }
+
+  /* a string of characters contained within double quotes is 
+      a single entry.  check that there are pairs of quotes,
+      return only the string between the quotes */
+  if (string[i] == '"') { 
+    i++;
+    if (string[i] == 0) return ((char *) NULL);
+    for (j = i; (string[j] != 0) && (string[j] != '"'); j++);
+    if (string[j] == 0) {
+      gprint (GP_ERR, "misbalanced quotes\n");
+      return ((char *)NULL);
+    }
+    //    for (; (string[j] != 0) && (!OHANA_WHITESPACE(string[j])); j++);
+    word = strncreate (&string[i], j - i);
+    return (word);
+  } 
+
+  /* a string of characters contained within parentheses is 
+      a single entry.  check that there are matched pairs of
+      parentheses, return string, including exterior parentheses */
+  if (string[i] == '(') { 
+    i++;
+    N = 1;
+    if (string[i] == 0) return ((char *) NULL);
+    for (j = i; (string[j] != 0) && (N > 0); j++) {
+      if (string[j] == '(') {
+	N++;
+      }
+      if (string[j] == ')') {
+	N--;
+      }
+    }
+    if ((string[j] == 0) && (N != 0)) {
+      gprint (GP_ERR, "misbalanced parenthesis\n");
+      return ((char *)NULL);
+    }
+    word = strncreate (&string[i-1], j - i + 1);
+    return (word);
+  } 
+
+
+  for (j = i; (string[j] != 0) && (string[j] != ';') && !OHANA_WHITESPACE(string[j]); j++);
+  word = strncreate (&string[i], j - i);
+  return (word);
+
+}
+
+/* returns a pointer to an isolated string containing the first command,
+   removing leading WHITESPACE.  A command ends with the first non WHITESPACE */
+char *thiscomm (char *string) {
+
+  int i, j;
+  char *word;
+
+  if (string == (char *) NULL) return ((char *) NULL);
+
+  for (i = 0; OHANA_WHITESPACE (string[i]); i++);
+  if (string[i] == 0) return ((char *)NULL);
+
+  for (j = i; ((string[j] != 0) && !OHANA_WHITESPACE (string[j])); j++);
+  if (i == j) return ((char *) NULL);
+
+  word = strncreate (&string[i], j - i);
+  return (word);
+
+}
+
+/* take a pointer to the beginning of a variable (ie $foo)
+and extract only the variable name (eg, foo) */
+
+char *thisvar (char *string) {
+
+  int i, start;
+  char *word;
+
+  if (string == (char *) NULL) return ((char *) NULL);
+  if (string[0] != '$') return ((char *) NULL);
+
+  /* special case $?name : check that name is valid */
+  start = 1;
+  if (string[1] == '?') start = 2;
+
+  for (i = start; ISVAR(string[i]); i++);
+  if (i == start) return ((char *) NULL);
+
+  /* the ? is part of the variable */
+  word = strncreate (&string[1], i - 1);
+  return (word);
+
+}
+
+
+/**********************************************************************/
+/* returns a pointer to the next word, or (char *) NULL if there is not a next word */
+char *nextword (char *string) {
+
+  int i, j;
+
+  if (string == (char *) NULL) return ((char *) NULL);
+
+  for (i = 0; OHANA_WHITESPACE (string[i]); i++);
+  if (string[i] == 0) return ((char *)NULL);
+
+  if (string[i] == '"') { 
+    i++;
+    if (string[i] == 0) return ((char *) NULL);
+    for (; (string[i] != 0) && (string[i] != '"'); i++);
+    if (string[i] == 0) {
+      gprint (GP_ERR, "misbalanced quotes\n");
+      return ((char *)NULL);
+    }
+    i++;
+    for (; (string[i] != 0) && OHANA_WHITESPACE (string[i]); i++);
+    if (string[i] == 0) return ((char *) NULL);
+    return (&string[i]);
+  } 
+
+  if (string[i] == '(') { 
+    i++; 
+    j = 1;
+    if (string[i] == 0) return ((char *) NULL);
+    for (; (string[i] != 0) && (j > 0); i++) {
+      if (string[i] == '(') {
+	j++;
+      }
+      if (string[i] == ')') {
+	j--;
+      }
+    }
+    if ((string[i] == 0) && (j != 0)) {
+      gprint (GP_ERR, "misbalanced parenthesis\n");
+      return ((char *)NULL);
+    }
+    for (; (string[i] != 0) && OHANA_WHITESPACE (string[i]); i++);
+    if (string[i] == 0) return ((char *) NULL);
+    return (&string[i]);
+  } 
+
+  if (string[i] == ';') i++;
+  for (; (string[i] != 0) && (string[i] != ';') && !OHANA_WHITESPACE(string[i]); i++);
+  for (; (string[i] != 0) && OHANA_WHITESPACE (string[i]); i++);
+  if (string[i] == 0) return ((char *) NULL);
+
+  return (&string[i]);
+}
+
+/* returns a pointer to the next command, or (char *) NULL 
+   if there is not a next command.  A command is bounded by WHITESPACE */
+char *nextcomm (char *string) {
+
+  int i;
+
+  if (string == (char *) NULL) return ((char *) NULL);
+  
+  for (i = 0; (string[i] != 0) && !OHANA_WHITESPACE (string[i]); i++);
+  if (string[i] == 0) return ((char *) NULL);
+  
+  for (; OHANA_WHITESPACE (string[i]); i++);
+  if (string[i] == 0) return ((char *) NULL);
+
+  return (&string[i]);
+}
+
+/* returns a pointer to the previous word,
+   or (char *) NULL if there is not a previous word
+*/
+char *lastword (char *string, char *c) {
+
+  if (string == (char *) NULL) return ((char *) NULL);
+  if (c == (char *) NULL) return ((char *) NULL);
+
+  for (; !OHANA_WHITESPACE(*c) && (c >= string); c--);
+  if (c < string) return ((char *)NULL);
+
+  for (; OHANA_WHITESPACE(*c) && (c >= string); c--);
+  if (c < string)
+    return ((char *)NULL);
+  for (; !OHANA_WHITESPACE(*c) && (c >= string); c--);
+  c++;
+  return (c);
+}
+
+
+
+/* take a pointer to the beginning of a variable (ie $fred) and return
+   a pointer to the next thing (non WHITESPACE) which is not part of the
+   variable extract only the variable name */
+
+char *aftervar (char *string) {
+
+  int i, j, start;
+
+  if (string == (char *) NULL) return ((char *) NULL);
+  if (string[0] != '$') return ((char *) NULL);
+
+  /* special case: $?name : test only name */
+  start = 1;
+  if (string[1] == '?') start = 2;
+
+  for (i = start; ISVAR(string[i]); i++);
+  if (i == start) return ((char *) NULL);
+
+  for (j = i; OHANA_WHITESPACE (string[j]); j++);
+  if (string[j] == 0) return ((char *)NULL);
+
+  return (&string[j]);
+
+}
+
+
+/* returns a pointer to the previous var, 
+   or (char *) NULL if there is not a previous word
+*/
+char *lastvar (char *string, char *c) {
+
+  if (string == (char *) NULL) return ((char *) NULL);
+  if (c == (char *) NULL) return ((char *) NULL);
+
+  for (; (c >= string) && OHANA_WHITESPACE(*c); c--);
+  if (c < string) return ((char *)NULL);
+
+  for (; (c >= string) && ISVAR(*c) ; c--);
+  if ((c < string) || (*c != '$')) return ((char *)NULL);
+
+  return (c);
+}
+
+// append string defined by range start - stop to the end of output, which
+// currently has an allocated size of Noutput.  if this operation would overshoot Noutput, 
+// output is reallocated to a sufficiently large size
+char *opihi_append (char *output, int *Noutput, char *start, char *stop) {
+
+  int N1, N2, outlen;
+
+  // a NULL end pointer means 'go to end of line'
+  if (stop == NULL) {
+    stop = start + strlen(start);
+  }
+
+  // enough space?
+  N1 = strlen(output);
+  N2 = stop - start;
+  outlen = N1 + N2;
+  if (outlen >= *Noutput) {
+    *Noutput = outlen + 128;
+    REALLOCATE (output, char, *Noutput);
+    memset (&output[N1], 0, N2 + 128);
+  }
+
+  strncat (output, start, stop - start);
+  return output;
+}
+
+/* replace all instances of \A with A in line */
+void interpolate_slash (char *line) {
+
+  char *in, *out;
+
+  for (in = out = line; *in != 0; in++, out++) {
+    if (*in == 0x5c) in++;
+    *out = *in;
+    if (*in == 0) return;
+  }
+  *out = *in;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/timeformat.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/timeformat.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/timeformat.c	(revision 15879)
@@ -0,0 +1,30 @@
+# include "opihi.h"
+
+int GetTimeFormat (time_t *TimeReference, int *TimeFormat) {
+
+  char *p;
+
+  *TimeReference = 0;
+  if ((p = get_variable ("TIMEREF")) != (char *) NULL) {
+    if (!ohana_str_to_time (p, TimeReference)) {
+      gprint (GP_ERR, "error in TIME_REF format\n");
+      return (FALSE);
+    }
+    free (p);
+  }
+  *TimeFormat = FALSE;
+  if ((p = get_variable ("TIMEFORMAT")) != (char *) NULL) {
+    if (!strcasecmp (p, "JD")) *TimeFormat     = TIME_JD;
+    if (!strcasecmp (p, "MJD")) *TimeFormat    = TIME_MJD;
+    if (!strcasecmp (p, "date")) *TimeFormat   = TIME_DATE;
+    if (!strcasecmp (p, "days")) *TimeFormat   = TIME_DAYS;
+    if (!strcasecmp (p, "hours")) *TimeFormat  = TIME_HOURS;
+    if (!strcasecmp (p, "min")) *TimeFormat    = TIME_MINUTES;
+    if (!strcasecmp (p, "sec")) *TimeFormat    = TIME_SECONDS;
+    if (!*TimeFormat) gprint (GP_ERR, "unknown TIME_FORMAT\n");
+    free (p);
+    return (FALSE);
+  }
+  if (!*TimeFormat) *TimeFormat = TIME_SECONDS;
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/variable.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/variable.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/variable.c	(revision 15879)
@@ -0,0 +1,359 @@
+# include "opihi.h"
+
+Variable *variables;   /* variable to store the list of all variables */
+int      Nvariables;   /* number of currently available variables */
+
+void InitVariables () {
+  Nvariables = 0;
+  ALLOCATE (variables, Variable, 1); 
+}
+
+int set_local_variable (char *name, char *value) {
+
+  int i;
+  char *local, *MacroName;
+
+  /* a local variable has the form (macroname).(varname) */
+  MacroName = GetMacroName ();
+
+  /* look for global variable (warning or error)
+  for (i = 0; i < Nvariables; i++) {
+    if (!strcmp (name, variables[i].name)) {
+      gprint (GP_ERR, "warning: local variable overrides global name\n");
+    }
+  } */
+
+  /* look for existing local variable */
+  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
+  sprintf (local, "%s.%s", MacroName, name);
+  for (i = 0; i < Nvariables; i++) {
+    if (!strcmp (local, variables[i].name)) {
+      free (variables[i].value);
+      free (local);
+      variables[i].value = strcreate (value);
+      return (TRUE);
+    }
+  }
+  /* NEW variable */
+  Nvariables ++;
+  REALLOCATE (variables, Variable, Nvariables);
+  variables[Nvariables - 1].name = local;
+  variables[Nvariables - 1].value = strcreate (value);
+  return (TRUE);
+}
+
+int set_str_variable (char *name, char *value) {
+
+  int i;
+  char *local, *MacroName;
+
+  MacroName = GetMacroName ();
+
+  /* look for local variable first */
+  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
+  sprintf (local, "%s.%s", MacroName, name);
+  for (i = 0; i < Nvariables; i++) {
+    if (!strcmp (local, variables[i].name)) {
+      free (variables[i].value);
+      free (local);
+      variables[i].value = strcreate (value);
+      return (TRUE);
+    }
+  }
+  free (local);
+
+  /* look for global variable */
+  for (i = 0; i < Nvariables; i++) {
+    if (!strcmp (name, variables[i].name)) {
+      free (variables[i].value);
+      variables[i].value = strcreate (value);
+      return (TRUE);
+    }
+  }
+  /* NEW variable */
+  Nvariables ++;
+  REALLOCATE (variables, Variable, Nvariables);
+  variables[Nvariables - 1].name = strcreate (name);
+  variables[Nvariables - 1].value = strcreate (value);
+  return (TRUE);
+}
+
+int set_variable (char *name, double dvalue) {
+
+  char value[1024];
+
+  sprintf (value, "%.12g", dvalue);
+  set_str_variable (name, value);
+  return (TRUE);
+}
+
+int set_int_variable (char *name, int ivalue) {
+
+  char value[1024];
+
+  sprintf (value, "%d", ivalue);
+  set_str_variable (name, value);
+  return (TRUE);
+}
+
+static char variable_true[] = "1";
+static char variable_false[] = "0";
+
+char *get_variable_ptr (char *name) {
+  
+  int i;
+  char *local, *MacroName, *value;
+
+  if (name == NULL) return (NULL);
+  if (*name == 0) return (NULL);
+
+  /* check for the existence of the given name (after ?) */
+  /* return a string which should not be freed */
+  if (*name == '?') {
+    value = get_variable_ptr (&name[1]);
+    if (value == NULL) {
+      return variable_false;
+    }
+    return variable_true;
+  }
+
+  MacroName = GetMacroName ();
+
+  /* look for local variable first */
+  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
+  sprintf (local, "%s.%s", MacroName, name);
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(local, variables[i].name)) {
+      free (local);
+      return (variables[i].value);
+    }
+  }
+  free (local);
+
+  /* look for global variable */
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(name, variables[i].name)) {
+      return (variables[i].value);
+    }
+  }
+  return (NULL);
+}
+
+char *get_variable (char *name) {
+  
+  int i;
+  char *local, *MacroName;
+  char *value;
+
+  if (name == NULL) return (NULL);
+  if (*name == 0) return (NULL);
+
+  /* check for the existence of the given name (after ?) */
+  /* return a string which can be freed */
+  if (*name == '?') {
+    value = get_variable_ptr (&name[1]);
+    if (value == NULL) {
+      value = strcreate (variable_false);
+      return value;
+    }
+    value = strcreate (variable_true);
+    return value;
+  }
+
+  MacroName = GetMacroName ();
+
+  /* look for local variable first */
+  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
+  sprintf (local, "%s.%s", MacroName, name);
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(local, variables[i].name)) {
+      free (local);
+      return (strcreate (variables[i].value));
+    }
+  }
+  free (local);
+
+  /* look for global variable */
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(name, variables[i].name)) {
+      return (strcreate (variables[i].value));
+    }
+  }
+  return (NULL);
+}
+
+/* return TRUE / FALSE if name is an existant variable */
+int get_variable_exists (char *name) {
+  
+  int i;
+  char *local, *MacroName;
+
+  MacroName = GetMacroName ();
+
+  /* look for local variable first */
+  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
+  sprintf (local, "%s.%s", MacroName, name);
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(local, variables[i].name)) {
+      free (local);
+      return (TRUE);
+    }
+  }
+  free (local);
+
+  /* look for global variable */
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(name, variables[i].name)) {
+      return (TRUE);
+    }
+  }
+  return (FALSE);
+}
+
+char *get_local_variable_ptr (char *name) {
+  
+  int i;
+  char *local, *MacroName;
+
+  MacroName = GetMacroName ();
+
+  /* look for local variable first */
+  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
+  sprintf (local, "%s.%s", MacroName, name);
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(local, variables[i].name)) {
+      free (local);
+      return (variables[i].value);
+    }
+  }
+  free (local);
+  return (NULL);
+}
+
+float get_variable_default (char *name, float dvalue) {
+
+  char *value;
+  float fvalue;
+
+  value = get_variable (name);
+  if (value == NULL) {
+    return (dvalue);
+  }
+  fvalue = atof (value);
+  return (fvalue);
+}
+
+double get_double_variable (char *name, int *found) {
+  
+  int i;
+  char *local, *MacroName;
+
+  MacroName = GetMacroName ();
+
+  /* look for local variable first */
+  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
+  sprintf (local, "%s.%s", MacroName, name);
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(local, variables[i].name)) {
+      free (local);
+      *found = TRUE;
+      return (atof (variables[i].value));
+    }
+  }
+  free (local);
+
+  /* look for global variable */
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(name, variables[i].name)) {
+      *found = TRUE;
+      return (atof (variables[i].value));
+    }
+  }
+  *found = FALSE;
+  return (0.0);
+}
+
+int get_int_variable (char *name, int *found) {
+  
+  int i;
+  char *local, *MacroName;
+
+  MacroName = GetMacroName ();
+
+  /* look for local variable first */
+  ALLOCATE (local, char, strlen(name) + strlen(MacroName) + 2);
+  sprintf (local, "%s.%s", MacroName, name);
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(local, variables[i].name)) {
+      *found = TRUE;
+      free (local);
+      return (atof (variables[i].value));
+    }
+  }
+  free (local);
+
+  /* look for global variable */
+  for (i = 0; i < Nvariables; i++) { /* find the variable mentioned */
+    if (!strcmp(name, variables[i].name)) {
+      *found = TRUE;
+      return (atof (variables[i].value));
+    }
+  }
+  *found = FALSE;
+  return (0.0);
+}
+
+int DeleteNamedScalar (char *name) {
+
+  int i, j;
+
+  for (i = 0; i < Nvariables; i++) {
+    if (!strcmp (name, variables[i].name)) {
+      free (variables[i].name);
+      free (variables[i].value);
+      for (j = i; j < Nvariables - 1; j++) {
+	variables[j] = variables[j + 1];
+      }
+      Nvariables --;
+      REALLOCATE (variables, Variable, MAX (Nvariables, 1));
+      return (TRUE);
+    }
+  }
+  return (FALSE);
+}
+
+int IsScalar (char *name) { 
+
+  int i;
+
+  for (i = 0; i < Nvariables; i++) {
+    if (!strcmp (name, variables[i].name)) return (TRUE);
+  }
+  return (FALSE);
+}
+
+void ListVariables () {
+
+  int i;
+
+  if (Nvariables == 0) {
+    gprint (GP_ERR, "No defined variables\n");
+    return;
+  }
+
+  for (i = 0; i < Nvariables; i++) {
+    gprint (GP_ERR, "%s = %s\n", variables[i].name, variables[i].value);
+  }
+  return;
+}
+
+int SelectScalar (char *string, double *value) {
+
+  char *end;
+
+  /* if string is a number, return TRUE */
+  *value = strtod (string, &end);
+  if (end == string + strlen(string)) return (TRUE);
+
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/version.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/version.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/lib.shell/version.c	(revision 15879)
@@ -0,0 +1,6 @@
+# include "shell.h"
+static char *name = "$Name: not supported by cvs2svn $";
+
+char *opihi_version () {
+  return (name);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/Makefile	(revision 15879)
@@ -0,0 +1,49 @@
+default: mana
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+SRC     =       $(HOME)/mana
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+DATA    =       $(DESTDATA)/mana
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+LIBS1   =       -lbasiccmd -ldatacmd -lastrocmd -lshell -ldata 
+LIBS2   =       -ldvo -lkapa -lFITS -lohana
+FULL_CFLAGS   = $(BASE_CFLAGS)
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(LIBS1) $(LIBS2) $(BASE_LDFLAGS)
+
+# mana user commands and support functions ########################
+funcs = \
+$(SRC)/init.$(ARCH).o \
+$(SRC)/mana.$(ARCH).o \
+$(SRC)/findrowpeaks.$(ARCH).o 
+
+cmds = \
+$(SRC)/rawstars.$(ARCH).o \
+$(SRC)/fitcontour.$(ARCH).o \
+$(SRC)/starcontour.$(ARCH).o \
+$(SRC)/version.$(ARCH).o \
+$(SRC)/findpeaks.$(ARCH).o 
+
+libs = \
+$(DESTLIB)/libshell.a \
+$(DESTLIB)/libdata.a \
+$(DESTLIB)/libbasiccmd.a \
+$(DESTLIB)/libastrocmd.a \
+$(DESTLIB)/libdatacmd.a
+
+mana: $(BIN)/mana.$(ARCH)
+$(SRC)/mana.$(ARCH).o : $(libs)
+$(BIN)/mana.$(ARCH)   : $(cmds) $(funcs)
+
+install: $(DESTBIN)/mana help modules
+
+help: clean-help cmd.basic.help cmd.data.help cmd.astro.help
+
+modules: mana.modules
+
+.PHONY: mana
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/adc.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/adc.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/adc.c	(revision 15879)
@@ -0,0 +1,117 @@
+# include "dimm.h"
+
+# define DIGITAL_OUT 0x40
+# define ANALOG_IN_INIT 0x00
+# define ANALOG_IN_HIGH 0xa1
+# define ANALOG_IN_LOW  0x91
+
+static char SerialConnected = FALSE;
+static unsigned char DigitalOutState = 0x00;
+static struct timeval reftime; 
+static char reftimeset = FALSE;
+
+# define DTIME(A,B) ((A.tv_sec - B.tv_sec) + 1e-6*(A.tv_usec - B.tv_usec))
+
+int adc (int argc, char **argv) {
+  
+  struct timeval now;
+  int i, N, mode, hi, lo, value;
+  unsigned char setbit, output[5], *input;
+  double dtime;
+
+  if (N = get_argument (argc, argv, "-reset")) {
+    remove_argument (N, &argc, argv);
+    gettimeofday (&reftime, (struct timeval *) NULL);
+    reftimeset = TRUE;
+    return (TRUE);
+  }
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: adc ai N (variable)\n");
+    gprint (GP_ERR, "USAGE: adc di N (variable)\n");
+    gprint (GP_ERR, "USAGE: adc do N mode\n");
+    return (FALSE);
+  }
+
+  if (!SerialConnected) {
+    if (!SerialInit ('b')) {
+      gprint (GP_ERR, "error opening serial line\n");
+      return (FALSE);
+    }
+    SerialConnected = TRUE;
+  }
+
+  if (!reftimeset) {
+    gettimeofday (&reftime, (struct timeval *) NULL);
+    reftimeset = TRUE;
+  }      
+
+  gettimeofday (&now, (struct timeval *) NULL);
+  dtime = DTIME (now, reftime);
+  set_variable ("TIME", dtime);
+  
+  /* set the digital outputs */
+  if (!strcmp (argv[1], "do")) {
+    N = atof (argv[2]);
+    if ((N < 1) || (N > 6)) {
+      gprint (GP_ERR, "digital output is between 1 and 6\n");
+      return (FALSE);
+    }
+    if (!strcasecmp (argv[3], "on")) {
+      mode = TRUE;
+    } else {
+      mode = FALSE;
+    }
+    setbit = (0x01 << N-1);
+    if (mode) {
+      DigitalOutState |= setbit;
+    } else {
+      DigitalOutState &= ~setbit;
+    }      
+    output[0] = (DIGITAL_OUT | DigitalOutState);
+    output[1] = 0;
+    SerialCommand (output, &input, 50);
+    gprint (GP_ERR, "%x (%x, %x) -> %x (%d, %d)\n", 
+	     output[0], setbit, DigitalOutState, input[0], 
+	     strlen(input), strlen(output));
+    free (input);
+    return (TRUE);
+  }
+  /* read the analog inputs */
+  if (!strcmp (argv[1], "ai")) {
+    N = atof (argv[2]);
+    if ((N < 2) || (N > 16)) {
+      gprint (GP_ERR, "analog input is between 2 and 16\n");
+      gprint (GP_ERR, " (problem with 1 for the moment...)\n");
+      return (FALSE);
+    }
+    /* init A/D converter */
+    output[0] = (ANALOG_IN_INIT | (N-1));
+    output[1] = 0;
+    SerialCommand (output, &input, 50);
+    free (input);
+
+    usleep (10000);
+    /* get high byte */
+    output[0] = ANALOG_IN_HIGH;
+    output[1] = 0;
+    do {
+      SerialCommand (output, &input, 50);
+      hi = input[0];
+      free (input);
+    } while (hi & 0x80);
+
+    output[0] = ANALOG_IN_LOW;
+    output[1] = 0;
+    SerialCommand (output, &input, 50);
+    /* gprint (GP_ERR, "%x -> %x\n", output[0], input[0]); */
+    lo = input[0];
+    free (input);
+    value = ((hi & 0x0f) << 8) | lo;
+    if (hi & 0x10) { value = -value; }
+    set_variable (argv[3], 0.0001*value);
+    return (TRUE);
+  }
+
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/demux.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/demux.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/demux.c	(revision 15879)
@@ -0,0 +1,72 @@
+# include "dimm.h"
+
+int demux (int argc, char **argv) {
+  
+  int i, j, k, N;
+  float *out, *in, *inptr, **outptr;
+  int nx, ny, Nx, Ny, NX, NY, Nmux, Nbuf;
+
+  if (argc != 4) {
+    gprint (GP_ERR, "USAGE: demux <buffer> nx ny\n");
+    return (FALSE);
+  }
+
+  if (!SelectBuffer (&Nbuf, argv[1], OLDBUFFER)) return (FALSE);
+
+  nx = atof (argv[2]);
+  ny = atof (argv[3]);
+  Nmux = nx*ny;
+
+  Nx = buffers[Nbuf].matrix.Naxis[0];
+  Ny = buffers[Nbuf].matrix.Naxis[1];
+
+  NX = Nx / nx;
+  NY = Ny / ny;
+
+  inptr = in = (float *) buffers[Nbuf].matrix.buffer;  /* don't lose reference */
+
+  ALLOCATE (out, float, Nx*Ny);
+  ALLOCATE (outptr, float *, Nmux);
+  
+  for (N = i = 0; i < nx; i++) {
+    for (j = 0; j < ny; j++, N++) {
+      outptr[N] = &out[i*NX + j*NX*NY*nx];
+    }
+  }
+
+  for (N = j = 0; j < NY; j++) {
+    for (i = 0; i < NX; i++) {
+      for (k = 0; k < Nmux; k++) {
+	*outptr[k] = *inptr;
+	outptr[k] ++;
+	inptr ++;
+      }
+    }
+    for (k = 0; k < Nmux; k++) outptr[k] += NX;
+  }
+
+  /*
+  for (X = Y = x = y = i = 0; i < NX*NY; i++) {
+    out[X + Y*NX + x*NX*(Y+1) + y*NX*NY*nx] = *in;
+    X++;
+    if (X == NX) {
+      X = 0;
+      Y++;
+    }
+    if (Y == NY) {
+      Y = 0;
+      x++;
+    }
+    if (x == nx) {
+      x = 0;
+      y++;
+    }
+  }
+  */
+
+  free (in);
+  buffers[Nbuf].matrix.buffer = (char *) out;
+
+  return (TRUE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/findpeaks.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/findpeaks.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/findpeaks.c	(revision 15879)
@@ -0,0 +1,106 @@
+# include "mana.h"
+
+int findpeaks (int argc, char **argv) {
+  
+  int i, j, n, N, Nx, Ny;
+  int xo, yo;
+  int Npeak, NPEAK, Npeaks;
+  float *v;
+  int *peaks, *keep, *xp, *yp, *zp;
+  float threshold, vt, vo;
+  Vector *vecx, *vecy, *vecz;
+  Buffer *buf;
+
+  if (argc < 3) goto usage;
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  threshold = atof (argv[2]);
+
+  if ((vecx = SelectVector ("xp", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vecy = SelectVector ("yp", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vecz = SelectVector ("zp", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+
+  Npeak = 0;
+  NPEAK = Nx;
+  ALLOCATE (xp, int, NPEAK);
+  ALLOCATE (yp, int, NPEAK);
+  ALLOCATE (zp, int, NPEAK);
+
+  /* find peaks for each row */
+  v = (float *) buf[0].matrix.buffer;
+  for (j = 0; j < Ny; j++) {
+    peaks = findrowpeaks (&v[j*Nx], Nx, threshold, &Npeaks);
+
+    if (Npeak + Npeaks >= NPEAK) {
+      NPEAK = Npeak + Npeaks + Nx;
+      REALLOCATE (xp, int, NPEAK);
+      REALLOCATE (yp, int, NPEAK);
+      REALLOCATE (zp, int, NPEAK);
+    }
+    for (i = 0; i < Npeaks; i++) {
+      xp[Npeak + i] = peaks[i];
+      yp[Npeak + i] = j;
+      zp[Npeak + i] = v[peaks[i] + j*Nx];
+    }
+    Npeak += Npeaks;
+    free (peaks);
+  }
+  
+  /* identify non-local peaks */
+  ALLOCATE (keep, int, MAX (Npeak, 1));
+  v = (float *) buf[0].matrix.buffer;
+  for (n = 0; n < Npeak; n++) {
+    xo = xp[n];
+    yo = yp[n];
+    vo = v[xo + yo*Nx];
+    keep[n] = TRUE;
+    for (i = xo - 1; i <= xo + 1; i++) {
+      if (i < 0) continue;
+      if (i >= Nx) continue;
+      for (j = yo - 1; j <= yo + 1; j++) {
+	if ((i == xo) && (j == yo)) continue;
+	if (j < 0) continue;
+	if (j >= Ny) continue;
+	vt = v[i + j*Nx];
+	if (vt > vo) {
+	  keep[n] = FALSE;
+	  goto next_peak;
+	}
+      }
+    }
+  next_peak:
+    continue;
+  }
+
+  REALLOCATE (vecx[0].elements, float, MAX (Npeak, 1));
+  REALLOCATE (vecy[0].elements, float, MAX (Npeak, 1));
+  REALLOCATE (vecz[0].elements, float, MAX (Npeak, 1));
+  /* eliminate non-local peaks */
+  for (N = n = 0; n < Npeak; n++) {
+    if (!keep[n]) continue;
+    vecx[0].elements[N] = xp[n];
+    vecy[0].elements[N] = yp[n];
+    vecz[0].elements[N] = zp[n];
+    N ++;
+  }
+  free (xp);
+  free (yp);
+  free (zp);
+  free (keep);
+
+  REALLOCATE (vecx[0].elements, float, MAX (N, 1));
+  REALLOCATE (vecy[0].elements, float, MAX (N, 1));
+  REALLOCATE (vecz[0].elements, float, MAX (N, 1));
+  vecx[0].Nelements = vecy[0].Nelements = vecz[0].Nelements = N;
+
+  return (TRUE);
+
+ usage:
+  gprint (GP_ERR, "findpeaks (buffer) (threshold)\n");
+  return (FALSE);
+}
+
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/findrowpeaks.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/findrowpeaks.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/findrowpeaks.c	(revision 15879)
@@ -0,0 +1,45 @@
+# include "mana.h"
+
+int *findrowpeaks (float *row, int Nrow, float threshold, int *npeaks) {
+  
+  int i;
+  int Npeaks, NPEAKS;
+  int *peaks;
+
+  Npeaks = 0;
+  NPEAKS = 100;
+  ALLOCATE (peaks, int, NPEAKS);
+
+  if (Nrow < 3) {
+    *npeaks = Npeaks;
+    return (peaks);
+  }
+    
+  /* special case for first pixel in row */
+  if ((row[0] > row[1]) && (row[0] > threshold)) {
+    peaks[Npeaks] = 0;
+    Npeaks ++;
+  }    
+
+  for (i = 1; i < Nrow - 1; i++) {
+    if (row[i] < threshold) continue;
+    if (row[i] < row[i-1]) continue;
+    if (row[i] <= row[i+1]) continue;
+
+    peaks[Npeaks] = i;
+    Npeaks ++;
+    if (Npeaks >= NPEAKS) {
+      NPEAKS += 100;
+      REALLOCATE (peaks, int, NPEAKS);
+    }
+  }      
+
+  /* special case for last pixel in row */
+  if ((row[Nrow-1] >= row[Nrow-2]) && (row[Nrow-1] > threshold)) {
+    peaks[Npeaks] = Nrow-1;
+    Npeaks ++;
+  }    
+
+  *npeaks = Npeaks;
+  return (peaks);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/fitcontour.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/fitcontour.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/fitcontour.c	(revision 15879)
@@ -0,0 +1,139 @@
+# include "mana.h"
+# define NTERM 3
+
+int fitcontour (int argc, char **argv) {
+  
+  int i;
+  double **C, **B;
+  float cs1, sn1, cs, sn, x, y, r, xo, yo;
+  float dR, Rmin, Rmaj, Theta, Rx, Ry, Rxy, R1, R2, R3;
+  Vector *vecx, *vecy;
+
+  /* USAGE fitcontour x y Xo Yo */
+  if (argc < 5) goto usage;
+
+  if ((vecx = SelectVector (argv[1], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vecy = SelectVector (argv[2], ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  xo = atof (argv[3]);
+  yo = atof (argv[4]);
+
+  ALLOCATE (B, double *, NTERM);
+  ALLOCATE (C, double *, NTERM);
+  for (i = 0; i < NTERM; i++) {
+    ALLOCATE (C[i], double, NTERM);
+    bzero (C[i], NTERM*sizeof(double));
+    ALLOCATE (B[i], double, 1);
+    bzero (B[i], sizeof(double));
+  }
+
+  /* we are fitting r = ro + rs*sin(2theta) + rc*cos(2theta) */
+  /* sin(2t) = 2cos(t)sin(t)
+     cos(2t) = cos^2(t) - sin^2(t)
+  */
+  for (i = 0; i < vecx[0].Nelements; i++) {
+    x = vecx[0].elements[i] - xo;
+    y = vecy[0].elements[i] - yo;
+    r = hypot (x, y);
+
+    /* calculate sin(2t), cos(2t) using 1/2 angle tri relationship above */
+    sn1 = y / r;
+    cs1 = x / r;
+    sn = 2*sn1*cs1;
+    cs = cs1*cs1 - sn1*sn1;
+
+    C[0][0] += 1.0;
+    C[1][0] += sn;
+    C[1][1] += SQ(sn);
+    C[2][0] += cs; 
+    C[2][1] += cs*sn; 
+    C[2][2] += SQ(cs);
+
+    B[0][0] += r;
+    B[1][0] += r*sn;
+    B[2][0] += r*cs; 
+  }
+  C[0][1] = C[1][0];
+  C[0][2] = C[2][0];
+  C[1][2] = C[2][1];
+    
+  dgaussj (C, NTERM, B, 1);
+  
+  /** this is somewhat weak: if the object is too elongated, Rmin can be < 0 **/
+  dR = hypot (B[1][0], B[2][0]);
+  Rmaj = B[0][0] + dR;
+  Rmin = B[0][0] - dR;
+  Theta = DEG_RAD*atan2 (B[1][0], B[2][0]) / 2;
+
+  sn = B[1][0] / dR;
+  cs = B[2][0] / dR;
+
+  R1 = SQ(Rmaj) + SQ(Rmin);
+  R2 = SQ(Rmaj) - SQ(Rmin);
+  R3 = Rmaj*Rmin;
+
+  Rx = R3 / sqrt (R1 - R2*cs);
+  Ry = R3 / sqrt (R1 + R2*cs);
+  Rxy = -sn*R2 / SQ(R3);
+
+  set_variable ("Rx", Rx);
+  set_variable ("Ry", Ry);
+  set_variable ("Rxy", Rxy);
+
+  set_variable ("Rmin", Rmin);
+  set_variable ("Rmaj", Rmaj);
+  set_variable ("Theta", Theta);
+
+  for (i = 0; i < NTERM; i++) {
+    free (B[i]);
+    free (C[i]);
+  }
+  free (B);
+  free (C);
+
+  return (TRUE);
+
+ usage:
+  gprint (GP_ERR, "fitcontour x y (xo) (yo)\n");
+  return (FALSE);
+}
+
+
+/* this routine fits a single sine and cosine to the value of dr as a function of the angle around the central
+ * point, theta.  this is NOT an exact fit, an is increasingly in error for more eccentric ellipses.  however,
+ * it does a reasonable job of approximating the value of the major and minor axes, and it gets the angle of
+ * orientation right at well.  We then assume the values of major and minor axis and angle are correct to get
+ * the parameters for the elliptical gaussian fit:
+ 
+ z = (x^2) / (2 Rx^2) + (y^2) / (2 Ry^2) + Rxy x y
+
+ the functions above give the correct relationship between these:
+
+   R1 = SQ(Rmaj) + SQ(Rmin);
+   R2 = SQ(Rmaj) - SQ(Rmin);
+   R3 = Rmaj*Rmin;
+
+   Rx = R3 / sqrt (R1 - R2*cs);
+   Ry = R3 / sqrt (R1 + R2*cs);
+   Rxy = -sn*R2 / SQ(R3);
+
+ to derive these relationships, write the equation for an ellipse with major axis in the x-dir and minor in
+ the y-dir:
+
+ z = (x^2) / (2 Rmaj^2) + (y^2) / (2 Rmin^2)
+
+ apply the rotation matrix:
+
+ (x)' = (cos, -sin)(x,y)
+ (y)' = (sin, +cos)(x,y)  (modulo the sign on the sine)
+
+ then group the x^2 terms, the y^2 terms, and the xy terms to find the three coeffs.
+
+ NOTE: I spent a while having trouble deriving this from the polar form of an ellipse:
+
+ x = Rmaj*cos(theta)
+ y = Rmin*sin(theta)
+
+ it turns out that 'theta' above is NOT the angle (0,1)-(0,0)-(x,y). rather, it should be viewed as a
+ paraterization of the ellipse.  
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/focus.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/focus.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/focus.c	(revision 15879)
@@ -0,0 +1,68 @@
+# include "dimm.h"
+
+int focus (int argc, char **argv) {
+  
+  if (argc < 2) goto usage;
+
+  if (!strcasecmp (argv[1], "init")) {
+    if (argc != 3) {
+      gprint (GP_ERR, "USAGE: focus init (port)\n");
+      return (FALSE);
+    }
+    if (!SerialInit (argv[2])) return (FALSE);
+    gprint (GP_ERR, "focus on port %s\n", argv[2]);
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "pos")) {
+
+    int status, servo, angle;
+    char *answer = (char *) NULL;
+    char line[64];
+
+    if (argc != 4) {
+      gprint (GP_ERR, "USAGE: focus pos Nservo (angle)\n");
+      return (FALSE);
+    }
+
+    servo = atoi (argv[2]);
+    angle = atoi (argv[3]);
+
+    sprintf (line, "%c%c%c\n", 0xff, servo, angle);
+    status = SerialCommand (line, &answer, 10);
+    gprint (GP_ERR, "status: %d\n", status);
+    if (answer != (char *) NULL) {
+      gprint (GP_ERR, "answer: ..%s..\n", answer);
+    }
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "raw")) {
+
+    int status, value;
+    char *answer = (char *) NULL;
+    char line[64];
+
+    if (argc != 3) {
+      gprint (GP_ERR, "USAGE: focus raw value\n");
+      return (FALSE);
+    }
+
+    value = atoi (argv[2]);
+
+    sprintf (line, "%c", value);
+    status = SerialCommand (line, &answer, 10);
+    gprint (GP_ERR, "status: %d\n", status);
+    if (answer != (char *) NULL) {
+      gprint (GP_ERR, "answer: ..%s..\n", answer);
+    }
+    return (TRUE);
+  }
+
+ usage:
+  gprint (GP_ERR, "focus init port\n");
+  gprint (GP_ERR, "focus pos (string)\n");
+  gprint (GP_ERR, "focus raw (value)\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/init.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/init.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/init.c	(revision 15879)
@@ -0,0 +1,25 @@
+# include "opihi.h"
+
+int findpeaks	    PROTO((int, char **));
+int fitcontour	    PROTO((int, char **));
+int starcontour	    PROTO((int, char **));
+int rawstars	    PROTO((int, char **));
+int version	    PROTO((int, char **));
+
+static Command cmds[] = {  
+  {"findpeaks",   findpeaks,    "find image peaks"},
+  {"fitcontour",  fitcontour,   "fit ellipse contour"},
+  {"starcontour", starcontour,  "object contour"},
+  {"rawstars",    rawstars,     "find raw star stats"},
+  {"version",     version,      "show version information"},
+}; 
+
+void InitMana () {
+  
+  int i;
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/mana.c.in
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/mana.c.in	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/mana.c.in	(revision 15879)
@@ -0,0 +1,62 @@
+# include "mana.h"
+
+# define opihi_name "MANA"
+# define opihi_prompt "mana: "
+# define opihi_description "an image manipulation tool\n"
+# define opihi_history ".mana"
+# define opihi_rcfile ".manarc"
+
+/* program-dependent initialization */
+void program_init (int *argc, char **argv) {
+  
+  auto_break = TRUE;
+
+  /* load the commands used by this implementation */
+  InitBasic ();
+  InitData ();
+  InitAstro ();
+  InitMana ();
+
+  rl_readline_name = opihi_name;
+  rl_attempted_completion_function = command_completer;
+
+  set_str_variable ("HISTORY", opihi_history);
+  set_str_variable ("PROMPT", opihi_prompt);
+  set_str_variable ("RCFILE", opihi_rcfile);
+
+  {
+    char *helpdir;
+    char *modules;
+    static char *datadir = "@DATADIR@";
+    ALLOCATE (helpdir, char, strlen(datadir) + strlen("/help") + 2);
+    sprintf (helpdir, "%s/help", datadir);
+    set_str_variable ("HELPDIR", helpdir);
+    free (helpdir);
+    ALLOCATE (modules, char, strlen(datadir) + strlen("/modules") + 2);
+    sprintf (modules, "%s/modules", datadir);
+    set_str_variable ("MODULES:0", modules);
+    set_int_variable ("MODULES:n", 1);
+    free (modules);
+  }
+
+  return;
+}
+
+/* standard welcome message */
+void welcome () {
+  gprint (GP_ERR, "\n");
+  gprint (GP_ERR, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
+/* add program-dependent exit functions here */
+void cleanup () {
+  QuitKapa ();
+  return;
+}
+
+/* call to opihi shell */
+int main (int argc, char **argv) {
+  int status;
+  status = opihi (argc, argv);
+  exit (status);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/opihi.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/opihi.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/opihi.c	(revision 15879)
@@ -0,0 +1,68 @@
+# include "opihi.h"
+
+# define opihi_name "Opihi"
+# define opihi_prompt "opihi: "
+# define opihi_description "Opihi - test shell\n"
+# define opihi_history ".opihi"
+# define opihi_rcfile ".opihirc"
+
+void InitBasic ();
+
+void welcome () {
+  gprint (GP_ERR, "\n");
+  gprint (GP_ERR, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
+/* program-dependent initialization */
+void initialize (int argc, char **argv) {
+  
+  FILE *f;
+
+  auto_break = TRUE;
+
+  /* init functions required by libraries */
+  /* -libopihi */
+  InitCommands ();
+  InitMacros ();
+  InitBuffers ();
+  InitVectors ();
+  InitVariables ();
+
+  /* -libdisplay
+  InitGraph ();
+  InitImage (); */
+
+  /* load the commands used by this implementation */
+  InitBasic ();
+
+  rl_readline_name = opihi_name;
+  rl_attempted_completion_function = command_completer;
+
+  set_str_variable ("HISTORY", opihi_history);
+  set_str_variable ("PROMPT", opihi_prompt);
+  set_str_variable ("RCFILE", opihi_rcfile);
+
+  /* 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 */
+    gprint (GP_ERR, "can't save history.\n");
+  else
+    fclose (f);
+  
+  stifle_history (200);
+  read_history (opihi_history);
+
+  signal (SIGINT, SIG_IGN);
+  return;
+}
+
+/* add program-dependent exit functions here */
+void cleanup () {
+  QuitKapa ();
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/rawstars.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/rawstars.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/rawstars.c	(revision 15879)
@@ -0,0 +1,95 @@
+# include "mana.h"
+
+int rawstars (int argc, char **argv) {
+  
+  int i, x, y, N, Nx, Ny, Np;
+  float *v;
+  double Raper, Rinner, Router;
+  Vector *xp, *yp;
+  Vector *xc, *yc, *sx, *sy, *sxy, *zs, *zc, *sk;
+  Buffer *buff;
+
+  Raper = 5;
+  if ((N = get_argument (argc, argv, "-Raper"))) {
+    remove_argument (N, &argc, argv);
+    Raper = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  Rinner = 10;
+  if ((N = get_argument (argc, argv, "-Rinner"))) {
+    remove_argument (N, &argc, argv);
+    Rinner = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+  Router = 15;
+  if ((N = get_argument (argc, argv, "-Router"))) {
+    remove_argument (N, &argc, argv);
+    Router = atof (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc < 4) goto usage;
+
+  if ((buff = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  if ((xp = SelectVector (argv[2], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yp = SelectVector (argv[3], OLDVECTOR, TRUE)) == NULL) return (FALSE);
+  if (xp[0].Nelements != yp[0].Nelements) {
+    gprint (GP_ERR, "vectors are not the same length\n");
+    return (FALSE);
+  }
+
+  set_rough_radii (Raper, Rinner, Router);
+
+  /* output vectors */
+  if ((xc = SelectVector ("xc", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((yc = SelectVector ("yc", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((zc = SelectVector ("zc", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((zs = SelectVector ("zs", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((sk = SelectVector ("sk", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((sx = SelectVector ("sx", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((sy = SelectVector ("sy", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((sxy = SelectVector ("sxy", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  Nx = buff[0].matrix.Naxis[0];
+  Ny = buff[0].matrix.Naxis[1];
+  Np = xp[0].Nelements;
+
+  REALLOCATE (xc[0].elements, float, Np);
+  REALLOCATE (yc[0].elements, float, Np);
+  REALLOCATE (sx[0].elements, float, Np);
+  REALLOCATE (sy[0].elements, float, Np);
+  REALLOCATE (sxy[0].elements, float, Np);
+  REALLOCATE (zs[0].elements, float, Np);
+  REALLOCATE (zc[0].elements, float, Np);
+  REALLOCATE (sk[0].elements, float, Np);
+  xc[0].Nelements = yc[0].Nelements = sx[0].Nelements = Np;
+  sy[0].Nelements = zs[0].Nelements = zc[0].Nelements = Np;
+  sxy[0].Nelements = sk[0].Nelements = Np;
+
+  v = (float *) buff[0].matrix.buffer;
+  for (i = 0; i < Np; i++) {
+    x = xp[0].elements[i];
+    y = yp[0].elements[i];
+    if (x < 0) continue;
+    if (x >= Nx) continue;
+    if (y < 0) continue;
+    if (y >= Ny) continue;
+
+    get_rough_star (v, Nx, Ny, x, y, 
+		    &xc[0].elements[i], 
+		    &yc[0].elements[i], 
+		    &sx[0].elements[i], 
+		    &sy[0].elements[i], 
+		    &sxy[0].elements[i], 
+		    &zs[0].elements[i], 
+		    &zc[0].elements[i],
+		    &sk[0].elements[i]);
+  }
+
+  return (TRUE);
+
+ usage:
+  gprint (GP_ERR, "rawstars (buffer) (xp) (yp)\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/simsignal.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/simsignal.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/simsignal.c	(revision 15879)
@@ -0,0 +1,50 @@
+# include "dimm.h"
+
+int simsignal (int argc, char **argv) {
+  
+  int Nvect, Nbin, Nbit, i, ivalue, jvalue, Nshift, mask, scale;
+  float *buf;
+  double cvalue, dvalue, sigma, SN, period;
+  double rnd_gauss ();
+
+  if (argc != 5) {
+    gprint (GP_ERR, "USAGE: simsignal (vector) Nbin Nbits period\n");
+    return (FALSE);
+  }
+
+  if (!SelectVector (&Nvect, argv[1], ANYVECTOR)) return (FALSE);
+  Nbin = atof (argv[2]);
+  Nbit = atof (argv[3]);
+  /* SN = atof (argv[4]); */
+  period = atof (argv[4]);
+
+  vectors[Nvect].Nelements = Nbin;
+  REALLOCATE (vectors[Nvect].elements, float, vectors[Nvect].Nelements);
+
+  scale = (0x1 << Nbit) - 1;
+
+  buf = vectors[Nvect].elements;
+  for (i = 0; i < Nbin; i++, buf++) {
+    ivalue = scale * 0.5 * (sin (i*2*M_PI/period) + 1) + 0.5;
+    /*
+    dvalue = rnd_gauss (cvalue, sigma);
+    cvalue = (dvalue + range) / (2.0*range);
+    dvalue = MAX (0, MIN (0.99999, cvalue));
+    ivalue = scale * dvalue;
+    *buf = (2.0 * range * ((double) ivalue + 0.5)) / scale - range; 
+    */
+    *buf = ivalue;
+  }
+
+  return (TRUE);
+}
+
+/* 
+
+8 bit = 2^8
+
+  gauss_init (2*scale);
+  sigma = 2.0 / SN;
+  range = 1 + 5*sigma;
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/starcontour.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/starcontour.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/starcontour.c	(revision 15879)
@@ -0,0 +1,130 @@
+# include "mana.h"
+
+int starcontour (int argc, char **argv) {
+  
+  int x, y, xs, xp, yp;
+  int Nx, Ny, N, Npts, min, max;
+  float *v;
+  float zt, zo, xmin, xmax;
+  Vector *vecx, *vecy;
+  Buffer *buf;
+
+  if (argc < 5) goto usage;
+
+  if ((buf = SelectBuffer (argv[1], OLDBUFFER, TRUE)) == NULL) return (FALSE);
+  xp = atof (argv[2]);
+  yp = atof (argv[3]);
+  zo = atof (argv[4]);
+
+  if ((vecx = SelectVector ("xo", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+  if ((vecy = SelectVector ("yo", ANYVECTOR, TRUE)) == NULL) return (FALSE);
+
+  N = 0;
+  Npts = 100;
+  REALLOCATE (vecx[0].elements, float, MAX (Npts, 1));
+  REALLOCATE (vecy[0].elements, float, MAX (Npts, 1));
+
+  Nx = buf[0].matrix.Naxis[0];
+  Ny = buf[0].matrix.Naxis[1];
+  v = (float *)buf[0].matrix.buffer;
+
+  /* find transition below (limit range?) */
+  xmin = xmax = 0;
+  xs = xp;
+  for (y = yp; (y >= 0) && (v[xs + y*Nx] > zo); y--) {
+    /* find transition below (limit range?) */
+    min = max = FALSE;
+    for (x = xs; (x >= 0) && !min; x--) {
+      min = FALSE;
+      zt = v[x + y*Nx];
+      if (zt < zo) {
+	min = TRUE;
+	xmin = x + (zo - zt)/(v[x + 1 + y*Nx] - zt);
+	vecx[0].elements[N] = xmin;
+	vecy[0].elements[N] = y;
+	N ++;
+	if (N >= Npts) {
+	  Npts += 100;
+	  REALLOCATE (vecx[0].elements, float, MAX (Npts, 1));
+	  REALLOCATE (vecy[0].elements, float, MAX (Npts, 1));
+	}
+      }
+      /* ignore edge cases? */
+    }
+    /* find transition above (limit range?) */
+    for (x = xs; (x < Nx) && !max; x++) {
+      max = FALSE;
+      zt = v[x + y*Nx];
+      if (zt < zo) {
+	max = TRUE;
+	xmax = x - (zo - zt)/(v[x - 1 + y*Nx] - zt);
+	vecx[0].elements[N] = xmax;
+	vecy[0].elements[N] = y;
+	N ++;
+	if (N >= Npts) {
+	  Npts += 100;
+	  REALLOCATE (vecx[0].elements, float, MAX (Npts, 1));
+	  REALLOCATE (vecy[0].elements, float, MAX (Npts, 1));
+	}
+      }
+      /* ignore edge cases? */
+    }
+    if (min && max) {
+      xs = 0.5*(xmin + xmax);
+    }
+  }
+
+  /* find transition above (limit range?) */
+  xs = xp;
+  for (y = yp; (y < Ny) && (v[xs + y*Nx] > zo); y++) {
+    /* find transition below (limit range?) */
+    min = max = FALSE;
+    for (x = xs; (x >= 0) && !min; x--) {
+      min = FALSE;
+      zt = v[x + y*Nx];
+      if (zt < zo) {
+	min = TRUE;
+	xmin = x + (zo - zt)/(v[x + 1 + y*Nx] - zt);
+	vecx[0].elements[N] = xmin;
+	vecy[0].elements[N] = y;
+	N ++;
+	if (N >= Npts) {
+	  Npts += 100;
+	  REALLOCATE (vecx[0].elements, float, MAX (Npts, 1));
+	  REALLOCATE (vecy[0].elements, float, MAX (Npts, 1));
+	}
+      }
+      /* ignore edge cases? */
+    }
+    /* find transition above (limit range?) */
+    for (x = xs; (x < Nx) && !max; x++) {
+      max = FALSE;
+      zt = v[x + y*Nx];
+      if (zt < zo) {
+	max = TRUE;
+	xmax = x - (zo - zt)/(v[x - 1 + y*Nx] - zt);
+	vecx[0].elements[N] = xmax;
+	vecy[0].elements[N] = y;
+	N ++;
+	if (N >= Npts) {
+	  Npts += 100;
+	  REALLOCATE (vecx[0].elements, float, MAX (Npts, 1));
+	  REALLOCATE (vecy[0].elements, float, MAX (Npts, 1));
+	}
+      }
+      /* ignore edge cases? */
+    }
+    if (min && max) {
+      xs = 0.5*(xmin + xmax);
+    }
+  }
+  vecx[0].Nelements = N;
+  vecy[0].Nelements = N;
+
+  return (TRUE);
+
+ usage:
+  gprint (GP_ERR, "starcontour (buffer) (xpeak) (ypeak) (level)\n");
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/tests.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/tests.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/tests.c	(revision 15879)
@@ -0,0 +1,108 @@
+# include "opihi.h"
+
+run_tests () {
+
+  /* test1 ();
+     test1b ();
+     test2 ();
+     test3 (); */
+  test4 (); 
+  test5 ();
+}
+
+test1 () {
+
+  int i, size;
+  char *test, *line;
+
+  gprint (GP_ERR, "starting test 1...  ");
+  ALLOCATE (test, char, 256);
+  sprintf (test, "100");
+  for (i = 0; i < 1000000; i++) {
+    line = dvomath (1, &test, &size, 0);
+    if (line != NULL) free (line);
+  }
+  gprint (GP_ERR, "done with test 1\n");
+  sleep (1);
+}
+
+test1b () {
+
+  int i, size;
+  char *test, *line;
+
+  gprint (GP_ERR, "starting test 1b...  ");
+  ALLOCATE (test, char, 256);
+  sprintf (test, "dsin(45)");
+  for (i = 0; i < 1000000; i++) {
+    line = dvomath (1, &test, &size, 0);
+    if (line != NULL) free (line);
+  }
+  gprint (GP_ERR, "done with test 1b\n");
+  sleep (1);
+}
+
+test2 () {
+
+  int i, size;
+  char *test, *line;
+
+  gprint (GP_ERR, "starting test 2...  ");
+  ALLOCATE (test, char, 256);
+  sprintf (test, "5 * 100");
+  for (i = 0; i < 1000000; i++) {
+    line = dvomath (1, &test, &size, 0);
+    if (line != NULL) free (line);
+  }
+  gprint (GP_ERR, "done with test 2\n");
+  sleep (1);
+}
+
+test3 () {
+
+  int i, size;
+  char *test, *line;
+
+  gprint (GP_ERR, "starting test 3...  ");
+  ALLOCATE (test, char, 256);
+  sprintf (test, "5 * dsin(45)");
+  for (i = 0; i < 1000000; i++) {
+    line = dvomath (1, &test, &size, 0);
+    if (line != NULL) free (line);
+  }
+  gprint (GP_ERR, "done with test 3\n");
+  sleep (1);
+}
+
+test4 () {
+
+  int i;
+  char *test, *line;
+
+  gprint (GP_ERR, "starting test 4...  ");
+  for (i = 0; i < 1000000; i++) {
+    ALLOCATE (test, char, 256);
+    sprintf (test, "$N = 100");
+    line = parse (test);
+    if (line != NULL) free (line);
+  }
+  gprint (GP_ERR, "done with test 4\n");
+  sleep (1);
+}
+
+test5 () {
+
+  int i;
+  char *test, *line;
+
+  gprint (GP_ERR, "starting test 5...  ");
+  for (i = 0; i < 1000000; i++) {
+    ALLOCATE (test, char, 256);
+    sprintf (test, "echo {100 * 800}");
+    line = parse (test);
+    if (line != NULL) free (line);
+  }
+  gprint (GP_ERR, "done with test 5\n");
+  sleep (1);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/mana/version.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/mana/version.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/mana/version.c	(revision 15879)
@@ -0,0 +1,17 @@
+# include "mana.h"
+static char *name = "$Name: not supported by cvs2svn $";
+
+int version (int argc, char **argv) {
+
+  char *tmp;
+
+  gprint (GP_LOG, "\n");
+  gprint (GP_LOG, "mana version: %s\n", (tmp = strip_version (name))); free (tmp);
+
+  gprint (GP_LOG, "opihi version: %s\n", (tmp = strip_version (opihi_version()))); free (tmp);
+  gprint (GP_LOG, "libohana version: %s\n", (tmp = strip_version (ohana_version()))); free (tmp);
+  gprint (GP_LOG, "libfits version: %s\n", (tmp = strip_version (gfits_version()))); free (tmp);
+
+  gprint (GP_LOG, "compiled on %s %s\n", __DATE__, __TIME__);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/modules/dvo/navigate
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/modules/dvo/navigate	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/modules/dvo/navigate	(revision 15879)
@@ -0,0 +1,623 @@
+# -*- perl -*-
+
+macro navigate
+  style -n 0
+  limits
+  $DRAWSTARS  = -1
+  $DRAWIMAGES =  1
+  $DRAWGRID   = -1
+  $ZOOM = 180 / ($YMAX - $YMIN)
+  #this should be changed to a while loop, except 'while' is broken for some reason
+  $KEY = "none"
+  while ("$KEY" != "q")
+    cursor -g 1
+
+    # help list
+    if ("$KEY" == "h")
+     echo "Arrow Keys - pan in that direction"
+     echo "PgUp,PgDn - zoom in/out a factor of 1.2"
+     echo "Home,End  - zoom in/out a factor of 2"
+     echo "1 - zoom in factor of 2 at the cursor"
+     echo "2 - zoom in factor of 1.2 at the cursor"
+     echo "3 - recenter at cursor"
+     echo "4 - zoom out factor of 1.2 at the cursor"
+     echo "5 - zoom out factor of 2 at the cursor"
+     echo "6 - zoom out factor of 10 at the cursor"
+     echo "z - zoom to radius (requires 2nd keystroke)"
+     echo "f - show full sky"
+     echo ""
+     echo "q - quit"
+     echo "S - toggle auto-plotting of stars"
+     echo "A - toggle auto-plotting of image borders"
+     echo "g - toggle skygrid on/off"
+     echo "c - plot status catalog boundaries"
+     echo "C - list catalog at cursor location"
+     echo "i - list info about images touching cursor location" 
+     echo "I - list info about images, with pixel coords of cursor position"
+     echo "j - adjust mag scale, +0.5"
+     echo "k - adjust mag scale, -0.5"
+     echo "J - adjust dmag scale, /1.25"
+     echo "K - adjust dmag scale, *1.25"
+     echo "r - plot detected asteroids (rocks)"
+     echo "l - plot HST GSC"
+     echo "L - plot Landolt stars"
+     echo "m - list measurements for stars within 1 pixel of cursor"
+     echo "M - list measurements for stars within 1.8 arcsec of cursor"
+     echo "p - ****(don't know what this does)"
+     echo "s - ****(don't know what this does)"
+     echo "t - plot light curve for star within 2 arcsec of cursor position"
+     echo "T - plot 'galaxy' light curve for star within 2 arcsec of cursor position"
+     echo "u - ****(don't know what this does)"
+     echo "x - plot stars scaled by magnitude Chisq"
+     echo "X - plot stars by magnitude scatter"
+     echo "y - ****(don't know what this does)"
+     echo ""
+     echo "@ - execute macro `user_macro`"
+     echo ": - ****input a line and execute (not yet implemented)"
+    end
+
+    # quit from navigate
+    if ("$KEY" == "q") continue
+
+    #pan controls
+    if (("$KEY" == "Left") || ("$KEY" == "Right") || ("$KEY" == "Up") || ("$KEY" == "Down"))
+      $SHIFT = 0.2
+      $R$KEY  = $RMAX-$XMAX  
+      $D$KEY  = $DMAX-$YMAX
+      #assumes standard sky orientation!! (N up, E left)
+      if ("$KEY"=="Left")
+        $R$KEY = $R$KEY + $SHIFT*$XMAX
+      end
+      if ("$KEY"=="Right")
+        $R$KEY = $R$KEY + $SHIFT*$XMIN
+      end
+      if ("$KEY"=="Up")
+        $D$KEY = $D$KEY + $SHIFT*$YMAX
+      end
+      if ("$KEY"=="Down")
+        $D$KEY = $D$KEY + $SHIFT*$YMIN
+      end
+      #pretend like I hit '3' in the place to recenter it
+      nav_zoom 1      
+    end
+
+    # NEW zoom controls
+    if (("$KEY" == "Prior") || ("$KEY" == "Next") || ("$KEY" == "Home") || ("$KEY" == "End") || ("$KEY" == "Button4") || ("$KEY" == "Button5"))    
+      #move where key was hit to center      
+      $R$KEY  = $RMAX-$XMAX  
+      $D$KEY  = $DMAX-$YMAX
+      if ("$KEY" == "Prior")
+        $zfac=1.2
+      end
+      if ("$KEY" == "Next")
+        $zfac={1/1.2}
+      end
+      if ("$KEY" == "Home")
+        $zfac=2
+      end
+      if ("$KEY" == "End")
+        $zfac={1/2.}
+      end
+      if ("$KEY"=="Button4")
+        $zfac=1.6
+      end
+      if ("$KEY"=="Button5")
+        $zfac={1/1.6}
+      end
+      nav_zoom $zfac
+    end
+
+    if ("$KEY"=="Button1")
+      nav_zoom 1
+    end
+    if ("$KEY"=="Button2")
+      nav_zoom {1/2.}
+    end
+    if ("$KEY"=="Button3")
+      nav_zoom 2
+    end
+
+
+
+    # zoom controls
+    if ("$KEY" == "1")
+      nav_zoom 2
+    end
+    if ("$KEY" == "2")
+      nav_zoom 1.2
+    end
+    if ("$KEY" == "3")
+      nav_zoom 1
+    end
+    if ("$KEY" == "4")
+      nav_zoom {1/1.2}
+    end
+    if ("$KEY" == "5")
+      nav_zoom {1/2.}
+    end
+    if ("$KEY" == "6")
+      nav_zoom {1/20.}
+    end
+
+ 
+   # measure distance
+    if ("$KEY" == "d")
+      $r0 = $R$KEY
+      $d0 = $D$KEY
+      $ok = $KEY
+      echo "type 'd' again at endpoint"
+      cursor -g 1
+      $r1 = $R$KEY
+      $d1 = $D$KEY
+      $dr = 3600*((dcos($d0)*($r0-$r1))^2 + ($d0-$d1)^2)^0.5
+      echo "$dr arcsec"
+    end
+    # show ra, dec
+    if ("$KEY" == "w")
+      $tmp = $R$KEY
+      if ($tmp < 0) 
+        $tmp = $R$KEY + 360.0
+      end
+      echo "$tmp $D$KEY" 
+      exec echo $tmp $D$KEY | radec -hh
+    end
+    # zoom to radius
+    if ("$KEY" == "z")
+      $r0 = $R$KEY
+      $d0 = $D$KEY
+      $ok = $KEY
+      echo "type 'z' again at radius"
+      cursor -g 1
+      $r1 = $R$KEY
+      $d1 = $D$KEY
+      $dr = (($r0-$r1)^2 + ($d0-$d1)^2)^0.5
+      $ZOOM = $RAD / $dr
+      nav_recenter
+      nav_redraw
+      $KEY = $ok
+      $R$KEY = $r0
+      $D$KEY = $d0
+    end
+
+    # adjust mag scaling
+    if ("$KEY" == "J")
+      $MAG = $MAG - 0.5
+      nav_redraw
+    end
+    if ("$KEY" == "K")
+      $MAG = $MAG + 0.5
+      nav_redraw
+    end
+    if ("$KEY" == "j")
+      $dMAG = $dMAG * 0.8
+      nav_redraw
+    end
+    if ("$KEY" == "k")
+      $dMAG = $dMAG * 1.25
+      nav_redraw
+    end
+    echo "mag, dmag: $MAG, $dMAG"
+
+
+
+    # plot full sky
+    if ("$KEY" == "f") 
+      echo "full"
+      $ZOOM = 1
+      resize 1150 600		      
+      region 0 0 90 ait
+      $RMIN = 0
+      $RMAX = 360
+      $DMIN = -90
+      $DMAX = +90
+      style -c red; cgrid
+      style -c black
+      images
+    end
+
+    # plot rocks
+    if ("$KEY" == "r") 
+#      plot.rocks
+      style -c blue   -pt 1; procks -speed 0.0041 1
+      style -c red    -pt 1; procks -speed 0.00041 0.0041
+      style -c indigo -pt 1; procks -speed 0 0.00041
+      style -c black -lw 0;
+    end
+    # plot HST-GSC
+    if ("$KEY" == "l") 
+      style -c blue -pt 7; cat -all -g -m 9 16
+      style -c black
+    end
+    # plot Landolt
+    if ("$KEY" == "L") 
+#      style -c red  -lw 2 -pt 3; cat -a 1 2 3 /data/elixir/srcdir/refs/stetson/stetsonBn.txt -m 9 18
+#      style -c blue -lw 2 -pt 3; cat -a 25 26 8 /data/elixir/srcdir/refs/landolt/new/Landolt92.fix -m 9 18
+      style -c red -lw 2 -pt 7; cat -a 1 2 3 /data/elixir/srcdir/refs/sdss/g_SDSS.dat -m 9 14
+#      style -c red -lw 2 -pt 3; cat -a 25 26 8 /data/elixir/srcdir/refs/landolt/new/Landolt92.hq -m 9 18
+#      style -c red -lw 2 -pt 3; cat -a 22 23 8 /data/elixir/srcdir/refs/landolt/new/Landolt92.unfix -m 9 18
+#      style -c blue -lw 2 -pt 7; cat -a 1 2 4 /data/elixir/srcdir/refs/landolt/extreme/extreme.match -m 0 20
+#      style -x 2 -c red -pt 7 ; cplot RA DEC
+      style -c black -lw 0
+    end
+
+    # list star measurements
+    if ("$KEY" == "m") 
+        $dR = $RAD/$ZOOM/300
+        if ($dR < 0.0005)
+	 $dR = 0.0005
+        end
+	gstar $R$KEY $D$KEY $dR -m
+    end
+
+    # plot mag residuals
+    if ("$KEY" == "R") 
+      echo "filter: "
+      cursor 1
+      clear -n 1 -s; lim 10 22 -0.2 0.2; clear; box
+      dmags $KEY\:rel - $KEY : $KEY -type 0
+      plot -x 2 -pt 0 -sz 0.3 -c red yv xv
+      dmags $KEY\:rel - $KEY : $KEY -type 0 -flag 0 -nphot +3 -chisq 2.0
+      plot -x 2 -pt 2 -sz 0.5 -c black yv xv
+      $KEY = R
+      style -n 0
+    end
+
+    if ("$KEY" == "M") 
+	gstar $R$KEY $D$KEY 0.0005 -m
+    end
+    # list images
+    if ("$KEY" == "i") 
+	gimages $R$KEY $D$KEY
+    end
+    if ("$KEY" == "I") 
+	gimages $R$KEY $D$KEY -pix
+    end
+
+    #toggle images on / off
+    if ("$KEY" == "A")
+      $DRAWIMAGES = $DRAWIMAGES * -1
+      if ($DRAWIMAGES == 1)
+        images
+      end
+    end
+    # toggle stars on / off
+    if ("$KEY" == "S")
+      $DRAWSTARS = $DRAWSTARS * -1
+      if (($ZOOM > 20) && ($DRAWSTARS == 1))
+       style -pt 7
+       pmeasure -all -m $MAG {$MAG + $dMAG}
+      end
+    end
+    # turn grid on / off
+    if ("$KEY" == "g")
+      $DRAWGRID = $DRAWGRID * -1
+      if (($ZOOM > 20) && ($DRAWGRID==1))
+        style -c black; cgrid
+      end
+      if (($ZOOM > 20) && ($DRAWGRID==-1))
+        nav_redraw
+      end
+    end
+
+    # plot light-curve interactive
+    if ("$KEY" == "t")
+      style -n 1 -pt 2 -x 2
+      clear
+      if ($R$KEY < 0) 
+       $R$KEY = $R$KEY + 360
+      end
+      lcurve -l $R$KEY $D$KEY {30/3600} -d -v time mag
+      box
+      lcv
+      style -n 0
+    end
+    # plot light-curve 
+    if ("$KEY" == "T")
+      style -n 1 -pt 1 -c red -x 2
+      lcurve $R$KEY $D$KEY {30/3600} -d
+      style -c black
+      style -n 0 
+    end
+    # plot catalogs
+    if ("$KEY" == "c")
+      style -c blue; pcat; style -c black
+    end
+    # list catalogs
+    if ("$KEY" == "C")
+      gcat $R$KEY $D$KEY
+    end
+
+    # plot image chisqs
+    if ("$KEY" == "x") 
+       gcat $R$KEY $D$KEY
+       extract $CATNAME Xm -photcode R
+       extract $CATNAME ra
+       extract $CATNAME dec
+       style -x 2 -pt 7 -c blue
+       czplot ra dec Xm 3 30
+       style -c black -pt 1
+    end
+    # plot meas errors
+    if ("$KEY" == "X") 
+       gcat $R$KEY $D$KEY
+       extract $CATNAME dM -photcode R
+       extract $CATNAME ra
+       extract $CATNAME dec
+       style -x 2 -pt 7 -c red
+       czplot ra dec dM 0 30
+       style -c black -pt 1
+    end
+
+
+    # temp plot for skyprobe
+    if ("$KEY" == "u") 
+      imextract -region time
+      imextract -region mcal
+      imextract -region airmass
+      imextract -region nstar
+      vstat time
+      clear -n 1;
+      section a 0 0.00 1 0.33
+      lim {$MEDIAN-0.3} {$MEDIAN+0.3} -0.8 -0.5; box; plot time mcal
+      section b 0 0.33 1 0.33
+      lim {$MEDIAN-0.3} {$MEDIAN+0.3}  0.95 3.0; box; plot time airmass
+      section c 0 0.66 1 0.33
+      lim {$MEDIAN-0.3} {$MEDIAN+0.3} 0 3000; box; plot time nstar
+      style -n 0
+    end
+    if ("$KEY" == "s")
+      $tmp = $R$KEY
+      if ($tmp < 0) 
+        $tmp = $R$KEY + 360.0
+      end
+      $line = `echo $tmp $D$KEY | radec -hh`
+      imextract -region photcode
+      imextract -region time
+     
+      subset t = time if (int(photcode/100) == 1)
+      uniq t T
+      $Bn = t[]
+      $BN = T[]
+      
+      subset t = time if (int(photcode/100) == 2)
+      uniq t T
+      $Vn = t[]
+      $VN = T[]
+      
+      subset t = time if (int(photcode/100) == 3)
+      uniq t T
+      $Rn = t[]
+      $RN = T[]
+      
+      subset t = time if (int(photcode/100) == 4)
+      uniq t T
+      $In = t[]
+      $IN = T[]
+     
+      echo "$line  $Bn $BN  $Vn $VN  $Rn $RN  $In $IN"
+    end
+
+    if ("$KEY" == "p") 
+      echo "P - new coords; p - old coords"
+      cursor -g 1
+      exec echo $Rp $Dp $RP $DP >> fix.coords
+    end
+
+    if ("$KEY" == "y")
+      ccd I - 2MASS_J : 2MASS_J - 2MASS_K
+      lim -n 1 -1 10 -1 3; clear; box; plot -x 2 -pt 2 -sz 0.5 xv yv
+      dev -n 0 -g
+    end
+
+    #  User-defined macro
+    if ("$KEY" == "at")
+      user_macro
+    end
+
+    if ("$KEY" == "colon")
+      #make this work similar to ':' in vi or iraf
+      #does not work correctly now.
+      scan stdin line
+      $line
+    end
+
+  end
+end
+
+#define this so navigate doesn't crash if you try to call it.
+#If you define a user_macro, be sure to do so AFTER this in .dvorc.
+macro user_macro
+  #echo "success!"
+  $do_nothing=0
+end
+    
+
+macro nav_zoom
+  $ZOOM = $ZOOM * $1
+  nav_recenter
+  nav_redraw
+  $Rnum = $R$KEY		      
+  $Dnum = $D$KEY
+  $KEY = num
+end
+
+macro nav_recenter
+  region $R$KEY $D$KEY {$RAD/$ZOOM} sin
+  #assumes standard sky orientation!! (N up, E left)
+  $RMIN = $R$KEY + $XMIN
+  $RMAX = $R$KEY + $XMAX
+  $DMIN = $D$KEY + $YMIN
+  $DMAX = $D$KEY + $YMAX
+end
+
+macro nav_redraw
+  clear
+  if ($ZOOM <= 20) 
+    style -c red; cgrid
+  end
+  if (($ZOOM > 20) && ($DRAWGRID==1))
+    style -c black; cgrid
+  end
+  if (($ZOOM > 20) && ($DRAWSTARS == 1))
+    pmeasure -all -m $MAG {$MAG + $dMAG}
+  end    
+  style -c black
+  if ($DRAWIMAGES == 1)
+    images
+  end
+end
+
+
+
+#==================================================
+#=================   END BSNAV   ==================
+#==================================================
+
+
+macro sigclip
+  if ("$0" == "1")
+    echo ""
+    echo "sigclip <clipvector> <N_iterations> <N_sigma> [other vectors ..]"
+    echo ""
+  end
+
+  #required parameters
+  $CLIPVECT = $1
+  $NITERATE = $2
+  $NSIGCLIP = $3
+  
+  for i 0 $NITERATE
+    vstat -q $CLIPVECT
+    #clip boundaries
+    $top = $MEAN + ($NSIGCLIP*$SIGMA)
+    $bot = $MEAN - ($NSIGCLIP*$SIGMA)
+    
+    #clip it good.
+    subset temp = $CLIPVECT if (($CLIPVECT < $top) && ($CLIPVECT > $bot))
+    
+    #if you specify other vectors, clip the same elements from them too.
+    #they must all be the same length, of course!!
+    if ($0>4)
+      for j 4 $0
+        subset $$j = $$j if (($CLIPVECT < $top) && ($CLIPVECT > $bot))
+      end
+    end
+    
+    #copy temp back to $CLIPVECT and reiterate!
+    delete $CLIPVECT
+    concat temp $CLIPVECT  
+  end
+end
+
+
+macro binvec
+  if ("$0" == "1")
+    echo ""
+    echo "binvec <vec> <Nbins> [other vectors...]"
+    echo ""
+    echo "Bin the vector 'vec' into Nbin bins.  Listing other vectors will"
+    echo "put the corresponding elements of those into other vectors which"
+    echo "are the subset of the vector in that bin.  (That can probably be"
+    echo "stated better.)  This macro makes lots of new vectors.  Hooray!"
+    echo ""
+    echo "Creates"
+  end
+
+  #REQUIRED PARAMS
+  $binvect = $1
+  $NBINS   = $2
+
+  vstat -q $binvect
+  $step = ($MAX-$MIN)/$NBINS
+  $vmin = $MIN
+  $vmax = $MAX
+  delete -q $binvect\_bins
+  delete -q $binvect\_num
+  for i 1 {$NBINS+1}
+    $top = $vmin + ( $i   *$step)
+    $bot = $vmin + (($i-1)*$step)
+    #      sightly different behavior for last bin    -------v
+    if ($i != $NBINS)
+      subset temp = $binvect if (($binvect>=$bot)&&($binvect< $top))
+    else
+      subset temp = $binvect if (($binvect>=$bot)&&($binvect<=$top))
+    end
+    set $binvect\_bin$i = temp
+    set temp2 = temp
+    delete temp
+    #if you specify other vectors, grab the same elements from them too.
+    #they must all be the same length, of course!!
+
+    if ($0>3)
+      for j 3 $0
+        if ($i != $NBINS)
+          subset temp = $$j if (($binvect>=$bot)&&($binvect< $top))
+        else 
+          subset temp = $$j if (($binvect>=$bot)&&($binvect<=$top))
+        end
+        set $$j\_bin$i = temp
+        delete temp
+      end
+    end
+
+
+    concat {$bot+($step/2)} $binvect\_bins
+    concat temp2[] $binvect\_num
+    #dvo didn't like me saying 'concat $binvect\_bin$i[] $binvect\_num
+    delete temp2
+  end
+end
+
+macro binvec.2
+  if ("$0" == "1")
+    echo ""
+    echo "binvec.2 <vec> <min> <max> <binsize> [other vectors...]"
+    echo ""
+    echo ""
+    echo "see also 'binvec'"
+  end
+
+  #REQUIRED PARAMS
+  $binvect = $1
+  $vmin    = $2
+  $vmax    = $3
+  $step    = $4
+
+  $NBINS = ($MAX-$MIN)/$step
+
+  delete -q $binvect\_bins
+  delete -q $binvect\_num
+  for i 1 {$NBINS+1}
+    $top = $vmin + ( $i   *$step)
+    $bot = $vmin + (($i-1)*$step)
+    #      sightly different behavior for last bin    -------v
+    if ($i != $NBINS)
+      subset temp = $binvect if (($binvect>=$bot)&&($binvect< $top))
+    else
+      subset temp = $binvect if (($binvect>=$bot)&&($binvect<=$top))
+    end
+    set $binvect\_bin$i = temp
+    set temp2 = temp
+    delete temp
+    #if you specify other vectors, grab the same elements from them too.
+    #they must all be the same length, of course!!
+
+    if ($0>5)
+      for j 5 $0
+        if ($i != $NBINS)
+          subset temp = $$j if (($binvect>=$bot)&&($binvect< $top))
+        else 
+          subset temp = $$j if (($binvect>=$bot)&&($binvect<=$top))
+        end
+        set $$j\_bin$i = temp
+        delete temp
+      end
+    end
+
+
+    concat {$bot+($step/2)} $binvect\_bins
+    concat temp2[] $binvect\_num
+    #dvo didn't like me saying 'concat $binvect\_bin$i[] $binvect\_num
+    delete temp2
+  end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/modules/mana/plots
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/modules/mana/plots	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/modules/mana/plots	(revision 15879)
@@ -0,0 +1,41 @@
+
+macro cvplot 
+  if ($0 != 6)
+    echo "USAGE: cvplot r d ur ud scale"
+    break
+  end
+ 
+  local i
+  delete -q _tmpr _tmpd
+
+  for i 0 $1[]
+   concat $1[$i] _tmpr
+   concat $2[$i] _tmpd
+   concat {$1[$i]+$3[$i]*$5} _tmpr
+   concat {$2[$i]+$4[$i]*$5} _tmpd
+  end
+  style -pt 100
+  cplot _tmpr _tmpd
+  style -pt 7
+end
+
+macro vplot 
+  if ($0 != 6)
+    echo "USAGE: cvplot r d ur ud scale"
+    break
+  end
+ 
+  local i
+  delete -q _tmpr _tmpd
+
+  for i 0 $1[]
+   concat $1[$i] _tmpr
+   concat $2[$i] _tmpd
+   concat {$1[$i]+$3[$i]*$5} _tmpr
+   concat {$2[$i]+$4[$i]*$5} _tmpd
+  end
+  style -pt 100
+  plot _tmpr _tmpd
+  style -pt 7
+end
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/.cvsignore
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/.cvsignore	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/.cvsignore	(revision 15879)
@@ -0,0 +1,3 @@
+pantasks.c
+pantasks_client.c
+pantasks_server.c
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckController.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckController.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckController.c	(revision 15879)
@@ -0,0 +1,116 @@
+# include "pantasks.h"
+
+static struct timeval start;
+void TimerMark ();
+float TimerElapsed (int reset);
+
+int CheckController () {
+
+  char *p, *q;
+  int i, Njobs, status, JobID;
+  Job *job;
+  IOBuffer buffer;
+
+  /* get the list of completed jobs (exit / crash), update the job status */
+  if (!CheckControllerStatus()) return (TRUE);
+
+  /*** check EXIT jobs ***/
+  InitIOBuffer (&buffer, 0x100);
+  // TimerMark ();
+  // status = ControllerCommand ("stop", CONTROLLER_PROMPT, &buffer); 
+  // if (VerboseMode()) gprint (GP_ERR, "stop controller %f\n", TimerElapsed(TRUE));
+
+  TimerMark ();
+  FlushIOBuffer (&buffer);
+  status = ControllerCommand ("jobstack exit", CONTROLLER_PROMPT, &buffer);
+  if (VerboseMode()) gprint (GP_ERR, "check exit stack %f\n", TimerElapsed(TRUE));
+  if (!status) goto escape;
+
+  /** programming error **/
+  p = memstr (buffer.buffer, "USAGE: jobstack", buffer.Nbuffer);
+  if (p != NULL) goto escape;
+
+  /** parse job list **/
+  status = sscanf (buffer.buffer, "%*s %d", &Njobs);
+  if (status != 1) goto escape;
+  if (VerboseMode()) gprint (GP_ERR, "parse %d jobs on stack %f\n", Njobs, TimerElapsed(TRUE));
+
+  p = buffer.buffer;
+  for (i = 0; i < Njobs; i++) {
+    q = strchr (p, '\n');
+    if (q == NULL) {
+      gprint (GP_ERR, "controller message error: incomplete job list\n");
+      break;
+    }
+    p = q + 1;
+    status = sscanf (p, "%d", &JobID);
+
+    job = FindControllerJob (JobID);
+    if (job == NULL) {
+      gprint (GP_ERR, "misplaced job? %d not in EXIT job list\n", JobID);
+      continue;
+    }
+    /* this checks the individual job status, grabs stdout/stderr */
+    CheckControllerJob (job);
+  }
+  if (VerboseMode()) gprint (GP_ERR, "clear %d exit jobs %f\n", i, TimerElapsed(TRUE));
+
+  /*** check CRASH jobs ***/
+  FlushIOBuffer (&buffer);
+  status = ControllerCommand ("jobstack crash", CONTROLLER_PROMPT, &buffer);
+  if (!status) goto escape;
+
+  p = memstr (buffer.buffer, "USAGE: jobstack", buffer.Nbuffer);
+  if (p != NULL) goto escape;
+
+  /** parse job list **/
+  status = sscanf (buffer.buffer, "%*s %d", &Njobs);
+  if (status != 1) goto escape;
+  if (VerboseMode()) gprint (GP_ERR, "check crash stack %f\n", TimerElapsed(TRUE)); 
+
+  p = buffer.buffer;
+  for (i = 0; i < Njobs; i++) {
+    q = strchr (p, '\n');
+    if (q == NULL) {
+      gprint (GP_ERR, "controller message error: incomplete job list\n");
+      break;
+    }
+    p = q + 1;
+    
+    status = sscanf (p, "%d", &JobID);
+    job = FindControllerJob (JobID);
+    if (job == NULL) {
+      gprint (GP_ERR, "misplaced job? %d not in CRASH job list\n", JobID);
+      continue;
+    }
+    /* this checks the individual job status, grabs stdout/stderr */
+    CheckControllerJob (job);
+  }
+  if (VerboseMode()) gprint (GP_ERR, "clear %d crash jobs %f\n", i, TimerElapsed(TRUE)); 
+
+  FlushIOBuffer (&buffer);
+  // status = ControllerCommand ("run", CONTROLLER_PROMPT, &buffer);
+  FreeIOBuffer (&buffer);
+  return (TRUE);
+
+ escape:
+  FlushIOBuffer (&buffer);
+  // status = ControllerCommand ("run", CONTROLLER_PROMPT, &buffer); 
+  FreeIOBuffer (&buffer);
+  return (FALSE);
+}
+
+void TimerMark () {
+    gettimeofday (&start, (void *) NULL);
+}
+
+float TimerElapsed (int reset) {
+
+  float dtime;
+  struct timeval stop;
+
+  gettimeofday (&stop, (void *) NULL);
+  dtime = DTIME (stop, start);
+  if (reset) gettimeofday (&start, (void *) NULL);
+  return (dtime);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckJobs.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckJobs.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckJobs.c	(revision 15879)
@@ -0,0 +1,230 @@
+# include "pantasks.h"
+
+float CheckJobs () {
+
+  FILE *f;
+  Job *job;
+  Task *task;
+  Macro *macro;
+  int i, status;
+  char varname[64];
+  Queue *queue;
+  float time_running, next_timeout;
+
+  // int Ncheck;
+  // Ncheck = 0;
+
+  // actual maximum delay is controlled in job_threads.c
+  next_timeout = 1.0;
+
+  /** test all jobs: ready to test?  finished? **/
+  while ((job = NextJob ()) != NULL) {
+    // Ncheck ++;
+
+    task = job[0].task;
+    // XXX we need to guarantee that the task exists
+    // if we delete a task, we need to keep a copy until all task jobs are
+    // removed
+
+    /* check poll period (ready to ask for status?) */
+    time_running = GetTaskTimer(job[0].last, FALSE);
+    // fprintf (stderr, "next: %f, poll: %f, run: %f\n", next_timeout, task[0].poll_period, time_running);
+    if (time_running < task[0].poll_period) {
+      next_timeout = MIN (next_timeout, task[0].poll_period - time_running);
+      continue;
+    }
+    next_timeout = 0.0;
+
+    /* check current status */
+    status = CheckJob (job);
+    switch (status) {
+      case JOB_PENDING:
+	/* if (VerboseMode()) gprint (GP_LOG, "job %s (%d) pending\n", task[0].name, job[0].JobID); */
+	break;
+
+      case JOB_BUSY:
+	/* if (VerboseMode()) gprint (GP_LOG, "job %s (%d) busy\n", task[0].name, job[0].JobID); */
+	break;
+
+      case JOB_CRASH:
+      case JOB_EXIT:
+	/* push output buffer data to the stdout and stderr queues */
+	/* XXX this will break on 0 values in output streams */
+	if (DEBUG) fprintf (stderr, "job: (%zx) %d of %d\n", (size_t) job[0].stdout_buff.buffer, job[0].stdout_buff.Nbuffer, job[0].stdout_buff.Nalloc); 
+	PushNamedQueue ("stdout", job[0].stdout_buff.buffer);
+	PushNamedQueue ("stderr", job[0].stderr_buff.buffer);
+
+	/* save the stdout and stderr if desired */
+	if ((job[0].stdout_dump != NULL) && strcasecmp(job[0].stdout_dump, "NULL")) {
+	  f = fopen (job[0].stdout_dump, "a");
+	  if (f == NULL) {
+	    gprint (GP_ERR, "unable to open stdout dump file %s\n", job[0].stdout_dump);
+	  } else {
+	    fwrite (job[0].stdout_buff.buffer, 1, job[0].stdout_buff.Nbuffer, f);
+	    fclose (f);
+	  }
+	}
+	if ((job[0].stderr_dump != NULL) && strcasecmp(job[0].stderr_dump, "NULL")) {
+	  f = fopen (job[0].stderr_dump, "a");
+	  if (f == NULL) {
+	    gprint (GP_ERR, "unable to open stderr dump file %s\n", job[0].stderr_dump);
+	  } else {
+	    fwrite (job[0].stderr_buff.buffer, 1, job[0].stderr_buff.Nbuffer, f);
+	    fclose (f);
+	  }
+	}
+
+	/* set taskarg variables */
+	for (i = 0; i < job[0].argc; i++) {
+	    sprintf (varname, "taskarg:%d", i);
+	    set_str_variable (varname, job[0].argv[i]);
+	}
+	set_int_variable ("taskarg:n", job[0].argc);
+
+	/* set options variables */
+	for (i = 0; i < job[0].optc; i++) {
+	    sprintf (varname, "options:%d", i);
+	    set_str_variable (varname, job[0].optv[i]);
+	}
+	set_int_variable ("options:n", job[0].optc);
+
+	set_variable ("JOB_DTIME", job[0].dtime);
+
+	if (job[0].realhost == NULL) {
+	  set_str_variable ("JOB_HOSTNAME", "localhost");
+	} else {
+	  set_str_variable ("JOB_HOSTNAME", job[0].realhost);
+	}	    
+
+	if (status == JOB_CRASH) {
+	  /* XXX add an Ncrash element? */
+	  task[0].Nfailure ++;
+	  UpdateTaskTimerStats (task, TIMER_FAILURE, job[0].dtime);
+
+	  /* run task[0].crash macro, if it exists */
+	  /* perhaps define PushNamedQueueBuffer */
+
+	  set_str_variable ("JOB_STATUS", "CRASH");
+
+	  if (VerboseMode()) gprint (GP_LOG, "job %s (%d) crash\n", task[0].name, job[0].JobID);
+	  if (task[0].crash != NULL) {
+	    exec_loop (task[0].crash);
+	  }
+	}
+	if (status == JOB_EXIT) {
+	  /* update the exit status counters */
+	  if (job[0].exit_status) {
+	    task[0].Nfailure ++;
+	    UpdateTaskTimerStats (task, TIMER_FAILURE, job[0].dtime);
+	  } else {
+	    task[0].Nsuccess ++;
+	    UpdateTaskTimerStats (task, TIMER_SUCCESS, job[0].dtime);
+	  }
+
+	  set_int_variable ("JOB_STATUS", job[0].exit_status);
+
+	  /* run corresponding task[0].exit macro, if it exists */
+	  if (VerboseMode()) gprint (GP_LOG, "job %s (%d) exit\n", task[0].name, job[0].JobID);
+	  macro = task[0].defexit;
+	  for (i = 0; i < task[0].Nexit; i++) {
+	    if (job[0].exit_status == atoi(task[0].exit[i][0].name)) {
+	      macro = task[0].exit[i];
+	      break;
+	    }
+	  }
+	  if (macro != NULL) exec_loop (macro);
+	}
+
+	/* flush the stderr and stdout queues */
+	queue = FindQueue ("stdout");
+	if (queue) InitQueue (queue);
+	queue = FindQueue ("stderr");
+	if (queue) InitQueue (queue);
+
+	UpdateTaskTimerStats (task, TIMER_ALLJOBS, job[0].dtime);
+
+	DeleteJob (job);
+	continue;
+	break;
+
+      default:
+	if (VerboseMode()) gprint (GP_LOG, "unknown exit status: %d\n", status);
+	/** do something more useful here ?? **/
+	break;
+    }
+
+    /* check for timeout - (local jobs only) 
+       we only check timeout after a poll (forces at least one poll)
+     */
+    if (job[0].mode == JOB_LOCAL) {
+      if (GetTaskTimer(job[0].start, FALSE) < task[0].timeout_period) { 
+	/* reset polling clock */
+	SetTaskTimer (&job[0].last);
+	continue;
+      }
+      if (VerboseMode()) gprint (GP_LOG, "timeout on %s\n", task[0].name);
+
+      // XXX harvest STDERR and STDOUT from timeout job (should be available...)
+      // XXX add this to controller as well
+
+      /* update the timeout counter */
+      task[0].Ntimeout ++;
+
+      if (!KillLocalJob (job)) {
+	job[0].state = JOB_HUNG;
+	if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", job[0].pid);
+	continue;
+      }
+
+      /* set taskarg variables */
+      for (i = 0; i < job[0].argc; i++) {
+	  sprintf (varname, "taskarg:%d", i);
+	  set_str_variable (varname, job[0].argv[i]);
+      }
+      set_int_variable ("taskarg:n", job[0].argc);
+
+      /* set options variables */
+      for (i = 0; i < job[0].optc; i++) {
+	sprintf (varname, "options:%d", i);
+	set_str_variable (varname, job[0].optv[i]);
+      }
+      set_int_variable ("options:n", job[0].optc);
+
+      /* run task[0].timeout macro, if it exists */
+      if (task[0].timeout != NULL) {
+	exec_loop (task[0].timeout);
+      }
+
+      task[0].Npending --;
+      DeleteJob (job);
+      continue;
+    }
+
+    /* reset polling clock */
+    SetTaskTimer (&job[0].last);
+  }
+  // fprintf (stderr, "check %d jobs\n", Ncheck);
+  return (next_timeout);
+}
+
+/* 
+
+  job / task timeline:
+
+  task:
+  0           exec     
+  start       create
+  task clock  new job
+
+  job:
+  0           1xpoll     2xpoll     3xpoll
+  start       check      check      check 
+  job clock   status     status     status
+
+  .           .          .          timeout
+                                    run
+				    timeout
+
+  must be at least one poll before timeout 
+  (timeout >= poll)
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckPassword.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckPassword.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckPassword.c	(revision 15879)
@@ -0,0 +1,34 @@
+# include "pantasks.h"
+# define DEBUG 0
+
+static char PASSWORD[256];
+
+int InitPassword () {
+
+  VarConfig ("PASSWORD", "%s", PASSWORD);
+  return (TRUE);
+}
+
+int CheckPassword (int BindSocket) {
+
+  IOBuffer message;
+  int status;
+
+  if (DEBUG) gprint (GP_ERR, "waiting for password %s\n", PASSWORD);
+
+  status = ExpectCommand (BindSocket, strlen(PASSWORD), 0.1, &message);
+  if (status != 0) {
+    if (DEBUG) gprint (GP_ERR, "failed connection\n");
+    FreeIOBuffer (&message);
+    close (BindSocket);
+    return (FALSE);
+  }
+  if (strncmp (message.buffer, PASSWORD, strlen(PASSWORD))) {
+    if (DEBUG) gprint (GP_ERR, "invalid password\n");
+    close (BindSocket);
+    return (FALSE);
+  }
+  if (DEBUG) gprint (GP_ERR, "accepted password (%s)\n", message.buffer);
+  
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckTasks.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckTasks.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckTasks.c	(revision 15879)
@@ -0,0 +1,97 @@
+# include "pantasks.h"
+
+float CheckTasks () {
+
+  Job *job;
+  Task *task;
+  int status;
+  float time_running, next_timeout, fuzz;
+  // struct timeval now;
+
+  // actual maximum delay is controlled in job_threads.c
+  next_timeout = 1.0;
+
+  /** test all tasks: ready to test? ready to run? **/
+  while ((task = NextTask ()) != NULL) {
+
+    /*** test for all reasons we should skip this task ***/
+
+    /* task has been de-activated by the user */
+    if (!task[0].active) {
+      continue;
+    }
+    /* current time is not within valid/invalid periods */
+    if (!CheckTimeRanges (task[0].ranges, task[0].Nranges)) {
+      continue;
+    }
+    /* all allowed tasks have been run in this period */
+    if (task[0].Nmax && (task[0].Njobs >= task[0].Nmax)) {
+      continue;
+    }
+    /* too many outstanding jobs */
+    if (task[0].NpendingMax && (task[0].Npending >= task[0].NpendingMax)) {
+      continue;
+    }
+
+    /* ready to test? : check time since last exec */
+    time_running = GetTaskTimer(task[0].last, FALSE);
+    if (time_running < task[0].exec_period) {
+      // is we are to ready to run, set time to timeout, if shortest of all tasks
+      next_timeout = MIN (next_timeout, task[0].exec_period - time_running);
+      continue;
+    }
+
+    /* ready to try running the task : reset the timer */
+    next_timeout = 0.0;
+    gettimeofday (&task[0].last, (void *) NULL);
+
+    // add random offset between 0 and 5% of exec_period
+    // XXX this should be optional
+    fuzz = 0.05*task[0].exec_period*drand48() + 1e-6*task[0].last.tv_usec; 
+    task[0].last.tv_usec = 1e6*(fuzz - (int)fuzz);
+    task[0].last.tv_sec += (int) fuzz;
+
+    /* ready to run? : run task.exec macro */
+    if (task[0].exec != NULL) {
+      status = exec_loop (task[0].exec);
+      if (!status) {
+	continue;
+      }
+    }
+
+    // gettimeofday (&now, (void *) NULL);
+    // fprintf (stderr, "t1: %d %6d  - \n", now.tv_sec, now.tv_usec);
+
+    /* check if there are errors with this task */
+    if (!ValidateTask (task, TRUE)) { 
+      continue;
+    }
+    
+    // gettimeofday (&now, (void *) NULL);
+    // fprintf (stderr, "t2: %d %6d  - \n", now.tv_sec, now.tv_usec);
+
+    /* construct job from task */
+    job = CreateJob (task);
+    if (DEBUG) fprintf (stderr, "create job: (%zx) %d of %d\n", (size_t) job[0].stdout_buff.buffer, job[0].stdout_buff.Nbuffer, job[0].stdout_buff.Nalloc); 
+
+    // gettimeofday (&now, (void *) NULL);
+    // fprintf (stderr, "t3: %d %6d  - \n", now.tv_sec, now.tv_usec);
+
+    /* execute job - XXX add status test */
+    SubmitJob (job);
+
+    // fprintf (stderr, "nl: %d %6d  - ",
+    // task[0].last.tv_sec, task[0].last.tv_usec);
+
+    /* increment job counters */
+    task[0].Njobs ++;
+    task[0].Npending ++;
+
+    // fprintf (stderr, "%d %6d\n", 
+    // task[0].last.tv_sec, task[0].last.tv_usec);
+
+    /* increment Nrun for inclusive ranges with Nmax */
+    BumpTimeRanges (task[0].ranges, task[0].Nranges);
+  }
+  return (next_timeout);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckTimeRanges.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckTimeRanges.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/CheckTimeRanges.c	(revision 15879)
@@ -0,0 +1,97 @@
+# include "pantasks.h"
+
+/* the tested time is saved by CheckTimeRanges for a following BumpTimeRanges
+   otherwise we could have an inconsistency between valid ranges and Nrun */
+static time_t daytime, weektime, abstime;
+
+/* test if we meet all time range qualifications */
+int CheckTimeRanges (TimeRange *ranges, int Nranges) {
+
+  int i, intime, Ninclude, include, exclude, valid;
+  time_t testtime;
+  struct timeval now;
+  struct tm Now;
+
+  /* get the current time */
+  gettimeofday (&now, NULL);
+  gmtime_r (&now.tv_sec, &Now);
+  daytime  = Now.tm_sec + Now.tm_min*60 + Now.tm_hour*3600;
+  weektime = Now.tm_sec + Now.tm_min*60 + Now.tm_hour*3600 + Now.tm_wday*86400;
+  abstime  = now.tv_sec;
+
+  Ninclude = 0;
+  include = FALSE;
+  exclude = FALSE;
+  
+  for (i = 0; i < Nranges; i++) {
+    if (ranges[i].include) Ninclude ++;
+
+    switch (ranges[i].type) {
+      /* set the testtime */
+      case RANGE_ABS:
+	testtime = abstime;
+	break;
+      case RANGE_DAY:
+	testtime = daytime;
+	break;
+      case RANGE_WEEK:
+	testtime = weektime;
+	break;
+      default:
+	abort ();
+    }
+    intime = (testtime >= ranges[i].start) && (testtime <= ranges[i].stop);
+
+    /* check for more than max runs in time range */
+    if (ranges[i].include && intime && ranges[i].Nmax) {
+      if (ranges[i].Nrun >= ranges[i].Nmax) return (FALSE);
+    }
+    /* reset Nrun if we are outside of intime */
+    if (ranges[i].include && !intime && ranges[i].Nmax && ranges[i].Nrun) {
+      ranges[i].Nrun = 0;
+    }
+
+    /* is this a valid time? */
+    if ( ranges[i].include &&  intime) include = TRUE;
+    if (!ranges[i].include && !intime) exclude = TRUE;
+  }
+
+  if (Ninclude == 0) include = TRUE;
+  valid = include && !exclude;
+
+  return (valid);
+}  
+
+/* increment the number of runs for all inclusive time ranges with Nmax > 0
+   (only call when we execute a task -- after CheckTimeRanges) */
+int BumpTimeRanges (TimeRange *ranges, int Nranges) {
+
+  int i, intime;
+  time_t testtime;
+
+  /* only increment the counter for ranges which are valid */
+  for (i = 0; i < Nranges; i++) {
+    if (!ranges[i].Nmax) continue;
+    if (!ranges[i].include) continue;
+
+    switch (ranges[i].type) {
+      /* set the testtime */
+      case RANGE_ABS:
+	testtime = abstime;
+	break;
+      case RANGE_DAY:
+	testtime = daytime;
+	break;
+      case RANGE_WEEK:
+	testtime = weektime;
+	break;
+      default:
+	abort ();
+    }
+    intime = (testtime >= ranges[i].start) && (testtime <= ranges[i].stop);
+
+    /* reset Nrun if we are outside of intime */
+    if (intime) ranges[i].Nrun ++;
+  }
+  return (TRUE);
+}  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/ControllerOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/ControllerOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/ControllerOps.c	(revision 15879)
@@ -0,0 +1,494 @@
+# include "pantasks.h"
+/* adding a new host can delay controller up to a second or so */
+# define CONTROLLER_TIMEOUT 1000
+# define CONNECT_TIMEOUT 300
+
+/* local static variables to hold the connection to the controller */
+static int ControllerStatus = FALSE;
+static int stdin_cntl, stdout_cntl, stderr_cntl;
+static IOBuffer stdout_buffer;
+static IOBuffer stderr_buffer;
+static int ControllerPID = 0;
+
+/* test if the controller is running */
+int CheckControllerStatus () {
+  return (ControllerStatus);
+}
+
+/* check job / get output if done */
+int CheckControllerJob (Job *job) {
+  struct timeval start, stop;
+  float dtime;
+
+  gettimeofday (&start, (void *) NULL);
+  CheckControllerJobStatus (job);
+  gettimeofday (&stop, (void *) NULL);
+  dtime = DTIME (stop, start);
+  /* if (VerboseMode()) gprint (GP_ERR, "check job status %f\n", dtime); */
+
+  if ((job[0].state == JOB_EXIT) || (job[0].state == JOB_CRASH)) {
+    gettimeofday (&start, (void *) NULL);
+    GetJobOutput ("stdout", job[0].pid, &job[0].stdout_buff, job[0].stdout_size);
+    gettimeofday (&stop, (void *) NULL);
+    dtime = DTIME (stop, start);
+    /* if (VerboseMode()) gprint (GP_ERR, "get stdout %f\n", dtime); */
+
+    gettimeofday (&start, (void *) NULL);
+    GetJobOutput ("stderr", job[0].pid, &job[0].stderr_buff, job[0].stderr_size);
+    gettimeofday (&stop, (void *) NULL);
+    dtime = DTIME (stop, start);
+    /* if (VerboseMode()) gprint (GP_ERR, "get stderr %f\n", dtime); */
+
+    gettimeofday (&start, (void *) NULL);
+    DeleteControllerJob (job);
+    gettimeofday (&stop, (void *) NULL);
+    dtime = DTIME (stop, start);
+    /* if (VerboseMode()) gprint (GP_ERR, "delete job %f\n", dtime); */
+  }  
+  return (TRUE);
+}
+
+int DeleteControllerJob (Job *job) {
+
+  int status;
+  char cmd[128]; 
+  IOBuffer buffer;
+
+  sprintf (cmd, "delete %d", job[0].pid);
+  InitIOBuffer (&buffer, 0x100);
+  status = ControllerCommand (cmd, CONTROLLER_PROMPT, &buffer);
+  FreeIOBuffer (&buffer);
+  return (status);
+}
+  
+/* ask controller about job status */
+int CheckControllerJobStatus (Job *job) {
+
+  int outstate, status;
+  char cmd[128], status_string[64], string[128];
+  char *p;
+  IOBuffer buffer;
+
+  sprintf (cmd, "check job %d", job[0].pid);
+  InitIOBuffer (&buffer, 0x100);
+  status = ControllerCommand (cmd, CONTROLLER_PROMPT, &buffer);
+  if (!status) {
+    FreeIOBuffer (&buffer);
+    return (FALSE);
+  }
+
+  /** was this a valid job? **/
+  p = memstr (buffer.buffer, "job not found", buffer.Nbuffer);
+  if (p != NULL) {
+    gprint (GP_ERR, "unknown job %d\n", job[0].pid);
+    FreeIOBuffer (&buffer);
+    return (FALSE);
+  }
+
+  /** parse status message **/
+  p = memstr (buffer.buffer, "STATUS",   buffer.Nbuffer);
+  sscanf (p, "%*s %s", status_string);
+  p = memstr (buffer.buffer, "EXITST",   buffer.Nbuffer);
+  sscanf (p, "%*s %d", &job[0].exit_status);
+  p = memstr (buffer.buffer, "STDOUT",   buffer.Nbuffer);
+  sscanf (p, "%*s %d", &job[0].stdout_size);
+  p = memstr (buffer.buffer, "STDERR",   buffer.Nbuffer);
+  sscanf (p, "%*s %d", &job[0].stderr_size);
+  p = memstr (buffer.buffer, "DTIME",    buffer.Nbuffer);
+  sscanf (p, "%*s %lf", &job[0].dtime);
+  p = memstr (buffer.buffer, "HOSTNAME", buffer.Nbuffer);
+  sscanf (p, "%*s %s", string);
+  job[0].realhost = strcreate (string);
+  FreeIOBuffer (&buffer);
+
+  /* possible exit status values */
+  outstate = -1;
+  if (!strcmp(status_string, "BUSY"))    outstate = JOB_BUSY;
+  if (!strcmp(status_string, "DONE"))    outstate = JOB_BUSY;
+  if (!strcmp(status_string, "PENDING")) outstate = JOB_PENDING;
+  if (!strcmp(status_string, "EXIT"))    outstate = JOB_EXIT;
+  if (!strcmp(status_string, "CRASH"))   outstate = JOB_CRASH;
+  if (outstate == -1) {
+    gprint (GP_ERR, "programming error?\n");
+    exit (1);
+  }
+  job[0].state = outstate;
+  return (TRUE);
+}
+
+/* we read Nbytes from the host, then watch for the prompt */ 
+int GetJobOutput (char *cmd, int pid, IOBuffer *buffer, int Nbytes) {
+  
+  int i, status, Nstart;
+  char *line;
+  struct timespec request, remain;
+
+  /* avoid blocking on waitpid, test every 100 usec, up to 50 msec */
+  request.tv_sec = 0;
+  request.tv_nsec = 100000;
+
+  /* flush any earlier messages */
+  ReadtoIOBuffer (buffer, stdout_cntl);
+  FlushIOBuffer (buffer);
+  Nstart = buffer[0].Nbuffer;
+
+  /* send command to get appropriate channel */
+  status = write_fmt (stdin_cntl, "%s %d\n", cmd, pid);
+
+  /* is pipe still open? */
+  if ((status == -1) && (errno == EPIPE)) return (CONTROLLER_DOWN);
+
+  /* read at least Nbytes, then watch for CONTROLLER_PROMPT */
+  line = NULL;
+  status = -1;
+  for (i = 0; (i < CONTROLLER_TIMEOUT) && (status != 0) && (line == NULL); i++) {
+    status = ReadtoIOBuffer (buffer, stdout_cntl);
+    if ((buffer[0].Nbuffer - Nstart) >= Nbytes) {
+      line = memstr (buffer[0].buffer, CONTROLLER_PROMPT, buffer[0].Nbuffer);
+    }
+    if (status == -1) nanosleep (&request, &remain);
+  }
+  if (status ==  0) return (CONTROLLER_DOWN);
+  if (status == -1) return (CONTROLLER_HUNG);
+
+  /* if (VerboseMode()) gprint (GP_ERR, "message received (GetJobOutput : %s)\n", cmd);   */
+  /* drop extra bytes from pcontrol (not pclient:job) */
+  buffer[0].Nbuffer = Nstart + Nbytes;
+  if (buffer[0].Nalloc > buffer[0].Nbuffer) {
+    bzero (buffer[0].buffer + buffer[0].Nbuffer, buffer[0].Nalloc - buffer[0].Nbuffer);
+  }
+  return (CONTROLLER_GOOD);
+}
+
+/* submitting a job to the controller automatically starts controller */
+int SubmitControllerJob (Job *job) {
+
+  int i, Nchar, status;
+  char *cmd, *p, string[64];
+  IOBuffer buffer;
+
+  if (job[0].task[0].host == NULL) return (FALSE); 
+
+  if (!StartController ()) {
+    gprint (GP_ERR, "failure to start pcontrol\n");
+    return (FALSE);
+  }
+
+  /** construct the line to be sent to the controller **/
+
+  /* determine the total line length */
+  Nchar = 0;
+  for (i = 0; i < job[0].argc; i++) {
+    Nchar += strlen (job[0].argv[i]) + 1;
+  }
+  if (job[0].task[0].host) {
+    Nchar += strlen (job[0].task[0].host) + 1;
+  }
+  Nchar += 10;
+  ALLOCATE (cmd, char, Nchar);
+  bzero (cmd, Nchar);
+
+  /* construct the controller command portion */
+  if (!strcasecmp (job[0].task[0].host, "ANYHOST")) {
+    sprintf (cmd, "job");
+  } else {
+    if (job[0].task[0].host_required) {
+      sprintf (cmd, "job +host %s", job[0].task[0].host);
+    } else {
+      sprintf (cmd, "job -host %s", job[0].task[0].host);
+    }
+  }
+
+  /* add the command arguments */
+  for (i = 0; i < job[0].task[0].argc; i++) {
+    strcat (cmd, " ");
+    strcat (cmd, job[0].task[0].argv[i]);
+  }
+
+  InitIOBuffer (&buffer, 0x100);
+  status = ControllerCommand (cmd, CONTROLLER_PROMPT, &buffer);
+  free (cmd);
+
+  /* extract the job PID from the controller response */
+  p = memstr (buffer.buffer, "JobID", buffer.Nbuffer);
+  if (p == NULL) {
+    gprint (GP_ERR, "missing PID in pcontrol message : programming error\n");
+    gprint (GP_ERR, "ControllerCommand returns: %d\n", status);
+    gprint (GP_ERR, "ControllerCommand response: %s\n", buffer.buffer);
+    exit (1);
+  }
+  sscanf (p, "%*s %s", string);
+  job[0].pid = atoi (string);
+  FreeIOBuffer (&buffer);
+  return (TRUE);
+}
+
+int StartController () {
+
+  char *p;
+  char **argv, cmd[128];
+  int i, pid, status;
+  int stdin_fd[2], stdout_fd[2], stderr_fd[2];
+  IOBuffer buffer;
+
+  if (ControllerStatus) return (TRUE);
+
+  if (VarConfig ("CONTROLLER", "%s", cmd) == NULL) strcpy (cmd, "pcontrol");
+
+  bzero (stdin_fd,  2*sizeof(int));
+  bzero (stdout_fd, 2*sizeof(int));
+  bzero (stderr_fd, 2*sizeof(int));
+
+  if (pipe (stdin_fd)  < 0) goto pipe_error;
+  if (pipe (stdout_fd) < 0) goto pipe_error;
+  if (pipe (stderr_fd) < 0) goto pipe_error;
+
+  ALLOCATE (argv, char *, 2);
+  argv[0] = cmd;
+  argv[1] = 0;
+
+  pid = fork ();
+  if (!pid) { /* must be child process */
+    gprint (GP_LOG, "starting controller connection\n");
+
+    /* close the other ends of the pipes */
+    close (stdin_fd[1]);
+    close (stdout_fd[0]);
+    close (stderr_fd[0]);
+
+    /* tie our ends of the pipes to stdin, stdout, stderr */
+    dup2 (stdin_fd[0],  STDIN_FILENO);
+    dup2 (stdout_fd[1], STDOUT_FILENO);
+    dup2 (stderr_fd[1], STDERR_FILENO);
+
+    /* set all three unblocking */
+    setvbuf (stdin,  (char *) NULL, _IONBF, BUFSIZ);
+    setvbuf (stdout, (char *) NULL, _IONBF, BUFSIZ);
+    setvbuf (stderr, (char *) NULL, _IONBF, BUFSIZ);
+
+    status = execvp (argv[0], argv); 
+    exit (1);
+  }
+  free (argv);
+
+  /* close the other ends of the pipes */
+  close (stdin_fd[0]);  stdin_fd[0]  = 0;
+  close (stdout_fd[1]); stdout_fd[1] = 0;
+  close (stderr_fd[1]); stderr_fd[1] = 0;
+
+  /* make the pipes non-blocking */
+  fcntl (stdin_fd[1],  F_SETFL, O_NONBLOCK);
+  fcntl (stdout_fd[0], F_SETFL, O_NONBLOCK);
+  fcntl (stderr_fd[0], F_SETFL, O_NONBLOCK);
+
+  /* perform handshake with controller to verify alive & running */
+  /** this handshake is similar to ControllerCommand, but has important differences **/
+  InitIOBuffer (&buffer, 0x100);
+
+  /* send handshake command */
+  status = write_fmt (stdin_fd[1], "echo CONNECTED\n");
+  if ((status == -1) && (errno == EPIPE)) goto pipe_error;
+
+  /* try to get evidence connection is alive - wait upto a few seconds */
+  /* connection is likely slow; don't bother with nanosleep here */
+  p = NULL;
+  status = -1;
+  for (i = 0; (i < CONNECT_TIMEOUT) && (status != 0) && (p == NULL); i++) {
+    status = ReadtoIOBuffer (&buffer, stdout_fd[0]);
+    p = memstr (buffer.buffer, "CONNECTED", buffer.Nbuffer);
+    usleep (10000); // wait for controller to start up
+  }
+  if (status == 0) goto pipe_error;
+  if (status == -1) goto io_error;
+  FreeIOBuffer (&buffer);
+
+  /* set local static vars to pipe connections */
+  stdin_cntl  = stdin_fd[1];
+  stdout_cntl = stdout_fd[0];
+  stderr_cntl = stderr_fd[0];
+
+  InitIOBuffer (&stdout_buffer, 0x100);
+  InitIOBuffer (&stderr_buffer, 0x100);
+
+  ControllerPID = pid;
+  ControllerStatus = TRUE;
+  gprint (GP_LOG, "Connected\n");
+  return (TRUE);
+
+pipe_error:
+  perror ("pipe error:");
+  goto close_pipes;
+
+io_error:
+  gprint (GP_ERR, "timeout while connecting\n");
+  goto close_pipes;
+
+close_pipes:
+  if (stdin_fd[0]  != 0) close (stdin_fd[0]);
+  if (stdin_fd[1]  != 0) close (stdin_fd[1]);
+  if (stdout_fd[0] != 0) close (stdout_fd[0]);
+  if (stdout_fd[1] != 0) close (stdout_fd[1]);
+  if (stderr_fd[0] != 0) close (stderr_fd[0]);
+  if (stderr_fd[1] != 0) close (stderr_fd[1]);
+  return (FALSE);
+}
+
+int ControllerCommand (char *cmd, char *response, IOBuffer *buffer) {
+
+  int i, j, status;
+  char *line;
+  struct timespec request, remain;
+
+  /* avoid blocking on waitpid, test every 100 usec, up to 50 msec */
+  request.tv_sec = 0;
+  request.tv_nsec = 100000;
+
+  ReadtoIOBuffer (buffer, stdout_cntl);
+  FlushIOBuffer (buffer);
+
+  /* send command, is pipe still open? */
+  status = write_fmt (stdin_cntl, "%s\n", cmd);
+  if ((status == -1) && (errno == EPIPE)) {
+    StopController ();
+    gprint (GP_ERR, "controller is down\n");
+    return (FALSE);
+  }
+  
+  /* for commands which don't return a prompt, don't look for one */
+  if (response == NULL) {
+      return (TRUE);
+  }
+
+  /* watch for response - wait up to 1 second */
+  line = NULL;
+  status = -1;
+  for (j = 0; (status == -1) && (j < 10); j++) {
+      for (i = 0; (i < CONTROLLER_TIMEOUT) && (status != 0) && (line == NULL); i++) {
+	  status = ReadtoIOBuffer (buffer, stdout_cntl);
+	  line = memstr (buffer[0].buffer, response, buffer[0].Nbuffer);
+	  if (status == -1) nanosleep (&request, &remain);
+      }
+      if (status ==  0) {
+	  StopController ();
+	  gprint (GP_ERR, "controller is down\n");
+	  return (FALSE);
+      }
+      if (status == -1) {
+	  gprint (GP_ERR, "controller is not responding (%d tries)\n", j);
+	  gwrite (buffer[0].buffer, 1, buffer[0].Nbuffer, GP_ERR);
+      }
+  }
+  if (status == -1) {
+      gprint (GP_ERR, "controller still not responding, giving up\n");
+      return (FALSE);
+  }
+
+  /* need to strip off the prompt */
+  line = memstr (buffer[0].buffer, response, buffer[0].Nbuffer);
+  if (line != NULL) {
+    buffer[0].Nbuffer = line - buffer[0].buffer;
+    bzero (buffer[0].buffer + buffer[0].Nbuffer, buffer[0].Nalloc - buffer[0].Nbuffer);
+  }
+  /* if (VerboseMode()) gprint (GP_ERR, "message received, %d cycles\n", i); */
+  return (TRUE);
+}
+
+int CheckControllerOutput () {
+
+  int Nread;
+
+  if (!ControllerStatus) return (TRUE);
+
+  /* read stdout buffer */
+  Nread = ReadtoIOBuffer (&stdout_buffer, stdout_cntl);
+  switch (Nread) {
+    case -2:  /* error in read (programming error?  system level error?) */
+      gprint (GP_ERR, "serious IO error\n");
+      exit (2);
+    case -1:  /* no data in pipe */
+    case 0:   /* pipe is closed, change child state? **/
+    default:  /* data in pipe */
+      break;
+  }
+  
+  /* read stderr buffer */
+  Nread = ReadtoIOBuffer (&stderr_buffer, stderr_cntl);
+  switch (Nread) {
+    case -2:  /* error in read (programming error?  system level error?) */
+      gprint (GP_ERR, "serious IO error\n");
+      exit (2);
+    case -1:  /* no data in pipe */
+    case 0:   /* pipe is closed, change child state? **/
+    default:  /* data in pipe */
+      break;
+  }
+  return (TRUE);
+}
+
+int PrintControllerOutput () {
+
+  gprint (GP_LOG, "--- stdout ---\n");
+  gwrite (stdout_buffer.buffer, 1, stdout_buffer.Nbuffer, GP_LOG);
+  gprint (GP_LOG, "--- stderr ---\n");
+  gwrite (stderr_buffer.buffer, 1, stderr_buffer.Nbuffer, GP_LOG);
+  gprint (GP_LOG, "---  done  ---\n");
+  return (TRUE);
+}
+
+
+int KillControllerJob (Job *job) {
+
+  int status;
+  char cmd[128];
+  IOBuffer buffer;
+
+  if (!ControllerStatus) return (TRUE);
+
+  sprintf (cmd, "kill %d", job[0].pid);
+  InitIOBuffer (&buffer, 0x100);
+  status = ControllerCommand (cmd, CONTROLLER_PROMPT, &buffer);
+  FreeIOBuffer (&buffer);
+  return (status);
+
+  /** need to interpret output message & free things **/
+}
+
+int QuitController () {
+
+  int status;
+  char cmd[128];
+  IOBuffer buffer;
+
+  if (!ControllerStatus) return (TRUE);
+
+  sprintf (cmd, "quit");
+  InitIOBuffer (&buffer, 0x100);
+  status = ControllerCommand (cmd, NULL, &buffer);
+  FreeIOBuffer (&buffer);
+
+  /* the quit command does not return a prompt, 
+     check that the controller exited */
+  StopController ();
+  return (TRUE);
+}
+
+int StopController () {
+
+  int i, waitstatus, result;
+
+  if (!ControllerStatus) return (TRUE);
+
+  ControllerStatus = FALSE;
+  result = waitpid (ControllerPID, &waitstatus, WNOHANG);
+  for (i = 0; (i < 10) && (result == 0); i++) {
+    usleep (10000);  // wait for controller to exit
+    result = waitpid (ControllerPID, &waitstatus, WNOHANG);
+  }
+  ControllerPID = 0;
+  close (stdin_cntl);
+  close (stdout_cntl);
+  close (stderr_cntl);
+  FreeIOBuffer (&stdout_buffer);
+  FreeIOBuffer (&stderr_buffer);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/InputQueue.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/InputQueue.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/InputQueue.c	(revision 15879)
@@ -0,0 +1,73 @@
+# include "pantasks.h"
+
+static int Ninputs = 0;
+static int NINPUTS = 0;
+static char **inputs;
+
+void InitInputs () {
+
+  Ninputs = 0;
+  NINPUTS = 10;
+  ALLOCATE (inputs, char *, NINPUTS);
+}
+
+/* add this input to the inputs table */
+void AddNewInput (char *input) {
+
+  SerialThreadLock ();
+  if (DEBUG) gprint (GP_LOG, "adding a new input (%s)\n", input);
+  inputs[Ninputs] = input;
+  Ninputs ++;
+  if (Ninputs >= NINPUTS - 1) {
+    NINPUTS += 10;
+    REALLOCATE (inputs, char *, NINPUTS);
+  }
+  if (DEBUG) gprint (GP_LOG, "done new input (%s)\n", input);
+  SerialThreadUnlock ();
+}
+
+/* remove this input from the inputs table */
+int DeleteInput (char *input) {
+
+  int i, j;
+
+  if (DEBUG) gprint (GP_LOG, "deleting an input (%s)\n", input);
+  for (i = 0; i < Ninputs; i++) {
+    if (inputs[i] == input) {
+      free (inputs[i]);
+      for (j = i; j < Ninputs - 1; j++) {
+	inputs[j] = inputs[j+1];
+      }
+      Ninputs --;
+      if ((Ninputs > 10) && (Ninputs / 2 < NINPUTS)) {
+	NINPUTS = Ninputs + 10;
+	REALLOCATE (inputs, char *, NINPUTS);
+      }
+      if (DEBUG) gprint (GP_LOG, "deleted an input\n");
+      return TRUE;
+    }
+  }
+  // did not find the input
+  return FALSE;
+}
+
+/* if any inputs are pending, run one */
+void CheckInputs () {
+
+  int Nbytes, status;
+  char *input, *line, *outline, tmp;
+
+  if (Ninputs < 1) return;
+
+  input = inputs[0];
+  if (DEBUG) gprint (GP_LOG, "got an input (%s)\n", input);
+  
+  Nbytes = snprintf (&tmp, 0, "input %s", input);
+  ALLOCATE (line, char, Nbytes + 1);
+  snprintf (line, Nbytes + 1, "input %s", input);
+
+  status = command (line, &outline, TRUE);
+  free (outline);
+  
+  DeleteInput (input);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/JobIDOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/JobIDOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/JobIDOps.c	(revision 15879)
@@ -0,0 +1,41 @@
+# include "pantasks.h"
+
+# define MAX_N_JOBS 1000
+static char *JobIDList;
+static int   JobIDPtr;
+
+int InitJobIDs () {
+
+  JobIDPtr = 0;
+  ALLOCATE (JobIDList, char, MAX_N_JOBS);
+  bzero (JobIDList, MAX_N_JOBS*sizeof(char));
+  return (TRUE);
+}  
+
+/* return next unique ID, recycle every MAX_N_JOBS */
+int NextJobID () {
+
+  int Ntry;
+
+  JobIDPtr ++;
+  if (JobIDPtr >= MAX_N_JOBS) JobIDPtr = 0;
+
+  Ntry = 0;
+  while (JobIDList[JobIDPtr]) {
+    Ntry ++;
+    JobIDPtr ++;
+    if (JobIDPtr >= MAX_N_JOBS) JobIDPtr = 0;
+    if (Ntry == MAX_N_JOBS) return (-1);
+  }
+  JobIDList[JobIDPtr] = TRUE;
+  return (JobIDPtr);
+}
+
+int FreeJobID (int JobID) {
+
+  if (JobID < 0) return (FALSE);
+  if (JobID >= MAX_N_JOBS) return (FALSE);
+
+  JobIDList[JobID] = FALSE;
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/JobOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/JobOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/JobOps.c	(revision 15879)
@@ -0,0 +1,277 @@
+# include "pantasks.h"
+
+static Job **jobs;
+static int   Njobs;
+static int   NJOBS;
+
+/* counter marking job being visited by the run loop */
+static int   ActiveJob;
+
+/* set up the jobs list */
+void InitJobs () {
+  NJOBS = 20;
+  Njobs = 0;
+  ALLOCATE (jobs, Job *, NJOBS);
+  ActiveJob = -1;
+}
+
+/* provide a mechanism to loop over the list of jobs */
+Job *NextJob () {
+  
+  Job *job;
+
+  ActiveJob ++;
+  if (ActiveJob < 0) ActiveJob = 0;
+  if (ActiveJob >= Njobs) {
+    ActiveJob = -1;
+    return (NULL);
+  }
+  job = jobs[ActiveJob];
+  return (job);
+}
+
+/* return job with given ID */
+Job *FindJob (int JobID) {
+
+  int i;
+
+  /* return job with matching JobID */
+  for (i = 0; i < Njobs; i++) {
+    if (jobs[i][0].JobID == JobID) {
+      return (jobs[i]);
+    }
+  }
+  return (NULL);
+}  
+
+/* return job with given controller Job ID */
+Job *FindControllerJob (int JobID) {
+
+  int i;
+
+  /* return job with matching JobID */
+  for (i = 0; i < Njobs; i++) {
+    if (jobs[i][0].mode == JOB_LOCAL) continue;
+    if (jobs[i][0].pid  == JobID) {
+      return (jobs[i]);
+    }
+  }
+  return (NULL);
+}  
+
+/* list known jobs */
+void ListJobs () {
+
+  int i;
+  int status;
+  char command[1024];
+  IOBuffer buffer;
+
+  gprint (GP_LOG, "\n");
+  if (Njobs == 0) {
+    gprint (GP_LOG, " no defined jobs\n");
+    return;
+  }
+
+  gprint (GP_LOG, " Jobs in Pantasks Queue\n");
+  for (i = 0; i < Njobs; i++) {
+    gprint (GP_LOG, " %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);
+  }
+
+  /* check if controller is running */
+  status = CheckControllerStatus ();
+  if (!status) {
+    return;
+  }
+
+  sprintf (command, "jobstack busy");
+  InitIOBuffer (&buffer, 0x100);
+
+  SerialThreadLock ();
+  status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
+  SerialThreadUnlock ();
+
+  if (status) {
+    gprint (GP_LOG, " jobs currently running remotely:\n");
+    gwrite (buffer.buffer, 1, buffer.Nbuffer, GP_LOG);
+  } else {
+    gprint (GP_LOG, "controller is not responding\n");
+  }
+  FreeIOBuffer (&buffer);
+  return;
+}
+
+/* make a new job from a task */
+Job *CreateJob (Task *task) {
+  
+  int i;
+  Job *job;
+  
+  ALLOCATE (job, Job, 1);
+
+  job[0].JobID = NextJobID ();
+  job[0].pid = 0;
+  job[0].mode = JOB_LOCAL;
+  if (task[0].host != NULL) {
+    job[0].mode = JOB_CONTROLLER;
+  }
+
+  /* we need our own copy of task[0].argv argc is the number of valid args, like the usual command line.  we
+   *  allocate one extra element, with value 0 to be passed to execvp
+   */
+  job[0].argc = task[0].argc;
+  ALLOCATE (job[0].argv, char *, MAX (task[0].argc + 1, 1));
+  for (i = 0; i < task[0].argc; i++) {
+    job[0].argv[i] = strcreate (task[0].argv[i]);
+  }
+  job[0].argv[i] = 0;
+
+  /* we need our own copy of task[0].optv: optc is the number of valid opts.  */
+  job[0].optc = task[0].optc;
+  ALLOCATE (job[0].optv, char *, MAX (task[0].optc, 1));
+  for (i = 0; i < job[0].optc; i++) {
+    job[0].optv[i] = strcreate (task[0].optv[i]);
+  }
+
+  /* Other data from the task is needed by the job. We carry a pointer back to the task.  Changes to an
+     executing task are applied to the existing jobs (exit macros, poll_period, timeout) */
+
+  job[0].task = task;
+  job[0].realhost = NULL;
+  
+  /* if we decide we need to be able to dynamically set task qualities (like host, timeouts, etc), the we will
+     need to have matched entries to these quantites in the job structure */
+
+  InitIOBuffer (&job[0].stdout_buff, 0x100);
+  InitIOBuffer (&job[0].stderr_buff, 0x100);
+
+  job[0].stdout_dump = NULL;
+  job[0].stderr_dump = NULL;
+  if (task[0].stdout_dump != NULL) job[0].stdout_dump = strcreate (task[0].stdout_dump);
+  if (task[0].stderr_dump != NULL) job[0].stderr_dump = strcreate (task[0].stderr_dump);
+
+  jobs[Njobs] = job;
+  Njobs ++;
+  if (Njobs == NJOBS) {
+    NJOBS += 20;
+    REALLOCATE (jobs, Job *, NJOBS);
+  }
+  return (jobs[Njobs-1]);
+}
+
+void FreeJob (Job *job) {
+  
+  int i;
+
+  if (job == NULL) return;
+  
+  FreeJobID (job[0].JobID);
+
+  for (i = 0; i < job[0].argc; i++) {
+    free (job[0].argv[i]);
+  }
+  free (job[0].argv);
+
+  for (i = 0; i < job[0].optc; i++) {
+    free (job[0].optv[i]);
+  }
+  free (job[0].optv);
+
+  if (job[0].stdout_dump != NULL) free (job[0].stdout_dump);
+  if (job[0].stderr_dump != NULL) free (job[0].stderr_dump);
+  if (job[0].realhost != NULL) free (job[0].realhost);
+
+  FreeIOBuffer (&job[0].stdout_buff);
+  FreeIOBuffer (&job[0].stderr_buff);
+  free (job);
+  return;
+}
+
+/* delete the job from the job list & adjust ActiveJob counter */
+int DeleteJob (Job *job) {
+
+  int i, Nm;
+
+  Nm = -1;
+  for (i = 0; i < Njobs; i++) {
+    if (job == jobs[i]) {
+      Nm = i;
+      break;
+    }
+  }
+  if (Nm == -1) {
+    gprint (GP_ERR, "programming error: job not found\n");
+    return (FALSE);
+  }
+
+  FreeJob (jobs[Nm]);
+  for (i = Nm; i < Njobs - 1; i++) {
+    jobs[i] = jobs[i + 1];
+  }
+  Njobs --;
+
+  /* adjust active job number */
+  if (ActiveJob >= Nm) {
+    ActiveJob --;
+  }
+
+  job[0].task[0].Npending --;
+  return (TRUE);
+}
+
+int FlushJobs () {
+
+  int i;
+
+  // kill outstanding jobs
+  for (i = 0; i < Njobs; i++) {
+    if (jobs[i][0].mode == JOB_LOCAL) {
+      if (!KillLocalJob (jobs[i])) {
+	jobs[i][0].state = JOB_HUNG;
+	if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", jobs[i][0].pid);
+      }
+    } else {
+      if (!KillControllerJob (jobs[i])) {
+	jobs[i][0].state = JOB_HUNG;
+	if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", jobs[i][0].pid);
+      }
+    }    
+    jobs[i][0].task[0].Npending = 0;
+    FreeJob (jobs[i]);
+  }
+    
+  Njobs = 0;
+  NJOBS = 20;
+  REALLOCATE (jobs, Job *, NJOBS);
+  ActiveJob = -1;
+  return (TRUE);
+}
+
+int SubmitJob (Job *job) {
+
+  if (job[0].mode == JOB_LOCAL) {
+    if (DEBUG) fprintf (stderr, "submit job: (%zx) %d of %d\n", (size_t) job[0].stdout_buff.buffer, job[0].stdout_buff.Nbuffer, job[0].stdout_buff.Nalloc); 
+    SubmitLocalJob (job);
+  } else {
+    SubmitControllerJob (job);
+  }
+
+  /* reset clock for start and poll-test */
+  gettimeofday (&job[0].start, (void *) NULL);
+  job[0].last = job[0].start;
+  job[0].state = JOB_PENDING;
+  return (TRUE);
+}
+
+int CheckJob (Job *job) {
+
+  /* add checks for timeouts */
+
+  if (job[0].mode == JOB_LOCAL) {
+    CheckLocalJob (job);
+  } else {
+    /* controller jobs are now checked en masse by CheckController */
+    /* CheckControllerJob (job); */
+  }
+  return (job[0].state);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/ListenClients.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/ListenClients.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/ListenClients.c	(revision 15879)
@@ -0,0 +1,182 @@
+# include "pantasks.h"
+# define DEBUG 0
+
+static int NCLIENTS;
+static int Nclients;
+static int *clients;
+static IOBuffer **buffers;
+
+void InitClients () {
+
+  Nclients = 0;
+  NCLIENTS = 10;
+  ALLOCATE (clients, int, NCLIENTS);
+  ALLOCATE (buffers, IOBuffer *, NCLIENTS);
+}
+
+/* add this client to the client table, create an IOBuffer for it */
+void AddNewClient (int client) {
+
+  if (DEBUG) gprint (GP_LOG, "adding a new client (%d)\n", client);
+  clients[Nclients] = client;
+  ALLOCATE (buffers[Nclients], IOBuffer, 1);
+  InitIOBuffer(buffers[Nclients], 256);
+  Nclients ++;
+  if (Nclients >= NCLIENTS - 1) {
+    NCLIENTS += 10;
+    REALLOCATE (clients, int, NCLIENTS);
+    REALLOCATE (buffers, IOBuffer *, NCLIENTS);
+  }
+}
+
+/* add this client to the client table, create an IOBuffer for it */
+int DeleteClient (int client) {
+
+  int i, j;
+
+  if (DEBUG) gprint (GP_LOG, "deleting a client (%d)\n", client);
+  for (i = 0; i < Nclients; i++) {
+    if (clients[i] == client) {
+      FreeIOBuffer (buffers[i]);
+      free (buffers[i]);
+      close (clients[i]);
+      for (j = i; j < Nclients - 1; j++) {
+	clients[j] = clients[j+1];
+	buffers[j] = buffers[j+1];
+      }
+      Nclients --;
+      if ((Nclients > 10) && (Nclients / 2 < NCLIENTS)) {
+	NCLIENTS = Nclients + 10;
+	REALLOCATE (clients, int, NCLIENTS);
+	REALLOCATE (buffers, IOBuffer *, NCLIENTS);
+      }
+      return TRUE;
+    }
+  }
+  // did not find the client
+  return FALSE;
+}
+
+/* select for messages from the current clients; wait for 0.5s before updating client list */
+void *ListenClients (void *data) {
+  
+  int i, Ncurrent, Nmax, status, Nread;
+  char *line, log_stdout[128], log_stderr[128];
+  fd_set fdSet;
+  struct timeval timeout;
+  IOBuffer *outbuffer;
+
+  InitClients ();
+  gprintInit ();  // each thread needs to init the printing system
+
+  // define server output log files
+  if (VarConfig ("PANTASKS_SERVER_STDOUT", "%s", log_stdout) != NULL) {
+    gprintSetFileThisThread (GP_LOG, log_stdout);
+  } else {
+    strcpy (log_stdout, "stdout");
+  }
+  if (VarConfig ("PANTASKS_SERVER_STDERR", "%s", log_stderr) != NULL) {
+    gprintSetFileThisThread (GP_ERR, log_stderr);
+  } else {
+    strcpy (log_stderr, "stderr");
+  }
+
+  while (1) {
+
+    /* Wait up to 0.5 second - need to timeout to update client list */
+    /* timeout gets mucked: need to reset before each select */
+    timeout.tv_sec = 0;
+    timeout.tv_usec = 500000;
+
+    /* place all of the clients in the fdSet */
+    Ncurrent = Nclients;
+    Nmax = 0;
+    FD_ZERO (&fdSet);
+    for (i = 0; i < Ncurrent; i++) {
+      Nmax = MAX (Nmax, clients[i]);
+      FD_SET (clients[i], &fdSet);
+    }    
+    Nmax ++;
+
+    /* block until we have some data on the pipes (or timeout) */
+    if (DEBUG) gprint (GP_ERR, "listening to %d clients\n", Ncurrent);
+    status = select (Nmax, &fdSet, NULL, NULL, &timeout);
+    if (status == -1) {
+      perror("select()");
+      return (FALSE);
+    }
+
+    /* if no data, update client list, wait for another select */
+    if (status <= 0) continue;
+
+    /* loop over the clients with data */
+    for (i = 0; i < Ncurrent; i++) {
+      /* if client has no data, skip it */
+      if (!FD_ISSET(clients[i], &fdSet)) continue;
+
+      /* read until the pipe is empty: 0 is closed, -1 is empty, -2 is error */
+      Nread = 1;
+      while (Nread > 0) {
+	Nread = ReadtoIOBuffer (buffers[i], clients[i]);	
+      }
+      if ((Nread == 0) || (Nread == -2)) {
+	/* error: do something */
+	if (DEBUG && (Nread == 0)) gprint (GP_ERR, "socket is closed\n");
+	if (DEBUG && (Nread == -2)) gprint (GP_ERR, "error reading from socket\n");
+	DeleteClient (clients[i]);
+	continue;
+      }
+
+      if (DEBUG) gprint (GP_ERR, "read %d total bytes\n", buffers[i][0].Nbuffer);
+
+      /* see if we have a complete message waiting; if not, keep waiting for messages */
+      line = CheckForMessage (buffers[i]);
+      if (line == NULL) continue;
+
+      /* we now have a possible command from the client: run it */
+      /* in this thread, we set the print output destination to be an
+	 internal buffer, which we dump at the end of the execution */
+      /* the commands sent to the server should not have ; */
+      stripwhite (line);
+      if (*line) {
+
+	/* set buffers for the output for this client */
+	gprintSetBuffer (GP_LOG);
+	gprintSetBuffer (GP_ERR);
+
+	/* run the command, return the exit status */
+	status = multicommand (line);
+	SendMessage (clients[i], "STATUS %d", status);
+
+	// return the stderr messages first
+	outbuffer = gprintGetBuffer (GP_ERR);
+	if (outbuffer) {
+	  SendMessageFixed (clients[i], outbuffer[0].Nbuffer, outbuffer[0].buffer);
+	} else {
+	  SendMessageFixed (clients[i], 0, "");
+	}	  
+
+	// return the stdout messages first
+	outbuffer = gprintGetBuffer (GP_LOG);
+	if (outbuffer) {
+	  SendMessageFixed (clients[i], outbuffer[0].Nbuffer, outbuffer[0].buffer);
+	} else {
+	  SendMessageFixed (clients[i], 0, "");
+	}	  
+	
+	/* clear and reset the output buffers to their last output file names */
+	gprintSetFileAllThreads (GP_LOG, NULL);
+	gprintSetFileAllThreads (GP_ERR, NULL);
+      }
+      free (line);
+    }
+    /* if Nread == -2, we probably need to drop the client */
+    /* check if we need to drop / remove any clients */
+    /* check if we need to shut down the thread */
+  }
+}
+
+/* the AddClient commands are issued by the parent thread
+   the value of Nclients may increase after we check it here. 
+   only this thread is allowed to decrease Nclients and remove
+   a client from the table */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/LocalJob.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/LocalJob.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/LocalJob.c	(revision 15879)
@@ -0,0 +1,222 @@
+# include "pantasks.h"
+
+/* local jobs are forked in the background 
+   we might need to limit the maximum number of local jobs.
+   should we have a queue/stack of pending local jobs, much
+   like controller? */
+
+/* update current state, drain stdout/stderr buffers */
+int CheckLocalJob (Job *job) {
+
+  int Nread;
+
+  // XXX do something useful with exit status?
+  CheckLocalJobStatus (job);
+
+  if ((job[0].state == JOB_EXIT) || (job[0].state == JOB_CRASH)) {
+    if (DEBUG) fprintf (stderr, "empty buffer 0: (%zx) %d of %d\n", (size_t) job[0].stdout_buff.buffer, job[0].stdout_buff.Nbuffer, job[0].stdout_buff.Nalloc); 
+    EmptyIOBuffer (&job[0].stdout_buff, 10, job[0].stdout_fd);
+    EmptyIOBuffer (&job[0].stderr_buff, 10, job[0].stderr_fd);
+    if (DEBUG) fprintf (stderr, "empty buffer 1: (%zx) %d of %d\n", (size_t) job[0].stdout_buff.buffer, job[0].stdout_buff.Nbuffer, job[0].stdout_buff.Nalloc); 
+    close (job[0].stdout_fd);
+    close (job[0].stderr_fd);
+  } else {
+    /* read stdout buffer */
+    if (DEBUG) fprintf (stderr, "read buffer 0: (%zx) %d of %d\n", (size_t) job[0].stdout_buff.buffer, job[0].stdout_buff.Nbuffer, job[0].stdout_buff.Nalloc); 
+    while ((Nread = ReadtoIOBuffer (&job[0].stdout_buff, job[0].stdout_fd)) > 0);
+    switch (Nread) {
+      case -2:  /* error in read (programming error?  system level error?) */
+	gprint (GP_ERR, "serious IO error\n");
+	exit (2);
+      case -1:  /* no data in pipe */
+      case 0:   /* pipe is closed, change child state? **/
+      default:  /* data in pipe */
+	// fprintf (stderr, "read %d bytes (Nblock: %d, Nbuffer: %d)\n", Nread, job[0].stdout.Nblock, job[0].stdout.Nbuffer);
+	break;
+    }
+    if (DEBUG) fprintf (stderr, "read buffer 1: (%zx) %d of %d\n", (size_t) job[0].stdout_buff.buffer, job[0].stdout_buff.Nbuffer, job[0].stdout_buff.Nalloc); 
+  
+    /* read stderr buffer */
+    while ((Nread = ReadtoIOBuffer (&job[0].stderr_buff, job[0].stderr_fd)) > 0);
+    switch (Nread) {
+      case -2:  /* error in read (programming error?  system level error?) */
+	gprint (GP_ERR, "serious IO error\n");
+	exit (2);
+      case -1:  /* no data in pipe */
+      case 0:   /* pipe is closed, change child state? **/
+      default:  /* data in pipe */
+	break;
+    }
+  }
+  return (TRUE);
+}
+
+int CheckLocalJobStatus (Job *job) {
+
+  int result, waitstatus;
+
+  /* check local job status */
+  result = waitpid (job[0].pid, &waitstatus, WNOHANG);
+  switch (result) {
+    case -1:  /* error with waitpid */
+      switch (errno) {
+	case ECHILD:
+	  gprint (GP_ERR, "unknown PID, not a child proc\n");
+	  gprint (GP_ERR, "did process already exit?  programming error?\n");
+	  job[0].state = JOB_NONE;
+	  job[0].exit_status = 0;
+	  return (FALSE);
+	case EINVAL:
+	  gprint (GP_ERR, "error EINVAL (waitpid): programming error\n");
+	  exit (1);
+	case EINTR:
+	  gprint (GP_ERR, "error EINTR (waitpid): programming error\n");
+	  exit (1);
+	default:
+	  gprint (GP_ERR, "unknown error for waitpid (%d): programming error\n", errno);
+	  exit (1);
+      }
+      break;
+      
+    case 0:  /* process not exited */
+      job[0].state = JOB_BUSY;
+      job[0].exit_status = 0;
+      return (TRUE);
+
+    default:
+      if (result != job[0].pid) {
+	gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, job[0].pid);
+	exit (1);
+      }
+      if (WIFEXITED(waitstatus)) {
+	job[0].state = JOB_EXIT;
+	job[0].exit_status = WEXITSTATUS(waitstatus);
+      }
+      if (WIFSIGNALED(waitstatus)) {
+	job[0].state = JOB_CRASH;
+	job[0].exit_status = WTERMSIG(waitstatus);
+      }
+      if (WIFSTOPPED(waitstatus)) {
+	gprint (GP_ERR, "waitpid returns 'stopped': programming error\n");
+	exit (1);
+      }
+      job[0].dtime = GetTaskTimer (job[0].start, FALSE);
+      break;
+  }
+  return (FALSE);
+}
+
+/* this could be written a just a one-way pipe */
+int SubmitLocalJob (Job *job) {
+
+  int status, pid;
+  int stdout_fd[2], stderr_fd[2];
+
+  bzero (stdout_fd, 2*sizeof(int));
+  bzero (stderr_fd, 2*sizeof(int));
+
+  if (pipe (stdout_fd) < 0) goto pipe_error;
+  if (pipe (stderr_fd) < 0) goto pipe_error;
+
+  // XXX nothing to be read at this point
+  // other threads are already halted here.
+  fflush (stdout);
+  fflush (stderr);
+
+  pid = fork ();
+  if (!pid) { /* must be child process */
+    if (VerboseMode()) gprint (GP_ERR, "starting local job\n");
+
+    /* close the other ends of the pipes */
+    close (stdout_fd[0]);
+    close (stderr_fd[0]);
+
+    // XXX neither of these work to empty the child stdout buffer
+    // fflush (stdout);
+    // fflush (stderr);
+    // close (STDOUT_FILENO);
+    // close (STDERR_FILENO);
+
+    /* tie our ends of the pipes to stdin, stdout, stderr */
+    dup2 (stdout_fd[1], STDOUT_FILENO);
+    dup2 (stderr_fd[1], STDERR_FILENO);
+
+    /* set all three unblocking */
+    setvbuf (stdout, (char *) NULL, _IONBF, BUFSIZ);
+    setvbuf (stderr, (char *) NULL, _IONBF, BUFSIZ);
+
+    // XXX allow the parent time to read the stdout/stderr buffers
+    usleep (10000);
+
+    status = execvp (job[0].argv[0], job[0].argv); 
+    exit (1);
+  }
+  if (VerboseMode()) gprint (GP_ERR, "local job launched\n");
+
+  /* close the other ends of the pipes */
+  close (stdout_fd[1]); stdout_fd[1] = 0;
+  close (stderr_fd[1]); stderr_fd[1] = 0;
+
+  /* make the pipes non-blocking */
+  fcntl (stdout_fd[0], F_SETFL, O_NONBLOCK);
+  fcntl (stderr_fd[0], F_SETFL, O_NONBLOCK);
+
+  // XXX There seems to always be extra data on the pipe, specifically the 
+  // stdout buffer from the parent.  If I read it here, then it clears out that data.
+  // But, how can I be sure I will not start reading data from the exec-ed process?
+
+  { // test read of the stdout buffer
+    int Nread;
+    char buffer[0x1000];
+
+    Nread = read (stdout_fd[0], buffer, 0x1000);
+    if (DEBUG) fprintf (stderr, "read from stdout before exec: %d bytes\n", Nread);
+
+    Nread = read (stderr_fd[0], buffer, 0x1000);
+    if (DEBUG) fprintf (stderr, "read from stderr before exec: %d bytes\n", Nread);
+  }
+
+  job[0].stdout_fd = stdout_fd[0];
+  job[0].stderr_fd = stderr_fd[0];
+  job[0].pid = pid;
+
+  return (TRUE);
+
+pipe_error:
+  perror ("pipe error:");
+  if (stdout_fd[0] != 0) close (stdout_fd[0]);
+  if (stdout_fd[1] != 0) close (stdout_fd[1]);
+  if (stderr_fd[0] != 0) close (stderr_fd[0]);
+  if (stderr_fd[1] != 0) close (stderr_fd[1]);
+  return (FALSE);
+}
+
+/* should this function close the fd's? */
+int KillLocalJob (Job *job) {
+
+  int i, result, waitstatus;
+
+  if (job[0].state != JOB_BUSY) return (TRUE);
+
+  /* send SIGTERM signal to job */
+  kill (job[0].pid, SIGTERM);
+  result = 0;
+  for (i = 0; (i < 10) && (result == 0); i++) {
+    usleep (10000);  // wait for job to exit
+    result = waitpid (job[0].pid, &waitstatus, WNOHANG);
+  }
+  if (result) return (TRUE);
+
+  /* send SIGKILL signal to job */
+  kill (job[0].pid, SIGKILL);
+  result = 0;
+  for (i = 0; (i < 10) && (result == 0); i++) {
+    usleep (10000);  // wait for job to exit
+    result = waitpid (job[0].pid, &waitstatus, WNOHANG);
+  }
+  if (result) return (TRUE);
+
+  /* total failure, don't reset */
+  return (FALSE);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/Makefile	(revision 15879)
@@ -0,0 +1,124 @@
+default: pantasks pantasks_client pantasks_server
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+SRC     =       $(HOME)/pantasks
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+DATA    =       $(DESTDATA)/pantasks
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+LIBS1   =       -lbasiccmd -ldatacmd -lastrocmd -lshell -ldata 
+LIBS2   =       -ldvo -lkapa -lFITS -lohana
+FULL_CFLAGS   = $(BASE_CFLAGS)
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(LIBS1) $(LIBS2) $(BASE_LDFLAGS)
+
+# sched user commands and support functions ########################
+
+client = \
+$(SRC)/pantasks_client.$(ARCH).o \
+$(SRC)/client_shell.$(ARCH).o \
+$(SRC)/invalid.$(ARCH).o \
+$(SRC)/init_client.$(ARCH).o
+
+single = \
+$(SRC)/init.$(ARCH).o \
+$(SRC)/run.$(ARCH).o \
+$(SRC)/stop.$(ARCH).o \
+$(SRC)/pantasks.$(ARCH).o \
+$(SRC)/thread_locks.$(ARCH).o \
+$(SRC)/job_threads.$(ARCH).o \
+$(SRC)/task_threads.$(ARCH).o \
+$(SRC)/controller_threads.$(ARCH).o 
+
+server = \
+$(SRC)/pantasks_server.$(ARCH).o \
+$(SRC)/server_run.$(ARCH).o \
+$(SRC)/server_load.$(ARCH).o \
+$(SRC)/InputQueue.$(ARCH).o \
+$(SRC)/ListenClients.$(ARCH).o \
+$(SRC)/server.$(ARCH).o \
+$(SRC)/status_server.$(ARCH).o \
+$(SRC)/init_server.$(ARCH).o \
+$(SRC)/CheckPassword.$(ARCH).o \
+$(SRC)/thread_locks.$(ARCH).o \
+$(SRC)/job_threads.$(ARCH).o \
+$(SRC)/task_threads.$(ARCH).o \
+$(SRC)/controller_threads.$(ARCH).o \
+$(SRC)/input_threads.$(ARCH).o
+
+funcs = \
+$(SRC)/CheckJobs.$(ARCH).o \
+$(SRC)/CheckController.$(ARCH).o \
+$(SRC)/CheckTasks.$(ARCH).o \
+$(SRC)/CheckTimeRanges.$(ARCH).o \
+$(SRC)/ControllerOps.$(ARCH).o \
+$(SRC)/LocalJob.$(ARCH).o \
+$(SRC)/JobOps.$(ARCH).o \
+$(SRC)/JobIDOps.$(ARCH).o \
+$(SRC)/TaskOps.$(ARCH).o
+
+cmds = \
+$(SRC)/pulse.$(ARCH).o \
+$(SRC)/status.$(ARCH).o \
+$(SRC)/flush.$(ARCH).o \
+$(SRC)/showtask.$(ARCH).o \
+$(SRC)/kill.$(ARCH).o \
+$(SRC)/delete.$(ARCH).o \
+$(SRC)/verbose.$(ARCH).o \
+$(SRC)/controller.$(ARCH).o \
+$(SRC)/controller_host.$(ARCH).o \
+$(SRC)/controller_exit.$(ARCH).o \
+$(SRC)/controller_check.$(ARCH).o \
+$(SRC)/controller_status.$(ARCH).o \
+$(SRC)/controller_jobstack.$(ARCH).o \
+$(SRC)/controller_run.$(ARCH).o \
+$(SRC)/controller_output.$(ARCH).o \
+$(SRC)/controller_pulse.$(ARCH).o \
+$(SRC)/task.$(ARCH).o \
+$(SRC)/task_host.$(ARCH).o \
+$(SRC)/task_nmax.$(ARCH).o \
+$(SRC)/task_active.$(ARCH).o \
+$(SRC)/task_macros.$(ARCH).o \
+$(SRC)/task_trange.$(ARCH).o \
+$(SRC)/task_stdout.$(ARCH).o \
+$(SRC)/task_periods.$(ARCH).o \
+$(SRC)/task_command.$(ARCH).o \
+$(SRC)/task_options.$(ARCH).o \
+$(SRC)/version.$(ARCH).o \
+$(SRC)/ipptool2book.$(ARCH).o
+
+libs = \
+$(DESTLIB)/libshell.a \
+$(DESTLIB)/libdata.a \
+$(DESTLIB)/libbasiccmd.a \
+$(DESTLIB)/libastrocmd.a \
+$(DESTLIB)/libdatacmd.a
+
+pantasks: $(BIN)/pantasks.$(ARCH)
+$(SRC)/pantasks.$(ARCH).o : $(libs)
+$(BIN)/pantasks.$(ARCH) : $(single) $(funcs) $(cmds)
+
+pantasks_client: $(BIN)/pantasks_client.$(ARCH)
+$(SRC)/pantasks_client.$(ARCH).o : $(libs)
+$(BIN)/pantasks_client.$(ARCH) : $(client)
+
+pantasks_server: $(BIN)/pantasks_server.$(ARCH)
+$(SRC)/pantasks_server.$(ARCH).o : $(libs)
+$(BIN)/pantasks_server.$(ARCH) : $(server) $(funcs) $(cmds)
+
+pantasks_client.install: $(DESTBIN)/pantasks_client
+pantasks_server.install: $(DESTBIN)/pantasks_server
+
+$(single) $(client) $(server) $(funcs) $(cmds) : $(INC)/pantasks.h
+
+install: $(DESTBIN)/pantasks $(DESTBIN)/pantasks_client $(DESTBIN)/pantasks_server help modules
+
+help: clean-help cmd.basic.help cmd.data.help cmd.astro.help pantasks.help
+
+modules: pantasks.modules
+
+.PHONY: pantasks pantasks_client pantasks_server
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/TaskOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/TaskOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/TaskOps.c	(revision 15879)
@@ -0,0 +1,667 @@
+# include "pantasks.h"
+# include <regex.h>
+
+static Task **tasks;
+static int    Ntasks;
+static int    NTASKS;
+
+/* counter marking task being visited by the run loop */
+static int   ActiveTask;
+
+/* temporary holder for a new task */
+static Task *NewTask = NULL;
+
+/* set up the task list system */
+void InitTasks () {
+  NTASKS = 20;
+  Ntasks = 0;
+  ALLOCATE (tasks, Task *, NTASKS);
+  ActiveTask = -1;
+}
+
+/* provide a mechanism to loop over the list of tasks */
+Task *NextTask () {
+  
+  Task *task;
+
+  /* move to the next task and return it */
+  ActiveTask ++;
+  if (ActiveTask < 0) ActiveTask = 0;
+  if (ActiveTask >= Ntasks) {
+    ActiveTask = -1;
+    return (NULL);
+  }
+  task = tasks[ActiveTask];
+  return (task);
+}
+
+/* return task with given name */
+Task *FindTask (char *name) {
+
+  int i;
+
+  /* try for an exact match first */
+  for (i = 0; i < Ntasks; i++) {
+    if (!strcmp (tasks[i][0].name, name)) {
+      return (tasks[i]);
+    }
+  }
+  return (NULL);
+}  
+
+/* list known tasks */
+void ListTasks (int verbose) {
+
+  int i, j, valid, nameLength, cmdLength;
+  char *start, *stop;
+  char format[128];
+
+  gprint (GP_LOG, "\n");
+  if (Ntasks == 0) {
+    gprint (GP_LOG, " no defined tasks\n");
+    return;
+  }
+
+  /* find string lengths */
+  nameLength = cmdLength = 0;
+  for (i = 0; i < Ntasks; i++) {
+    nameLength = MAX (nameLength, strlen(tasks[i][0].name));
+    if (tasks[i][0].argv == NULL) {
+      cmdLength = MAX (nameLength, strlen("(dynamic)"));
+    } else {
+      cmdLength = MAX (nameLength, strlen(tasks[i][0].argv[0]));
+    }
+  }
+
+  gprint (GP_LOG, " Task Status\n");
+
+  snprintf (format, 128, "  AV %%-%ds %5s  %5s %5s %5s %%-%ds\n", nameLength, "Njobs", "Ngood", "Nfail", "Ntime", cmdLength);
+  gprint (GP_LOG, format, "Name", "Command");
+
+  snprintf (format, 128, "%%-%ds %%5d  %%5d %%5d %%5d %%-%ds\n", nameLength, cmdLength);
+  for (i = 0; i < Ntasks; i++) {
+    valid = CheckTimeRanges (tasks[i][0].ranges, tasks[i][0].Nranges);
+    if (verbose) gprint (GP_LOG, "\n");
+    if (tasks[i][0].active) {
+      gprint (GP_LOG, "  +");
+    } else {
+      gprint (GP_LOG, "  -");
+    }
+    if (valid) {
+      gprint (GP_LOG, "+ ");
+    } else {
+      gprint (GP_LOG, "- ");
+    }
+    if (tasks[i][0].argv == NULL) {
+      gprint (GP_LOG, format, tasks[i][0].name, tasks[i][0].Njobs, tasks[i][0].Nsuccess, tasks[i][0].Nfailure, tasks[i][0].Ntimeout, "(dynamic)");
+    } else {
+      gprint (GP_LOG, format, tasks[i][0].name, tasks[i][0].Njobs, tasks[i][0].Nsuccess, tasks[i][0].Nfailure, tasks[i][0].Ntimeout, tasks[i][0].argv[0]);
+    }
+    if (verbose) {
+      gprint (GP_LOG, "    spawn period: %f, polling period: %f, timeout period: %f\n", 
+	       tasks[i][0].exec_period, tasks[i][0].poll_period, tasks[i][0].timeout_period);
+      for (j = 0; j < tasks[i][0].Nranges; j++) {
+	switch (tasks[i][0].ranges[j].type) {
+	  case RANGE_ABS:
+	    start = ohana_sec_to_date (tasks[i][0].ranges[j].start);
+	    stop  = ohana_sec_to_date (tasks[i][0].ranges[j].stop);
+	    break;
+	  case RANGE_DAY:
+	    start = ohana_sec_to_hms (tasks[i][0].ranges[j].start);
+	    stop  = ohana_sec_to_hms (tasks[i][0].ranges[j].stop);
+	    break;
+	  case RANGE_WEEK:
+	    start = ohana_sec_to_day (tasks[i][0].ranges[j].start);
+	    stop  = ohana_sec_to_day (tasks[i][0].ranges[j].stop);
+	    break;
+	  default:
+	    abort ();
+	}
+	if (tasks[i][0].ranges[j].include) {
+	  gprint (GP_LOG, "     active : %s - %s", start, stop);
+	  if (tasks[i][0].ranges[j].Nmax) gprint (GP_LOG, " (%d of %d)", tasks[i][0].ranges[j].Nrun, tasks[i][0].ranges[j].Nmax);
+	  gprint (GP_LOG, "\n");
+	} else {
+	  gprint (GP_LOG, "     avoid  : %s - %s\n", start, stop);
+	}
+	free (start);
+	free (stop);
+      }
+      if (tasks[i][0].host == NULL) {
+	gprint (GP_LOG, "    task runs locally\n");
+	continue;
+      }
+      if (!strcasecmp(tasks[i][0].host, "ANYHOST")) {
+	gprint (GP_LOG, "    task host selected by controller\n");
+	continue;
+      }
+      if (tasks[i][0].host_required) {
+	gprint (GP_LOG, "    host %s (required)\n", tasks[i][0].host);
+      } else {
+	gprint (GP_LOG, "    host %s (desired)\n", tasks[i][0].host);
+      }
+    }
+  }
+  return;
+}
+
+/* list known tasks */
+void ListTaskStats (char *regex) {
+
+  int i, valid, nameLength;
+  char format[128];
+  regex_t preg;
+
+  gprint (GP_LOG, "\n");
+  if (Ntasks == 0) {
+    gprint (GP_LOG, " no defined tasks\n");
+    return;
+  }
+
+  if (regex != NULL) {
+    regcomp (&preg, regex, REG_EXTENDED);
+  }
+
+  /* find string lengths */
+  nameLength = 0;
+  for (i = 0; i < Ntasks; i++) {
+    nameLength = MAX (nameLength, strlen(tasks[i][0].name));
+  }
+
+  gprint (GP_LOG, " Task Statistics\n");
+
+  snprintf (format, 128, "     %%-%ds |           alljobs          |           success          |           failure          |\n", nameLength);
+  gprint (GP_LOG, format, "");
+  snprintf (format, 128, "  AV %%-%ds | Njobs   Tmin   Tave   Tmax | Njobs   Tmin   Tave   Tmax | Njobs   Tmin   Tave   Tmax |\n", nameLength);
+  gprint (GP_LOG, format, "Name");
+
+  snprintf (format, 128, "%%-%ds", nameLength);
+  for (i = 0; i < Ntasks; i++) {
+      
+    if ((regex != NULL) && regexec (&preg, tasks[i][0].name, 0, NULL, 0)) continue;
+
+    valid = CheckTimeRanges (tasks[i][0].ranges, tasks[i][0].Nranges);
+    if (tasks[i][0].active) {
+      gprint (GP_LOG, "  +");
+    } else {
+      gprint (GP_LOG, "  -");
+    }
+    if (valid) {
+      gprint (GP_LOG, "+ ");
+    } else {
+      gprint (GP_LOG, "- ");
+    }
+    if (tasks[i][0].argv == NULL) {
+      gprint (GP_LOG, format, tasks[i][0].name);
+    } else {
+      gprint (GP_LOG, format, tasks[i][0].name);
+    }
+    if (tasks[i][0].dtimeMin_alljobs < 0) {
+      gprint (GP_LOG, " | %5d %6s %6.2f %6.2f",     tasks[i][0].Njobs,    "NONE",                       tasks[i][0].dtimeAve_alljobs, tasks[i][0].dtimeMax_alljobs);
+    } else {
+      gprint (GP_LOG, " | %5d %6.2f %6.2f %6.2f",   tasks[i][0].Njobs,    tasks[i][0].dtimeMin_alljobs, tasks[i][0].dtimeAve_alljobs, tasks[i][0].dtimeMax_alljobs);
+    }      
+    if (tasks[i][0].dtimeMin_success < 0) {
+      gprint (GP_LOG, " | %5d %6s %6.2f %6.2f",     tasks[i][0].Nsuccess, "NONE",                       tasks[i][0].dtimeAve_success, tasks[i][0].dtimeMax_success);
+    } else {
+      gprint (GP_LOG, " | %5d %6.2f %6.2f %6.2f",   tasks[i][0].Nsuccess, tasks[i][0].dtimeMin_success, tasks[i][0].dtimeAve_success, tasks[i][0].dtimeMax_success);
+    }
+    if (tasks[i][0].dtimeMin_failure < 0) {
+      gprint (GP_LOG, " | %5d %6s %6.2f %6.2f |\n",   tasks[i][0].Nfailure, "NONE",                       tasks[i][0].dtimeAve_failure, tasks[i][0].dtimeMax_failure);
+    } else {
+      gprint (GP_LOG, " | %5d %6.2f %6.2f %6.2f |\n", tasks[i][0].Nfailure, tasks[i][0].dtimeMin_failure, tasks[i][0].dtimeAve_failure, tasks[i][0].dtimeMax_failure);
+    }
+  }
+  return;
+}
+
+/* list known tasks */
+void ResetTaskStats (char *regex) {
+
+  int i, nameLength;
+  regex_t preg;
+
+  if (Ntasks == 0) {
+    return;
+  }
+
+  if (regex != NULL) {
+    regcomp (&preg, regex, REG_EXTENDED);
+  }
+
+  /* find string lengths */
+  nameLength = 0;
+  for (i = 0; i < Ntasks; i++) {
+    nameLength = MAX (nameLength, strlen(tasks[i][0].name));
+  }
+
+  for (i = 0; i < Ntasks; i++) {
+      
+    if ((regex != NULL) && regexec (&preg, tasks[i][0].name, 0, NULL, 0)) continue;
+
+    tasks[i][0].Njobs = 0;
+    tasks[i][0].dtimeMin_alljobs = 0;
+    tasks[i][0].dtimeAve_alljobs = 0;
+    tasks[i][0].dtimeMax_alljobs = 0;
+
+    tasks[i][0].Nsuccess = 0;
+    tasks[i][0].dtimeMin_success = 0;
+    tasks[i][0].dtimeAve_success = 0;
+    tasks[i][0].dtimeMax_success = 0;
+
+    tasks[i][0].Nfailure = 0;
+    tasks[i][0].dtimeMin_failure = 0;
+    tasks[i][0].dtimeAve_failure = 0;
+    tasks[i][0].dtimeMax_failure = 0;
+  }
+  return;
+}
+
+/* show details of a task */
+int ShowTask (char *name) {
+
+  int i, j;
+  char *start, *stop;
+  Task *task;
+
+  task = FindTask (name);
+  if (task == NULL) {
+    gprint (GP_LOG, "task %s not found\n", name);
+    return (FALSE);
+  }
+
+  gprint (GP_LOG, "\n macro %s\n", task[0].name);
+
+  gprint (GP_LOG, "\n command: ");
+  for (i = 0; i < task[0].argc; i++) {
+    gprint (GP_LOG, "%s ", task[0].argv[i]);
+  }
+  gprint (GP_LOG, "\n\n");
+
+  gprint (GP_LOG, "\n options: ");
+  for (i = 0; i < task[0].optc; i++) {
+    gprint (GP_LOG, "%s ", task[0].optv[i]);
+  }
+  gprint (GP_LOG, "\n\n");
+
+  if (task[0].host == NULL) {
+    gprint (GP_LOG, " task runs locally\n");
+    goto periods;
+  }
+  if (!strcasecmp(task[0].host, "ANYHOST")) {
+    gprint (GP_LOG, " task host selected by controller\n");
+    goto periods;
+  }
+  if (task[0].host_required) {
+    gprint (GP_LOG, " host %s (required)\n", task[0].host);
+  } else {
+    gprint (GP_LOG, " host %s (desired)\n", task[0].host);
+  }
+
+periods:
+  gprint (GP_LOG, " time periods: exec: %f  poll: %f  timeout: %f\n", 
+	  task[0].exec_period, task[0].poll_period, task[0].timeout_period);
+
+  for (j = 0; j < tasks[i][0].Nranges; j++) {
+    switch (tasks[i][0].ranges[j].type) {
+      case RANGE_ABS:
+	start = ohana_sec_to_date (tasks[i][0].ranges[j].start);
+	stop  = ohana_sec_to_date (tasks[i][0].ranges[j].stop);
+	break;
+      case RANGE_DAY:
+	start = ohana_sec_to_hms (tasks[i][0].ranges[j].start);
+	stop  = ohana_sec_to_hms (tasks[i][0].ranges[j].stop);
+	break;
+      case RANGE_WEEK:
+	start = ohana_sec_to_day (tasks[i][0].ranges[j].start);
+	stop  = ohana_sec_to_day (tasks[i][0].ranges[j].stop);
+	break;
+      default:
+	abort ();
+    }
+    if (tasks[i][0].ranges[j].include) {
+      gprint (GP_LOG, "     active : %s - %s", start, stop);
+      if (tasks[i][0].ranges[j].Nmax) gprint (GP_LOG, " (%d of %d)", tasks[i][0].ranges[j].Nrun, tasks[i][0].ranges[j].Nmax);
+      gprint (GP_LOG, "\n");
+    } else {
+      gprint (GP_LOG, "     avoid  : %s - %s\n", start, stop);
+    }
+    free (start);
+    free (stop);
+  }
+
+  gprint (GP_LOG, "\n pre-execute macro\n");
+  ListMacro (task[0].exec);
+
+  gprint (GP_LOG, "\n timeout macro\n");
+  ListMacro (task[0].timeout);
+
+  gprint (GP_LOG, "\n crash macro\n");
+  ListMacro (task[0].crash);
+
+  gprint (GP_LOG, "\n default exit macro\n");
+  ListMacro (task[0].defexit);
+
+  for (i = 0; i < task[0].Nexit; i++) {
+    gprint (GP_LOG, "\n exit macro (status == %d)\n", atoi(task[0].exit[i][0].name));
+    ListMacro (task[0].exit[i]);
+  }
+
+  return (TRUE);
+}
+
+/* make a new named task */
+int FreeTask (Task *task) {
+  
+  int i;
+
+  if (task == NULL) return (FALSE);
+  
+  if (task[0].name != NULL) free (task[0].name);
+  if (task[0].host != NULL) free (task[0].host);
+  if (task[0].argv != NULL) {
+    for (i = 0; i < task[0].argc; i++) {
+      free (task[0].argv[i]);
+    }
+    free (task[0].argv);
+  }
+  if (task[0].optv != NULL) {
+    for (i = 0; i < task[0].optc; i++) {
+      free (task[0].optv[i]);
+    }
+    free (task[0].optv);
+  }
+  if (task[0].exec != NULL) {
+    FreeMacro (task[0].exec);
+    free (task[0].exec);
+  }
+  if (task[0].crash != NULL) {
+    FreeMacro (task[0].crash);
+    free (task[0].crash);
+  }
+  if (task[0].timeout != NULL) {
+    FreeMacro (task[0].timeout);
+    free (task[0].timeout);
+  }
+  for (i = 0; i < task[0].Nexit; i++) {
+    if (task[0].exit[i] != NULL) {
+      FreeMacro (task[0].exit[i]);
+    }
+    free (task[0].exit[i]);
+  }
+  free (task[0].exit);
+
+  if (task[0].ranges != NULL) {
+    free (task[0].ranges);
+  }
+  return (TRUE);
+}
+
+/**** new task functions ***/
+
+/* make a new named task */
+Task *CreateTask (char *name) {
+  
+  ALLOCATE (NewTask, Task, 1);
+
+  NewTask[0].name = strcreate (name);;
+
+  NewTask[0].host = NULL;
+  NewTask[0].host_required = FALSE;
+
+  NewTask[0].argc = 0;
+  NewTask[0].argv = NULL;
+
+  NewTask[0].optc = 0;
+  NewTask[0].optv = NULL;
+
+  NewTask[0].stdout_dump = NULL;
+  NewTask[0].stderr_dump = NULL;
+
+  NewTask[0].exec = NULL;
+  NewTask[0].crash = NULL;
+  NewTask[0].timeout = NULL;
+  NewTask[0].defexit = NULL;
+
+  NewTask[0].Nexit = 0;
+  NewTask[0].NEXIT = 10;
+  ALLOCATE (NewTask[0].exit, Macro *, NewTask[0].NEXIT);
+  /* don't free tasks[0].exit, keep at least 1 allocated */
+
+  NewTask[0].exec_period = 1.0;
+  NewTask[0].poll_period = 1.0;
+  NewTask[0].timeout_period = 1.0;
+
+  NewTask[0].Nranges = 0;
+  ALLOCATE (NewTask[0].ranges, TimeRange, 1);
+
+  /* init task timer (is reset by 'run') */  
+  gettimeofday (&NewTask[0].last, (void *) NULL);
+  NewTask[0].Nmax = 0;  /* default value means 'no limit' */
+
+  NewTask[0].NpendingMax = 0;  /* default value means 'no limit' */
+  NewTask[0].Npending = 0;  /* default value means 'no limit' */
+
+  NewTask[0].Njobs = 0;
+  NewTask[0].Nsuccess = 0;
+  NewTask[0].Nfailure = 0;
+  NewTask[0].Ntimeout = 0;
+
+  /* jobs timing statistics */
+  NewTask[0].dtimeAve_alljobs =  0.0;
+  NewTask[0].dtimeMin_alljobs = -1.0;
+  NewTask[0].dtimeMax_alljobs =  0.0;
+
+  NewTask[0].dtimeAve_success =  0.0;
+  NewTask[0].dtimeMin_success = -1.0;
+  NewTask[0].dtimeMax_success =  0.0;
+
+  NewTask[0].dtimeAve_failure =  0.0;
+  NewTask[0].dtimeMin_failure = -1.0;
+  NewTask[0].dtimeMax_failure =  0.0;
+
+  NewTask[0].active = TRUE;
+  return (NewTask);
+}
+
+/* remove the task from the task list */
+int RemoveTask (Task *task) {
+  
+  int i, Nt;
+
+  /* find task in task list */
+  Nt = -1;
+  for (i = 0; i < Ntasks; i++) {
+    if (task == tasks[i]) {
+      Nt = i;
+      break;
+    }
+  }
+  if (Nt == -1) {
+    gprint (GP_ERR, "programming error: task not found\n");
+    return (FALSE);
+  }
+  for (i = Nt; i < Ntasks - 1; i++) {
+    tasks[i] = tasks[i+1];
+  }
+  Ntasks --;
+  return (TRUE);
+}
+
+int ValidateTask (Task *task, int RequireStatic) {
+
+  int i, hash;
+
+  /* is a static command defined? */
+  if (task[0].argc != 0) {
+    if (task[0].argv == NULL) {
+      gprint (GP_ERR, "task command arguments not defined (programming error)\n");
+      return (FALSE);
+    }
+    return (TRUE);
+  }
+  if (RequireStatic) {
+    gprint (GP_ERR, "task command not defined\n");
+    return (FALSE);
+  }
+
+  /* no static command; dynamic command? */
+  if (task[0].exec != NULL) {
+    for (i = 0; i < task[0].exec[0].Nlines; i++) {
+      hash = TaskHash (task[0].exec[0].line[i]);
+      if (hash == TASK_COMMAND) return (TRUE);
+    }
+  }
+  gprint (GP_ERR, "task command not defined\n");
+  return (FALSE);
+}
+
+int RegisterNewTask () {
+  
+  int N;
+
+  N = Ntasks;
+  Ntasks ++;
+  if (Ntasks == NTASKS) {
+    NTASKS += 20;
+    REALLOCATE (tasks, Task *, NTASKS);
+  }
+  tasks[N] = NewTask;
+  NewTask = NULL;
+  return (TRUE);
+}
+
+int DeleteNewTask () {
+  if (NewTask != NULL) {
+    FreeTask (NewTask);
+    free (NewTask);
+    NewTask = NULL;
+  }
+  return (TRUE);
+}
+
+Task *SetNewTask (Task *task) {
+  NewTask = task;
+  return (task);
+}
+
+Task *GetNewTask () {
+  return (NewTask);
+}
+
+Task *GetActiveTask () {
+  Task *task;
+  if (ActiveTask < 0) return (NULL);
+  task = tasks[ActiveTask];
+  return (task);
+}
+
+int TaskHash (char *input) {
+  
+  int hash;
+  char *command;
+
+  hash = TASK_NONE;
+
+  command = thisword (input);
+  if (command == NULL) return (TASK_EMPTY);
+
+  if (command[0] == '#')                  hash = TASK_COMMENT;
+  if (!strcasecmp (command, "END"))       hash = TASK_END;
+  if (!strcasecmp (command, "HOST"))      hash = TASK_HOST;
+  if (!strcasecmp (command, "NMAX"))      hash = TASK_NMAX;
+  if (!strcasecmp (command, "ACTIVE"))    hash = TASK_ACTIVE;
+  if (!strcasecmp (command, "TRANGE"))    hash = TASK_TRANGE;
+  if (!strcasecmp (command, "STDOUT"))    hash = TASK_STDOUT;
+  if (!strcasecmp (command, "STDERR"))    hash = TASK_STDERR;
+  if (!strcasecmp (command, "COMMAND"))   hash = TASK_COMMAND;
+  if (!strcasecmp (command, "OPTIONS"))   hash = TASK_OPTIONS;
+  if (!strcasecmp (command, "PERIODS"))   hash = TASK_PERIODS;
+  if (!strcasecmp (command, "NPENDING"))  hash = TASK_NPENDING;
+  if (!strcasecmp (command, "TASK.EXIT")) hash = TASK_EXIT;
+  if (!strcasecmp (command, "TASK.EXEC")) hash = TASK_EXEC;
+
+  free (command);
+  return (hash);
+}
+
+/*** task timer functions ***/
+
+double GetTaskTimer (struct timeval start, int verbose) {
+
+  double dtime;
+  struct timeval now;
+  
+  gettimeofday (&now, (void *) NULL);
+  dtime = DTIME (now, start);
+  
+  if (verbose) {
+      fprintf (stderr, "tt: %d %6d  - %d %6d : %f\n", 
+	       (int) now.tv_sec, (int) now.tv_usec, 
+	       (int) start.tv_sec, (int) start.tv_usec, dtime);
+  }
+
+  return (dtime);
+}
+
+void SetTaskTimer (struct timeval *timer) {
+  gettimeofday (timer, (void *) NULL);
+}
+
+/* start the clock for all tasks */
+void InitTaskTimers () {
+
+  Task *task;
+  double isec, fsec;
+
+  while ((task = NextTask ()) != NULL) {
+    gettimeofday (&task[0].last, (void *) NULL);
+    fsec = modf (task[0].exec_period, &isec);
+    task[0].last.tv_sec -= isec;
+    task[0].last.tv_usec -= 1e6*fsec;
+ }
+}
+
+/* must call this after updating the corresponding counter */
+void UpdateTaskTimerStats (Task *task, int mode, double dtime) {
+
+  double total;
+
+  switch (mode) {
+    case TIMER_ALLJOBS:
+      total = task[0].dtimeAve_alljobs * (task[0].Njobs - 1);
+      total += dtime;
+      task[0].dtimeAve_alljobs = total / (float) task[0].Njobs;
+      if (task[0].dtimeMin_alljobs < 0) {
+	task[0].dtimeMin_alljobs = dtime;
+      } else {
+	task[0].dtimeMin_alljobs = MIN (task[0].dtimeMin_alljobs, dtime);
+      }
+      task[0].dtimeMax_alljobs = MAX (task[0].dtimeMax_alljobs, dtime);
+      break;
+    case TIMER_SUCCESS:
+      total = task[0].dtimeAve_success * (task[0].Nsuccess - 1);
+      total += dtime;
+      task[0].dtimeAve_success = total / (float) task[0].Nsuccess;
+      if (task[0].dtimeMin_success < 0) {
+	task[0].dtimeMin_success = dtime;
+      } else {
+	task[0].dtimeMin_success = MIN (task[0].dtimeMin_success, dtime);
+      }
+      task[0].dtimeMax_success = MAX (task[0].dtimeMax_success, dtime);
+      break;
+    case TIMER_FAILURE:
+      total = task[0].dtimeAve_failure * (task[0].Nfailure - 1);
+      total += dtime;
+      task[0].dtimeAve_failure = total / (float) task[0].Nfailure;
+      if (task[0].dtimeMin_failure < 0) {
+	task[0].dtimeMin_failure = dtime;
+      } else {
+	task[0].dtimeMin_failure = MIN (task[0].dtimeMin_failure, dtime);
+      }
+      task[0].dtimeMax_failure = MAX (task[0].dtimeMax_failure, dtime);
+      break;
+    default:
+      abort();
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/client_shell.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/client_shell.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/client_shell.c	(revision 15879)
@@ -0,0 +1,99 @@
+# include "opihi.h"
+
+/******************/
+int client_shell (int argc, char **argv) {
+
+  int Nbad, status;
+  char *line, *prompt, *history;
+  pid_t ppid;
+
+  general_init (&argc, argv);
+  program_init (&argc, argv);
+  startup (&argc, argv);
+  prompt = get_variable("PROMPT");
+  history = get_variable("HISTORY");
+  welcome ();
+
+  /* attempt to connect to the pantasks server (exit on failure) */
+  multicommand_InitServer ();
+
+  Nbad = 0;
+  while (1) {  /** must exit with command "exit" or "quit" */
+    if (Nbad == 10) exit (3);
+
+    line = readline (prompt);
+
+    if (line == NULL) { 
+      
+      ppid = getppid();
+      if (ppid == 1) {
+	gprint (GP_ERR, "caught parent shutdown\n");
+	exit (2);
+      }
+      if (!isatty (STDIN_FILENO)) exit (2);
+      gprint (GP_ERR, "Use \"quit\" to exit\n");
+      Nbad ++;
+      continue;
+    }
+    Nbad = 0;
+    ohana_memregister (line);
+
+    stripwhite (line);
+
+    if (*line) {
+	status = multicommand (line);
+	add_history (line);
+	append_history (1, history);
+    }
+    free (line);
+  }
+}
+
+/* 
+   startup sequence:
+
+   - general_init
+   - program_init
+   - startup (exit if non-interactive)
+   - welcome
+
+*/
+
+/* client issues and questions:
+
+- need to identify the commands to be caught by the client
+- pass each input line through the command parser first, then
+  send to server if not identified as a valid command
+- this raises the question of variables: do we parse variables
+  at the client level?  I would not think so.  what about input?
+  if the input is to be parsed by the client, but executed on the server, 
+  I'll need to re-work the input parsing system.  would be better 
+  for the server to parse the input command.  in this case, the client 
+  user needs to have access to the directories with input scripts.
+  this may be an advantage: it would allow some limitation on who can 
+  install server scripts.
+- variables, vectors and buffers: where are they valid (client or server?)
+  it seems they should all be defined locally on the server.  this makes
+  graphics plotting a server-side action as well.  this is probably easier,
+  but we do need to be careful about multiple clients trying to make plots
+  on the same window at the same time.  Exporting the window can be done 
+  for one client with the $KII variable, but could be tricky for more 
+  complex interactions
+- list of commands which clearly must be parsed by the client:
+  - quit / exit
+  - exec / !
+  - ?
+
+- i may need an alternative version of command, modified to avoid parsing the 
+  variables and vectors.  I also need an alternative version of the Init commands
+  to just list the blocked ones.
+
+- the client now executes all of the basic opihi commands, and only passes
+  through the pantasks commands.  The pantasks server interface should only
+  accept functions which immediately return, sending back the result to be
+  printed by the client.  
+
+  The server should not accept the 'task' commands from the client command-line.
+  To define and run macros or tasks on the server, these need to be added to 
+  a script which is loaded with a varient on the input command.  
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "pantasks.h"
+
+int controller_host    	PROTO((int, char **));
+int controller_exit    	PROTO((int, char **));
+int controller_status  	PROTO((int, char **));
+int controller_jobstack PROTO((int, char **));
+int controller_run     	PROTO((int, char **));
+int controller_stop    	PROTO((int, char **));
+int controller_check   	PROTO((int, char **));
+int controller_output  	PROTO((int, char **));
+int controller_pulse   	PROTO((int, char **));
+
+static Command controller_cmds[] = {
+  {"exit",     controller_exit,     "shutdown controller"},
+  {"host",     controller_host,     "define host for controller"},
+  {"check",    controller_check,    "check controller host/job"},
+  {"run",      controller_run,      "start controller operation / set run levels"},
+  {"stop",     controller_run,      "stop controller (no disconnect)"},
+  {"status",   controller_status,   "check controller status"},
+  {"jobstack", controller_jobstack, "check controller status"},
+  {"output",   controller_output,   "print controller output"},
+  {"pulse",    controller_pulse,    "set controller pulse"},
+};
+
+int controller (int argc, char **argv) {
+
+  int i, N, status;
+  CommandF *func;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: controller (command) ... \n");
+    return (FALSE);
+  }
+
+  if (!strcasecmp (argv[1], "help")) {
+    N = sizeof (controller_cmds) / sizeof (Command);
+
+    for (i = 0; i < N; i++) {
+      gprint (GP_LOG, "%-15s %s\n", controller_cmds[i].name, controller_cmds[i].help);
+    }
+    return (TRUE);
+  }
+
+  func = FindControllerCommand (argv[1]);
+  if (func == NULL) {
+    gprint (GP_ERR, "invalid controller command\n");
+    return (FALSE);
+  }
+
+  status = (*func)(argc - 1, argv + 1);
+  return (status);
+}
+
+CommandF *FindControllerCommand (char *cmd) {
+
+  int i, N;
+
+  N = sizeof (controller_cmds) / sizeof (Command);
+
+  for (i = 0; i < N; i++) {
+    if (!strcmp (controller_cmds[i].name, cmd)) {
+      return (controller_cmds[i].func);
+    }
+  }
+  return (NULL);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_check.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_check.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_check.c	(revision 15879)
@@ -0,0 +1,35 @@
+# include "pantasks.h"
+
+int controller_check (int argc, char **argv) {
+
+  int status;
+  char command[1024];
+  IOBuffer buffer;
+
+  if (argc != 3) goto usage;
+  if (strcasecmp (argv[1], "JOB") && 
+      strcasecmp (argv[1], "HOST")) goto usage;
+
+  /* check if controller is running */
+  status = CheckControllerStatus ();
+  if (!status) {
+    gprint (GP_LOG, "controller is not running\n");
+    return (TRUE);
+  }
+
+  sprintf (command, "check %s %s", argv[1], argv[2]);
+  InitIOBuffer (&buffer, 0x100);
+  status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
+  if (VerboseMode()) {
+    gprint (GP_LOG, "controller command sent\n");  
+    gprint (GP_LOG, "\n Nbytes received: %d\n", buffer.Nbuffer);  
+  }
+  gwrite (buffer.buffer, 1, buffer.Nbuffer, GP_LOG);
+  FreeIOBuffer (&buffer);
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: controller check job (jobID)\n");
+  gprint (GP_ERR, "USAGE: controller check host (hostID)\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_exit.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_exit.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_exit.c	(revision 15879)
@@ -0,0 +1,14 @@
+# include "pantasks.h"
+
+int controller_exit (int argc, char **argv) {
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: controller exit TRUE\n");
+    return (FALSE);
+  }
+
+  if (strcasecmp (argv[1], "TRUE")) return (FALSE);
+
+  QuitController ();
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_host.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_host.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_host.c	(revision 15879)
@@ -0,0 +1,37 @@
+# include "pantasks.h"
+
+int controller_host (int argc, char **argv) {
+
+  int status;
+  char command[1024];
+  IOBuffer buffer;
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: controller host (command) (hostname)\n");
+    return (FALSE);
+  }
+
+  /* start controller connection (if needed) */
+  if (!StartController ()) {
+    gprint (GP_ERR, "failure to start pcontrol\n");
+    return (FALSE);
+  }
+
+  sprintf (command, "host %s %s", argv[1], argv[2]);
+  InitIOBuffer (&buffer, 0x100);
+
+  SerialThreadLock ();
+  status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
+  SerialThreadUnlock ();
+
+  if (status) gwrite (buffer.buffer, 1, buffer.Nbuffer, GP_LOG);
+
+  FreeIOBuffer (&buffer);
+  return (TRUE);
+}
+
+/* should I keep an internal host table so I can reload the 
+   hosts if the controller exits?
+
+   alternatively, that could be a user-level choice
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_jobstack.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_jobstack.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_jobstack.c	(revision 15879)
@@ -0,0 +1,37 @@
+# include "pantasks.h"
+
+int controller_jobstack (int argc, char **argv) {
+
+  int status;
+  char command[1024];
+  IOBuffer buffer;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: controller jobstack (jobstack)\n");
+    gprint (GP_ERR, "       (jobstack) : pending, busy, exit, crash, hung, done\n");
+    return (FALSE);
+  }
+
+  /* check if controller is running */
+  status = CheckControllerStatus ();
+  if (!status) {
+    gprint (GP_LOG, "controller is not active\n");
+    return (TRUE);
+  }
+
+  // XXX this has an error?  test this out...
+  sprintf (command, "jobstack %s", argv[2]);
+  InitIOBuffer (&buffer, 0x100);
+
+  SerialThreadLock ();
+  status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
+  SerialThreadUnlock ();
+
+  if (status) {
+    gwrite (buffer.buffer, 1, buffer.Nbuffer, GP_LOG);
+  } else {
+    gprint (GP_LOG, "controller is not communicating\n");
+  }
+  FreeIOBuffer (&buffer);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_output.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_output.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_output.c	(revision 15879)
@@ -0,0 +1,13 @@
+# include "pantasks.h"
+
+int controller_output (int argc, char **argv) {
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: controller status\n");
+    return (FALSE);
+  }
+
+  CheckControllerOutput ();
+  PrintControllerOutput ();
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_pulse.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_pulse.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_pulse.c	(revision 15879)
@@ -0,0 +1,26 @@
+# include "pantasks.h"
+
+int controller_pulse (int argc, char **argv) {
+
+  int status;
+  char command[1024];
+  IOBuffer buffer;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: controller pulse (usec)\n");
+    return (FALSE);
+  }
+
+  /* start controller connection (if needed) */
+  if (!StartController ()) {
+    gprint (GP_ERR, "failure to start pcontrol\n");
+    return (FALSE);
+  }
+
+  sprintf (command, "pulse %d", atoi(argv[1]));
+  InitIOBuffer (&buffer, 0x100);
+  status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
+  if (status) gwrite (buffer.buffer, 1, buffer.Nbuffer, GP_LOG);
+  FreeIOBuffer (&buffer);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_run.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_run.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_run.c	(revision 15879)
@@ -0,0 +1,49 @@
+# include "pantasks.h"
+
+int controller_run (int argc, char **argv) {
+
+  int status;
+  char command[1024];
+  IOBuffer buffer;
+
+  if ((argc > 2) ||
+      get_argument (argc, argv, "help") ||
+      get_argument (argc, argv, "-h") ||
+      get_argument (argc, argv, "--help")) 
+  {
+    if (!strcmp (argv[0], "run")) {
+      gprint (GP_ERR, "USAGE: controller run [level]\n");
+      gprint (GP_ERR, "  allowed levels:\n");
+      gprint (GP_ERR, "  all (default) : manage machines, spawn jobs, harvest jobs\n");
+      gprint (GP_ERR, "  reap          : manage machines, harvest jobs\n");
+      gprint (GP_ERR, "  hosts         : manage machines, not jobs\n");
+      gprint (GP_ERR, "  none          : all stop\n");
+    } else {
+      gprint (GP_ERR, "USAGE: controller stop (immediate processing halt)\n");
+    }
+    return (FALSE);
+  }
+
+  /* check if controller is running */
+  status = CheckControllerStatus ();
+  if (!status) {
+    gprint (GP_LOG, "controller is not active\n");
+    return (TRUE);
+  }
+
+  if (argc == 1) {
+    strcpy (command, argv[0]);
+  } else {
+    sprintf (command, "run %s", argv[1]);
+  }
+
+  InitIOBuffer (&buffer, 0x100);
+  status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
+  if (status) {
+    gwrite (buffer.buffer, 1, buffer.Nbuffer, GP_LOG);
+  } else {
+    gprint (GP_LOG, "controller is not responding\n");
+  }
+  FreeIOBuffer (&buffer);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_status.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_status.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_status.c	(revision 15879)
@@ -0,0 +1,36 @@
+# include "pantasks.h"
+
+int controller_status (int argc, char **argv) {
+
+  int status;
+  char command[1024];
+  IOBuffer buffer;
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: controller status\n");
+    return (FALSE);
+  }
+
+  /* check if controller is running */
+  status = CheckControllerStatus ();
+  if (!status) {
+    gprint (GP_LOG, "controller is not active\n");
+    return (TRUE);
+  }
+
+
+  sprintf (command, "status");
+  InitIOBuffer (&buffer, 0x100);
+
+  SerialThreadLock ();
+  status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
+  SerialThreadUnlock ();
+
+  if (status) {
+    gwrite (buffer.buffer, 1, buffer.Nbuffer, GP_LOG);
+  } else {
+    gprint (GP_LOG, "controller is not communicating\n");
+  }
+  FreeIOBuffer (&buffer);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_threads.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_threads.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/controller_threads.c	(revision 15879)
@@ -0,0 +1,44 @@
+# include "pantasks.h"
+
+/** things related to CheckController **/
+
+static int CheckControllerRun = FALSE;
+
+void CheckControllerSetState (int state) {
+  CheckControllerRun = state;
+}
+int CheckControllerGetState () {
+  return (CheckControllerRun);
+}
+
+void *CheckControllerThread (void *data) {
+
+  char log_stdout[128], log_stderr[128];
+
+  gprintInit ();  // each thread needs to init the printing system
+  // define server output log files
+  if (VarConfig ("PANTASKS_SERVER_STDOUT", "%s", log_stdout) != NULL) {
+      gprintSetFileThisThread (GP_LOG, log_stdout);
+  }
+  if (VarConfig ("PANTASKS_SERVER_STDERR", "%s", log_stderr) != NULL) {
+      gprintSetFileThisThread (GP_ERR, log_stderr);
+  }
+
+  while (1) {
+
+    // check for thread suspend
+    if (!CheckControllerRun) {
+      usleep (100000); // idle if thread action is suspended
+      continue;
+    }
+
+    // one run of the task checker
+    SerialThreadLock ();
+    CheckController ();
+    CheckControllerOutput ();
+    SerialThreadUnlock ();
+    if (VerboseMode() == 2) fprintf (stderr, "C");
+    // fprintf (stderr, "**** C ****");
+    usleep (500000); // allow other threads a chance to run
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/delete.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/delete.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/delete.c	(revision 15879)
@@ -0,0 +1,48 @@
+# include "pantasks.h"
+
+int delete_job (int argc, char **argv) {
+
+  Job *job;
+  int JobID;
+
+  if (argc != 3) goto usage;
+
+  if (!strcasecmp (argv[1], "job")) {
+    JobID = atoi (argv[2]);
+
+    job = FindJob (JobID);
+    if (job == NULL) {
+      gprint (GP_LOG, "job not found\n");
+      return (TRUE);
+    }
+
+    if (job[0].mode == JOB_LOCAL) {
+      if (!KillLocalJob (job)) {
+	job[0].state = JOB_HUNG;
+	if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", job[0].pid);
+	return (FALSE);
+      }
+    } else {
+      if (!KillControllerJob (job)) {
+	job[0].state = JOB_HUNG;
+	if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", job[0].pid);
+	return (FALSE);
+      }
+    }    
+    DeleteJob (job);
+    gprint (GP_LOG, "job removed\n");
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "task")) {
+    gprint (GP_ERR, "delete task not implemented yet\n");
+    return (FALSE);
+  }
+
+usage:
+    gprint (GP_ERR, "USAGE: delete job (JobID)\n");
+    gprint (GP_ERR, "USAGE: delete task (TaskName)\n");
+    return (FALSE);
+}
+
+/* find job from jobID, kill and delete */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/flush.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/flush.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/flush.c	(revision 15879)
@@ -0,0 +1,17 @@
+# include "pantasks.h"
+
+int flush_jobs (int argc, char **argv) {
+
+  if (argc != 2) goto usage;
+
+  if (!strcasecmp (argv[1], "jobs")) {
+    FlushJobs ();
+    return (TRUE);
+  }
+  
+usage:
+  gprint (GP_ERR, "USAGE: flush jobs\n");
+  return (FALSE);
+}
+
+/* find job from jobID, kill and delete */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/controller
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/controller	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/controller	(revision 15879)
@@ -0,0 +1,29 @@
+
+   controller (command) ...
+
+   Interact with the parallel controller 'pcontrol'.  This command
+   groups together several controller sub-commands, listed below.
+
+
+   controller host (hostname)
+
+   Define a new machine available to the parallel controller.  
+
+
+   controller check (host) (HostID)
+   controller check (job) (JobID)
+
+   Check on the status of a specific host or job known to the parallel
+   controller.
+
+
+   controller status
+
+   Query the parallel controller for its current status
+
+
+   controller output
+
+   Dump the contents of the parallel controller message buffers.
+   These are the messages from the controller itself, rather than the
+   messages generated by jobs run by the controller.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/task
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/task	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/task	(revision 15879)
@@ -0,0 +1,27 @@
+
+   task (name)
+
+   Define or modify a task.  A task is defined by issuing a series of
+   task commands, listed below (see their individual help pages).  A
+   task describes the rules for constructing jobs.  At a minimum, a
+   task must include a command, defining the UNIX command to run for
+   each job.  Other task commands define optional concepts for the
+   task.  These include: 
+
+   - a macro to be run before the job is constructed (task.exec).
+   - a set of macros to be run when the job is completed (task.exit)
+   - time ranges in which the task should be run (or not) (trange) 
+   - required / desired parallel controller hosts (host)
+   - job contruction time interval (periods -exec)
+   - job polling time interval (periods -poll)
+   - job timeouts (periods -timeout)
+   - maximum number of jobs to construct
+
+   See also:
+   task.command
+   task.exit
+   task.exec
+   task.trange
+   task.nmax
+   task.host
+   task.periods
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/task.command
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/task.command	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/task.command	(revision 15879)
@@ -0,0 +1,15 @@
+
+   command (arg0) (arg1) ...
+
+   Define the rule for constructing a job command for a task.  The
+   arguments are UNIX command and the collection of command arguments.
+   The arguments may include references to Opihi variables.  The task
+   command may be included at the top level of the task, or it may be
+   defined within the task exec macro.  In the latter case, the
+   command is constructed only when the exec macro is run, every job
+   construction interval.  Thus, the command arguments may depend on
+   the result of the exec macro operation.   
+
+   See also:
+   task
+   task.exec
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/task.exec
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/task.exec	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/help/task.exec	(revision 15879)
@@ -0,0 +1,17 @@
+
+   task.exec
+
+   A special macro to be executed before constructing the job command.
+   The macro is defined by commands following the 'task.exec' command,
+   ending with the word 'end'.  If the exit status of the task.exec
+   macro is FALSE, then the job is NOT constructed.  This allows the
+   construction of a job to be conditional on other, external
+   quantites.  (Note: the exit status of the macro is false if 'break'
+   is called).  The task command may be defined within the task.exec
+   macro, in which case the command is constructed only when the exec
+   macro is run, every job construction interval.  Thus, the command
+   arguments may depend on the result of the exec macro operation.
+
+   See also:
+   task
+   task.command
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/init.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/init.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/init.c	(revision 15879)
@@ -0,0 +1,69 @@
+# include "pantasks.h"
+
+int controller      PROTO((int, char **));
+int task	    PROTO((int, char **));
+int task_host	    PROTO((int, char **));
+int task_nmax	    PROTO((int, char **));
+int task_npending   PROTO((int, char **));
+int task_active	    PROTO((int, char **));
+int task_trange	    PROTO((int, char **));
+int task_macros	    PROTO((int, char **));
+int task_command    PROTO((int, char **));
+int task_options    PROTO((int, char **));
+int task_periods    PROTO((int, char **));
+int task_stdout     PROTO((int, char **));
+int task_stderr     PROTO((int, char **));
+int run             PROTO((int, char **));
+int stop            PROTO((int, char **));
+int halt            PROTO((int, char **));
+int flush_jobs      PROTO((int, char **));
+int pulse           PROTO((int, char **));
+int showtask        PROTO((int, char **));
+int status_sys      PROTO((int, char **));
+int kill_job        PROTO((int, char **));
+int delete_job      PROTO((int, char **));
+int verbose         PROTO((int, char **));
+int version         PROTO((int, char **));
+int ipptool2book    PROTO((int, char **));
+
+static Command cmds[] = {  
+  {"active",     task_active,  	"set the active state of a task"},
+  {"command",    task_command, 	"define executed command for a task"},
+  {"controller", controller,   	"controller commands"},
+  {"delete",     delete_job,   	"delete job"},
+  {"halt",       halt,         	"halt the scheduler (no job harvesting)"},
+  {"host",       task_host,    	"define host machine for a task"},
+  {"ipptool2book", ipptool2book, "convert queue with ipptool output to book"},
+  {"kill",       kill_job,     	"kill job"},
+  {"nmax",       task_nmax,    	"define maximum number of jobs for a task"},
+  {"npending",   task_npending, "define maximum number of outstanding jobs for a task"},
+  {"options",    task_options, 	"define optional variables associated with the job task"},
+  {"periods",    task_periods, 	"define time scales for a task"},
+  {"pulse",      pulse,        	"set the scheduler update period"},
+  {"run",        run,          	"run the scheduler"},
+  {"flush",      flush_jobs,    "flush all jobs from the queue"},
+  {"showtask",   showtask,   	"list a task"},
+  {"status",     status_sys,   	"get system or task status"},
+  {"stderr",     task_stderr,  	"define a file for the job stderr dump"},
+  {"stdout",     task_stdout,  	"define a file for the job stdout dump"},
+  {"stop",       stop,         	"stop the scheduler (continue job harvesting)"},
+  {"task",       task,         	"define a schedulable task"},
+  {"task.exec",  task_macros,  	"define pre-exec macro for a task"},
+  {"task.exit",  task_macros,  	"define exit macros for a task"},
+  {"trange",     task_trange,  	"define valid/invalid time periods for a task"},
+  {"verbose",    verbose,      	"set/toggle verbose mode"},
+  {"version",    version,      	"show version information"},
+}; 
+
+void InitPantasks () {
+  
+  int i;
+
+  InitTasks ();
+  InitJobs ();
+  InitJobIDs ();
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/init_client.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/init_client.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/init_client.c	(revision 15879)
@@ -0,0 +1,23 @@
+# include "pantasks.h"
+
+int invalid         PROTO((int, char **));
+
+/* we list here commands which are not valid for the client, 
+   but represent valid pantasks commands.  these are caught 
+   by the client and sent to the 'invalid' function */
+
+static Command cmds[] = {  
+  {"task",       invalid,  "define a schedulable task"},
+  {"task.exit",  invalid,  "define exit macros for a task"},
+  {"task.exec",  invalid,  "define pre-exec macro for a task"},
+}; 
+
+void InitPantasksClient () {
+  
+  int i;
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/init_server.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/init_server.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/init_server.c	(revision 15879)
@@ -0,0 +1,65 @@
+# include "pantasks.h"
+
+int controller      PROTO((int, char **));
+int task	    PROTO((int, char **));
+int task_host	    PROTO((int, char **));
+int task_nmax	    PROTO((int, char **));
+int task_npending   PROTO((int, char **));
+int task_active	    PROTO((int, char **));
+int task_trange	    PROTO((int, char **));
+int task_macros	    PROTO((int, char **));
+int task_command    PROTO((int, char **));
+int task_options    PROTO((int, char **));
+int task_periods    PROTO((int, char **));
+int task_stdout     PROTO((int, char **));
+int task_stderr     PROTO((int, char **));
+int pulse           PROTO((int, char **));
+int flush_jobs      PROTO((int, char **));
+int status_server   PROTO((int, char **));
+int showtask        PROTO((int, char **));
+int kill_job        PROTO((int, char **));
+int delete_job      PROTO((int, char **));
+int verbose         PROTO((int, char **));
+int version         PROTO((int, char **));
+int server          PROTO((int, char **));
+int ipptool2book    PROTO((int, char **));
+
+static Command cmds[] = {  
+  {"active",     task_active,  	"set the active state of a task"},
+  {"command",    task_command, 	"define executed command for a task"},
+  {"controller", controller,   	"controller commands"},
+  {"delete",     delete_job,   	"delete job"},
+  {"host",       task_host,    	"define host machine for a task"},
+  {"ipptool2book", ipptool2book, "convert queue with ipptool output to book"},
+  {"kill",       kill_job,     	"kill job"},
+  {"nmax",       task_nmax,    	"define maximum number of jobs for a task"},
+  {"options",    task_options, "define optional variables associated with the job task"},
+  {"npending",   task_npending, "define maximum number of outstanding jobs for a task"},
+  {"periods",    task_periods, 	"define time scales for a task"},
+  {"pulse",      pulse,        	"set the scheduler update period"},
+  {"flush",      flush_jobs,    "flush all jobs from the queue"},
+  {"server",     server,       	"server-specific commands"},
+  {"showtask",   showtask,   	"list a task"},
+  {"status",     status_server, "get system status"},
+  {"stderr",     task_stderr,  	"define a file for the job stderr dump"},
+  {"stdout",     task_stdout,  	"define a file for the job stdout dump"},
+  {"task",       task,         	"define a schedulable task"},
+  {"task.exec",  task_macros,  	"define pre-exec macro for a task"},
+  {"task.exit",  task_macros,  	"define exit macros for a task"},
+  {"trange",     task_trange,  	"define valid/invalid time periods for a task"},
+  {"verbose",    verbose,      	"set/toggle verbose mode"},
+  {"version",    version,      	"show version information"},
+}; 
+
+void InitPantasksServer () {
+  
+  int i;
+
+  InitTasks ();
+  InitJobs ();
+  InitJobIDs ();
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/input_threads.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/input_threads.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/input_threads.c	(revision 15879)
@@ -0,0 +1,43 @@
+# include "pantasks.h"
+
+/** things related to CheckInputs **/
+
+static int CheckInputsRun = TRUE;
+
+void CheckInputsSetState (int state) {
+  CheckInputsRun = state;
+}
+int CheckInputsGetState () {
+  return (CheckInputsRun);
+}
+
+void *CheckInputsThread (void *data) {
+
+  char log_stdout[128], log_stderr[128];
+
+  gprintInit ();  // each thread needs to init the printing system
+
+  // define server output log files
+  if (VarConfig ("PANTASKS_SERVER_STDOUT", "%s", log_stdout) != NULL) {
+      gprintSetFileThisThread (GP_LOG, log_stdout);
+  }
+  if (VarConfig ("PANTASKS_SERVER_STDERR", "%s", log_stderr) != NULL) {
+      gprintSetFileThisThread (GP_ERR, log_stderr);
+  }
+
+  while (1) {
+
+    // check for thread suspend
+    if (!CheckInputsRun) {
+      usleep (100000); // idle if thread action is suspended
+      continue;
+    }
+
+    // one run of the task checker
+    SerialThreadLock ();
+    CheckInputs ();
+    SerialThreadUnlock ();
+    if (VerboseMode() == 2) fprintf (stderr, "I");
+    usleep (10000); // allow other threads a chance to run
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/invalid.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/invalid.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/invalid.c	(revision 15879)
@@ -0,0 +1,8 @@
+# include "pantasks.h"
+
+int invalid (int argc, char **argv) {
+
+  gprint (GP_ERR, "%s is not valid for the pantasks client\n", argv[0]);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/ipptool2book.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/ipptool2book.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/ipptool2book.c	(revision 15879)
@@ -0,0 +1,239 @@
+# include "pantasks.h"
+
+# define FREEKEYS \
+  if (keys) { for (i = 0; i < Nkeys; i++) { free (keys[i]); } free (keys); } \
+  for (i = 0; i < setWordN; i++) { free (setWordList[i]); free (setWordValue[i]); } \
+  free (setWordValue); free (setWordList);
+
+// convert the named queue with ipptool metadata output into book format
+int ipptool2book (int argc, char **argv) {
+
+  int i, N, onPage, found, Unique, Nkeys, NKEYS;
+  char *line, *tmpword, *tmpvalue;
+  char pagename[512], *bookName, **keys, *p, *q;
+  char **setWordList;
+  char **setWordValue;
+  int setWordN, setWordNalloc;
+
+  Page *page = NULL;
+  Book *book = NULL;
+  Queue *queue = NULL;
+
+  /* supply additional constant words */
+  setWordN = 0;
+  setWordNalloc = 10;
+  ALLOCATE (setWordList, char *, setWordNalloc);
+  ALLOCATE (setWordValue, char *, setWordNalloc);
+  while ((N = get_argument (argc, argv, "-setword"))) {
+    remove_argument (N, &argc, argv);
+    setWordList[setWordN] = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    setWordValue[setWordN] = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    setWordN ++;
+    if (setWordN >= setWordNalloc) {
+      setWordNalloc += 10;
+      REALLOCATE (setWordList, char *, setWordNalloc);
+      REALLOCATE (setWordValue, char *, setWordNalloc);
+    }      
+  }
+
+  Unique = FALSE;
+  if ((N = get_argument (argc, argv, "-uniq"))) {
+    remove_argument (N, &argc, argv);
+    Unique = TRUE;
+  }
+
+  Nkeys = 0;
+  keys = NULL;
+  if ((N = get_argument (argc, argv, "-key"))) {
+    remove_argument (N, &argc, argv);
+
+    /* parse the key (word:word:word) into constituents */
+    NKEYS = 10;
+    ALLOCATE (keys, char *, NKEYS);
+    
+    p = q = argv[N];
+    while (q != NULL) {
+      q = strchr (p, ':');
+      keys[Nkeys] = (q == NULL) ? strcreate (p) : strncreate (p, q - p);
+      p = q + 1;
+      Nkeys ++;
+      CHECK_REALLOCATE (keys, char *, NKEYS, Nkeys, 10);
+    }
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 3) {
+    gprint (GP_ERR, "USAGE: ipptool2book (queue) (book) [-uniq] [-key key[:key..]]\n");
+    FREEKEYS;
+    return (FALSE);
+  }
+
+  queue = FindQueue (argv[1]);
+  if (queue == NULL) {
+    gprint (GP_ERR, "queue %s not found\n", argv[1]);
+    FREEKEYS;
+    return (FALSE);
+  }
+    
+  book = CreateBook (argv[2]);
+
+  /* the first non-whitespace line of the queue should contain:
+     BookName MULTI
+  */
+
+  /* scan for first non-emtpy line */
+  while (TRUE) {
+    line = PopQueue (queue);
+    if (!line) {
+      FREEKEYS;
+      return (TRUE); // no output in queue - not an error?
+    }
+    if (*line) break;
+    free (line);
+  }
+  bookName = thisword (line);
+  tmpword = nextword (line);
+
+  if (strcmp(tmpword, "MULTI")) {
+    gprint (GP_ERR, "ERROR: missing metadata output name on first line\n");
+    free (bookName);
+    free (line);
+    FREEKEYS;
+    return FALSE;
+  }
+  if (strcmp(bookName, argv[2])) {
+    gprint (GP_ERR, "WARNING: metadata output name %s does not match expected bookname %s\n", bookName, argv[2]);
+  }
+  free (line);
+  
+  onPage = FALSE;
+  while (TRUE) {
+    line = PopQueue (queue);
+    if (!line) {
+      free (bookName);
+      if (onPage) {
+	gprint (GP_ERR, "ERROR: unterminated metadata\n");
+	FREEKEYS;
+	return (FALSE);
+      }
+      FREEKEYS;
+      return (TRUE);
+    }
+    if (!*line) {
+      free (line);
+      continue;
+    }
+    
+    tmpword = thisword (line);
+    if (tmpword == NULL) abort(); // should not happen if line exists
+
+    if (!onPage) {
+      if (strcmp(tmpword, bookName)) {
+	gprint (GP_ERR, "ERROR: unexpected metadata name %s\n", tmpword);
+	free (line);
+	free (tmpword);
+	free (bookName);
+	FREEKEYS;
+	return (FALSE);
+      }
+      free (tmpword);
+      tmpword = thisword (nextword (line));
+      if (strcmp(tmpword, "METADATA")) {
+	gprint (GP_ERR, "ERROR: missing METADATA tag\n");
+	free (line);
+	free (tmpword);
+	free (bookName);
+	FREEKEYS;
+	return FALSE;
+      }
+      onPage = TRUE;
+      // we don't know the page name until we load its data?
+      sprintf (pagename, "page.%03d", book[0].Npages);
+      page = CreatePage (book, pagename);
+      free (line);
+      free (tmpword);
+      continue;
+    } 
+
+    /* close out the page */
+    if (!strcmp(tmpword, "END")) {
+      // XXX set the page name based on the contents
+      free (tmpword);
+      free (line);
+
+      if (keys) {
+	memset (pagename, 0, 512);
+	for (i = 0; i < Nkeys; i++) {
+	  tmpword = BookGetWord (page, keys[i]);
+	  if (tmpword == NULL) {
+	    gprint (GP_ERR, "ERROR: missing key %s for ID\n", keys[i]);
+	    FREEKEYS;
+	    return (FALSE);
+	  }
+	  if (i > 0) strcat (pagename, ":");
+	  strcat (pagename, tmpword);
+	}
+	free (page[0].name);
+	page[0].name = strcreate (pagename);
+      }
+
+      // add the fixed words to the page
+      for (i = 0; i < setWordN; i++) {
+	BookSetWord (page, setWordList[i], setWordValue[i]);
+      }
+
+      if (Unique) {
+	/* search for an existing page with this name
+	   delete this one if one is found */
+	/* XXX don't attach this page to the book until this step is passed */	
+
+	found = FALSE;
+	for (i = 0; !found && (i < book[0].Npages); i++) {
+	  if (book[0].pages[i] == page) continue;
+	  if (!strcmp (book[0].pages[i][0].name, page[0].name)) {
+	    found = TRUE;
+	  }
+	}
+	if (found) {
+	  DeletePage (book, page);
+	}
+      }
+
+      onPage = FALSE;
+      continue;
+    }
+
+    tmpvalue = thisword (nextword(nextword(line)));
+    if (tmpvalue == NULL) {
+      gprint (GP_ERR, "ERROR: missing value for %s\n", tmpword);
+      free (tmpword);
+      free (line);
+      free (bookName);
+      FREEKEYS;
+      return (FALSE);
+    }
+    BookSetWord (page, tmpword, tmpvalue);
+    free (tmpword);
+    free (tmpvalue);
+    free (line);
+  }    
+  FREEKEYS;
+  return (FALSE);
+}
+
+/* scan through the queue lines.  these should look like:  
+
+bookName METADATA
+key type value
+key type value
+...
+END
+
+bookName METADATA
+key type value
+key type value
+...
+END
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/job.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/job.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/job.c	(revision 15879)
@@ -0,0 +1,68 @@
+# include "pantasks.h"
+
+/* this will require a bit of care: to define a job, we need
+   to specify:
+   - the command 
+     this is defined in the job command: job argv0 argv1 argv2...
+   - timeout (an option to the command)
+   - exit macros?
+     do nothing by default?
+   - stderr / stdout disposal?
+     save in a specific buffer by default?
+     send to a file?
+
+   the command can look just like the controller equivalent one:
+   job [-host host] [-timeout timeout] args...
+
+*/
+
+int job (int argc, char **argv) {
+
+  char *Host, **targv;
+  int i, N, Mode, targc, Timeout;
+  IDtype JobID;
+
+  Host = NULL;
+  Mode = PCONTROL_JOB_ANYHOST;
+  if ((N = get_argument (argc, argv, "-host"))) {
+    remove_argument (N, &argc, argv);
+    Host = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    Mode = PCONTROL_JOB_WANTHOST;
+  }
+  if ((N = get_argument (argc, argv, "+host"))) {
+    if (Mode == PCONTROL_JOB_WANTHOST) {
+      gprint (GP_ERR, "ERROR: -host and +host are incompatible\n");
+      FREE (Host);
+      return (FALSE);
+    }
+    remove_argument (N, &argc, argv);
+    Host = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    Mode = PCONTROL_JOB_NEEDHOST;
+  }
+  if (Host == NULL) Host = strcreate ("anyhost");
+ 
+  Timeout = 100;
+  if ((N = get_argument (argc, argv, "-timeout"))) {
+    remove_argument (N, &argc, argv);
+    Timeout = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: job [options] (arg0) (arg1) ... (argN)\n");
+    FREE (Host);
+    return (FALSE);
+  }
+  
+  targc = argc - 1;
+  ALLOCATE (targv, char *, targc);
+  for (i = 1; i < argc; i++) {
+    targv[i-1] = strcreate (argv[i]);
+  }
+
+  JobID = AddJob (Host, Mode, Timeout, targc, targv);
+  gprint (GP_LOG, "JobID: %d\n", JobID);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/job_threads.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/job_threads.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/job_threads.c	(revision 15879)
@@ -0,0 +1,48 @@
+# include "pantasks.h"
+
+/** things related to CheckJobs **/
+
+static int CheckJobsRun = FALSE;
+
+void CheckJobsSetState (int state) {
+  CheckJobsRun = state;
+}
+int CheckJobsGetState () {
+  return (CheckJobsRun);
+}
+
+void *CheckJobsThread (void *data) {
+
+  char log_stdout[128], log_stderr[128];
+  float next_timeout;
+
+  gprintInit ();  // each thread needs to init the printing system
+
+  // define server output log files
+  if (VarConfig ("PANTASKS_SERVER_STDOUT", "%s", log_stdout) != NULL) {
+      gprintSetFileThisThread (GP_LOG, log_stdout);
+  }
+  if (VarConfig ("PANTASKS_SERVER_STDERR", "%s", log_stderr) != NULL) {
+      gprintSetFileThisThread (GP_ERR, log_stderr);
+  }
+
+  while (1) {
+
+    // check for thread suspend
+    if (!CheckJobsRun) {
+      usleep (100000); // idle if thread action is suspended
+      continue;
+    }
+
+    // one run of the task checker
+    SerialThreadLock ();
+    next_timeout = CheckJobs ();
+    SerialThreadUnlock ();
+    if (VerboseMode() == 2) fprintf (stderr, "J");
+
+    next_timeout = MIN (next_timeout, 0.1);
+    if (next_timeout > 0.001) {
+      usleep ((int)(1000000*next_timeout)); // allow other threads a chance to run
+    }      
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/kill.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/kill.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/kill.c	(revision 15879)
@@ -0,0 +1,36 @@
+# include "pantasks.h"
+
+int kill_job (int argc, char **argv) {
+
+  Job *job;
+  int JobID;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: kill (JobID)\n");
+    return (FALSE);
+  }
+  JobID = atoi (argv[1]);
+
+  job = FindJob (JobID);
+  if (job == NULL) {
+    gprint (GP_LOG, "job not found\n");
+    return (TRUE);
+  }
+
+  if (job[0].mode == JOB_LOCAL) {
+    if (!KillLocalJob (job)) {
+      job[0].state = JOB_HUNG;
+      if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", job[0].pid);
+      return (FALSE);
+    }
+  } else {
+    if (!KillControllerJob (job)) {
+      job[0].state = JOB_HUNG;
+      if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", job[0].pid);
+      return (FALSE);
+    }
+  }    
+  DeleteJob (job);
+  gprint (GP_LOG, "job removed\n");
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/notes.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/notes.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/notes.txt	(revision 15879)
@@ -0,0 +1,36 @@
+
+PanTasks Client / Server design
+
+Client
+
+client uses readline to parse the incoming commands commands are only
+validated by the client before being sent to the server:
+
+client loop:
+
+   line = readline ()
+   validate argv[0]
+   send to server
+   wait for response?
+
+Server
+
+Server does not use readline at all.  server has two threads.  first
+thread listens for commands from the clients.  how many clients?  use
+poll to wait for data?  can we manage enough clients with a single
+thread?
+
+the second thread runs the scheduler loop: this is the same background
+check that is being run by the current model on the timeouts.
+
+server loop:
+
+  check socket for new incoming client connection
+  check known clients for new messages
+    execute new command
+    send response to the client
+  run the scheduler for a single loop
+
+client / server communication is modelled after addstar client /
+server?
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pantasks.c.in
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pantasks.c.in	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pantasks.c.in	(revision 15879)
@@ -0,0 +1,88 @@
+# include "pantasks.h"
+
+# define opihi_name "pantasks"
+# define opihi_prompt "pantasks: "
+# define opihi_description "parallel task scheduler\n"
+# define opihi_history ".pantasks"
+# define opihi_rcfile ".pantasksrc"
+
+/* program-dependent initialization */
+void program_init (int *argc, char **argv) {
+  
+  pthread_t jobsThread;
+  pthread_t tasksThread;
+  pthread_t controllerThread;
+
+  auto_break = TRUE;
+
+  /* load the commands used by this implementation */
+  InitBasic ();
+  InitData ();
+  InitPantasks ();
+
+  rl_readline_name = opihi_name;
+  rl_attempted_completion_function = command_completer;
+  rl_event_hook = NULL;
+  rl_set_keyboard_input_timeout (1000); 
+
+  set_str_variable ("HISTORY", opihi_history);
+  set_str_variable ("PROMPT", opihi_prompt);
+  set_str_variable ("RCFILE", opihi_rcfile);
+
+  { 
+    char *helpdir;
+    char *modules;
+    static char *datadir = "@DATADIR@";
+    ALLOCATE (helpdir, char, strlen(datadir) + strlen("/help") + 2);
+    sprintf (helpdir, "%s/help", datadir);
+    set_str_variable ("HELPDIR", helpdir);
+    free (helpdir);
+    ALLOCATE (modules, char, strlen(datadir) + strlen("/modules") + 2);
+    sprintf (modules, "%s/modules", datadir);
+    set_str_variable ("MODULES:0", modules);
+    set_int_variable ("MODULES:n", 1);
+    free (modules);
+  }
+
+  signal (SIGPIPE, gotsignal);
+  signal (SIGTSTP, gotsignal);
+  signal (SIGTTIN, gotsignal);
+
+  /* start up the background threads here */
+  pthread_create (&tasksThread,      NULL, &CheckTasksThread, 	   NULL);
+  pthread_create (&jobsThread,       NULL, &CheckJobsThread, 	   NULL);
+  pthread_create (&controllerThread, NULL, &CheckControllerThread, NULL);
+  return;
+}
+
+/* standard welcome message */
+void welcome () {
+  gprint (GP_LOG, "\n");
+  gprint (GP_LOG, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
+/* add program-dependent exit functions here */
+void cleanup () {
+  QuitKapa ();
+  QuitController ();
+  return;
+}
+
+void gotsignal (int signum) {
+  gprint (GP_ERR, "got signal : %d\n", signum);
+  return;
+}
+
+/* call to opihi shell */
+int main (int argc, char **argv) {
+  int status;
+  status = opihi (argc, argv);
+  exit (status);
+}
+
+/* pantasks runs three (or four) threads:
+   - one thread parses commands from the connected clients
+   - one thread runs the scheduler loop
+   - one thread may run the controller loop independently
+   - the main thread runs readline and accepts user input
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pantasks_client.c.in
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pantasks_client.c.in	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pantasks_client.c.in	(revision 15879)
@@ -0,0 +1,72 @@
+# include "pantasks.h"
+
+# define opihi_name "pantasks client shell"
+# define opihi_prompt "pantasks: "
+# define opihi_description "parallel task scheduler\n"
+# define opihi_history ".pantasks"
+# define opihi_rcfile ".pantasksrc"
+
+/* program-dependent initialization */
+void program_init (int *argc, char **argv) {
+  
+  auto_break = TRUE;
+
+  /* load the commands used by this implementation */
+  InitBasic ();
+  InitData ();
+  InitAstro ();
+  InitPantasksClient ();
+
+  rl_readline_name = opihi_name;
+  rl_attempted_completion_function = command_completer;
+
+  set_str_variable ("HISTORY", opihi_history);
+  set_str_variable ("PROMPT", opihi_prompt);
+  set_str_variable ("RCFILE", opihi_rcfile);
+
+  {
+      char *helpdir;
+      char *modules;
+      static char *datadir = "@DATADIR@";
+      ALLOCATE (helpdir, char, strlen(datadir) + strlen("/help") + 2);
+      sprintf (helpdir, "%s/help", datadir);
+      set_str_variable ("HELPDIR", helpdir);
+      free (helpdir);
+      ALLOCATE (modules, char, strlen(datadir) + strlen("/modules") + 2);
+      sprintf (modules, "%s/modules", datadir);
+      set_str_variable ("MODULES:0", modules);
+      set_int_variable ("MODULES:n", 1);
+      free (modules);
+  }
+
+  signal (SIGPIPE, gotsignal);
+  signal (SIGTSTP, gotsignal);
+  signal (SIGTTIN, gotsignal);
+  return;
+}
+
+/* standard welcome message */
+void welcome () {
+  gprint (GP_LOG, "\n");
+  gprint (GP_LOG, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
+/* add program-dependent exit functions here */
+void cleanup () {
+  QuitKapa ();
+  return;
+}
+
+/* default signal handling */
+void gotsignal (int signum) {
+  gprint (GP_ERR, "got signal : %d\n", signum);
+  return;
+}
+
+/* call to client_shell: this opihi tool uses a slightly different
+   shell function from the standard tools */
+int main (int argc, char **argv) {
+  int status;
+  status = client_shell (argc, argv);
+  exit (status);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pantasks_server.c.in
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pantasks_server.c.in	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pantasks_server.c.in	(revision 15879)
@@ -0,0 +1,108 @@
+# include "pantasks.h"
+
+/* pantasks-server is not a readline program.
+   it runs three (or four) threads:
+   - one thread listens on the socket for incomming connections 
+     and performs client validation
+   - one thread parses commands from the connected clients
+   - one thread runs the scheduler loop
+   - one thread may run the controller loop independently
+   
+   * note: the client shell traps certain commands and performs them
+   locally. at a minimum: help.  perhaps: input, other I/O commands?
+*/
+
+/* program-dependent initialization */
+int main (int argc, char **argv) {
+  
+  char log_stdout[128], log_stderr[128];
+  pthread_t jobsThread;
+  pthread_t tasksThread;
+  pthread_t inputsThread;
+  pthread_t clientsThread;
+  pthread_t controllerThread;
+  int InitSocket, BindSocket;
+  SockAddress Address;
+
+  general_init (&argc, argv);
+
+  // define server output log files
+  if (VarConfig ("PANTASKS_SERVER_STDOUT", "%s", log_stdout) != NULL) {
+      gprintSetFileThisThread (GP_LOG, log_stdout);
+  }
+  if (VarConfig ("PANTASKS_SERVER_STDERR", "%s", log_stderr) != NULL) {
+      gprintSetFileThisThread (GP_ERR, log_stderr);
+  }
+
+  DefineValidIP ();
+
+  /* XXX not sure what is a good setting for this in the server */
+  auto_break = TRUE;
+
+  /* load the commands used by this implementation */
+  InitBasic ();
+  InitData ();
+  InitPantasksServer ();
+  
+  InitInputs ();
+
+  { 
+    char *modules;
+    static char *datadir = "@DATADIR@";
+    ALLOCATE (modules, char, strlen(datadir) + strlen("/modules") + 2);
+    sprintf (modules, "%s/modules", datadir);
+    set_str_variable ("MODULES:0", modules);
+    set_int_variable ("MODULES:n", 1);
+    free (modules);
+  }
+
+  signal (SIGPIPE, gotsignal);
+  // signal (SIGTSTP, gotsignal);
+  // signal (SIGTTIN, gotsignal);
+  signal (SIGINT, SIG_DFL);
+
+  startup (&argc, argv);
+
+  /* start up the background threads here */
+  pthread_create (&clientsThread,    NULL, &ListenClients,    	   NULL);
+  pthread_create (&tasksThread,      NULL, &CheckTasksThread, 	   NULL);
+  pthread_create (&jobsThread,       NULL, &CheckJobsThread,  	   NULL);
+  pthread_create (&controllerThread, NULL, &CheckControllerThread, NULL);
+  pthread_create (&inputsThread,     NULL, &CheckInputsThread,     NULL);
+
+  /* in this loop, we listen for incoming connections, validate, and
+     pass them to the ListenClient thread */
+
+  /* create the listening socket */
+  InitSocket = InitServerSocket (&Address);
+  
+  InitPassword ();
+
+  while (1) {
+
+    /* wait for clients to make connection */
+    BindSocket = WaitServerSocket (InitSocket, &Address);
+    if (BindSocket == -1) continue;
+
+    /* validate : wait for password */
+    if (!CheckPassword (BindSocket)) continue;
+    
+    AddNewClient (BindSocket);
+  }
+}
+
+/* add program-dependent exit functions here */
+void cleanup () {
+  QuitKapa ();
+  QuitController ();
+  return;
+}
+
+void gotsignal (int signum) {
+  gprint (GP_ERR, "got signal : %d\n", signum);
+  return;
+}
+
+/* these are needed to resolve symbols expected by libshell.so */
+void welcome () { }
+void program_init (int *argc, char **argv) {}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pulse.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pulse.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/pulse.c	(revision 15879)
@@ -0,0 +1,16 @@
+# include "pantasks.h"
+
+int pulse (int argc, char **argv) {
+
+  int Nusec;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: pulse (microseconds)\n");
+    return (FALSE);
+  }
+
+  Nusec = atoi (argv[1]);
+  rl_set_keyboard_input_timeout (Nusec); 
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/run.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/run.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/run.c	(revision 15879)
@@ -0,0 +1,25 @@
+# include "pantasks.h"
+
+// XXX for client/server, we need to simply start or stop the
+// appropriate threads
+// with one thread for each of the major actions, this would
+// make it easy to keep the controller running and stop the 
+// scheduler (don't run CheckTasks, but run everything else 
+// until nothing is left...
+
+int run (int argc, char **argv) {
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: run\n");
+    return (FALSE);
+  }
+
+  CheckTasksSetState (TRUE);
+  CheckControllerSetState (TRUE);
+  CheckJobsSetState (TRUE);
+
+  // InitTaskTimers ();
+  // rl_event_hook = CheckSystem;
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/server.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/server.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/server.c	(revision 15879)
@@ -0,0 +1,72 @@
+# include "pantasks.h"
+
+/* most of these are defined in cmd.basic */
+int quit            PROTO((int, char **));
+int input      	    PROTO((int, char **));
+int module     	    PROTO((int, char **));
+int server_load	    PROTO((int, char **));
+int server_run	    PROTO((int, char **));
+int server_stop	    PROTO((int, char **));
+int server_halt	    PROTO((int, char **));
+int cd              PROTO((int, char **));
+int pwd        	    PROTO((int, char **));
+int output     	    PROTO((int, char **));
+
+CommandF *FindServerCommand (char *cmd);
+
+static Command server_cmds[] = {
+  {"exit",   quit,   "shutdown server"},
+  {"quit",   quit,   "shutdown server"},
+  {"input",  input,  "load input file on server"},
+  {"module", module, "load module file on server"},
+  {"load",   server_load, "load input file on server"},
+  {"run",    server_run,  "run scheduler"},
+  {"stop",   server_stop, "stop scheduler"},
+  {"halt",   server_halt, "halt scheduler"},
+  {"cd",     cd,     "set local directory"},
+  {"pwd",    pwd,    "check local directory"},
+  {"output", output, "set server output destinations"},
+};
+
+int server (int argc, char **argv) {
+
+  int i, N, status;
+  CommandF *func;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: server (command) ... \n");
+    return (FALSE);
+  }
+
+  if (!strcasecmp (argv[1], "help")) {
+    N = sizeof (server_cmds) / sizeof (Command);
+
+    for (i = 0; i < N; i++) {
+      gprint (GP_LOG, "%-15s %s\n", server_cmds[i].name, server_cmds[i].help);
+    }
+    return (TRUE);
+  }
+
+  func = FindServerCommand (argv[1]);
+  if (func == NULL) {
+    gprint (GP_ERR, "invalid server command\n");
+    return (FALSE);
+  }
+
+  status = (*func)(argc - 1, argv + 1);
+  return (status);
+}
+
+CommandF *FindServerCommand (char *cmd) {
+
+  int i, N;
+
+  N = sizeof (server_cmds) / sizeof (Command);
+
+  for (i = 0; i < N; i++) {
+    if (!strcmp (server_cmds[i].name, cmd)) {
+      return (server_cmds[i].func);
+    }
+  }
+  return (NULL);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/server_load.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/server_load.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/server_load.c	(revision 15879)
@@ -0,0 +1,18 @@
+# include "pantasks.h"
+
+int server_load (int argc, char **argv) {
+
+  char *input;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: server load (file)\n");
+    return (FALSE);
+  }
+
+  // the allocated input string is eventually freed 
+  // by the InputQueue system
+  input = strcreate (argv[1]);
+  AddNewInput (input);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/server_run.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/server_run.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/server_run.c	(revision 15879)
@@ -0,0 +1,43 @@
+# include "pantasks.h"
+
+int server_run (int argc, char **argv) {
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: server run\n");
+    return (FALSE);
+  }
+
+  CheckTasksSetState (TRUE);
+  CheckJobsSetState (TRUE);
+  CheckControllerSetState (TRUE);
+  CheckInputsSetState (TRUE);
+  return (TRUE);
+}
+
+int server_stop (int argc, char **argv) {
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: server stop\n");
+    return (FALSE);
+  }
+
+  CheckTasksSetState (FALSE);
+  // CheckJobsSetState (FALSE);
+  // CheckControllerSetState (FALSE);
+  CheckInputsSetState (FALSE);
+  return (TRUE);
+}
+
+int server_halt (int argc, char **argv) {
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: server halt\n");
+    return (FALSE);
+  }
+
+  CheckTasksSetState (FALSE);
+  CheckJobsSetState (FALSE);
+  CheckControllerSetState (FALSE);
+  CheckInputsSetState (FALSE);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/showtask.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/showtask.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/showtask.c	(revision 15879)
@@ -0,0 +1,12 @@
+# include "pantasks.h"
+
+int showtask (int argc, char **argv) {
+
+  if (argc != 2) {
+    gprint (GP_LOG, "USAGE: showtask (task)\n");
+    return (FALSE);
+  }
+
+  ShowTask (argv[1]);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/status.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/status.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/status.c	(revision 15879)
@@ -0,0 +1,70 @@
+# include "pantasks.h"
+
+int status_sys (int argc, char **argv) {
+
+  int N;
+
+  if (get_argument (argc, argv, "-h")) goto help;
+  if (get_argument (argc, argv, "-help")) goto help;
+  if (get_argument (argc, argv, "--help")) goto help;
+
+  if ((N = get_argument (argc, argv, "-tasks"))) {
+    remove_argument (N, &argc, argv);
+    ListTasks (FALSE);
+    return (TRUE);
+  }
+
+  if ((N = get_argument (argc, argv, "-taskinfo"))) {
+    remove_argument (N, &argc, argv);
+    ListTasks (TRUE);
+    return (TRUE);
+  }
+
+  if ((N = get_argument (argc, argv, "-taskstats"))) {
+    remove_argument (N, &argc, argv);
+    if (argc == 2) {
+      ListTaskStats (argv[N]);
+    } else {
+      ListTaskStats (NULL);
+    }      
+    return (TRUE);
+  }
+
+  if ((N = get_argument (argc, argv, "-taskstatsreset"))) {
+    remove_argument (N, &argc, argv);
+    if (argc == 2) {
+      ResetTaskStats (argv[N]);
+    } else {
+      ResetTaskStats (NULL);
+    }      
+    return (TRUE);
+  }
+
+  gprint (GP_LOG, "\n");
+  if (CheckTasksGetState()) {
+    gprint (GP_LOG, " Scheduler is running\n");
+  } else {
+    if (CheckJobsGetState()) {
+      gprint (GP_LOG, " Scheduler is stopped, harvesting jobs\n");
+    } else {
+      gprint (GP_LOG, " Scheduler is stopped\n");
+    }
+  }
+  if (CheckControllerStatus()) {
+    gprint (GP_LOG, " Controller is running\n");
+  } else {
+    gprint (GP_LOG, " Controller is stopped\n");
+  }
+  ListTasks (FALSE);
+  ListJobs ();
+  return (TRUE);
+
+help:
+  gprint (GP_LOG, "USAGE: status [options]\n");
+  gprint (GP_LOG, "       (without options: over system status)\n");
+  gprint (GP_LOG, "       -tasks     : list defined tasks\n");
+  gprint (GP_LOG, "       -taskinfo  : details for tasks\n");
+  gprint (GP_LOG, "       -taskstats : processing statistics for tasks\n");
+  gprint (GP_LOG, "       -taskstatsreset : reset processing statistics for tasks\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/status_server.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/status_server.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/status_server.c	(revision 15879)
@@ -0,0 +1,59 @@
+# include "pantasks.h"
+
+int status_server (int argc, char **argv) {
+
+  int N;
+
+  if (get_argument (argc, argv, "-h")) goto help;
+  if (get_argument (argc, argv, "-help")) goto help;
+  if (get_argument (argc, argv, "--help")) goto help;
+
+  if ((N = get_argument (argc, argv, "-tasks"))) {
+    remove_argument (N, &argc, argv);
+    ListTasks (FALSE);
+    return (TRUE);
+  }
+
+  if ((N = get_argument (argc, argv, "-taskinfo"))) {
+    remove_argument (N, &argc, argv);
+    ListTasks (TRUE);
+    return (TRUE);
+  }
+
+  if ((N = get_argument (argc, argv, "-taskstats"))) {
+    remove_argument (N, &argc, argv);
+    if (argc == 2) {
+      ListTaskStats (argv[N]);
+    } else {
+      ListTaskStats (NULL);
+    }      
+    return (TRUE);
+  }
+
+  gprint (GP_LOG, "\n");
+  if (CheckTasksGetState()) {
+    gprint (GP_LOG, " Scheduler is running\n");
+  } else {
+    if (CheckJobsGetState()) {
+      gprint (GP_LOG, " Scheduler is stopped, harvesting jobs\n");
+    } else {
+      gprint (GP_LOG, " Scheduler is stopped\n");
+    }
+  }
+  if (CheckControllerStatus()) {
+    gprint (GP_LOG, " Controller is running\n");
+  } else {
+    gprint (GP_LOG, " Controller is stopped\n");
+  }
+  ListTasks (FALSE);
+  ListJobs ();
+  return (TRUE);
+
+help:
+  gprint (GP_LOG, "USAGE: status [options]\n");
+  gprint (GP_LOG, "       (without options: over system status)\n");
+  gprint (GP_LOG, "       -tasks     : list defined tasks\n");
+  gprint (GP_LOG, "       -taskinfo  : details for tasks\n");
+  gprint (GP_LOG, "       -taskstats : processing statistics for tasks\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/stop.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/stop.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/stop.c	(revision 15879)
@@ -0,0 +1,29 @@
+# include "pantasks.h"
+
+int stop (int argc, char **argv) {
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: stop\n");
+    return (FALSE);
+  }
+
+  CheckTasksSetState (FALSE);
+  // CheckControllerSetState (FALSE);
+  // CheckJobsSetState (FALSE);
+
+  return (TRUE);
+}
+
+int halt (int argc, char **argv) {
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: halt\n");
+    return (FALSE);
+  }
+
+  CheckTasksSetState (FALSE);
+  CheckControllerSetState (FALSE);
+  CheckJobsSetState (FALSE);
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task.c	(revision 15879)
@@ -0,0 +1,100 @@
+# include "pantasks.h"
+# define prompt "> "
+
+int task (int argc, char **argv) {
+
+  int hash;
+  int ThisList, status;
+  char *input, *outline;
+  Task *task;
+
+  if (argc != 2) goto usage;
+
+  task = FindTask (argv[1]);
+  if (task == NULL) { /**** new task ****/
+    task = CreateTask (argv[1]);
+  } else {
+    RemoveTask (task);
+    SetNewTask (task);
+  }
+  /* While a task is being defined, it is removed from the task list.  The new task is added to the task list
+     when the definition process is complete.  
+     XXX If an outstanding job has a task deleted, it will not be able to complete... */
+
+  /* read in task from appropriate source (keyboard or list) until end */
+
+  /* allowed tokens: command, host, stderr, periods, trange, nmax, task.exit, task.exec, end */
+
+  ThisList = current_list_depth();
+  while (1) {
+
+    /* get the next line (from correct place) */
+    if (ThisList == 0) 
+      input = readline (prompt);
+    else 
+      input = get_next_listentry (ThisList);
+
+    if ((ThisList == 0) && (input == (char *) NULL)) {
+      gprint (GP_ERR, "end task with 'END'\n");
+      continue;
+    }
+    if ((ThisList > 0) && (input == (char *) NULL)) {
+      gprint (GP_ERR, "missing 'END' in task definition\n");
+      input = strcreate ("end");
+    }
+    if (ThisList == 0) ohana_memregister (input);
+
+    stripwhite (input);
+    hash = TaskHash (input);
+    switch (hash) {
+
+      case TASK_EMPTY:
+      case TASK_COMMENT:
+	free (input);
+	break;
+
+      case TASK_END:
+	/* I need to add in a test here to see if all task elements 
+	   have been defined.  delete the task if not */
+	free (input);
+	/* validate the new task: all mandatory elements defined? */ 
+	if (!ValidateTask (task, FALSE)) {
+	  DeleteNewTask ();
+	  return (FALSE);
+	}
+	RegisterNewTask ();
+	return (TRUE);
+	break;
+
+      case TASK_TRANGE:
+      case TASK_NMAX:
+      case TASK_HOST:
+      case TASK_EXIT:
+      case TASK_EXEC:
+      case TASK_STDOUT:
+      case TASK_STDERR:
+      case TASK_COMMAND:
+      case TASK_OPTIONS:
+      case TASK_PERIODS:
+      case TASK_NPENDING:
+      case TASK_ACTIVE:
+	status = command (input, &outline, TRUE);
+	if (outline != NULL) free (outline);
+	/* what to do if command is invalid?
+	   if (!status) return (FALSE); */
+	break;
+
+      case TASK_NONE:
+	gprint (GP_ERR, "unknown task command %s\n", input);
+	break;
+    }
+  }
+
+usage:
+  gprint (GP_ERR, "USAGE: task -list\n");
+  gprint (GP_ERR, "USAGE: task -longlist\n");
+  gprint (GP_ERR, "USAGE: task -show (task)\n");
+  gprint (GP_ERR, "USAGE: task <name>\n");
+  gprint (GP_ERR, "  (enter commands & task functions; end with the word 'END')\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_active.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_active.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_active.c	(revision 15879)
@@ -0,0 +1,30 @@
+# include "pantasks.h"
+
+int task_active (int argc, char **argv) {
+
+  Task *task;
+
+  if (argc != 2) goto usage;
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    gprint (GP_ERR, "ERROR: not defining or running a task\n");
+    return (FALSE);
+  }
+
+  if (!strcasecmp (argv[1], "true")) {
+    task[0].active = TRUE;
+    return (TRUE);
+  }
+  if (!strcasecmp (argv[1], "false")) {
+    task[0].active = FALSE;
+    return (TRUE);
+  }
+
+  gprint (GP_ERR, "ERROR: invalid option: %s\n", argv[1]);
+  return (FALSE);
+
+usage:
+  gprint (GP_ERR, "USAGE: active (true|false)\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_command.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_command.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_command.c	(revision 15879)
@@ -0,0 +1,38 @@
+# include "pantasks.h"
+
+int task_command (int argc, char **argv) {
+
+  int i;
+  Task *task;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: command <command> <arg>. ..\n");
+    gprint (GP_ERR, "  (define command for this task)\n");
+    return (FALSE);
+  }
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    task = GetActiveTask ();
+    if (task == NULL) {
+      gprint (GP_ERR, "ERROR: not defining or running a task\n");
+      return (FALSE);
+    }
+  }
+
+  /* free existing memory used by argv */
+  if (task[0].argc != 0) {
+    for (i = 0; i < task[0].argc; i++) {
+      if (task[0].argv[i] != NULL) free (task[0].argv[i]);
+    }
+    free (task[0].argv);
+  }
+
+  /* create new memory for argv */
+  task[0].argc = argc - 1;
+  ALLOCATE (task[0].argv, char *, MAX (task[0].argc, 1));
+  for (i = 0; i < task[0].argc; i++) {
+    task[0].argv[i] = strcreate (argv[i+1]);
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_host.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_host.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_host.c	(revision 15879)
@@ -0,0 +1,42 @@
+# include "pantasks.h"
+
+int task_host (int argc, char **argv) {
+
+  int N, RequiredHost;
+  Task *task;
+
+  RequiredHost = FALSE;
+  if ((N = get_argument (argc, argv, "-required"))) {
+    remove_argument (N, &argc, argv);
+    RequiredHost = TRUE;
+  }
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: host <name> [-required]\n");
+    gprint (GP_ERR, "  define host machine for this task\n");
+    gprint (GP_ERR, "  -required flags indicates controller must use this host\n");
+    gprint (GP_ERR, "  value of 'local' for host indicates process not using controller\n");
+    gprint (GP_ERR, "  value of 'anyhost' for host indicates controller may assign at will\n");
+    return (FALSE);
+  }
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    task = GetActiveTask ();
+    if (task == NULL) {
+      gprint (GP_ERR, "ERROR: not defining or running a task\n");
+      return (FALSE);
+    }
+  }
+  task[0].host_required = RequiredHost;
+
+  if (task[0].host != NULL) free (task[0].host);
+  task[0].host = NULL;
+
+  if (!strcasecmp (argv[1], "LOCAL")) return (TRUE);
+
+  task[0].host = strcreate (argv[1]);
+  return (TRUE);
+}
+
+/* apparently, local is the default! */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_macros.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_macros.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_macros.c	(revision 15879)
@@ -0,0 +1,151 @@
+# include "pantasks.h"
+# define D_NLINES 100
+# define prompt "> "
+
+int task_macros (int argc, char **argv) {
+
+  int i, N, NLINES, done, depth, ThisList;
+  char *input;
+  Macro *macro;
+  Task *task;
+
+  if (!strcmp (argv[0], "task.exec") && (argc != 1)) {
+    gprint (GP_ERR, "USAGE: task.exec\n");
+    gprint (GP_ERR, "  (define pre-exec macro for this task)\n");
+    return (FALSE);
+  }
+
+  if (!strcmp (argv[0], "task.exit") && (argc != 2)) {
+    gprint (GP_ERR, "USAGE: task.exit (state)\n");
+    gprint (GP_ERR, "  (define exit state macro for this task)\n");
+    return (FALSE);
+  }
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    gprint (GP_ERR, "ERROR: not defining or running a task\n");
+    return (FALSE);
+  }
+
+  macro = NULL;
+
+  /*** identify which Macro in Task this particular macro goes with ***/ 
+  if (!strcmp (argv[0], "task.exec")) {
+    if (task[0].exec != NULL) {
+      FreeMacro (task[0].exec);
+      free (task[0].exec);
+    }
+    ALLOCATE (task[0].exec, Macro, 1);
+    macro = task[0].exec;
+    macro[0].name = strcreate ("exec");
+    goto found;
+  }
+  if (!strcmp (argv[0], "task.exit") && !strcmp (argv[1], "timeout")) {
+    if (task[0].timeout != NULL) {
+      FreeMacro (task[0].timeout);
+      free (task[0].timeout);
+    }
+    ALLOCATE (task[0].timeout, Macro, 1);
+    macro = task[0].timeout;
+    macro[0].name = strcreate ("timeout");
+    goto found;
+  }
+  if (!strcmp (argv[0], "task.exit") && !strcmp (argv[1], "crash")) {
+    if (task[0].crash != NULL) {
+      FreeMacro (task[0].crash);
+      free (task[0].crash);
+    }
+    ALLOCATE (task[0].crash, Macro, 1);
+    macro = task[0].crash;
+    macro[0].name = strcreate ("crash");
+    goto found;
+  }
+  if (!strcmp (argv[0], "task.exit") && !strcmp (argv[1], "default")) {
+    if (task[0].defexit != NULL) {
+      FreeMacro (task[0].defexit);
+      free (task[0].defexit);
+    }
+    ALLOCATE (task[0].defexit, Macro, 1);
+    macro = task[0].defexit;
+    macro[0].name = strcreate ("default");
+    goto found;
+  }
+  if (!strcmp (argv[0], "task.exit")) {	/* generic exit function */
+    for (i = 0; i < task[0].Nexit; i++) { /* find exiting exit function with same name */
+      if (!strcmp (task[0].exit[i][0].name, argv[1])) {	/*** replace this one ***/
+	FreeMacro (task[0].exit[i]);
+	free (task[0].exit[i]);
+	ALLOCATE (task[0].exit[i], Macro, 1);
+	macro = task[0].exit[i];
+	macro[0].name = strcreate (argv[1]);
+	goto found;
+      }
+    }
+    /** create a new exit status macro **/
+    N = task[0].Nexit;
+    ALLOCATE (task[0].exit[N], Macro, 1);
+    task[0].Nexit ++;
+    if (task[0].Nexit == task[0].NEXIT) {
+      task[0].NEXIT += 10;
+      REALLOCATE (task[0].exit, Macro *, task[0].NEXIT);
+    }
+    macro = task[0].exit[N];
+    macro[0].name = strcreate (argv[1]);
+    goto found;
+  }
+
+found:
+
+  macro[0].Nlines = 0;
+  NLINES = D_NLINES;
+  ALLOCATE (macro[0].line, char *, NLINES);
+
+  /* load macro lines from appropriate source (readline / list) */
+
+  depth = 0;
+  done = FALSE;
+  ThisList = current_list_depth();
+  while (!done) {
+
+    /* get the next line (from correct place) */
+    if (ThisList == 0) 
+      input = readline (prompt);
+    else 
+      input = get_next_listentry (ThisList);
+
+    if ((ThisList == 0) && (input == (char *) NULL)) {
+      gprint (GP_ERR, "end macro with 'END'\n");
+      continue;
+    }
+    if ((ThisList > 0) && (input == (char *) NULL)) {
+      gprint (GP_ERR, "missing 'END' in macro definition\n");
+      input = strcreate ("end");
+    }
+    if (ThisList == 0) ohana_memregister (input);
+
+    stripwhite (input);
+
+    /* test for new macro (or other list, in the future?) */
+    if (is_list (input)) depth ++;
+
+    /* test for end of nested list -- if not nested, END refers to this macro */
+    if (!strncasecmp (input, "END", 3)) {
+      depth --;
+      if (depth < 0) { /* we hit the last "END", macro is done */
+	free (input);
+	REALLOCATE (macro[0].line, char *, MAX (1, macro[0].Nlines));
+	return (TRUE);
+      }
+    }
+
+    if (*input) { 
+      macro[0].line[macro[0].Nlines] = input;
+      macro[0].Nlines ++;
+      if (macro[0].Nlines == NLINES - 1) {
+	NLINES += D_NLINES;
+	REALLOCATE (macro[0].line, char *, NLINES);
+      }
+    }
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_nmax.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_nmax.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_nmax.c	(revision 15879)
@@ -0,0 +1,41 @@
+# include "pantasks.h"
+
+int task_nmax (int argc, char **argv) {
+
+  Task *task;
+
+  if (argc != 2) goto usage;
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    gprint (GP_ERR, "ERROR: not defining or running a task\n");
+    return (FALSE);
+  }
+
+  task[0].Nmax = atoi (argv[1]);
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: nmax N\n");
+  return (FALSE);
+}
+
+int task_npending (int argc, char **argv) {
+
+  Task *task;
+
+  if (argc != 2) goto usage;
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    gprint (GP_ERR, "ERROR: not defining or running a task\n");
+    return (FALSE);
+  }
+
+  task[0].NpendingMax = atoi (argv[1]);
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: npending N\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_options.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_options.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_options.c	(revision 15879)
@@ -0,0 +1,38 @@
+# include "pantasks.h"
+
+int task_options (int argc, char **argv) {
+
+  int i;
+  Task *task;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: options <opt>. ..\n");
+    gprint (GP_ERR, "  (define options for this task)\n");
+    return (FALSE);
+  }
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    task = GetActiveTask ();
+    if (task == NULL) {
+      gprint (GP_ERR, "ERROR: not defining or running a task\n");
+      return (FALSE);
+    }
+  }
+
+  /* free existing memory used by optv */
+  if (task[0].optc != 0) {
+    for (i = 0; i < task[0].optc; i++) {
+      if (task[0].optv[i] != NULL) free (task[0].optv[i]);
+    }
+    free (task[0].optv);
+  }
+
+  /* create new memory for optv */
+  task[0].optc = argc - 1;
+  ALLOCATE (task[0].optv, char *, MAX (task[0].optc, 1));
+  for (i = 0; i < task[0].optc; i++) {
+    task[0].optv[i] = strcreate (argv[i+1]);
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_periods.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_periods.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_periods.c	(revision 15879)
@@ -0,0 +1,56 @@
+# include "pantasks.h"
+
+int task_periods (int argc, char **argv) {
+
+  int N, Poll, Exec, Timeout;
+  float PollValue, ExecValue, TimeoutValue;
+  Task *task;
+
+  PollValue = 0;
+  Poll = FALSE;
+  if ((N = get_argument (argc, argv, "-poll"))) {
+    Poll = TRUE;
+    remove_argument (N, &argc, argv);
+    PollValue = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  ExecValue = 0;
+  Exec = FALSE;
+  if ((N = get_argument (argc, argv, "-exec"))) {
+    Exec = TRUE;
+    remove_argument (N, &argc, argv);
+    ExecValue = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  TimeoutValue = 0;
+  Timeout = FALSE;
+  if ((N = get_argument (argc, argv, "-timeout"))) {
+    Timeout = TRUE;
+    remove_argument (N, &argc, argv);
+    TimeoutValue = atof(argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: periods [-poll value] [-exec value] [-timeout value]\n");
+    gprint (GP_ERR, "  define time periods for this task\n");
+    return (FALSE);
+  }
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    task = GetActiveTask ();
+    if (task == NULL) {
+      gprint (GP_ERR, "ERROR: not defining or running a task\n");
+      return (FALSE);
+    }
+  }
+
+  if (Poll) task[0].poll_period = PollValue;
+  if (Exec) task[0].exec_period = ExecValue;
+  if (Timeout) task[0].timeout_period = TimeoutValue;
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_stdout.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_stdout.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_stdout.c	(revision 15879)
@@ -0,0 +1,49 @@
+# include "pantasks.h"
+
+int task_stdout (int argc, char **argv) {
+
+  Task *task;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: stdout <name>\n");
+    gprint (GP_ERR, "  define dump file for job stdout for this task\n");
+    return (FALSE);
+  }
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    task = GetActiveTask ();
+    if (task == NULL) {
+      gprint (GP_ERR, "ERROR: not defining or running a task\n");
+      return (FALSE);
+    }
+  }
+  if (task[0].stdout_dump != NULL) free (task[0].stdout_dump);
+  task[0].stdout_dump = strcreate (argv[1]);
+  return (TRUE);
+}
+
+int task_stderr (int argc, char **argv) {
+
+  Task *task;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: stderr <name>\n");
+    gprint (GP_ERR, "  define dump file for job stderr for this task\n");
+    return (FALSE);
+  }
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    task = GetActiveTask ();
+    if (task == NULL) {
+      gprint (GP_ERR, "ERROR: not defining or running a task\n");
+      return (FALSE);
+    }
+  }
+  if (task[0].stderr_dump != NULL) free (task[0].stderr_dump);
+  task[0].stderr_dump = strcreate (argv[1]);
+  return (TRUE);
+}
+
+/* apparently, local is the default! */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_threads.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_threads.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_threads.c	(revision 15879)
@@ -0,0 +1,52 @@
+# include "pantasks.h"
+
+/** things related to CheckTasks **/
+
+static int CheckTasksRun = FALSE;
+
+void CheckTasksSetState (int state) {
+  CheckTasksRun = state;
+}
+int CheckTasksGetState () {
+  return (CheckTasksRun);
+}
+
+void *CheckTasksThread (void *data) {
+
+  float next_timeout;
+  char log_stdout[128], log_stderr[128];
+
+  gprintInit ();  // each thread needs to init the printing system
+
+  // define server output log files
+  if (VarConfig ("PANTASKS_SERVER_STDOUT", "%s", log_stdout) != NULL) {
+      gprintSetFileThisThread (GP_LOG, log_stdout);
+  }
+  if (VarConfig ("PANTASKS_SERVER_STDERR", "%s", log_stderr) != NULL) {
+      gprintSetFileThisThread (GP_ERR, log_stderr);
+  }
+
+  while (1) {
+
+    // check for thread suspend
+    if (!CheckTasksRun) {
+      usleep (100000); // idle if thread action is suspended
+      continue;
+    }
+
+    // one run of the task checker
+    SerialThreadLock ();
+    next_timeout = CheckTasks ();
+    SerialThreadUnlock ();
+    if (VerboseMode() == 2) fprintf (stderr, "T");
+
+    next_timeout = MIN (next_timeout, 0.1);
+    if (next_timeout > 0.001) {
+      usleep ((int)(1000000*next_timeout)); // allow other threads a chance to run
+    }      
+  }
+}
+
+// I sleep for a small amount of time here, based on how long until the next expected
+// timeout.  this enforces a certain granularity in the task creation, but prevents the task
+// thread from driving the load up to silly levels.
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_trange.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_trange.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/task_trange.c	(revision 15879)
@@ -0,0 +1,96 @@
+# include "pantasks.h"
+
+int task_trange (int argc, char **argv) {
+
+  int N;
+  Task *task;
+  TimeRange range;
+
+  /* reset the tranges for the current task */
+  if ((N = get_argument (argc, argv, "-reset"))) {
+    remove_argument (N, &argc, argv);
+    if (argc != 1) goto usage;
+
+    task = GetNewTask ();
+    if (task == NULL) {
+      gprint (GP_ERR, "ERROR: not defining or running a task\n");
+      return (FALSE);
+    }
+
+    task[0].Nranges = 0;
+    REALLOCATE (task[0].ranges, TimeRange, 1);
+    return (TRUE);
+  } 
+
+  range.Nmax = 0;
+  range.Nrun = 0;
+  if ((N = get_argument (argc, argv, "-nmax"))) {
+    remove_argument (N, &argc, argv);
+    range.Nmax = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  /* keep = true means the time range defines a valid time range
+     keep = false means the time range defines an invalid range */
+  range.include = TRUE;
+  if ((N = get_argument (argc, argv, "-exclude"))) {
+    remove_argument (N, &argc, argv);
+    range.include = FALSE;
+  }
+
+  if (argc != 3) goto usage;
+
+  task = GetNewTask ();
+  if (task == NULL) {
+    gprint (GP_ERR, "ERROR: not defining or running a task\n");
+    return (FALSE);
+  }
+
+  /* test for Mon[@HH:MM:SS] - both must match */
+  if (day_to_sec (argv[1], &range.start)) {
+    if (!day_to_sec (argv[2], &range.stop)) {
+      gprint (GP_ERR, "invalid day/time %s\n", argv[2]);
+      goto usage;
+    }
+    range.type = RANGE_WEEK;
+    goto valid;
+  }
+
+  /* allow a syntax which means something like "every hour at MM:SS"
+     this could by something like *:MM:SS ? */
+
+  /* test for HH:MM:SS */
+  if (hms_to_sec (argv[1], &range.start)) {
+    if (!hms_to_sec (argv[2], &range.stop)) {
+      gprint (GP_ERR, "invalid time %s\n", argv[2]);
+      goto usage;
+    }
+    range.type = RANGE_DAY;
+    goto valid;
+  }
+
+  /* this test does not fail sufficiently robustly for invalid inputs */
+  /* test for YYYY/MM/DD - both must match */
+  if (ohana_str_to_time (argv[1], &range.start)) {
+    if (!ohana_str_to_time (argv[2], &range.stop)) {
+      gprint (GP_ERR, "invalid date/time %s\n", argv[2]);
+      goto usage;
+    }
+    range.type = RANGE_ABS;
+    goto valid;
+  }
+  goto usage;
+
+valid:
+  N = task[0].Nranges;
+  task[0].Nranges ++;
+  REALLOCATE (task[0].ranges, TimeRange, task[0].Nranges);
+  
+  task[0].ranges[N] = range;
+  return (TRUE);
+
+usage:
+  gprint (GP_ERR, "USAGE: trange start end [-nmax N]\n");
+  gprint (GP_ERR, "USAGE: trange -reset\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/iotest.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/iotest.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/iotest.sh	(revision 15879)
@@ -0,0 +1,57 @@
+
+$BLOCK = 0
+
+macro testloop
+  queuepush stdout start
+  for i 0 5
+    echo $i
+    queueprint stdout
+  end
+end
+
+# a basic task which just runs 'echo foobar'
+task	       basic
+  command      echo foobar
+  host         local
+
+  periods      -poll 0.1
+  periods      -exec 1.0
+  periods      -timeout 20
+  npending 5
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    if ($BLOCK) break
+    queuepush stdout start
+    echo "command start"
+    queuelist
+    queueprint stdout
+    queueinit stdout
+    queuelist
+    echo "command stop"
+  end
+
+  # success
+  task.exit    0
+    $BLOCK = 1
+    echo "exit start"
+    queuelist
+    queueprint stdout
+    queueinit stdout
+    queuelist
+    echo "exit stop"
+    $BLOCK = 0
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "failure: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "timeout"
+  end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/joberror.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/joberror.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/joberror.sh	(revision 15879)
@@ -0,0 +1,29 @@
+
+# a basic task which just runs 'echo'
+task	       basic
+  host         local
+
+  periods      -poll 0.005
+  periods      -exec 0.005
+  periods      -timeout 2
+  command      ls -l /usr/bin /tmp/foobar
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  # success
+  task.exit    0
+    $Npass ++
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $JOB_STATUS"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/load.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/load.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/load.sh	(revision 15879)
@@ -0,0 +1,37 @@
+
+# a basic task which just runs 'sleep'
+task	       newtask
+  # command      sleep 1
+  command      echo hi
+  host         local
+
+  periods      -poll 0.01
+  periods      -exec 0.01
+  periods      -timeout 20
+  npending 5
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    # echo "create command"
+  end
+
+  # success
+  task.exit    0
+    $Npass ++
+    # echo done sleep
+    # status
+    # halt
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local.sh	(revision 15879)
@@ -0,0 +1,78 @@
+
+## a basic test of memory allocation
+
+exec rm -f tmp.txt
+verbose off
+$Npass = 0
+
+# a basic task which just runs 'echo'
+task	       basic
+  command      echo "a test line"
+  host         local
+
+  periods      -poll 0.1
+  periods      -exec 0.2
+  periods      -timeout 2
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  # success
+  task.exit    0
+    $Npass ++
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
+
+macro memcheck.init
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+end
+macro memcheck
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+ # echo growth: {$endmem - $startmem}
+end
+
+macro done
+ stop
+ date -var dtime -seconds -reftime $start
+ if ($VERBOSE > 3)
+  status
+  exec wc -l tmp.txt
+ end
+
+ $answer = `wc -l tmp.txt`
+ list word -split $answer
+ if ($word:0 != $Npass) 
+   echo "missing lines in tmp.txt: $word:0"
+ end
+ if ($Npass/$dtime < 4.2) 
+   echo "tasks running too slow: {$Npass/$dtime}"
+ end
+
+ memcheck
+
+ if ($endmem - $startmem > 10)
+   $PASS = 0
+   echo "failed memcheck"
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+memcheck.init
+echo "starting memcheck"
+echo "wait a few seconds and type 'done'"
+
+run
+date -var start -seconds
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local2.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local2.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local2.sh	(revision 15879)
@@ -0,0 +1,79 @@
+
+## a basic test of memory allocation
+
+exec rm -f tmp.txt
+verbose off
+$Npass = 0
+
+# a basic task which just runs 'echo'
+task	       basic
+  command      echo "a test line"
+  host         local
+
+  periods      -poll 0.1
+  periods      -exec 0.2
+  periods      -timeout 2
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  # success
+  task.exit    0
+    $Npass ++
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
+
+macro memcheck.init
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+end
+macro memcheck
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+ echo growth: {$endmem - $startmem}
+end
+
+macro done
+ stop
+ date -var dtime -seconds -reftime $start
+ if ($VERBOSE > 3)
+  status
+  exec wc -l tmp.txt
+ end
+
+ $answer = `wc -l tmp.txt`
+ list word -split $answer
+ if ($word:0 != $Npass) 
+   echo "missing lines in tmp.txt: $word:0"
+ end
+ if ($Npass/$dtime < 4.2) 
+   echo "tasks running too slow: {$Npass/$dtime}"
+ end
+
+ memcheck
+
+ if ($endmem - $startmem > 30)
+   $PASS = 0
+   echo "failed memcheck"
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+
+memcheck.init
+echo "starting memcheck"
+echo "wait a few seconds and type 'done'"
+
+run
+date -var start -seconds
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local3.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local3.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local3.sh	(revision 15879)
@@ -0,0 +1,88 @@
+
+## a basic test of memory allocation
+
+exec rm -f tmp.txt
+verbose off
+$Npass = 0
+if ($?VERBOSE == 0)
+  $VERBOSE = 4
+end
+
+# a basic task which just runs 'echo'
+task	       basic
+  command      echo "a test line"
+  host         local
+
+  periods      -poll 0.005
+  periods      -exec 0.005
+  periods      -timeout 2
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  # success
+  task.exit    0
+    $Npass ++
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
+
+macro memcheck.init
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+end
+macro memcheck
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+ if ($VERBOSE > 3)
+   echo growth: {$endmem - $startmem}
+ end
+end
+
+macro done
+ stop
+ date -var dtime -seconds -reftime $start
+ if ($VERBOSE > 3)
+  status
+  exec wc -l tmp.txt
+ end
+
+ $answer = `wc -l tmp.txt`
+ list word -split $answer
+ if ($word:0 != $Npass) 
+   echo "missing lines in tmp.txt: $word:0"
+ end
+ if ($VERBOSE > 3)
+   echo "task speed: {$dtime/$Npass} sec/tasks"
+ end
+ ### this test depends on the value of periods -exec above
+ if ($dtime/$Npass > 0.010) 
+   echo "tasks running too slow: {$dtime/$Npass}"
+ end
+
+ memcheck
+
+ if ($endmem - $startmem > 30)
+   $PASS = 0
+   echo "failed memcheck"
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+
+memcheck.init
+echo "starting memcheck"
+echo "wait a few seconds and type 'done'"
+
+run
+date -var start -seconds
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local4.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local4.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local4.sh	(revision 15879)
@@ -0,0 +1,93 @@
+
+## a basic test of memory allocation
+## task.exec test
+
+exec rm -f tmp.txt
+verbose off
+$Npass = 0
+if ($?VERBOSE == 0)
+  $VERBOSE = 4
+end
+
+# a basic task which just runs 'echo'
+task	       basic
+  command      echo "a test line"
+  host         local
+
+  periods      -poll 0.005
+  periods      -exec 0.005
+  periods      -timeout 2
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    $Nrun = 1
+  end
+
+  # success
+  task.exit    0
+    $Npass ++
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
+
+macro memcheck.init
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+end
+macro memcheck
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+ if ($VERBOSE > 3)
+   echo growth: {$endmem - $startmem}
+ end
+end
+
+macro done
+ stop
+ date -var dtime -seconds -reftime $start
+ if ($VERBOSE > 3)
+  status
+  exec wc -l tmp.txt
+ end
+
+ $answer = `wc -l tmp.txt`
+ list word -split $answer
+ if ($word:0 != $Npass) 
+   echo "missing lines in tmp.txt: $word:0"
+ end
+ if ($VERBOSE > 3)
+   echo "task speed: {$dtime/$Npass} sec/tasks"
+ end
+ ### this test depends on the value of periods -exec above
+ if ($dtime/$Npass > 0.010) 
+   echo "tasks running too slow: {$dtime/$Npass}"
+ end
+
+ memcheck
+
+ if ($endmem - $startmem > 30)
+   $PASS = 0
+   echo "failed memcheck"
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+
+memcheck.init
+echo "starting memcheck"
+echo "wait a few seconds and type 'done'"
+
+run
+date -var start -seconds
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local5.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local5.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local5.sh	(revision 15879)
@@ -0,0 +1,93 @@
+
+## a basic test of memory allocation
+## dynamic command
+
+exec rm -f tmp.txt
+verbose off
+$Npass = 0
+if ($?VERBOSE == 0)
+  $VERBOSE = 4
+end
+
+# a basic task which just runs 'echo'
+task	       basic
+  host         local
+
+  periods      -poll 0.005
+  periods      -exec 0.005
+  periods      -timeout 2
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    $Nrun = 1
+    command echo "$Npass : test line"
+  end
+
+  # success
+  task.exit    0
+    $Npass ++
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
+
+macro memcheck.init
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+end
+macro memcheck
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+ if ($VERBOSE > 3)
+   echo growth: {$endmem - $startmem}
+ end
+end
+
+macro done
+ stop
+ date -var dtime -seconds -reftime $start
+ if ($VERBOSE > 3)
+  status
+  exec wc -l tmp.txt
+ end
+
+ $answer = `wc -l tmp.txt`
+ list word -split $answer
+ if ($word:0 != $Npass) 
+   echo "missing lines in tmp.txt: $word:0"
+ end
+ if ($VERBOSE > 3)
+   echo "task speed: {$dtime/$Npass} sec/tasks"
+ end
+ ### this test depends on the value of periods -exec above
+ if ($dtime/$Npass > 0.010) 
+   echo "tasks running too slow: {$dtime/$Npass}"
+ end
+
+ memcheck
+
+ if ($endmem - $startmem > 30)
+   $PASS = 0
+   echo "failed memcheck"
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+
+memcheck.init
+echo "starting memcheck"
+echo "wait a few seconds and type 'done'"
+
+run
+date -var start -seconds
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local6.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local6.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local6.sh	(revision 15879)
@@ -0,0 +1,94 @@
+
+## a basic test of memory allocation
+## test of 'options'
+
+exec rm -f tmp.txt
+verbose off
+$Npass = 0
+if ($?VERBOSE == 0)
+  $VERBOSE = 4
+end
+
+# a basic task which just runs 'echo'
+task	       basic
+  host         local
+
+  periods      -poll 0.005
+  periods      -exec 0.005
+  periods      -timeout 2
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    $Nrun = 1
+    options "test options line"
+    command echo "$Npass : test line"
+  end
+
+  # success
+  task.exit    0
+    $Npass ++
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
+
+macro memcheck.init
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+end
+macro memcheck
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+ if ($VERBOSE > 3)
+   echo growth: {$endmem - $startmem}
+ end
+end
+
+macro done
+ stop
+ date -var dtime -seconds -reftime $start
+ if ($VERBOSE > 3)
+  status
+  exec wc -l tmp.txt
+ end
+
+ $answer = `wc -l tmp.txt`
+ list word -split $answer
+ if ($word:0 != $Npass) 
+   echo "missing lines in tmp.txt: $word:0"
+ end
+ if ($VERBOSE > 3)
+   echo "task speed: {$dtime/$Npass} sec/tasks"
+ end
+ ### this test depends on the value of periods -exec above
+ if ($dtime/$Npass > 0.010) 
+   echo "tasks running too slow: {$dtime/$Npass}"
+ end
+
+ memcheck
+
+ if ($endmem - $startmem > 30)
+   $PASS = 0
+   echo "failed memcheck"
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+
+memcheck.init
+echo "starting memcheck"
+echo "wait a few seconds and type 'done'"
+
+run
+date -var start -seconds
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local7.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local7.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/local7.sh	(revision 15879)
@@ -0,0 +1,127 @@
+
+## a basic test of memory allocation
+## test of 'exec failure'
+
+exec rm -f tmp.txt
+verbose off
+$Npass = 0
+$Ntry = 0
+if ($?VERBOSE == 0)
+  $VERBOSE = 4
+end
+
+# a basic task which just runs 'echo'
+task	       basic
+  host         local
+
+  periods      -poll 0.005
+  periods      -exec 0.005
+  periods      -timeout 2
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    $Ntry ++
+    if ($Ntry > -1) break
+
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+    echo "this is a line in the task exec code"
+
+    command echo "$Npass : test line"
+  end
+
+  # success
+  task.exit    0
+    $Npass ++
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
+
+macro memcheck.init
+ list word -x "ps -p $PID -o rss"
+ $startmem = $word:1
+end
+macro memcheck
+ list word -x "ps -p $PID -o rss"
+ $endmem = $word:1
+ if ($VERBOSE > 3)
+   echo growth: {$endmem - $startmem}
+ end
+end
+
+macro done
+ stop
+ date -var dtime -seconds -reftime $start
+ if ($VERBOSE > 3)
+  status
+ end
+
+ # this task generates no output files
+ if ($VERBOSE > 3)
+   echo "task test speed: {$dtime/$Ntry} sec/tasks"
+ end
+ ### this test depends on the value of periods -exec above
+ if ($dtime/$Ntry > 0.010) 
+   echo "tasks tests running too slow: {$dtime/$Ntry}"
+ end
+
+ memcheck
+
+ if ($endmem - $startmem > 30)
+   $PASS = 0
+   echo "failed memcheck"
+   echo "growth: {$endmem-$startmem}"
+   echo "kB/loop: {($endmem-$startmem)/10000}"
+ end
+end
+
+
+memcheck.init
+echo "starting memcheck"
+echo "wait a few seconds and type 'done'"
+
+run
+date -var start -seconds
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/sleep.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/sleep.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/sleep.sh	(revision 15879)
@@ -0,0 +1,34 @@
+
+# a basic task which just runs 'sleep'
+task	       basic
+  command      sleep 10
+  host         local
+
+  periods      -poll 0.1
+  periods      -exec 0.2
+  periods      -timeout 20
+  npending 5
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    echo "create command"
+  end
+
+  # success
+  task.exit    0
+    $Npass ++
+    echo done sleep
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/sleep2.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/sleep2.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/sleep2.sh	(revision 15879)
@@ -0,0 +1,39 @@
+
+$hostname = `hostname`
+
+controller exit true
+controller host add $hostname
+
+# a basic task which just runs 'sleep'
+task	       basic
+  command      sleep 1
+  host         anyhost
+
+  periods      -poll 0.01
+  periods      -exec 0.02
+  periods      -timeout 20
+  npending 100
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    # echo "create command"
+  end
+
+  # success
+  task.exit    0
+    $Npass ++
+    # echo done sleep
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/sleep3.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/sleep3.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/test/sleep3.sh	(revision 15879)
@@ -0,0 +1,47 @@
+
+$hostname = `hostname`
+
+controller exit true
+controller host add po02
+controller host add po03
+controller host add po04
+controller host add po05
+controller host add po06
+controller host add po07
+controller host add po08
+controller host add po09
+controller host add po10
+
+# a basic task which just runs 'sleep'
+task	       basic
+  command      sleep 1
+  host         anyhost
+
+  periods      -poll 0.01
+  periods      -exec 0.02
+  periods      -timeout 20
+  npending 100
+  
+  stdout tmp.txt
+  stderr tmp.txt
+
+  task.exec
+    # echo "create command"
+  end
+
+  # success
+  task.exit    0
+    $Npass ++
+    # echo done sleep
+  end
+
+  # default exit status
+  task.exit    default
+    echo       "basic: exit status: $EXIT"
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "basic: timeout"
+  end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/thread_locks.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/thread_locks.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/thread_locks.c	(revision 15879)
@@ -0,0 +1,14 @@
+# include "pantasks.h"
+
+/* this mutex is used by the serialized threads */
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+void SerialThreadLock () {
+    pthread_mutex_lock (&mutex);
+}
+
+void SerialThreadUnlock () {
+    pthread_mutex_unlock (&mutex);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/verbose.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/verbose.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/verbose.c	(revision 15879)
@@ -0,0 +1,41 @@
+# include "pantasks.h"
+
+static int VERBOSE = FALSE;
+
+int verbose (int argc, char **argv) {
+
+  if (argc == 1) {
+    if (VERBOSE) {
+      gprint (GP_LOG, "verbose mode ON\n");
+    } else {
+      gprint (GP_LOG, "verbose mode OFF\n");
+    }
+    return (TRUE);
+  }
+
+  if (argc == 2) {
+    if (!strcasecmp (argv[1], "ON")) {
+      VERBOSE = TRUE;
+      return (TRUE);
+    }
+    if (!strcasecmp (argv[1], "OFF")) {
+      VERBOSE = FALSE;
+      return (TRUE);
+    }
+    if (!strcasecmp (argv[1], "THREADS")) {
+      VERBOSE = 2;
+      return (TRUE);
+    }
+    if (!strcasecmp (argv[1], "TOGGLE")) {
+      VERBOSE = ~VERBOSE;
+      return (TRUE);
+    }
+  }
+
+  gprint (GP_ERR, "USAGE: verbose (on/off/threads/toggle)\n");
+  return (FALSE);
+}
+
+int VerboseMode () {
+  return (VERBOSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/version.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/version.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pantasks/version.c	(revision 15879)
@@ -0,0 +1,17 @@
+# include "pantasks.h"
+static char *name = "$Name: not supported by cvs2svn $";
+
+int version (int argc, char **argv) {
+
+  char *tmp;
+
+  gprint (GP_LOG, "\n");
+  gprint (GP_LOG, "pantasks version: %s\n", (tmp = strip_version (name))); free (tmp);
+
+  gprint (GP_LOG, "opihi version: %s\n", (tmp = strip_version (opihi_version()))); free (tmp);
+  gprint (GP_LOG, "ohana version: %s\n", (tmp = strip_version (ohana_version()))); free (tmp);
+  gprint (GP_LOG, "gfits version: %s\n", (tmp = strip_version (gfits_version()))); free (tmp);
+
+  gprint (GP_LOG, "compiled on %s %s\n", __DATE__, __TIME__);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/ChildOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/ChildOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/ChildOps.c	(revision 15879)
@@ -0,0 +1,135 @@
+# include "pclient.h"
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <unistd.h>
+// #include <stropts.h>
+
+static int Nbad = 0;
+static struct timeval last = {0, 0};
+
+int InitChild () {
+
+  ChildPID         = 0;                /** current child PID **/
+  ChildStatus      = PCLIENT_NONE;     /** current status of child **/
+  ChildExitStatus  = 0;                /** recent exit status of child **/
+  
+  child_stdin_fd[0]  = 0;
+  child_stdin_fd[1]  = 0;
+  child_stdout_fd[0] = 0;
+  child_stdout_fd[1] = 0;
+  child_stderr_fd[0] = 0;
+  child_stderr_fd[1] = 0;
+
+  InitIOBuffer (&child_stdout, 1024);
+  InitIOBuffer (&child_stderr, 1024);
+  return (TRUE);
+}
+
+int CheckChild () {
+
+  int Nread;
+  double dtime;
+  struct timeval now;
+
+  /* runaway test - if pcontrol is killed, pclient starts running away.  this test is a bit
+     dangerous: the choice of dtime probably depends on the processor and the value provided to
+     pclient.c:rl_set_keyboard_input_timeout (1000); note that we cannot use getppid == 1 as a test
+     because the parent of pclient is the ssh process on the pclient host, not pcontrol.  in any
+     case, the opihi shell catches if the ssh dies using getppid
+   */
+  gettimeofday (&now, (void *) NULL);
+  dtime = 1e6*DTIME (now, last);
+  if (dtime < 100) {
+    Nbad ++;
+    if (Nbad > 10) exit (2);
+  }
+  if (dtime > 950) Nbad = 0;
+  last = now;
+
+  CheckChildStatus ();
+  
+  /* read stdout buffer */
+  Nread = ReadtoIOBuffer (&child_stdout, child_stdout_fd[0]);
+  switch (Nread) {
+    case -2:  /* error in read (programming error?  system level error?) */
+      gprint (GP_ERR, "serious IO error\n");
+      exit (2);
+    case -1:  /* no data in pipe */
+      break;
+    case 0:   /* pipe is closed */
+      /** change child state? **/
+      break;
+    default:  /* data in pipe */
+      break;
+  }
+  
+  /* read stderr buffer */
+  Nread = ReadtoIOBuffer (&child_stderr, child_stderr_fd[0]);
+  switch (Nread) {
+    case -2:  /* error in read (programming error?  system level error?) */
+      gprint (GP_ERR, "serious IO error\n");
+      exit (2);
+    case -1:  /* no data in pipe */
+      break;
+    case 0:   /* pipe is closed */
+      /** change child state? **/
+      break;
+    default:  /* data in pipe */
+      break;
+  }
+  return (TRUE);
+}
+
+void CheckChildStatus () {
+
+  int result, waitstatus;
+
+  if (ChildStatus != PCLIENT_BUSY) return;
+
+  /* check current child status */
+  result = waitpid (ChildPID, &waitstatus, WNOHANG);
+  switch (result) {
+    case -1:  /* error with waitpid */
+      switch (errno) {
+	case ECHILD:
+	  gprint (GP_ERR, "unknown PID, not a child proc\n");
+	  gprint (GP_ERR, "did process already exit?  programming error?\n");
+	  ChildStatus = PCLIENT_NONE;
+	  break;
+	case EINVAL:
+	  gprint (GP_ERR, "error EINVAL (waitpid): programming error\n");
+	  exit (1);
+	case EINTR:
+	  gprint (GP_ERR, "error EINTR (waitpid): programming error\n");
+	  exit (1);
+	default:
+	  gprint (GP_ERR, "unknown error for waitpid (%d): programming error\n", errno);
+	  exit (1);
+      }
+      break;
+      
+    case 0:  /* process not exited */
+      ChildStatus = PCLIENT_BUSY;
+      break;
+
+    default:
+      if (result != ChildPID) {
+	gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, ChildPID);
+	exit (1);
+      }
+      
+      if (WIFEXITED(waitstatus)) {
+	ChildStatus = PCLIENT_EXIT;
+	ChildExitStatus = WEXITSTATUS(waitstatus);
+      }
+      if (WIFSIGNALED(waitstatus)) {
+	ChildStatus = PCLIENT_CRASH;
+	ChildExitStatus = WTERMSIG(waitstatus);
+      }
+      if (WIFSTOPPED(waitstatus)) {
+	gprint (GP_ERR, "waitpid returns 'stopped': programming error\n");
+	exit (1);
+      }
+  }
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/Makefile	(revision 15879)
@@ -0,0 +1,46 @@
+default: pclient
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+SDIR    =       $(HOME)/pclient
+DATA    =       $(DESTDATA)/pclient
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+LIBS1         = -lbasiccmd -lshell -ldata 
+LIBS2         = -ldvo -lkapa -lFITS -lohana
+FULL_CFLAGS   = $(BASE_CFLAGS)
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(LIBS1) $(LIBS2) $(BASE_LDFLAGS)
+
+# pclient user commands and support functions ########################
+funcs = \
+$(SDIR)/init.$(ARCH).o \
+$(SDIR)/pclient.$(ARCH).o \
+$(SDIR)/ChildOps.$(ARCH).o \
+
+cmds = \
+$(SDIR)/job.$(ARCH).o \
+$(SDIR)/reset.$(ARCH).o \
+$(SDIR)/check.$(ARCH).o \
+$(SDIR)/status.$(ARCH).o \
+$(SDIR)/stdout.$(ARCH).o  \
+$(SDIR)/version.$(ARCH).o
+
+libs = \
+$(DESTLIB)/libbasiccmd.a \
+$(DESTLIB)/libshell.a \
+$(DESTLIB)/libdata.a
+
+pclient: $(BIN)/pclient.$(ARCH)
+$(SRC)/pclient.$(ARCH).o : $(libs)
+$(BIN)/pclient.$(ARCH)   : $(funcs) $(cmds)
+
+install: $(DESTBIN)/pclient help
+
+help: clean-help cmd.basic.help pclient.help
+
+.PHONY: pclient
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/check.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/check.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/check.c	(revision 15879)
@@ -0,0 +1,9 @@
+# include "pclient.h"
+
+int check (int argc, char **argv) {
+
+  /* force a check */
+  CheckChild ();
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/help/job
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/help/job	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/help/job	(revision 15879)
@@ -0,0 +1,1 @@
+0
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/init.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/init.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/init.c	(revision 15879)
@@ -0,0 +1,29 @@
+# include "opihi.h"
+
+int job	            PROTO((int, char **));
+int reset           PROTO((int, char **));
+int check           PROTO((int, char **));
+int status	    PROTO((int, char **));
+int stdout_pclient  PROTO((int, char **));
+int stderr_pclient  PROTO((int, char **));
+int version         PROTO((int, char **));
+
+static Command cmds[] = {  
+  {"job",       job,      "start job"},
+  {"reset",     reset,    "reset job"},
+  {"check",     check,    "check job"},
+  {"status",    status,   "check job status"},
+  {"stdout",    stdout_pclient,   "get stdout buffer"},
+  {"stderr",    stderr_pclient,   "get stderr buffer"},
+  {"version",   version,      "show version information"},
+}; 
+
+void InitPclient () {
+  
+  int i;
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/job.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/job.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/job.c	(revision 15879)
@@ -0,0 +1,98 @@
+# include "pclient.h"
+
+int job (int argc, char **argv) {
+
+  int i, pid, status;
+  char **targv;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: job (arg0) (arg1) ... (argN)\n");
+    gprint (GP_LOG, "STATUS %d\n", -2);
+    return (FALSE);
+  }
+  
+  if (ChildStatus != PCLIENT_NONE) {
+    gprint (GP_ERR, "need to clear existing child\n");
+    gprint (GP_LOG, "STATUS %d\n", -3);
+    return (FALSE);
+  }
+
+  if (pipe (child_stdin_fd)  < 0) goto pipe_error;
+  if (pipe (child_stdout_fd) < 0) goto pipe_error;
+  if (pipe (child_stderr_fd) < 0) goto pipe_error;
+
+  /* need to define arg list with NULL termination */
+  ALLOCATE (targv, char *, argc);
+  for (i = 1; i < argc; i++) {
+    targv[i-1] = strcreate (argv[i]);
+  }
+  targv[i-1] = 0;
+
+  pid = fork ();
+  if (!pid) { /* must be child process */
+    /* gprint (GP_ERR, "starting child process %s...\n", targv[0]); */
+
+    /* close the other ends of the pipes */
+    close (child_stdin_fd[1]);
+    close (child_stdout_fd[0]);
+    close (child_stderr_fd[0]);
+
+    /* tie our ends of the pipes to stdin, stdout, stderr */
+    dup2 (child_stdin_fd[0],  STDIN_FILENO);
+    dup2 (child_stdout_fd[1], STDOUT_FILENO);
+    dup2 (child_stderr_fd[1], STDERR_FILENO);
+
+    /* set all three unblocking */
+    setvbuf (stdin,  (char *) NULL, _IONBF, BUFSIZ);
+    setvbuf (stdout, (char *) NULL, _IONBF, BUFSIZ);
+    setvbuf (stderr, (char *) NULL, _IONBF, BUFSIZ);
+
+    /* exec job */ 
+    status = execvp (targv[0], targv); 
+    gprint (GP_ERR, "error starting child process: %d\n", status);
+    exit (1);
+  }
+
+  /* free temporary arg list */
+  for (i = 0; i < argc - 1; i++) {
+    free (targv[i]);
+  }
+  free (targv);
+
+  /* close the other ends of the pipes */
+  close (child_stdin_fd[0]);
+  close (child_stdout_fd[1]);
+  close (child_stderr_fd[1]);
+
+  /* make the pipes non-blocking */
+  fcntl (child_stdin_fd[1],  F_SETFL, O_NONBLOCK);
+  fcntl (child_stdout_fd[0], F_SETFL, O_NONBLOCK);
+  fcntl (child_stderr_fd[0], F_SETFL, O_NONBLOCK);
+  
+  ChildStatus = PCLIENT_BUSY;
+  ChildPID = pid;
+
+  gprint (GP_LOG, "STATUS %d\n", ChildPID);
+  return (TRUE);
+
+pipe_error:
+  perror ("pipe error:");
+  if (child_stdin_fd[0]  != 0) close (child_stdin_fd[0]);
+  if (child_stdin_fd[1]  != 0) close (child_stdin_fd[1]);
+  if (child_stdout_fd[0] != 0) close (child_stdout_fd[0]);
+  if (child_stdout_fd[1] != 0) close (child_stdout_fd[1]);
+  if (child_stderr_fd[0] != 0) close (child_stderr_fd[0]);
+  if (child_stderr_fd[1] != 0) close (child_stderr_fd[1]);
+
+  gprint (GP_LOG, "STATUS %d\n", -1);
+  return (FALSE);
+}
+
+/* possible responses:
+
+STATUS -1 - pipe error
+STATUS -2 - syntax error
+STATUS -3 - existing child
+STATUS >0 - success (PID)
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/notes.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/notes.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/notes.txt	(revision 15879)
@@ -0,0 +1,17 @@
+
+pclient special commands:
+
+ job 
+
+ reset
+
+ check
+
+ status
+
+ stdout
+
+ stderr
+
+- communication with pclient should search for the pclient prompt:
+  pclient:
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/outline.txt
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/outline.txt	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/outline.txt	(revision 15879)
@@ -0,0 +1,12 @@
+
+init stage:
+
+  - set child 
+
+readline loop:
+
+  - wait for commands
+
+
+
+  
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/pclient.c.in
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/pclient.c.in	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/pclient.c.in	(revision 15879)
@@ -0,0 +1,77 @@
+# include "pclient.h"
+
+# define opihi_name "PCLIENT"
+# define opihi_prompt "pclient: "
+# define opihi_description "pcontrol client shell\n"
+# define opihi_history ""
+# define opihi_rcfile ".pcontrolrc"
+
+void dummy_prep_term (int flag) {
+}
+
+/* program-dependent initialization */
+void program_init (int *argc, char **argv) {
+  
+  auto_break = TRUE;
+
+  /* load the commands used by this implementation */
+  InitBasic ();
+  InitPclient ();
+  InitChild ();
+
+  rl_prep_term_function = dummy_prep_term;
+  rl_readline_name = opihi_name;
+  rl_attempted_completion_function = command_completer;
+  rl_event_hook = CheckChild;
+  rl_set_keyboard_input_timeout (1000); 
+  /* 1 ms seems to be the minimum valid number */
+
+  // set_str_variable ("HISTORY", opihi_history);
+  set_str_variable ("PROMPT", opihi_prompt);
+  set_str_variable ("RCFILE", opihi_rcfile);
+
+  {
+    char *helpdir;
+    char *modules;
+    static char *datadir = "@DATADIR@";
+    ALLOCATE (helpdir, char, strlen(datadir) + strlen("/help") + 2);
+    sprintf (helpdir, "%s/help", datadir);
+    set_str_variable ("HELPDIR", helpdir);
+    free (helpdir);
+    ALLOCATE (modules, char, strlen(datadir) + strlen("/modules") + 2);
+    sprintf (modules, "%s/modules", datadir);
+    set_str_variable ("MODULES:0", modules);
+    set_int_variable ("MODULES:n", 1);
+    free (modules);
+  }
+
+  /* ignore the history file.  to change this, see, eg, mana.c */
+  signal (SIGPIPE, gotsignal);
+  signal (SIGTSTP, gotsignal);
+  signal (SIGTTIN, gotsignal);
+  return;
+}
+
+/* standard welcome message */
+void welcome () {
+  gprint (GP_ERR, "\n");
+  gprint (GP_ERR, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
+/* add program-dependent exit functions here */
+void cleanup () {
+  return;
+}
+
+void gotsignal (int signum) {
+  gprint (GP_ERR, "got signal : %d\n", signum);
+  return;
+}
+
+/* call to opihi shell */
+int main (int argc, char **argv) {
+  int status;
+  status = opihi (argc, argv);
+  exit (status);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/reset.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/reset.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/reset.c	(revision 15879)
@@ -0,0 +1,75 @@
+# include "pclient.h"
+
+int reset (int argc, char **argv) {
+
+  int i, result, waitstatus;
+  struct timespec request, remain;
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: reset\n");
+    gprint (GP_LOG, "STATUS -1\n");
+    return (FALSE);
+  }
+  
+  if (ChildStatus == PCLIENT_NONE) {
+    gprint (GP_ERR, "no child process, cannot reset\n");
+    gprint (GP_LOG, "STATUS 2\n");
+    return (TRUE);
+  }
+
+  /* avoid blocking on waitpid, test every 100 usec, up to 50 msec */
+  request.tv_sec = 0;
+  request.tv_nsec = 100000;
+
+  if (ChildStatus == PCLIENT_BUSY) {
+    /* job is still running, send SIGTERM signal to job */
+    kill (ChildPID, SIGTERM);
+    result = waitpid (ChildPID, &waitstatus, WNOHANG);
+    for (i = 0; (i < 500) && (result == 0); i++) {
+      nanosleep (&request, &remain);
+      result = waitpid (ChildPID, &waitstatus, WNOHANG);
+    }
+    if (result) goto reset_job;
+
+    /* job did not exit, send SIGKILL signal to job */
+    kill (ChildPID, SIGKILL);
+    result = waitpid (ChildPID, &waitstatus, WNOHANG);
+    for (i = 0; (i < 500) && (result == 0); i++) {
+      nanosleep (&request, &remain);
+      result = waitpid (ChildPID, &waitstatus, WNOHANG);
+    }
+    if (result) goto reset_job;
+
+    /* total failure, don't reset */
+    gprint (GP_ERR, "child process %d is hung, cannot reset\n", ChildPID);
+    gprint (GP_LOG, "STATUS 0\n");
+    return (FALSE);
+  }
+
+reset_job:
+  /* close out ends of the pipes */
+  close (child_stdin_fd[1]);
+  close (child_stdout_fd[0]);
+  close (child_stderr_fd[0]);
+  child_stdin_fd[1] = 0;
+  child_stdout_fd[0] = 0;
+  child_stderr_fd[0] = 0;
+
+  FlushIOBuffer (&child_stdout);
+  FlushIOBuffer (&child_stderr);
+  ChildStatus = PCLIENT_NONE;
+  ChildPID = 0;
+  ChildExitStatus = 0;
+
+  gprint (GP_LOG, "STATUS 1\n");
+  return (TRUE);
+}
+
+/* exit conditions:
+   -1 - usage message / syntax error
+    2 - unknown job
+    0 - process hung
+    1 - successful resetn
+*/
+
+/* the linux kernel timer sticks in a 10ms lag between kill and the harvest */
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/status.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/status.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/status.c	(revision 15879)
@@ -0,0 +1,24 @@
+# include "pclient.h"
+
+int status (int argc, char **argv) {
+
+  char status_string[64];
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: status\n");
+    return (FALSE);
+  }
+  
+  if (ChildStatus == PCLIENT_NONE)  strcpy (status_string, "NONE");
+  if (ChildStatus == PCLIENT_BUSY)  strcpy (status_string, "BUSY");
+  if (ChildStatus == PCLIENT_EXIT)  strcpy (status_string, "EXIT");
+  if (ChildStatus == PCLIENT_CRASH) strcpy (status_string, "CRASH");
+
+  gprint (GP_LOG, "STATUS %s\n", status_string);
+  gprint (GP_LOG, "EXITST %d\n", ChildExitStatus);
+  gprint (GP_LOG, "STDOUT %d\n", child_stdout.Nbuffer);
+  gprint (GP_LOG, "STDERR %d\n", child_stderr.Nbuffer);
+
+  set_str_variable ("JOBSTATUS", status_string);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/stdout.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/stdout.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/stdout.c	(revision 15879)
@@ -0,0 +1,29 @@
+# include "pclient.h"
+
+int stdout_pclient (int argc, char **argv) {
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: stdout\n");
+    gprint (GP_LOG, "STATUS %d\n", -1);
+    return (FALSE);
+  }
+  
+  fwrite (child_stdout.buffer, 1, child_stdout.Nbuffer, stdout);
+  gprint (GP_LOG, "STATUS %d\n", 0);
+  return (TRUE);
+
+}
+
+int stderr_pclient (int argc, char **argv) {
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: stderr\n");
+    gprint (GP_LOG, "STATUS %d\n", -1);
+    return (FALSE);
+  }
+  
+  fwrite (child_stderr.buffer, 1, child_stderr.Nbuffer, stdout);
+  gprint (GP_LOG, "STATUS %d\n", 0);
+  return (TRUE);
+
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/test/status.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/test/status.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/test/status.sh	(revision 15879)
@@ -0,0 +1,64 @@
+
+list tests
+ test1
+ test2
+end
+
+# check status without any jobs
+macro test1
+ $PASS = 1
+ break -auto off
+
+ output -err /dev/null
+ reset
+ exec rm -f test.txt
+ output -err stderr
+
+ output test.txt
+ status
+ output stdout
+
+ # this test requires a specific set of output
+ list line -x "cat test.txt"
+ if ($line:n != 4)
+   $PASS = 0
+ end
+ if ("$line:0" != "STATUS NONE")
+   $PASS = 0
+ end
+ if ("$line:1" != "EXITST 0")
+   $PASS = 0
+ end
+ if ("$line:2" != "STDOUT 0")
+   $PASS = 0
+ end
+ if ("$line:3" != "STDERR 0")
+   $PASS = 0
+ end
+end
+
+# check status with a basic job
+macro test2
+ $PASS = 1
+ break -auto off
+
+ output -err /dev/null
+ reset
+ exec rm -f test.txt
+ job ls 
+ usleep 500000
+ output -err stderr
+
+ output test.txt
+ status
+ output stdout
+
+ # this test requires a specific set of output
+ list line -x "cat test.txt"
+ if ($line:n != 4)
+   $PASS = 0
+ end
+ if ("$line:0" != "STATUS EXIT")
+   $PASS = 0
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/test/version.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/test/version.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/test/version.sh	(revision 15879)
@@ -0,0 +1,106 @@
+
+list tests
+ test1
+ test2
+ test3
+ test4
+ test5
+ test6
+ test7
+end
+
+## these tests check that the version command reports the versions
+## they do not validate the actual versions themselves
+
+# set up the version output file
+macro test1
+ $PASS = 1
+ break -auto off
+ exec rm test.txt
+ output -err test.txt
+ version
+ output -err stderr
+ file test.txt found
+ if ($found != 1)
+   $PASS = 0
+ end
+end
+
+# test for the correct number of version lines
+macro test2
+ $PASS = 1
+ break -auto off
+ 
+ $line = `wc -l test.txt`
+
+ list word -split $line
+ if ($word:0 != 6)
+   $PASS = 0
+ end
+end
+
+# test for pclient version name
+macro test3
+ $PASS = 1
+ break -auto off
+ 
+ list line -x "cat test.txt"
+ list word -split $line:0
+
+ if ("$word:0" != "pclient")
+   $PASS = 0
+ end
+end
+
+# test for opihi version name
+macro test4
+ $PASS = 1
+ break -auto off
+ 
+ list line -x "cat test.txt"
+ list word -split $line:1
+
+ if ("$word:0" != "opihi")
+   $PASS = 0
+ end
+end
+
+# test for ohana version name
+macro test5
+ $PASS = 1
+ break -auto off
+ 
+ list line -x "cat test.txt"
+ list word -split $line:2
+
+ if ("$word:0" != "ohana")
+   $PASS = 0
+ end
+end
+
+# test for gfits version name
+macro test6
+ $PASS = 1
+ break -auto off
+ 
+ list line -x "cat test.txt"
+ list word -split $line:3
+
+ if ("$word:0" != "gfits")
+   $PASS = 0
+ end
+end
+
+# test for compilation date/time
+macro test7
+ $PASS = 1
+ break -auto off
+ 
+ list line -x "cat test.txt"
+ list word -split $line:4
+
+ if ("$word:0" != "compiled")
+   $PASS = 0
+ end
+end
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pclient/version.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pclient/version.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pclient/version.c	(revision 15879)
@@ -0,0 +1,17 @@
+# include "pclient.h"
+static char *name = "$Name: not supported by cvs2svn $";
+
+int version (int argc, char **argv) {
+
+  char *tmp;
+
+  gprint (GP_LOG, "\n");
+  gprint (GP_LOG, "pclient version: %s\n", (tmp = strip_version (name))); free (tmp);
+
+  gprint (GP_LOG, "opihi version: %s\n", (tmp = strip_version (opihi_version()))); free (tmp);
+  gprint (GP_LOG, "ohana version: %s\n", (tmp = strip_version (ohana_version()))); free (tmp);
+  gprint (GP_LOG, "gfits version: %s\n", (tmp = strip_version (gfits_version()))); free (tmp);
+
+  gprint (GP_LOG, "compiled on %s %s\n", __DATE__, __TIME__);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckBusyJob.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckBusyJob.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckBusyJob.c	(revision 15879)
@@ -0,0 +1,98 @@
+# include "pcontrol.h"
+# define DEBUG 0
+
+int CheckBusyJob (Job *job, Host *host) {
+
+  int      status;
+  int      outstate;
+  char    *p;
+  char     string[64];
+  IOBuffer buffer;
+
+  /* we are checking a job which is currently busy.  it has been pulled from the
+     JOB_BUSY stack, and is linked to a host in the HOST_BUSY stack.  
+     XXX need to check on state of HOST on return */
+
+  ASSERT (job, "job not set");
+  ASSERT (host, "host not set");
+
+  ASSERT (host == (Host *) job[0].host, "invalid host");
+  ASSERT (job  == (Job *) host[0].job, "invalid job");
+
+  InitIOBuffer (&buffer, 0x100);
+
+  status = PclientCommand (host, "status", PCLIENT_PROMPT, &buffer);
+
+  /* check on success of pclient command */
+  switch (status) {
+    case PCLIENT_DOWN:
+      HarvestHost (host[0].pid);
+      // unlink host & job
+      job[0].host = NULL;
+      host[0].job = NULL;
+      if (job[0].realhost) free (job[0].realhost);
+      job[0].realhost = NULL;
+      PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+      PutJob (job, PCONTROL_JOB_PENDING, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+
+    case PCLIENT_HUNG:
+      // don't do anything drastic, just keep trying
+      if (DEBUG || VerboseMode()) gprint (GP_ERR, "client is busy, not responding");
+      PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
+      PutJob (job, PCONTROL_JOB_BUSY, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (TRUE);
+
+    case PCLIENT_GOOD:
+      if (DEBUG || VerboseMode()) gprint (GP_ERR, "message received (CheckBusyJob)");
+      break;
+
+    default:
+      ABORT ("unknown status for pclient command");  
+  }
+
+  /** host is up, need to parse message **/
+  p = memstr (buffer.buffer, "STATUS", buffer.Nbuffer);
+  ASSERT (p != NULL, "missing STATUS in pclient message");
+
+  sscanf (p, "%*s %s", string);
+  ASSERT (strcmp(string, "NONE"), "no current job\n");
+
+  /** no status change, return to BUSY stack **/
+  if (!strcmp(string, "BUSY")) {
+    PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
+    PutJob (job, PCONTROL_JOB_BUSY, STACK_BOTTOM);
+    FreeIOBuffer (&buffer);
+    return (TRUE);
+  }
+
+  /* exit status better be either EXIT or CRASH */
+  outstate = PCONTROL_JOB_BUSY;
+  if (!strcmp(string, "EXIT")) outstate = PCONTROL_JOB_EXIT;
+  if (!strcmp(string, "CRASH")) outstate = PCONTROL_JOB_CRASH;
+  ASSERT (outstate != PCONTROL_JOB_BUSY, "should not reach here (CheckJob)");
+
+  /* parse the exit status and sizes of output buffers */
+  p = memstr (buffer.buffer, "EXITST", buffer.Nbuffer);
+  sscanf (p, "%*s %d", &job[0].exit_status);
+  p = memstr (buffer.buffer, "STDOUT", buffer.Nbuffer);
+  sscanf (p, "%*s %d", &job[0].stdout_size);
+  p = memstr (buffer.buffer, "STDERR", buffer.Nbuffer);
+  sscanf (p, "%*s %d", &job[0].stderr_size);
+
+  // XXX runaway job if output too large?
+  if (job[0].stdout_size > 0x100000) abort();
+  if (job[0].stderr_size > 0x100000) abort();
+
+  // job has exited : move to DONE stack 
+  // the host is still BUSY until job output is gathered (int CheckDoneJob)
+  // don't unlink job and host yet
+  PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
+  PutJobSetState (job, PCONTROL_JOB_DONE, STACK_BOTTOM, outstate);
+  gettimeofday (&job[0].stop, (void *) NULL);
+  job[0].dtime = DTIME(job[0].stop, job[0].start);
+  FreeIOBuffer (&buffer);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckDoneHost.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckDoneHost.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckDoneHost.c	(revision 15879)
@@ -0,0 +1,71 @@
+# include "pcontrol.h"
+# define DEBUG 0
+
+int CheckDoneHost (Host *host) {
+  
+  int       status;
+  char     *p;
+  IOBuffer  buffer;
+
+  ASSERT (host, "host not set");
+
+  InitIOBuffer (&buffer, 0x100);
+  
+  status = PclientCommand (host, "reset", PCLIENT_PROMPT, &buffer);
+
+  /* check on success of pclient command */
+  switch (status) {
+    case PCLIENT_DOWN:
+      if (DEBUG || VerboseMode()) gprint (GP_ERR, "host %s is down\n", host[0].hostname);
+      /* DONE host does not have an incomplete job */
+      HarvestHost (host[0].pid);
+      PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+      // XXX do we need to close the connection?
+
+    case PCLIENT_HUNG:
+      // don't do anything drastic, just try again later
+      PutHost (host, PCONTROL_HOST_DONE, STACK_BOTTOM);
+      if (DEBUG || VerboseMode()) gprint (GP_ERR, "host %s is not responding\n", host[0].hostname);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+
+    case PCLIENT_GOOD:
+      if (VerboseMode()) gprint (GP_ERR, "message received (CheckDoneHost)\n");  
+      break;
+
+    default:
+      ABORT ("unknown status for pclient command");  
+  }
+
+  /** successful command, examine result **/
+  p = memstr (buffer.buffer, "STATUS", buffer.Nbuffer);
+  ASSERT (p != NULL, "missing STATUS in pclient message (CheckDoneHost)");
+
+  sscanf (p, "%*s %d", &status);
+  switch (status) {
+    case -1:
+      ABORT ("reset syntax error");
+      
+    case 0:
+      if (DEBUG || VerboseMode()) gprint (GP_ERR, "reset failed\n");
+      PutHost (host, PCONTROL_HOST_DONE, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+      
+    case 1:
+    case 2:
+      if (DEBUG || VerboseMode()) gprint (GP_ERR, "successful reset\n");
+      PutHost (host, PCONTROL_HOST_IDLE, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+
+    default:
+      ABORT ("should not reach here (CheckDoneHost)");
+  }
+  ABORT ("should not reach here (CheckDoneHost)");
+}
+
+/** probably need to flush the buffer before the command **/
+/** need to add timeout check here **/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckDoneJob.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckDoneJob.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckDoneJob.c	(revision 15879)
@@ -0,0 +1,35 @@
+# include "pcontrol.h"
+
+int CheckDoneJob (Job *job, Host *host) {
+  
+  int success;
+
+  ASSERT (job, "job not set");
+  ASSERT (host, "host not set");
+
+  ASSERT (host == (Host *) job[0].host, "invalid host");
+  ASSERT (job == (Job *) host[0].job, "invalid job");
+
+  success = TRUE;
+  success &= GetJobOutput ("stdout", host, &job[0].stdout_buff, job[0].stdout_size);
+  success &= GetJobOutput ("stderr", host, &job[0].stderr_buff, job[0].stderr_size);
+
+  if (!success) {
+    // XXX some kind of error?
+    // XXX try again later?
+    PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
+    PutJob (job, PCONTROL_JOB_DONE, STACK_BOTTOM);
+    return (FALSE);
+  }
+
+  /* job's state is either EXIT or CRASH (verify?) */
+  // unlink host & job
+  job[0].host = NULL;
+  host[0].job = NULL;
+  PutHost (host, PCONTROL_HOST_DONE, STACK_BOTTOM);
+  PutJob (job, job[0].state, STACK_BOTTOM);
+
+  return (TRUE);
+}
+
+/** need to add timeout check here **/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckHost.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckHost.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckHost.c	(revision 15879)
@@ -0,0 +1,47 @@
+# include "pcontrol.h"
+
+int CheckHost (Host *host) {
+  
+  int status;
+  IOBuffer buffer;
+
+  ASSERT (host, "host not set");
+
+  if (host[0].job != NULL) return (TRUE);
+
+  /* if this host has been marked to be turned off, do that and return */
+  if (host[0].markoff) {
+    host[0].markoff = FALSE;
+    StopHost (host);
+    OffHost (host);
+    return (TRUE);
+  }
+
+  InitIOBuffer (&buffer, 0x100);
+
+  status = PclientCommand (host, "echo OK", PCLIENT_PROMPT, &buffer);
+  switch (status) {
+    case 0:
+      if (VerboseMode()) gprint (GP_ERR, "host %s is down\n", host[0].hostname);
+      HarvestHost (host[0].pid);
+      PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+      
+    case -1:
+      if (VerboseMode()) gprint (GP_ERR, "host %s is not responding\n", host[0].hostname);
+      /*** do we mark this in some way (HUNG) ? ***/
+      PutHost (host, host[0].stack, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+
+    default:
+      PutHost (host, host[0].stack, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (TRUE);
+  }
+  ABORT ("should not reach here (Check Host)"); 
+}
+
+// if the host has a job, we skip it (down or crash state will be caught elsewhere)
+// in fact, just touch the IDLE hosts, not the BUSY hosts?
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckIdleHost.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckIdleHost.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckIdleHost.c	(revision 15879)
@@ -0,0 +1,102 @@
+# include "pcontrol.h"
+
+/* the supplied host is not on a stack: it cannot be taken by the other thread */
+int CheckIdleHost (Host *host) {
+
+  int i;
+  Stack *stack;
+  Job *job;
+
+  ASSERT (host, "host not set");
+
+  /* if this host has been marked to be turned off, do that and return */
+  if (host[0].markoff) {
+    host[0].markoff = FALSE;
+    StopHost (host);
+    OffHost (host);
+    return (TRUE);
+  }
+    
+  /* search the JOB_PENDING stack for an appropriate job */
+  stack = GetJobStack (PCONTROL_JOB_PENDING);
+  LockStack (stack);
+  
+  /* look for first NEEDHOST matching this host */
+  for (i = 0; i < stack[0].Nobject; i++) {
+    job = (Job *) stack[0].object[i];
+    if (job[0].mode != PCONTROL_JOB_NEEDHOST) continue;
+    ASSERT (job[0].hostname != NULL, "NEEDHOST hostname missing");
+    if (strcasecmp (job[0].hostname, host[0].hostname)) continue;
+
+    /* we have found an appropriate job; link it to the host and send to StartJob */
+    job[0].host = (struct Host *) host;
+    host[0].job = (struct Job *) job;
+
+    /* take the job off the stack and unlock the stack */
+    RemoveStackEntry (stack, i);
+    UnlockStack (stack);
+    StartJob (job, host);
+    return (TRUE);
+  }
+
+  /* no NEEDHOST entry, look for first WANTHOST matching this host */
+  for (i = 0; i < stack[0].Nobject; i++) {
+    job = (Job *) stack[0].object[i];
+    if (job[0].mode != PCONTROL_JOB_WANTHOST) continue;
+    ASSERT (job[0].hostname != NULL, "WANTHOST hostname missing");
+    if (strcasecmp (job[0].hostname, host[0].hostname)) continue;
+
+    /* we have found an appropriate job; link it to the host and send to StartJob */
+    job[0].host = (struct Host *) host;
+    host[0].job = (struct Job *) job;
+
+    /* take the job off the stack and unlock the stack */
+    RemoveStackEntry (stack, i);
+    UnlockStack (stack);
+    StartJob (job, host);
+    return (TRUE);
+  }
+
+  /* no WANTHOST entry, look for first ANYHOST matching this host */
+  for (i = 0; i < stack[0].Nobject; i++) {
+    job = (Job *) stack[0].object[i];
+    if (job[0].mode != PCONTROL_JOB_ANYHOST) continue;
+
+    /* we have found an appropriate job; link it to the host and send to StartJob */
+    job[0].host = (struct Host *) host;
+    host[0].job = (struct Job *) job;
+
+    /* take the job off the stack and unlock the stack */
+    RemoveStackEntry (stack, i);
+    UnlockStack (stack);
+    StartJob (job, host);
+    return (TRUE);
+  }
+
+  /* no ANYHOST entry, look for first WANTHOST with old time */
+  /* XXX perhaps I should add this to the conditions for ANYHOST instead of
+     running a separate loop?  ie, WANTHOST && time > X == ANYHOST */
+  for (i = 0; i < stack[0].Nobject; i++) {
+    job = (Job *) stack[0].object[i];
+    if (job[0].mode != PCONTROL_JOB_WANTHOST) continue;
+    // XXX test the job age and skip if too young
+
+    /* we have found an appropriate job; link it to the host and send to StartJob */
+    job[0].host = (struct Host *) host;
+    host[0].job = (struct Job *) job;
+
+    /* take the job off the stack and unlock the stack */
+    RemoveStackEntry (stack, i);
+    UnlockStack (stack);
+    StartJob (job, host);
+    return (TRUE);
+  }
+  UnlockStack (stack);
+
+  /* no jobs for host, put it back on IDLE stack */
+  PutHost (host, PCONTROL_HOST_IDLE, STACK_BOTTOM);
+  return (TRUE);
+}
+
+/** note : host and job popped off IDLE and PENDING stacks, 
+    unless no job is available **/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckPoint.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckPoint.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckPoint.c	(revision 15879)
@@ -0,0 +1,69 @@
+# include "pcontrol.h"
+
+// one thread (user) interacts with the user and blocks for long periods on input.
+// one thread (client) spins continuously and monitors the hosts and jobs
+// in some cases, the user thread needs to set a check point on the client thread 
+// to ensure the all HOSTs and JOBs are on one of the stacks (nothing 'in flight').
+// these are not symmetric: the client thread should not call Set/Clear, the user 
+// thread should not call Test
+
+# ifdef THREADED
+static pthread_mutex_t client = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t user = PTHREAD_MUTEX_INITIALIZER;
+# endif
+
+// The user thread calls this to stop the client thread from shuffling the Host/Job stacks
+int SetCheckPoint () {
+
+# ifdef THREADED
+  int status;
+  int Nwait;
+
+  // set my lock
+  pthread_mutex_lock (&user);
+
+  // wait until client thread sets its lock
+  Nwait = 0;
+  while (1) {
+    status = pthread_mutex_trylock (&client);
+    if (status == EBUSY) {
+      // client has reached the check-point
+      return (TRUE);
+    }
+    pthread_mutex_unlock (&client);
+    usleep (10000); // wait for client thread to set lock
+    Nwait ++;
+  }
+  // put in a timeout?  (client thread not spinning...)
+  return (FALSE);
+# else
+  return (TRUE);
+# endif
+}
+
+// The user thread calls this to allow the client thread to continue
+int ClearCheckPoint () {
+  // clear my lock
+# ifdef THREADED
+  pthread_mutex_unlock (&user);
+# endif
+  return (TRUE);
+}
+
+// The client thread calls in the thread loop somewhere the stacks are stable
+// (ie, no jobs or hosts currently in flight)
+int TestCheckPoint () {
+
+# ifdef THREADED
+  // set my lock
+  pthread_mutex_lock (&client);
+  
+  // try the user-thread lock
+  pthread_mutex_lock (&user);
+  pthread_mutex_unlock (&user);
+
+  // clear my lock
+  pthread_mutex_unlock (&client);
+# endif
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckSystem.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 15879)
@@ -0,0 +1,383 @@
+# include "pcontrol.h"
+# define DEBUG 0
+
+static struct timeval lastlive = {0, 0};
+static RunLevels RunLevel = PCONTROL_RUN_NONE;
+
+RunLevels SetRunLevel (RunLevels level) {
+  RunLevels oldlevel;
+  oldlevel = RunLevel;
+  RunLevel = level;
+  return oldlevel;
+}
+
+RunLevels GetRunLevel () {
+  return RunLevel;
+}
+
+int CheckSystem () {
+
+  struct timeval now;
+  float dtime;
+
+  /* we want to give each block a maximum allowed time */
+  CheckIdleHosts(0.020); /* submit a new job */
+
+  CheckBusyJobs(0.020);  /* get job status */
+  CheckDoneJobs(0.020);  /* harvest job stdout/stderr */
+  CheckKillJobs(0.020);  /* harvest job stdout/stderr */
+
+  CheckDoneHosts(0.020); /* reset the host */
+  CheckDownHosts(0.100); /* launch the host */
+
+  /* always allow at least one test */
+  /* most tests require about 2ms per host.  
+     CheckDoneJobs must depend on the size of the output buffer */
+
+  gettimeofday (&now, (void *) NULL);
+  dtime = DTIME (now, lastlive);
+  if (dtime > 1.0) {
+    CheckLiveHosts(0.040);
+    lastlive = now;
+  } 
+
+  if (DEBUG) { 
+    Stack *stack;
+    int Nidle, Ndown, Nbusy;
+    stack = GetHostStack (PCONTROL_HOST_IDLE);
+    Nidle = stack[0].Nobject;
+    stack = GetHostStack (PCONTROL_HOST_DOWN);
+    Ndown = stack[0].Nobject;
+    stack = GetHostStack (PCONTROL_HOST_BUSY);
+    Nbusy = stack[0].Nobject;
+    gprint (GP_ERR, "busy, idle, down: %2d %2d %2d\n", Nbusy, Nidle, Ndown);
+  }
+
+  return (TRUE);
+}
+
+void *CheckSystem_Threaded (void *data) {
+
+  int Njobchecks, Nhostchecks, Nlivechecks;
+
+  Nlivechecks = 0;
+
+  gprintInit ();
+
+  while (1) {
+    // stop here if the user-thread requests (no objects in flight) 
+    TestCheckPoint ();
+
+    // don't run the system checks if RunLevel is FALSE
+    // XXX stop should not suspend all checks: we should continue
+    // to harvest completed jobs and migrate idle machines to down
+    if (RunLevel == PCONTROL_RUN_NONE) {
+      usleep (100000); // idle if we are running nothing
+      continue;
+    }
+
+    /* always allow at least one test */
+    /* most tests require about 2ms per host.  
+       CheckDoneJobs must depend on the size of the output buffer */
+    /* the max delay times are fairly arbitrary and do not impact
+       the user interface.
+     */
+
+    Njobchecks = 0;
+    Nhostchecks = 0;
+
+    if ((RunLevel == PCONTROL_RUN_ALL) || (RunLevel == PCONTROL_RUN_REAP)) {
+      Njobchecks  += CheckBusyJobs(0.020);  /* get job status (PCLIENT) */
+      TestCheckPoint ();
+      Njobchecks  += CheckDoneJobs(0.020);  /* harvest job stdout/stderr (!PCLIENT) */
+      TestCheckPoint ();
+      Njobchecks  += CheckKillJobs(0.020);  /* harvest job stdout/stderr (PCLIENT) */
+      TestCheckPoint ();
+    }
+
+    if (RunLevel != PCONTROL_RUN_NONE) {
+      Nhostchecks += CheckDoneHosts(0.020); /* reset the host */
+      TestCheckPoint ();
+      Nhostchecks += CheckDownHosts(0.100); /* launch the host */
+      TestCheckPoint ();
+    }
+
+    if (RunLevel == PCONTROL_RUN_ALL) {
+      // we want to give each block a maximum allowed time
+      Nhostchecks += CheckIdleHosts(0.020); /* submit a new job (PCLIENT) */
+      TestCheckPoint ();
+    }
+
+    // there is nothing on the stacks.  test the hosts and wait a bit
+    if (!Njobchecks && !Nhostchecks && (RunLevel != PCONTROL_RUN_NONE)) {
+      CheckLiveHosts(0.040);
+      usleep (100000); // idle if no jobs are waiting
+    } 
+    
+    if (DEBUG) { 
+      Stack *stack;
+      int Nidle, Ndown, Nbusy;
+      stack = GetHostStack (PCONTROL_HOST_IDLE);
+      Nidle = stack[0].Nobject;
+      stack = GetHostStack (PCONTROL_HOST_DOWN);
+      Ndown = stack[0].Nobject;
+      stack = GetHostStack (PCONTROL_HOST_BUSY);
+      Nbusy = stack[0].Nobject;
+      gprint (GP_ERR, "Njobchecks: %d, busy, idle, down: %2d %2d %2d\n", Njobchecks, Nbusy, Nidle, Ndown);
+    }
+  }
+  return (NULL);
+}
+
+int CheckBusyJobs (float MaxDelay) {
+
+  struct timeval start, stop;
+  int i, Nobject;
+  Stack *hoststack;
+  Stack *jobstack;
+  Job   *job;
+  Host  *host;
+  float dtime;
+
+  /* Loop through objects on the stack, no more than once.  Note that it is not important if the
+     stack size is modified by other threads or is changed by any of the actions performed during
+     this loop: the Nobject value is only used to get a rough number for the number of iterations.
+   */
+
+  hoststack = GetHostStack (PCONTROL_HOST_BUSY);
+  jobstack  = GetJobStack (PCONTROL_JOB_BUSY);
+  Nobject   = jobstack[0].Nobject;
+
+  /* always allow at least one test */
+  gettimeofday (&start, (void *) NULL);
+  dtime = 0.0;
+  for (i = 0; (i < Nobject) && (dtime < MaxDelay); i++) {
+    // pull both job and host from their stacks
+    LockStack (hoststack);
+    job = PullStackByLocation (jobstack, STACK_TOP);
+    if (job == NULL) {
+      UnlockStack (hoststack);
+      break;
+    }
+    host = (Host *) job[0].host;
+    ASSERT (host != NULL, "host is NULL");
+    RemoveStackByID (hoststack, host[0].HostID);
+    UnlockStack (hoststack);
+
+    CheckBusyJob (job, host);
+    gettimeofday (&stop, (void *) NULL);
+    dtime = DTIME (stop, start);
+  }
+  if (DEBUG && (Nobject > 0)) gprint (GP_ERR, "checked %d of %d jobs\n", i, Nobject);
+  return (i);
+}
+
+int CheckDoneJobs (float MaxDelay) {
+
+  struct timeval start, stop;
+  int i, Nobject;
+  Stack *hoststack;
+  Stack *jobstack;
+  Job   *job;
+  Host  *host;
+  float dtime;
+
+  /* Loop through objects on the stack, no more than once. see note above */
+  hoststack = GetHostStack (PCONTROL_HOST_BUSY);
+  jobstack  = GetJobStack (PCONTROL_JOB_DONE);
+  Nobject   = jobstack[0].Nobject;
+
+  /* always allow at least one test */
+  gettimeofday (&start, (void *) NULL);
+  dtime = 0.0;
+  for (i = 0; (i < Nobject) && (dtime < MaxDelay); i++) {
+    LockStack (hoststack);
+    job = PullStackByLocation (jobstack, STACK_TOP);
+    if (job == NULL) {
+      UnlockStack (hoststack);
+      break;
+    }
+    host = (Host *) job[0].host;
+    ASSERT (host, "host is NULL");
+
+    RemoveStackByID (hoststack, host[0].HostID);
+    UnlockStack (hoststack);
+
+    CheckDoneJob (job, host);
+    gettimeofday (&stop, (void *) NULL);
+    dtime = DTIME (stop, start);
+  }
+  if (DEBUG && (Nobject > 0)) gprint (GP_ERR, "checked %d of %d jobs\n", i, Nobject);
+  return (i);
+}
+
+int CheckKillJobs (float MaxDelay) {
+
+  struct timeval start, stop;
+  int i, Nobject;
+  Stack *hoststack;
+  Stack *jobstack;
+  Job   *job;
+  Host  *host;
+  float dtime;
+
+  /* Loop through objects on the stack, no more than once. see note above */
+  hoststack = GetHostStack (PCONTROL_HOST_BUSY);
+  jobstack = GetJobStack (PCONTROL_JOB_KILL);
+  Nobject = jobstack[0].Nobject;
+
+  /* always allow at least one test */
+  gettimeofday (&start, (void *) NULL);
+  dtime = 0.0;
+  for (i = 0; (i < Nobject) && (dtime < MaxDelay); i++) {
+    LockStack (hoststack);
+    job = PullStackByLocation (jobstack, STACK_TOP);
+    if (job == NULL) {
+      UnlockStack (hoststack);
+      break;
+    }
+    host = (Host *) job[0].host;
+    ASSERT (host, "host is NULL");
+
+    RemoveStackByID (hoststack, host[0].HostID);
+    UnlockStack (hoststack);
+
+    KillJob (job, host);
+    gettimeofday (&stop, (void *) NULL);
+    dtime = DTIME (stop, start);
+  }
+  if (DEBUG && (Nobject > 0)) gprint (GP_ERR, "checked %d of %d jobs\n", i, Nobject);
+  return (i);
+}
+
+int CheckDoneHosts (float MaxDelay) {
+
+  struct timeval start, stop;
+  int i, Nobject;
+  Stack *stack;
+  Host  *host;
+  float dtime;
+
+  /* Loop through objects on the stack, no more than once. see note above */
+  stack = GetHostStack (PCONTROL_HOST_DONE);
+  Nobject = stack[0].Nobject;
+
+  /* always allow at least one test */
+  gettimeofday (&start, (void *) NULL);
+  dtime = 0.0;
+  for (i = 0; (i < Nobject) && (dtime < MaxDelay); i++) {
+    host = PullStackByLocation (stack, STACK_TOP);
+    if (host == NULL) break;
+    CheckDoneHost (host);
+    gettimeofday (&stop, (void *) NULL);
+    dtime = DTIME (stop, start);
+  }
+  if (DEBUG) gprint (GP_ERR, "checked %d hosts\n", i);
+  return (i);
+}
+
+int CheckDownHosts (float MaxDelay) {
+
+  int i, Nobject;
+  Stack *stack;
+  Host  *host;
+  struct timeval start, stop;
+  float dtime;
+
+  /* Loop through objects on the stack, no more than once. see note above */
+  stack = GetHostStack (PCONTROL_HOST_DOWN);
+  Nobject = stack[0].Nobject;
+
+  /* always allow at least one test */
+  gettimeofday (&start, (void *) NULL);
+  dtime = 0.0;
+  for (i = 0; (i < Nobject) && (dtime < MaxDelay); i++) {
+    host = PullStackByLocation (stack, STACK_TOP);
+    if (host == NULL) break;
+    if (host[0].markoff) {
+      host[0].markoff = FALSE;
+      OffHost (host);
+      return (TRUE);
+    }
+    dtime = DTIME (host[0].nexttry, start);
+    if (dtime > 0) {
+      PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+    } else {
+      StartHost (host);
+    }
+    gettimeofday (&stop, (void *) NULL);
+    dtime = DTIME (stop, start);
+  }
+  if (DEBUG) gprint (GP_ERR, "checked %d hosts\n", i);
+  return (i);
+}
+
+int CheckIdleHosts (float MaxDelay) {
+
+  struct timeval start, stop;
+  int i, Nobject;
+  Stack *stack;
+  Host  *host;
+  float dtime;
+
+  /* check if there are any pending jobs, otherwise skip step */
+  stack = GetJobStack (PCONTROL_JOB_PENDING);
+  if (!stack[0].Nobject) return (0);
+
+  /* Loop through objects on the stack, no more than once. see note above */
+  stack = GetHostStack (PCONTROL_HOST_IDLE);
+  Nobject = stack[0].Nobject;
+
+  /* always allow at least one test */
+  gettimeofday (&start, (void *) NULL);
+  dtime = 0.0;
+  for (i = 0; (i < Nobject) && (dtime < MaxDelay); i++) {
+    host = PullStackByLocation (stack, STACK_TOP);
+    if (host == NULL) break;
+    CheckIdleHost (host);
+    gettimeofday (&stop, (void *) NULL);
+    dtime = DTIME (stop, start);
+  }
+  if (DEBUG) gprint (GP_ERR, "checked %d hosts\n", i);
+  return (i);
+}
+
+/* this is just a heartbeat check (only IDLE hosts) */
+int CheckLiveHosts (float MaxDelay) {
+
+  struct timeval start, stop;
+  int i, Nobject;
+  Stack *stack;
+  Host  *host;
+  float dtime;
+
+  /* Loop through objects on the stack, no more than once. see note above */
+  stack = GetHostStack (PCONTROL_HOST_IDLE);
+  Nobject = stack[0].Nobject;
+
+  gettimeofday (&start, (void *) NULL);
+
+  dtime = 0.0;
+  for (i = 0; (i < Nobject) && (dtime < MaxDelay); i++) {
+    host = PullStackByLocation (stack, STACK_TOP);
+    if (host == NULL) break;
+    CheckHost (host);
+    gettimeofday (&stop, (void *) NULL);
+    dtime = DTIME (stop, start);
+  }
+  if (DEBUG) gprint (GP_ERR, "checked %d idle hosts\n", i);
+  return (TRUE);
+}
+
+/*
+
+  gettimeofday (&stop, (void *) NULL);
+  dtime = DTIME (stop, start);
+  if (VerboseMode()) gprint (GP_ERR, "check 4: %f seconds\n", dtime);
+
+  gettimeofday (&start, (void *) NULL);
+*/
+
+/** All of the CheckFooBar entries cycle though their respective queues, popping from the top and
+    pushing to the bottom.  if we stop before the loop is done there is no tendancy for bias because
+    we continue where we left off next round **/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/GetJobOutput.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/GetJobOutput.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/GetJobOutput.c	(revision 15879)
@@ -0,0 +1,65 @@
+# include "pcontrol.h"
+# define PCLIENT_TIMEOUT 500
+
+/* we read Nbytes from the host, then watch for the prompt */ 
+int GetJobOutput (char *cmd, Host *host, IOBuffer *buffer, int Nbytes) {
+  
+  int i, status, Nstart;
+  char *line;
+  struct timespec request, remain;
+
+  ASSERT (cmd, "cmd missing");
+  ASSERT (host, "host missing");
+  ASSERT (buffer, "buffer missing");
+
+  /* flush any earlier messages */
+  ReadtoIOBuffer (buffer, host[0].stdout_fd);
+  FlushIOBuffer (buffer);
+  Nstart = buffer[0].Nbuffer;
+
+  /* avoid blocking on waitpid, test every 100 usec, up to 50 msec */
+  request.tv_sec = 0;
+  request.tv_nsec = 100000;
+
+  /* send cmd (stdout / stderr) */
+  status = write_fmt (host[0].stdin_fd, "%s\n", cmd);
+
+  /* is pipe still open? */
+  if ((status == -1) && (errno == EPIPE)) return (PCLIENT_DOWN);
+
+  /* read at least Nbytes, then watch for PCLIENT_PROMPT */
+  line = NULL;
+  status = -1;
+  for (i = 0; (i < PCLIENT_TIMEOUT) && (status != 0) && (line == NULL); i++) {
+    status = ReadtoIOBuffer (buffer, host[0].stdout_fd);
+    if ((buffer[0].Nbuffer - Nstart) >= Nbytes) {
+      line = memstr (buffer[0].buffer, PCLIENT_PROMPT, buffer[0].Nbuffer);
+    }
+    if (status == -1) nanosleep (&request, &remain);
+  }
+  if (status ==  0) return (PCLIENT_DOWN);
+  if (status == -1) return (PCLIENT_HUNG);
+
+  /* check on success of pclient command */
+  switch (status) {
+    case -1:
+      if (VerboseMode()) gprint (GP_ERR, "host %s is not responding\n", host[0].hostname);
+      return (FALSE);
+
+    case 0:
+      if (VerboseMode()) gprint (GP_ERR, "host %s is down\n", host[0].hostname);
+      return (FALSE);
+
+    default:
+      if (VerboseMode()) gprint (GP_ERR, "message received (GetJobOutput : %s)\n", cmd);  
+      /* drop extra bytes from pclient (not pclient:job) */
+      buffer[0].Nbuffer = Nstart + Nbytes;
+      if (buffer[0].Nalloc > buffer[0].Nbuffer) {
+	bzero (buffer[0].buffer + buffer[0].Nbuffer, buffer[0].Nalloc - buffer[0].Nbuffer);
+      }
+      return (TRUE);
+  }
+
+  gprint (GP_ERR, "programming error: should not reach here (GetJobOutput)\n");
+  pcontrol_exit (1);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/HostOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/HostOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/HostOps.c	(revision 15879)
@@ -0,0 +1,176 @@
+# include "pcontrol.h"
+
+Stack *HostPool_Idle;
+Stack *HostPool_Busy;
+Stack *HostPool_Done;
+Stack *HostPool_Down;
+Stack *HostPool_Off;
+
+void InitHostStacks () {
+  HostPool_Idle = InitStack ();
+  HostPool_Busy = InitStack ();
+  HostPool_Done = InitStack ();
+  HostPool_Down = InitStack ();
+  HostPool_Off  = InitStack ();
+}
+
+char *GetHostStackName (int StackID) {
+  switch (StackID) {
+    case PCONTROL_HOST_IDLE: return ("IDLE");
+    case PCONTROL_HOST_DOWN: return ("DOWN");
+    case PCONTROL_HOST_DONE: return ("DONE");
+    case PCONTROL_HOST_BUSY: return ("BUSY");
+    case PCONTROL_HOST_OFF:  return ("OFF");
+  }
+  gprint (GP_ERR, "error: unknown host stack : programming error\n");
+  pcontrol_exit (1);
+  return (NULL);
+}
+
+Stack *GetHostStack (int StackID) {
+  switch (StackID) {
+    case PCONTROL_HOST_IDLE: return (HostPool_Idle);
+    case PCONTROL_HOST_DOWN: return (HostPool_Down);
+    case PCONTROL_HOST_DONE: return (HostPool_Done);
+    case PCONTROL_HOST_BUSY: return (HostPool_Busy);
+    case PCONTROL_HOST_OFF:  return (HostPool_Off);
+  }
+  gprint (GP_ERR, "error: unknown host stack : programming error\n");
+  pcontrol_exit (1);
+  return (NULL);
+}
+
+Stack *GetHostStackByName (char *name) {
+  if (!strcasecmp (name, "idle")) return (HostPool_Idle);
+  if (!strcasecmp (name, "down")) return (HostPool_Down);
+  if (!strcasecmp (name, "done")) return (HostPool_Done);
+  if (!strcasecmp (name, "busy")) return (HostPool_Busy);
+  if (!strcasecmp (name, "off"))  return (HostPool_Off);
+  return (NULL);
+}
+
+/* add host to position in stack */
+int PutHost (Host *host, int StackID, int where) {
+
+  int stat;
+  Stack *stack;
+
+  stack = GetHostStack (StackID);
+  if (stack == NULL) return (FALSE);
+
+  host[0].stack = StackID;
+  stat = PushStack (stack, where, host, host[0].HostID, host[0].hostname);
+  // XXX need to handle the error conditions, or we drop the host & leak memory
+  return (stat);
+}
+  
+/* find the host by ID in the defined host stacks */
+Host *PullHostByID (IDtype HostID, int *StackID) {
+
+  Host *host;
+
+  *StackID = PCONTROL_HOST_IDLE;
+  host = PullHostFromStackByID (*StackID, HostID);
+  if (host != NULL) return (host);
+
+  *StackID = PCONTROL_HOST_DOWN;
+  host = PullHostFromStackByID (*StackID, HostID);
+  if (host != NULL) return (host);
+
+  *StackID = PCONTROL_HOST_DONE;
+  host = PullHostFromStackByID (*StackID, HostID);
+  if (host != NULL) return (host);
+
+  *StackID = PCONTROL_HOST_BUSY;
+  host = PullHostFromStackByID (*StackID, HostID);
+  if (host != NULL) return (host);
+
+  *StackID = PCONTROL_HOST_OFF;
+  host = PullHostFromStackByID (*StackID, HostID);
+  if (host != NULL) return (host);
+
+  *StackID = -1;
+  return (NULL);
+}
+
+/* find the host by ID in the defined host stacks */
+Host *PullHostByName (char *name, int *StackID) {
+
+  Host *host;
+
+  *StackID = PCONTROL_HOST_IDLE;
+  host = PullHostFromStackByName (*StackID, name);
+  if (host != NULL) return (host);
+
+  *StackID = PCONTROL_HOST_DOWN;
+  host = PullHostFromStackByName (*StackID, name);
+  if (host != NULL) return (host);
+
+  *StackID = PCONTROL_HOST_DONE;
+  host = PullHostFromStackByName (*StackID, name);
+  if (host != NULL) return (host);
+
+  *StackID = PCONTROL_HOST_BUSY;
+  host = PullHostFromStackByName (*StackID, name);
+  if (host != NULL) return (host);
+
+  *StackID = PCONTROL_HOST_OFF;
+  host = PullHostFromStackByName (*StackID, name);
+  if (host != NULL) return (host);
+
+  *StackID = -1;
+  return (NULL);
+}
+
+Host *PullHostFromStackByID (int StackID, IDtype ID) {
+
+  Host *host;
+  Stack *stack;
+
+  stack = GetHostStack (StackID);
+  if (stack == NULL) return (NULL);
+
+  host = PullStackByID (stack, ID);
+  return (host);
+}
+
+Host *PullHostFromStackByName (int StackID, char *name) {
+
+  Host *host;
+  Stack *stack;
+
+  stack = GetHostStack (StackID);
+  if (stack == NULL) return (NULL);
+
+  host = PullStackByName (stack, name);
+  return (host);
+}
+
+IDtype AddHost (char *hostname) {
+
+  Host *host;
+
+  ALLOCATE (host, Host, 1);
+
+  host[0].hostname  = strcreate (hostname);
+  host[0].stdin_fd  = 0;
+  host[0].stdout_fd = 0;
+  host[0].stderr_fd = 0;
+  host[0].HostID    = NextHostID();
+
+  host[0].lasttry.tv_sec = 0;
+  host[0].lasttry.tv_usec = 0;
+  host[0].nexttry.tv_sec = 0;
+  host[0].nexttry.tv_usec = 0;
+
+  host[0].markoff  = FALSE;
+  host[0].job      = NULL;
+  PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+  return (host[0].HostID);
+}
+
+void DelHost (Host *host) {
+  FREE (host[0].hostname);
+  FREE (host[0].job);
+  FREE (host);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/IDops.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/IDops.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/IDops.c	(revision 15879)
@@ -0,0 +1,42 @@
+# include "pcontrol.h"
+
+static IDtype CurrentJobID  = 0;
+static IDtype CurrentHostID = 0;
+
+/* for now, no persistence : we could use the date/time to seed the upper byte(s) if needed */
+void InitIDs () {
+  CurrentJobID = 0;
+  CurrentHostID = 0;
+}
+
+IDtype NextJobID () {
+
+  IDtype ID;
+
+  ID = CurrentJobID;
+  CurrentJobID ++;
+  return (ID);
+}
+
+/* only used by the User thread */
+IDtype NextHostID () {
+
+  IDtype ID;
+
+  ID = CurrentHostID;
+  CurrentHostID ++;
+  return (ID);
+}
+
+void PrintID (gpDest dest, IDtype ID) {
+
+  unsigned short int word0, word1, word2, word3;
+
+  word0 = 0xffff & ID;
+  word1 = 0xffff & (ID >> 16);
+  word2 = 0xffff & (ID >> 32);
+  word3 = 0xffff & (ID >> 48);
+
+  gprint (dest, "%x.%x.%x.%x", word3, word2, word1, word0);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/JobID.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/JobID.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/JobID.c	(revision 15879)
@@ -0,0 +1,41 @@
+# include "pcontrol.h"
+
+static IDtype CurrentJobID  = 0;
+static IDtype CurrentHostID = 0;
+
+/* for now, no persistence : we could use the date/time to seed the upper byte(s) if needed */
+void InitIDs () {
+  CurrentJobID = 0;
+  CurrentHostID = 0;
+}
+
+IDtype NextJobID () {
+
+  IDtype ID;
+
+  ID = CurrentJobID;
+  CurrentJobID ++;
+  return (ID);
+}
+
+IDtype NextHostID () {
+
+  IDtype ID;
+
+  ID = CurrentHostID;
+  CurrentHostID ++;
+  return (ID);
+}
+
+void PrintID (gpDest dest, IDtype ID) {
+
+  unsigned short int word0, word1, word2, word3;
+
+  word0 = 0xffff & ID;
+  word1 = 0xffff & (ID >> 16);
+  word2 = 0xffff & (ID >> 32);
+  word3 = 0xffff & (ID >> 48);
+
+  gprint (dest, "%x.%x.%x.%x", word3, word2, word1, word0);
+}
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/JobOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/JobOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/JobOps.c	(revision 15879)
@@ -0,0 +1,175 @@
+# include "pcontrol.h"
+
+Stack *JobPool_Pending;
+Stack *JobPool_Busy;
+Stack *JobPool_Done;
+Stack *JobPool_Kill;
+Stack *JobPool_Exit;
+Stack *JobPool_Crash;
+
+void InitJobStacks () {
+  JobPool_Pending = InitStack ();
+  JobPool_Busy    = InitStack ();
+  JobPool_Done    = InitStack ();
+  JobPool_Kill    = InitStack ();
+  JobPool_Exit    = InitStack ();
+  JobPool_Crash   = InitStack ();
+}
+
+char *GetJobStackName (int StackID) {
+  switch (StackID) {
+    case PCONTROL_JOB_PENDING: return ("PENDING");
+    case PCONTROL_JOB_BUSY:    return ("BUSY");
+    case PCONTROL_JOB_DONE:    return ("DONE");
+    case PCONTROL_JOB_KILL:    return ("KILL");
+    case PCONTROL_JOB_EXIT:    return ("EXIT");
+    case PCONTROL_JOB_CRASH:   return ("CRASH");
+  }
+  gprint (GP_ERR, "error: unknown host stack : programming error\n");
+  pcontrol_exit (1);
+  return (NULL);
+}
+
+Stack *GetJobStack (int StackID) {
+  switch (StackID) {
+    case PCONTROL_JOB_PENDING: return (JobPool_Pending);
+    case PCONTROL_JOB_BUSY:    return (JobPool_Busy);
+    case PCONTROL_JOB_DONE:    return (JobPool_Done);
+    case PCONTROL_JOB_KILL:    return (JobPool_Kill);
+    case PCONTROL_JOB_EXIT:    return (JobPool_Exit);
+    case PCONTROL_JOB_CRASH:   return (JobPool_Crash);
+  }
+  gprint (GP_ERR, "error: unknown job stack : programming error\n");
+  pcontrol_exit (1);
+  return (NULL);
+}
+
+Stack *GetJobStackByName (char *name) {
+
+  if (!strcasecmp (name, "pending")) return (JobPool_Pending);
+  if (!strcasecmp (name, "busy"))    return (JobPool_Busy);
+  if (!strcasecmp (name, "done"))    return (JobPool_Done);
+  if (!strcasecmp (name, "exit"))    return (JobPool_Exit);
+  if (!strcasecmp (name, "crash"))   return (JobPool_Crash);
+  return (NULL);
+}
+
+/* add job to position in stack, use StackID as default state */
+int PutJob (Job *job, int StackID, int where) {
+
+  int stat;
+  Stack *stack;
+
+  stack = GetJobStack (StackID);
+  if (stack == NULL) return (FALSE);
+
+  /* by default, these are both the same - to override, use PutJobSetState */
+  job[0].state = StackID;
+  job[0].stack = StackID;
+  stat = PushStack (stack, where, job, job[0].JobID, job[0].argv[0]);
+  // XXX need to handle the error conditions, or we drop the host & leak memory
+  return (stat);
+}
+  
+/* add job to position in stack.  set state to 'state' */
+int PutJobSetState (Job *job, int StackID, int where, int state) {
+
+  int stat;
+  Stack *stack;
+
+  stack = GetJobStack (StackID);
+  if (stack == NULL) return (FALSE);
+
+  /* alternate state specified by user */
+  job[0].state = state;
+  job[0].stack = StackID;
+  stat = PushStack (stack, where, job, job[0].JobID, job[0].argv[0]);
+  // XXX need to handle the error conditions, or we drop the host & leak memory
+  return (stat);
+}
+  
+Job *PullJobByID (IDtype JobID, int *StackID) {
+
+  Job *job;
+
+  *StackID = PCONTROL_JOB_PENDING;
+  job = PullJobFromStackByID (*StackID, JobID);
+  if (job != NULL) return (job);
+
+  *StackID = PCONTROL_JOB_BUSY;
+  job = PullJobFromStackByID (*StackID, JobID);
+  if (job != NULL) return (job);
+
+  *StackID = PCONTROL_JOB_EXIT;
+  job = PullJobFromStackByID (*StackID, JobID);
+  if (job != NULL) return (job);
+
+  *StackID = PCONTROL_JOB_CRASH;
+  job = PullJobFromStackByID (*StackID, JobID);
+  if (job != NULL) return (job);
+
+  *StackID = PCONTROL_JOB_DONE;
+  job = PullJobFromStackByID (*StackID, JobID);
+  if (job != NULL) return (job);
+
+  *StackID = PCONTROL_JOB_KILL;
+  job = PullJobFromStackByID (*StackID, JobID);
+  if (job != NULL) return (job);
+
+  return (NULL);
+}
+
+/* remove job from position in stack */
+Job *PullJobFromStackByID (int StackID, int ID) {
+
+  Job *job;
+  Stack *stack;
+
+  stack = GetJobStack (StackID);
+  if (stack == NULL) return (NULL);
+
+  job = PullStackByID (stack, ID);
+  return (job);
+}
+
+IDtype AddJob (char *hostname, JobMode mode, int timeout, int argc, char **argv) {
+
+  int JobID;
+  Job *job;
+
+  ALLOCATE (job, Job, 1);
+
+  job[0].argc     = argc;
+  job[0].argv     = argv;
+  job[0].hostname = hostname;
+  job[0].mode     = mode;
+  job[0].host     = NULL;
+  job[0].JobID    = NextJobID();
+  job[0].Reset    = FALSE;
+  job[0].realhost = NULL;
+
+  /* do this step on start? */
+  InitIOBuffer (&job[0].stdout_buff, 0x1000);
+  InitIOBuffer (&job[0].stderr_buff, 0x1000);
+
+  JobID = job[0].JobID;
+  PutJob (job, PCONTROL_JOB_PENDING, STACK_BOTTOM);
+  if (VerboseMode()) gprint (GP_ERR, "added new job\n");
+  return (JobID);
+}
+
+void DelJob (Job *job) {
+
+  int i;
+
+  FREE (job[0].hostname);
+  for (i = 0; i < job[0].argc; i++) {
+    FREE (job[0].argv[i]);
+  }
+  FREE (job[0].argv);
+
+  FreeIOBuffer (&job[0].stdout_buff);
+  FreeIOBuffer (&job[0].stderr_buff);
+
+  FREE (job);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/KillJob.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/KillJob.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/KillJob.c	(revision 15879)
@@ -0,0 +1,75 @@
+# include "pcontrol.h"
+
+int KillJob (Job *job, Host *host) {
+  
+  IOBuffer buffer;
+  int status;
+  char *p;
+
+  ASSERT (host != NULL, "host missing");
+  ASSERT (job != NULL, "job missing");
+
+  ASSERT (host == (Host *) job[0].host, "invalid host");
+  ASSERT (job  == (Job *) host[0].job, "invalid job");
+
+  InitIOBuffer (&buffer, 0x100);
+
+  status = PclientCommand (host, "reset", PCLIENT_PROMPT, &buffer);
+
+  /* check on success of pclient command */
+  switch (status) {
+    case PCLIENT_DOWN:
+      HarvestHost (host[0].pid);
+      // unlink host & job
+      job[0].host = NULL;
+      host[0].job = NULL;
+      PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+      PutJob (job, PCONTROL_JOB_CRASH, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+
+    case PCLIENT_HUNG:
+      // don't do anything drastic, just keep trying
+      // XXX move to which stack??
+      gprint (GP_ERR, "client is busy, not responding (KillJob)");
+      FreeIOBuffer (&buffer);
+      return (TRUE);
+
+    case PCLIENT_GOOD:
+      if (VerboseMode()) gprint (GP_ERR, "message received (KillJob)\n");  
+      break;
+
+    default:
+      ABORT ("unknown status for pclient command");  
+  }
+
+  /** host is up, need to parse message **/
+  p = memstr (buffer.buffer, "STATUS", buffer.Nbuffer);
+  ASSERT (p != NULL, "missing STATUS in pclient message");
+  if (VerboseMode()) gprint (GP_ERR, "client message: %s\n", buffer.buffer);
+
+  sscanf (p, "%*s %d", &status);
+  FreeIOBuffer (&buffer);
+  gprint (GP_ERR, "client status: %d\n", status);
+
+  switch (status) {
+    case -1:
+      ABORT ("syntax error to pclient");
+    case 0:
+      gprint (GP_ERR, "failure to kill child process\n");
+      PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
+      PutJob (job, PCONTROL_JOB_KILL, STACK_BOTTOM);
+      return (FALSE);
+    case 1:
+      gprint (GP_ERR, "killing job %s on %s\n", job[0].argv[0], host[0].hostname);
+      // unlink host & job
+      job[0].host = NULL;
+      host[0].job = NULL;
+      PutHost (host, PCONTROL_HOST_IDLE, STACK_BOTTOM);
+      PutJob (job, PCONTROL_JOB_CRASH, STACK_BOTTOM);
+      return (TRUE);
+    case 2:
+      ABORT ("client has no job");
+  }
+  ABORT ("should not reach here (KillJob)");
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/Makefile
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/Makefile	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/Makefile	(revision 15879)
@@ -0,0 +1,76 @@
+default: pcontrol
+
+include ../../../Makefile.System
+HOME    =       $(ROOT)/src/opihi
+BIN     =       $(HOME)/bin
+LIB     =       $(HOME)/lib
+INC     =       $(HOME)/include
+SRC     =       $(HOME)/pcontrol
+DATA    =       $(DESTDATA)/pcontrol
+include ../Makefile.Common
+
+# programs may add their own internal requirements here
+LIBS1         = -lkapa -lFITS -lohana
+LIBS2         = -lbasiccmd -lshell -ldata 
+FULL_CFLAGS   = $(BASE_CFLAGS)
+FULL_CPPFLAGS = $(BASE_CPPFLAGS)
+FULL_LDFLAGS  = $(LIBS1) $(LIBS2) $(BASE_LDFLAGS)
+
+# to build the non-threaded version, remove -lpthread and comment out
+# the THREADED line in include/pcontrol.h
+
+# pcontrol user commands and support functions ########################
+funcs = \
+$(SRC)/init.$(ARCH).o \
+$(SRC)/pcontrol.$(ARCH).o \
+$(SRC)/rconnect.$(ARCH).o \
+$(SRC)/CheckBusyJob.$(ARCH).o \
+$(SRC)/CheckDoneHost.$(ARCH).o \
+$(SRC)/CheckDoneJob.$(ARCH).o \
+$(SRC)/CheckHost.$(ARCH).o \
+$(SRC)/CheckIdleHost.$(ARCH).o \
+$(SRC)/CheckPoint.$(ARCH).o \
+$(SRC)/CheckSystem.$(ARCH).o \
+$(SRC)/GetJobOutput.$(ARCH).o \
+$(SRC)/HostOps.$(ARCH).o \
+$(SRC)/IDops.$(ARCH).o \
+$(SRC)/JobOps.$(ARCH).o \
+$(SRC)/StackOps.$(ARCH).o \
+$(SRC)/PclientCommand.$(ARCH).o \
+$(SRC)/ResetJob.$(ARCH).o \
+$(SRC)/StartHost.$(ARCH).o \
+$(SRC)/StopHosts.$(ARCH).o \
+$(SRC)/KillJob.$(ARCH).o \
+$(SRC)/StartJob.$(ARCH).o
+
+cmds = \
+$(SRC)/check.$(ARCH).o \
+$(SRC)/delete.$(ARCH).o \
+$(SRC)/host.$(ARCH).o \
+$(SRC)/job.$(ARCH).o \
+$(SRC)/jobstack.$(ARCH).o \
+$(SRC)/hoststack.$(ARCH).o \
+$(SRC)/kill.$(ARCH).o \
+$(SRC)/pulse.$(ARCH).o \
+$(SRC)/run.$(ARCH).o \
+$(SRC)/status.$(ARCH).o \
+$(SRC)/stdout.$(ARCH).o \
+$(SRC)/version.$(ARCH).o \
+$(SRC)/verbose.$(ARCH).o
+
+libs = \
+$(DESTLIB)/libbasiccmd.a \
+$(DESTLIB)/libshell.a \
+$(DESTLIB)/libdata.a
+
+pcontrol: $(BIN)/pcontrol.$(ARCH)
+$(SRC)/pcontrol.$(ARCH).o : $(libs)
+$(BIN)/pcontrol.$(ARCH)   : $(cmds) $(funcs)
+
+$(cmds) $(funcs) : $(INC)/pcontrol.h
+
+install: $(DESTBIN)/pcontrol help
+
+help: clean-help cmd.basic.help pcontrol.help
+
+.PHONY: pcontrol
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/QueueOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/QueueOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/QueueOps.c	(revision 15879)
@@ -0,0 +1,67 @@
+# include "pcontrol.h"
+
+/* get object from point in stack (negative == distance from end) */
+void *GetStack (Stack *stack, int where) {
+
+  int i;
+  void *object;
+  
+  ASSERT (stack != NULL, "stack missing");
+
+  /* STACK_TOP == 0, STACK_BOTTOM == -1 */
+  /* this code correctly handles the negative 'where' and Nobject == 0 */
+  if (where < 0) where += stack[0].Nobject;
+  if (where < 0) return (NULL);
+  if (where >= stack[0].Nobject) return (NULL);
+
+  object = stack[0].object[where];
+  stack[0].Nobject --;
+  for (i = where; i < stack[0].Nobject; i++) {
+    stack[0].object[i] = stack[0].object[i+1];
+  }
+  return (object);
+}
+
+/* push object on top of stack */
+int PutStack (Stack *stack, int where, void *object) {
+
+  int i;
+
+  ASSERT (stack != NULL, "stack missing");
+
+  /* STACK_TOP == 0, STACK_BOTTOM == -1 */
+  /* this code correctly handles the negative 'where' and Nobject == 0 */
+  if (where < 0) where += stack[0].Nobject + 1;
+  if (where < 0) return (FALSE);
+  if (where > stack[0].Nobject) return (FALSE);
+
+  /* extend stack as needed */
+  if (stack[0].Nobject >= stack[0].NOBJECT) {
+    stack[0].NOBJECT += 100;
+    REALLOCATE (stack[0].object, void *, stack[0].NOBJECT);
+  }
+
+  for (i = stack[0].Nobject; i > where; i--) {
+    stack[0].object[i] = stack[0].object[i-1];
+  }
+  stack[0].object[where] = object;
+  stack[0].Nobject ++;
+  return (TRUE);
+}
+
+/* allocate stack, setup with default values, allocate data */
+Stack *InitStack () {
+
+  Stack *stack;
+
+  ALLOCATE (stack, Stack, 1);
+
+  stack[0].Nobject = 0;
+  stack[0].NOBJECT = 50;
+  ALLOCATE (stack[0].object, void *, stack[0].NOBJECT);
+  return (stack);
+}
+
+/* these stacks are not super efficient, and should probably be replaced with linked lists, 
+   but I find these easier to get my brain around
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/ResetJob.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/ResetJob.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/ResetJob.c	(revision 15879)
@@ -0,0 +1,58 @@
+# include "pcontrol.h"
+
+int ResetJob (Job *job) {
+  
+  int       status;
+  IOBuffer  buffer;
+  Host     *host;
+
+  /** must have a valid host : if not, move to pending? **/
+  ASSERT (job != NULL, "job missing");
+
+  host = (Host *) job[0].host;
+  ASSERT (job != NULL, "host missing");
+
+  InitIOBuffer (&buffer, 0x100);
+  
+  /* we have tried to reset the job; may not get status */
+  job[0].Reset = TRUE;
+
+  status = PclientCommand (host, "reset", PCLIENT_PROMPT, &buffer);
+
+  /* check on success of pclient command */
+  switch (status) {
+    case PCLIENT_DOWN:
+      /*** different behavior for ANYHOST, WANTHOST, NEEDHOST? ***/
+      gprint (GP_ERR, "host %s is down\n", host[0].hostname);
+      HarvestHost (host[0].pid);
+      PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+
+    case PCLIENT_HUNG:
+      /*** should we consider a HUNG host DOWN? ***/
+      gprint (GP_ERR, "host %s is not responding (ResetJob)\n", host[0].hostname);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+
+    case PCLIENT_GOOD:
+      gprint (GP_ERR, "message received (ResetJob)\n");  
+      FreeIOBuffer (&buffer);
+      return (TRUE);
+
+    default:
+      gprint (GP_ERR, "unknown status for pclient command: programming error\n");  
+      pcontrol_exit (1);
+  }
+
+  gprint (GP_ERR, "programming error in GetJobOutput (should not reach here)\n");
+  pcontrol_exit (1);
+  return (FALSE);
+}
+
+/* if machine is down, return FALSE
+   this will place job back in BUSY state,
+   next check of job will catch state and
+   put machine down correctly
+
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StackOps.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StackOps.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StackOps.c	(revision 15879)
@@ -0,0 +1,216 @@
+# include "pcontrol.h"
+
+/* these stacks are not super efficient, and should probably be replaced with linked lists, 
+   but I find these easier to get my brain around.
+*/
+
+/* Stacks and thread locks: interacting with the Stacks needs to be thread-safe so that the user may
+ * perform operations which interact with the stacks at the same time that the background loops
+ * check the current status of the jobs and hosts in the different stacks.  The simplest way in
+ * which the stacks are made thread safe is to lock them with a mutex before every interaction
+ */
+
+# define DEBUG 0
+
+void PrintStackInfo (Stack *stack, const char *func) {
+
+  if (!DEBUG) return;
+  fprintf (stderr, "%s: %p  ", func, stack);
+  fprintf (stderr, "objects: %p  ", stack[0].object);
+  fprintf (stderr, "Nobjects: %d, NOBJECTS: %d\n", stack[0].Nobject, stack[0].NOBJECT);
+}
+
+/* allocate stack, setup with default values, allocate data */
+Stack *InitStack () {
+
+  Stack *stack;
+
+  ALLOCATE (stack, Stack, 1);
+
+  stack[0].Nobject = 0;
+  stack[0].NOBJECT = 50;
+
+  ALLOCATE (stack[0].object, void *, stack[0].NOBJECT);
+  ALLOCATE (stack[0].name,   char *, stack[0].NOBJECT);
+  ALLOCATE (stack[0].id,     int,    stack[0].NOBJECT);
+
+# ifdef THREADED
+  pthread_mutex_init (&stack[0].mutex, NULL);
+# endif
+  return (stack);
+}
+
+/* STACK_TOP == 0, STACK_BOTTOM == -1 */
+/* this code correctly handles the negative 'where' and Nobject == 0 */
+
+/* push object on stack at given location */
+int PushStack (Stack *stack, int where, void *object, int id, char *name) {
+
+  int i;
+
+  PrintStackInfo (stack, __func__);
+  ASSERT (stack != NULL, "stack not set");
+  LockStack (stack);
+
+  if (where < 0) where += stack[0].Nobject + 1;
+  if (where < 0) {
+    UnlockStack (stack);
+    return (FALSE);
+  }
+  if (where > stack[0].Nobject) {
+    UnlockStack (stack);
+    return (FALSE);
+  }
+
+  /* extend stack as needed */
+  if (stack[0].Nobject >= stack[0].NOBJECT) {
+    stack[0].NOBJECT += 100;
+    REALLOCATE (stack[0].object, void *, stack[0].NOBJECT);
+    REALLOCATE (stack[0].name,   char *, stack[0].NOBJECT);
+    REALLOCATE (stack[0].id,     int, stack[0].NOBJECT);
+  }
+
+  for (i = stack[0].Nobject; i > where; i--) {
+    stack[0].object[i] = stack[0].object[i-1];
+    stack[0].name[i]   = stack[0].name[i-1];
+    stack[0].id[i]     = stack[0].id[i-1];
+  }
+  stack[0].object[where] = object;
+  stack[0].name[where]   = name;
+  stack[0].id[where]     = id;
+  stack[0].Nobject ++;
+
+  UnlockStack (stack);
+  return (TRUE);
+}
+
+/* get object from specified point in stack (negative == distance from end) */
+void *PullStackByLocation (Stack *stack, int where) {
+
+  void *object;
+  
+  PrintStackInfo (stack, __func__);
+  ASSERT (stack != NULL, "stack not set");
+  LockStack (stack);
+
+  if (where < 0) where += stack[0].Nobject;
+  if (where < 0) { 
+    UnlockStack (stack); 
+    return (NULL); 
+  }
+  if (where >= stack[0].Nobject) {
+    UnlockStack (stack); 
+    return (NULL);
+  }
+
+  object = stack[0].object[where];
+  RemoveStackEntry (stack, where);
+  UnlockStack (stack); 
+  return (object);
+}
+
+/* get object from stack which matches name */
+void *PullStackByName (Stack *stack, char *name) {
+
+  int i;
+  void *object;
+
+  PrintStackInfo (stack, __func__);
+  ASSERT (stack != NULL, "stack not set");
+  LockStack (stack);
+
+  for (i = 0; i < stack[0].Nobject; i++) {
+    if (strcasecmp (stack[0].name[i], name)) continue;
+
+    /* here is the element of interest */
+    object = stack[0].object[i];
+    RemoveStackEntry (stack, i);
+    UnlockStack (stack); 
+    return (object);
+  }
+  UnlockStack (stack); 
+  return (NULL);
+}
+
+/* get object from point in stack (negative == distance from end) */
+void *PullStackByID (Stack *stack, int id) {
+
+  int i;
+  void *object;
+  
+  PrintStackInfo (stack, __func__);
+  ASSERT (stack != NULL, "stack not set");
+  LockStack (stack);
+
+  for (i = 0; i < stack[0].Nobject; i++) {
+    if (stack[0].id[i] != id) continue;
+
+    /* here is the element of interest */
+    object = stack[0].object[i];
+    RemoveStackEntry (stack, i);
+    UnlockStack (stack); 
+    return (object);
+  }
+  UnlockStack (stack); 
+  return (NULL);
+}
+
+/* should only be called if you know where is a valid entry */
+int RemoveStackEntry (Stack *stack, int where) {
+
+  int i;
+
+  PrintStackInfo (stack, __func__);
+  ASSERT (stack != NULL, "stack not set");
+
+  if (where < 0) abort();
+  if (where >= stack[0].Nobject) abort();
+  if (stack[0].Nobject < 1) abort();
+
+  /* shift the remaining entries by one */
+  /* XXX free associated memory */
+  stack[0].Nobject --;
+  for (i = where; i < stack[0].Nobject; i++) {
+    stack[0].object[i] = stack[0].object[i+1];
+    stack[0].name[i]   = stack[0].name[i+1];
+    stack[0].id[i]     = stack[0].id[i+1];
+  }
+  return (TRUE);
+}
+
+/* should only be called if you manually lock the stack */
+void *RemoveStackByID (Stack *stack, int id) {
+
+  int i;
+  void *object;
+  
+  PrintStackInfo (stack, __func__);
+  ASSERT (stack != NULL, "stack not set");
+  for (i = 0; i < stack[0].Nobject; i++) {
+    if (stack[0].id[i] != id) continue;
+
+    /* here is the element of interest */
+    object = stack[0].object[i];
+    RemoveStackEntry (stack, i);
+    return (object);
+  }
+  return (NULL);
+}
+
+void LockStack (Stack *stack) {
+# ifdef THREADED
+  PrintStackInfo (stack, __func__);
+  ASSERT (stack != NULL, "stack not set");
+  pthread_mutex_lock (&stack[0].mutex);
+# endif
+  return;
+}
+
+void UnlockStack (Stack *stack) {
+# ifdef THREADED
+  PrintStackInfo (stack, __func__);
+  ASSERT (stack != NULL, "stack not set");
+  pthread_mutex_unlock (&stack[0].mutex);
+# endif
+  return;
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StartHost.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StartHost.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StartHost.c	(revision 15879)
@@ -0,0 +1,47 @@
+# include "pcontrol.h"
+# define RETRY_BASE 10.0
+
+int StartHost (Host *host) {
+
+  int pid;
+  int stdio[3];
+  char command[64], shell[64];
+  struct timeval now;
+  float delta;
+
+  /* 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");
+
+  if (VerboseMode()) gprint (GP_ERR, "starting host within thread %d\n", pthread_self());
+
+  pid = rconnect (command, host[0].hostname, shell, stdio);
+  if (!pid) {     
+    /** failure to start: extend retry period **/
+    if (VerboseMode()) gprint (GP_ERR, "failure to start %s\n", host[0].hostname);
+    gettimeofday (&now, (void *) NULL);
+    if (ZTIME(host[0].nexttry) || ZTIME(host[0].lasttry)) {
+      /* reset retry period if either is zero */
+      delta = RETRY_BASE;
+    } else {
+      delta = 2*DTIME (host[0].nexttry, host[0].lasttry);
+    }
+    host[0].nexttry.tv_sec  = now.tv_sec  + delta;
+    host[0].nexttry.tv_usec = now.tv_usec;
+    host[0].lasttry.tv_sec  = now.tv_sec;
+    host[0].lasttry.tv_usec = now.tv_usec;
+    PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+    return (FALSE);
+  }
+  host[0].nexttry.tv_sec  = 0;
+  host[0].nexttry.tv_usec = 0;
+  host[0].lasttry.tv_sec  = 0;
+  host[0].lasttry.tv_usec = 0;
+
+  host[0].stdin_fd  = stdio[0];
+  host[0].stdout_fd = stdio[1];
+  host[0].stderr_fd = stdio[2];
+  host[0].pid       = pid;
+  PutHost (host, PCONTROL_HOST_IDLE, STACK_BOTTOM);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StartJob.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StartJob.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StartJob.c	(revision 15879)
@@ -0,0 +1,102 @@
+# include "pcontrol.h"
+
+int StartJob (Job *job, Host *host) {
+
+  int  i, Nline, status;
+  char *line, *p;
+  IOBuffer buffer;
+
+  InitIOBuffer (&buffer, 0x100);
+
+  /* job must have assigned host */
+  ASSERT (job != NULL, "missing job");
+  ASSERT (host != NULL, "missing host");
+  ASSERT (host == (Host *) job[0].host, "invalid host");
+  ASSERT (job  == (Job *) host[0].job, "invalid job");
+
+  /* construct command line : job arg0 arg1 ... argN\n */
+  Nline = 10 + job[0].argc;
+  for (i = 0; i < job[0].argc; i++) {
+    Nline += strlen (job[0].argv[i]);
+  }
+  ALLOCATE (line, char, Nline);
+  bzero (line, Nline);
+  strcpy (line, "job");
+  for (i = 0; i < job[0].argc; i++) {
+    strcat (line, " ");
+    strcat (line, job[0].argv[i]);
+  }
+
+  status = PclientCommand (host, line, PCLIENT_PROMPT, &buffer);
+  free (line);
+
+  /* check on success of pclient command */
+  switch (status) {
+    case PCLIENT_DOWN:
+      if (VerboseMode()) gprint (GP_ERR, "host %s is down\n", host[0].hostname);
+      goto failure;
+
+    case PCLIENT_HUNG:
+      // we need the job start to return a valid Job ID, 
+      // give up on jobs which don't get started.
+      // XXX we are sensitive here to the time it takes pclient
+      // to fork the job.  if this is slow, the client may appear to hang.
+      gprint (GP_ERR, "host %s is not responding (StartJob)\n", host[0].hostname);
+      if (VerboseMode()) gprint (GP_ERR, "host %s is not responding\n", host[0].hostname);
+
+      // unlink host & job
+      job[0].host = NULL;
+      host[0].job = NULL;
+      if (job[0].realhost) free (job[0].realhost);
+      job[0].realhost = NULL;
+      PutHost (host, PCONTROL_HOST_DONE, STACK_BOTTOM);
+      PutJob (job, PCONTROL_JOB_PENDING, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      return (FALSE);
+
+    case PCLIENT_GOOD:
+      if (VerboseMode()) gprint (GP_ERR, "message received (StartJob)\n");  
+      break;
+
+    default:
+      ABORT ("unknown status for pclient command");  
+  }
+
+  /* check on result of pclient command */
+  p = memstr (buffer.buffer, "STATUS", buffer.Nbuffer);
+  ASSERT (p != NULL, "missing STATUS in pclient message");
+
+  sscanf (p, "%*s %d", &status);
+  switch (status) {
+    case -1:
+      if (VerboseMode()) gprint (GP_ERR, "error in pclient child\n");
+      goto failure;
+
+    case -2:
+      ABORT ("syntax error in pclient command");
+
+    case -3:
+      ABORT ("existing child on pclient");
+
+    default:
+      job[0].realhost = strcreate (host[0].hostname);
+      job[0].pid = status;
+      PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
+      PutJob (job, PCONTROL_JOB_BUSY, STACK_BOTTOM);
+      FreeIOBuffer (&buffer);
+      gettimeofday (&job[0].start, (void *) NULL);
+      return (TRUE);
+  }
+  /* we should never reach here */
+  ABORT ("should not reach here (StartJob)");
+
+failure:
+  // unlink host & job
+  job[0].host = NULL;
+  host[0].job = NULL;
+  HarvestHost (host[0].pid);
+  PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+  PutJob (job, PCONTROL_JOB_PENDING, STACK_BOTTOM);
+  FreeIOBuffer (&buffer);
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StopHosts.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StopHosts.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/StopHosts.c	(revision 15879)
@@ -0,0 +1,156 @@
+# include "pcontrol.h"
+
+void DownHost (Host *host) {
+  CLOSE (host[0].stdin_fd);
+  CLOSE (host[0].stdout_fd);
+  CLOSE (host[0].stderr_fd);
+  host[0].job = NULL;
+  PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+}
+
+void OffHost (Host *host) {
+  CLOSE (host[0].stdin_fd);
+  CLOSE (host[0].stdout_fd);
+  CLOSE (host[0].stderr_fd);
+  host[0].job = NULL;
+  PutHost (host, PCONTROL_HOST_OFF, STACK_BOTTOM);
+}
+
+/* for use by shutdown: force machines which are up to go down
+   wait for a little while for the client thread to take care 
+   of them
+*/
+   
+int DownHosts () {
+
+  int i, Nobject, Nwait;
+  Stack *stack;
+  Host  *host;
+
+  SetCheckPoint (); // ensure we can find the specified host
+  stack = GetHostStack (PCONTROL_HOST_IDLE);
+  ASSERT (stack != NULL, "stack missing");
+  Nobject = stack[0].Nobject;
+  for (i = 0; i < Nobject; i++) {
+    host = PullStackByLocation (stack, STACK_TOP);
+    if (host == NULL) continue;
+    host[0].markoff = TRUE;
+    PutHost (host, PCONTROL_HOST_IDLE, STACK_BOTTOM);
+  }
+
+  stack = GetHostStack (PCONTROL_HOST_BUSY);
+  ASSERT (stack != NULL, "stack missing");
+  Nobject = stack[0].Nobject;
+  for (i = 0; i < Nobject; i++) {
+    host = PullStackByLocation (stack, STACK_TOP);
+    if (host == NULL) continue;
+    host[0].markoff = TRUE;
+    PutHost (host, PCONTROL_HOST_IDLE, STACK_BOTTOM);
+  }
+  ClearCheckPoint ();
+
+  Nwait = 0;
+  stack = GetHostStack (PCONTROL_HOST_IDLE);
+  ASSERT (stack != NULL, "stack missing");
+
+  gprint (GP_ERR, "waiting for clients to exit");
+  while ((Nwait < 15) && stack[0].Nobject) {
+    gprint (GP_ERR, ".");
+    usleep (100000); // wait for clients to exit
+    Nwait++;
+  }
+  gprint (GP_ERR, "\n");
+  if (stack[0].Nobject) {
+    gprint (GP_ERR, "trouble shutting down all pclient instances: %d still alive\n", stack[0].Nobject);
+  } else {
+    gprint (GP_ERR, "done\n");
+  }
+  return (TRUE);
+}
+
+int StopHost (Host *host) {
+
+  int       status;
+  IOBuffer  buffer;
+
+  InitIOBuffer (&buffer, 0x100);
+  status = PclientCommand (host, "exit", "Goodbye", &buffer);
+
+  /* check on success of pclient command */
+  switch (status) {
+    case PCLIENT_DOWN:
+      break;
+
+    case PCLIENT_HUNG:
+      gprint (GP_ERR, "host %s is not responding\n", host[0].hostname);
+      break;
+
+    case PCLIENT_GOOD:
+      break;
+
+    default:
+      gprint (GP_ERR, "unknown status for pclient command: programming error\n");  
+      pcontrol_exit (1);
+  }
+  HarvestHost (host[0].pid);
+  return (TRUE);
+}
+
+/* the host is thought to be down; check for child exit status */
+int HarvestHost (int pid) {
+  
+  int i, result, waitstatus;
+
+  gprint (GP_ERR, "harvesting within thread %d\n", pthread_self());
+  gprint (GP_ERR, "child process %d is down, wait for exit status\n", pid);
+  
+  // Loop a few times waiting for child to exit
+  for (i = 0; i < 50; i++) {
+    result = waitpid (pid, &waitstatus, WNOHANG);
+    if ((result == -1) && (errno == ECHILD)) {
+      usleep (10000); // wait for child to exit
+      continue;
+    } else {
+      break;
+    }
+  }
+  switch (result) {
+    case -1:  /* error with waitpid */
+      switch (errno) {
+	case ECHILD:
+	  gprint (GP_ERR, "unknown PID, not a child proc\n");
+	  gprint (GP_ERR, "did process already exit?  programming error?\n");
+	  break;
+	case EINTR:
+	case EINVAL:
+	default:
+	  perror ("unexpected error");
+	  ABORT ("(HarvestHost)");
+      }
+      break;
+      
+    case 0:
+      gprint (GP_ERR, "child did not exit??");
+      abort ();
+      /** put back in IDLE state? **/
+      break;
+
+    default:
+      if (result != pid) {
+	gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, pid);
+	pcontrol_exit (1);
+      }
+      
+      if (WIFEXITED(waitstatus)) {
+	if (VerboseMode()) gprint (GP_ERR, "child exited with status %d\n", WEXITSTATUS(waitstatus));
+      }
+      if (WIFSIGNALED(waitstatus)) {
+	if (VerboseMode()) gprint (GP_ERR, "child crashed with status %d\n", WTERMSIG(waitstatus));
+      }
+      if (WIFSTOPPED(waitstatus)) {
+        gprint (GP_ERR, "waitpid returns 'stopped': programming error\n");
+	pcontrol_exit (1);
+      }
+  }
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/check.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/check.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/check.c	(revision 15879)
@@ -0,0 +1,58 @@
+# include "pcontrol.h"
+
+int check (int argc, char **argv) {
+
+  Job *job;
+  Host *host;
+  int JobID, HostID, StackID;
+
+  if (argc != 3) {
+    gprint (GP_LOG, "USAGE: check job (JobID)\n");
+    gprint (GP_LOG, "USAGE: check host (HostID)\n");
+    return (FALSE);
+  }
+
+  if (!strcasecmp (argv[1], "JOB")) {
+    JobID = atoi (argv[2]);
+
+    SetCheckPoint ();  // ensure the JOB is on one of the stacks
+    job = PullJobByID (JobID, &StackID);
+    if (job == NULL) {
+      gprint (GP_LOG, "job not found\n");
+      ClearCheckPoint ();
+      return (FALSE);
+    }
+    gprint (GP_LOG, "STATUS %s\n", GetJobStackName(StackID));
+    gprint (GP_LOG, "EXITST %d\n", job[0].exit_status);
+    gprint (GP_LOG, "STDOUT %d\n", job[0].stdout_size);
+    gprint (GP_LOG, "STDERR %d\n", job[0].stderr_size);
+    gprint (GP_LOG, "DTIME %lf\n", job[0].dtime);
+    if (job[0].realhost) {
+	gprint (GP_LOG, "HOSTNAME %s\n", job[0].realhost);
+    } else {
+	gprint (GP_LOG, "HOSTNAME NONE\n");
+    }
+    PutJob (job, StackID, STACK_BOTTOM);
+    ClearCheckPoint ();
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "HOST")) {
+    HostID = atoi (argv[2]);
+
+    SetCheckPoint ();  // ensure the HOST is on one of the stacks
+    host = PullHostByID (HostID, &StackID);
+    if (host == NULL) {
+      gprint (GP_LOG, "host not found\n");
+      ClearCheckPoint ();
+      return (FALSE);
+    }
+    gprint (GP_LOG, "host %s\n", GetHostStackName(StackID));
+    PutHost (host, StackID, STACK_BOTTOM);
+    ClearCheckPoint ();
+    return (TRUE);
+  }
+
+  gprint (GP_LOG, "unknown item to check\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/delete.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/delete.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/delete.c	(revision 15879)
@@ -0,0 +1,45 @@
+# include "pcontrol.h"
+
+int delete (int argc, char **argv) {
+
+  Job *job;
+  int JobID;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: delete (JobID)\n");
+    return (FALSE);
+  }
+  JobID = atoi (argv[1]);
+  /* use a string interp to convert JobIDs to ints ? */
+
+  job = PullJobFromStackByID (PCONTROL_JOB_PENDING, JobID);
+  if (job != NULL) goto found;
+
+  job = PullJobFromStackByID (PCONTROL_JOB_CRASH, JobID);
+  if (job != NULL) goto found;
+
+  job = PullJobFromStackByID (PCONTROL_JOB_EXIT, JobID);
+  if (job != NULL) goto found;
+
+  gprint (GP_ERR, "job %s not PENDING, CRASH, EXIT\n", argv[1]);
+  return (FALSE);
+  
+found:
+  {
+    int j;
+    gprint (GP_LOG, "deleting job  %s  %d  ", job[0].hostname, job[0].argc);
+    for (j = 0; j < job[0].argc; j++) {
+      gprint (GP_LOG, "%s ", job[0].argv[j]);
+    }
+    PrintID (GP_LOG, job[0].JobID);
+    gprint (GP_LOG, "\n");
+  }  
+  DelJob (job);
+
+  return (TRUE);
+}
+
+/**** at the moment, this function requires the job to be in the correct state
+      to be deleted.  This should be changed to kill, then delete job if it is 
+      not in the correct state 
+****/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/help/host
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/help/host	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/help/host	(revision 15879)
@@ -0,0 +1,1 @@
+empty
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/host.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/host.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/host.c	(revision 15879)
@@ -0,0 +1,85 @@
+# include "pcontrol.h"
+
+// we use CheckPoints in this function to prevent objects in flight from being missing.
+int host (int argc, char **argv) {
+
+  int StackID;
+  IDtype HostID;
+  Host *host;
+
+  if (argc != 3) goto usage;
+
+  if (!strcasecmp (argv[1], "ADD")) {
+    HostID = AddHost (argv[2]);
+    gprint (GP_LOG, "HostID: %d\n", (int) HostID);
+    return (TRUE);
+  }
+  if (!strcasecmp (argv[1], "ON")) {
+    host = PullHostFromStackByName (PCONTROL_HOST_OFF, argv[2]);
+    if (!host) {
+      gprint (GP_LOG, "host %s is not OFF\n", argv[2]);
+      return (FALSE);
+    }
+    host[0].markoff = FALSE;
+    DownHost (host);
+    return (TRUE);
+  }
+  if (!strcasecmp (argv[1], "RETRY")) {
+    // no need to use a check point [thief: CheckDownHost (DOWN->IDLE)]
+    host = PullHostFromStackByName (PCONTROL_HOST_DOWN, argv[2]);
+    if (!host) {
+      gprint (GP_LOG, "host %s is not DOWN\n", argv[2]);
+      return (FALSE);
+    }
+    /* reset time, place back on DOWN stack */
+    host[0].nexttry.tv_sec  = 0;
+    host[0].nexttry.tv_usec = 0;
+    host[0].lasttry.tv_sec  = 0;
+    host[0].lasttry.tv_usec = 0;
+    PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
+    return (TRUE);
+  }
+  if (!strcasecmp (argv[1], "CHECK")) {
+    SetCheckPoint ();  // ensure the host is on one of the stacks
+    host = PullHostByName (argv[2], &StackID);
+    if (host == NULL) {
+      gprint (GP_LOG, "host %s not found\n", argv[2]);
+      ClearCheckPoint ();
+      return (FALSE);
+    }
+    PutHost (host, StackID, STACK_BOTTOM);
+    ClearCheckPoint ();
+
+    gprint (GP_LOG, "host %s is %s\n", argv[2], GetHostStackName (StackID));
+    return (TRUE);
+  }
+  if (!strcasecmp (argv[1], "OFF")) {
+    SetCheckPoint (); // ensure we can find the specified host
+    host = PullHostByName (argv[2], &StackID);
+    if (host == NULL) {
+      gprint (GP_LOG, "host %s not found\n", argv[2]);
+      ClearCheckPoint ();
+      return (FALSE);
+    }
+    host[0].markoff = TRUE;
+    PutHost (host, StackID, STACK_BOTTOM);
+    ClearCheckPoint ();
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "DELETE")) {
+    // a check point is not required: no possible thief
+    host = PullHostFromStackByName (PCONTROL_HOST_OFF, argv[2]);
+    if (!host) {
+      gprint (GP_LOG, "host %s is not OFF\n", argv[2]);
+      return (FALSE);
+    }
+    DelHost (host);
+    return (TRUE);
+  }
+  
+usage:
+  gprint (GP_LOG, "USAGE: host (command) (hostname)\n");
+  gprint (GP_ERR, "  valid commands: add, on, retry, check, off, delete\n");
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/hoststack.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/hoststack.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/hoststack.c	(revision 15879)
@@ -0,0 +1,34 @@
+# include "pcontrol.h"
+
+int hoststack (int argc, char **argv) {
+
+  int i;
+  Stack *stack;
+  Host *host;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: hoststack (hoststack)\n");
+    gprint (GP_ERR, "       (hoststack) : idle, busy, done, down, off\n");
+    return (FALSE);
+  }
+
+  /* select hoststack */
+  stack = GetHostStackByName (argv[1]);
+  if (stack == NULL) {
+    gprint (GP_ERR, "hoststack not found\n");
+    return (FALSE);
+  }
+
+  /* print list */
+  LockStack (stack);
+  gprint (GP_LOG, "Nhosts: %d\n", stack[0].Nobject);
+  for (i = 0; i < stack[0].Nobject; i++) {
+    host = stack[0].object[i];
+    gprint (GP_LOG, "%lld %s\n", host[0].HostID, host[0].hostname);
+  }
+  UnlockStack (stack);
+
+  return (TRUE);
+}
+
+// Safe with PTHREAD_MUTEX_INITIALIZER lock
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/init.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/init.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/init.c	(revision 15879)
@@ -0,0 +1,47 @@
+# include "pcontrol.h"
+
+int check       PROTO((int, char **));
+int delete      PROTO((int, char **));
+int host        PROTO((int, char **));
+int hoststack   PROTO((int, char **));
+int job	        PROTO((int, char **));
+int jobstack    PROTO((int, char **));
+int kill_pc     PROTO((int, char **));
+int status      PROTO((int, char **));
+int run         PROTO((int, char **));
+int stderr_pc   PROTO((int, char **));
+int stdout_pc   PROTO((int, char **));
+int verbose     PROTO((int, char **));
+int version     PROTO((int, char **));
+
+// pulse is only available in the un-threaded version
+int pulse       PROTO((int, char **));
+
+static Command cmds[] = {  
+  {"host",      host,      "add / delete / modify host"},
+  {"hoststack", hoststack, "list hosts for a single stack"},
+  {"status",    status,    "get system status"},
+  {"stop",      run,       "stop controller processing"},
+  {"run",       run,       "set controller runlevel"},
+  {"verbose",   verbose,   "set the verbose mode for job"},
+  {"version",   version,   "show version information"},
+  {"job",       job,       "add job"},
+  {"jobstack",  jobstack,  "list jobs for a single stack"},
+  {"check",     check,     "get job or host status"},
+  {"delete",    delete,    "delete job"},
+  {"kill",      kill_pc,   "kill job"},
+  {"stderr",    stderr_pc, "get stderr buffer for job"},
+  {"stdout",    stdout_pc, "get stdout buffer for job"},
+# ifndef THREADED
+  {"pulse",     pulse,     "set system pulse"},
+# endif
+}; 
+
+void InitPcontrol () {
+  
+  int i;
+
+  for (i = 0; i < sizeof (cmds) / sizeof (Command); i++) {
+    AddCommand (&cmds[i]);
+  }
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/job.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/job.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/job.c	(revision 15879)
@@ -0,0 +1,52 @@
+# include "pcontrol.h"
+
+int job (int argc, char **argv) {
+
+  char *Host, **targv;
+  int i, N, Mode, targc, Timeout;
+  IDtype JobID;
+
+  if (get_argument (argc, argv, "-host") && get_argument (argc, argv, "+host")) {
+      gprint (GP_ERR, "ERROR: -host and +host are incompatible\n");
+      return (FALSE);
+  }    
+
+  Host = NULL;
+  Mode = PCONTROL_JOB_ANYHOST;
+  if ((N = get_argument (argc, argv, "-host"))) {
+    remove_argument (N, &argc, argv);
+    Host = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    Mode = PCONTROL_JOB_WANTHOST;
+  }
+  if ((N = get_argument (argc, argv, "+host"))) {
+    remove_argument (N, &argc, argv);
+    Host = strcreate (argv[N]);
+    remove_argument (N, &argc, argv);
+    Mode = PCONTROL_JOB_NEEDHOST;
+  }
+  if (Host == NULL) Host = strcreate ("anyhost");
+ 
+  Timeout = 100;
+  if ((N = get_argument (argc, argv, "-timeout"))) {
+    remove_argument (N, &argc, argv);
+    Timeout = atoi (argv[N]);
+    remove_argument (N, &argc, argv);
+  }
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: job [options] (arg0) (arg1) ... (argN)\n");
+    FREE (Host);
+    return (FALSE);
+  }
+  
+  targc = argc - 1;
+  ALLOCATE (targv, char *, targc);
+  for (i = 1; i < argc; i++) {
+    targv[i-1] = strcreate (argv[i]);
+  }
+
+  JobID = AddJob (Host, Mode, Timeout, targc, targv);
+  gprint (GP_LOG, "JobID: %d\n", (int) JobID);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/jobstack.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/jobstack.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/jobstack.c	(revision 15879)
@@ -0,0 +1,40 @@
+# include "pcontrol.h"
+
+int jobstack (int argc, char **argv) {
+
+  int i;
+  Stack *stack;
+  Job *job;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: jobstack (jobstack)\n");
+    gprint (GP_ERR, "       (jobstack) : pending, busy, exit, crash, hung, done\n");
+    return (FALSE);
+  }
+
+  /* select jobstack */
+  stack = GetJobStackByName (argv[1]);
+  if (stack == NULL) {
+    gprint (GP_ERR, "jobstack not found\n");
+    return (FALSE);
+  }
+
+  /* print list */
+  LockStack (stack);
+  gprint (GP_LOG, "Njobs: %d\n", stack[0].Nobject);
+  for (i = 0; i < stack[0].Nobject; i++) {
+    job = stack[0].object[i];
+    /* PrintID (GP_LOG, job[0].JobID); */
+    gprint (GP_LOG, "%lld ", job[0].JobID);
+    if (job[0].realhost) {
+	gprint (GP_LOG, "%s   %s\n", job[0].argv[0], job[0].realhost);
+    } else {
+	gprint (GP_LOG, "%s  (%s)\n", job[0].argv[0], job[0].hostname);
+    }
+  }
+  UnlockStack (stack);
+
+  return (TRUE);
+}
+
+// Safe with PTHREAD_MUTEX_INITIALIZER lock
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/kill.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/kill.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/kill.c	(revision 15879)
@@ -0,0 +1,24 @@
+# include "pcontrol.h"
+
+int kill_pc (int argc, char **argv) {
+
+  Job *job;
+  int JobID;
+
+  if (argc < 2) {
+    gprint (GP_ERR, "USAGE: kill (JobID)\n");
+    return (FALSE);
+  }
+  JobID = atoi (argv[1]);
+
+  /* XXX this function should only fail if a process is hung */
+  job = PullJobFromStackByID (PCONTROL_JOB_BUSY, JobID);
+  if (job == NULL) {
+    gprint (GP_ERR, "job %s not BUSY\n", argv[1]);
+    /* make output message more readable by scheduler */
+    return (FALSE);
+  }
+
+  PutJob (job, PCONTROL_JOB_KILL, STACK_BOTTOM);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/pcontrol.c.in
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/pcontrol.c.in	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/pcontrol.c.in	(revision 15879)
@@ -0,0 +1,94 @@
+# include "pcontrol.h"
+
+# define opihi_name "PCONTROL"
+# define opihi_prompt "pcontrol: "
+# define opihi_description "pcontrol client shell\n"
+# define opihi_history ".pcontrol"
+# define opihi_rcfile ".pcontrolrc"
+
+/* program-dependent initialization */
+void program_init (int *argc, char **argv) {
+  
+# ifdef THREADED  
+  pthread_t clientsThread;
+# endif
+
+  auto_break = TRUE;
+
+  /* load the commands used by this implementation */
+  InitBasic ();
+  InitPcontrol ();
+
+  InitJobStacks ();
+  InitHostStacks ();
+
+  /* set global signal masks (these apply to all threads launched below) */
+  // signal (SIGPIPE, gotsignal);
+  signal (SIGTSTP, gotsignal);
+  signal (SIGTTIN, gotsignal);
+
+  rl_readline_name = opihi_name;
+  rl_attempted_completion_function = command_completer;
+# ifdef THREADED
+  SetRunLevel (PCONTROL_RUN_ALL);
+  pthread_create (&clientsThread, NULL, &CheckSystem_Threaded, NULL);
+  rl_event_hook = NULL;
+  rl_set_keyboard_input_timeout (1000); 
+# else
+  rl_event_hook = CheckSystem;
+  rl_set_keyboard_input_timeout (1000); 
+# endif  
+
+  // set_str_variable ("HISTORY", opihi_history);
+  set_str_variable ("PROMPT", opihi_prompt);
+  set_str_variable ("RCFILE", opihi_rcfile);
+
+  {
+    char *helpdir;
+    char *modules;
+    static char *datadir = "@DATADIR@";
+    ALLOCATE (helpdir, char, strlen(datadir) + strlen("/help") + 2);
+    sprintf (helpdir, "%s/help", datadir);
+    set_str_variable ("HELPDIR", helpdir);
+    free (helpdir);
+    ALLOCATE (modules, char, strlen(datadir) + strlen("/modules") + 2);
+    sprintf (modules, "%s/modules", datadir);
+    set_str_variable ("MODULES:0", modules);
+    set_int_variable ("MODULES:n", 1);
+    free (modules);
+  }
+
+  /* ignore the history file.  to change this, see, eg, mana.c */
+  return;
+}
+
+/* standard welcome message */
+void welcome () {
+  gprint (GP_ERR, "\n");
+  gprint (GP_ERR, "Welcome to %s - %s\n\n", opihi_name, opihi_description);
+}
+
+/* add program-dependent exit functions here */
+void cleanup () {
+  DownHosts ();
+  return;
+}
+
+void gotsignal (int signum) {
+  // this message is lost if we are connected to a pantasks
+  fprintf (stderr, "got signal : %d\n", signum);
+  return;
+}
+
+/* call to opihi shell */
+int main (int argc, char **argv) {
+  int status;
+  status = opihi (argc, argv);
+  abort ();	
+  exit (status);
+}
+
+void pcontrol_exit (int n) {
+  abort ();
+  exit (n);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/pulse.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/pulse.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/pulse.c	(revision 15879)
@@ -0,0 +1,16 @@
+# include "pantasks.h"
+
+int pulse (int argc, char **argv) {
+
+  int Nusec;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: pulse (microseconds)\n");
+    return (FALSE);
+  }
+
+  Nusec = atoi (argv[1]);
+  rl_set_keyboard_input_timeout (Nusec); 
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/rconnect.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/rconnect.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/rconnect.c	(revision 15879)
@@ -0,0 +1,148 @@
+# include "pcontrol.h"
+
+/* connection can take a while, allow up to 2 sec */
+# define CONNECT_TIMEOUT 500
+
+/* connect to host, start the shell: ssh hostname pclient -> command hostname shell
+   stdio is an array of file descriptors (stdio[3]) 
+*/
+
+int rconnect (char *command, char *hostname, char *shell, int *stdio) {
+
+  int i, stdin_fd[2], stdout_fd[2], stderr_fd[2], status;
+  int result, waitstatus;
+  pid_t pid;
+  char *p;
+  char **argv;
+  IOBuffer buffer;
+  struct timespec request, remain;
+
+  ASSERT (command != NULL, "command is NULL");
+  ASSERT (hostname != NULL, "hostname is NULL");
+  ASSERT (shell != NULL, "shell is NULL");
+  ASSERT (stdio != NULL, "stdio is NULL");
+
+  bzero (stdin_fd,  2*sizeof(int));
+  bzero (stdout_fd, 2*sizeof(int));
+  bzero (stderr_fd, 2*sizeof(int));
+
+  if (pipe (stdin_fd)  < 0) goto pipe_error;
+  if (pipe (stdout_fd) < 0) goto pipe_error;
+  if (pipe (stderr_fd) < 0) goto pipe_error;
+
+  ALLOCATE (argv, char *, 4);
+  argv[0] = command;
+  argv[1] = hostname;
+  argv[2] = shell;
+  argv[3] = 0;
+
+  pid = fork ();
+  if (!pid) { /* must be child process */
+    if (VerboseMode()) gprint (GP_ERR, "starting remote connection to %s...", hostname);
+
+    /* close the other ends of the pipes */
+    close (stdin_fd[1]);
+    close (stdout_fd[0]);
+    close (stderr_fd[0]);
+
+    /* tie our ends of the pipes to stdin, stdout, stderr */
+    dup2 (stdin_fd[0],  STDIN_FILENO);
+    dup2 (stdout_fd[1], STDOUT_FILENO);
+    dup2 (stderr_fd[1], STDERR_FILENO);
+
+    /* set all three unblocking */
+    setvbuf (stdin,  (char *) NULL, _IONBF, BUFSIZ);
+    setvbuf (stdout, (char *) NULL, _IONBF, BUFSIZ);
+    setvbuf (stderr, (char *) NULL, _IONBF, BUFSIZ);
+
+    status = execvp (argv[0], argv); 
+    gprint (GP_ERR, "error starting remote shell process\n");
+    pcontrol_exit (1);
+  }
+  free (argv);
+
+  /* close the other ends of the pipes */
+  close (stdin_fd[0]);  stdin_fd[0]  = 0;
+  close (stdout_fd[1]); stdout_fd[1] = 0;
+  close (stderr_fd[1]); stderr_fd[1] = 0;
+
+  /* make the pipes non-blocking */
+  fcntl (stdin_fd[1],  F_SETFL, O_NONBLOCK);
+  fcntl (stdout_fd[0], F_SETFL, O_NONBLOCK);
+  fcntl (stderr_fd[0], F_SETFL, O_NONBLOCK);
+
+  /* perform handshake with pclient to verify alive & running */
+  /** this handshake is similar to PclientCommand, but has important differences **/
+  InitIOBuffer (&buffer, 0x100);
+
+  /* send handshake command */
+  status = write_fmt (stdin_fd[1], "echo CONNECTED\n");
+  if ((status == -1) && (errno == EPIPE)) goto connect_error;
+
+  /* try to get evidence connection is alive - wait upto a few seconds */
+  p = NULL;
+  status = -1;
+  for (i = 0; (i < CONNECT_TIMEOUT) && (status != 0) && (p == NULL); i++) {
+    status = ReadtoIOBuffer (&buffer, stdout_fd[0]);
+    p = memstr (buffer.buffer, "CONNECTED", buffer.Nbuffer);
+    usleep (10000); // wait for client to be connected
+  }
+  if (status == 0) goto connect_error;
+  if (status == -1) goto connect_error;
+  if (VerboseMode()) gprint (GP_ERR, "%d cycles to connect\n", i);
+  FreeIOBuffer (&buffer);
+
+  if (VerboseMode()) gprint (GP_ERR, "Connected\n");
+
+  stdio[0] = stdin_fd[1];
+  stdio[1] = stdout_fd[0];
+  stdio[2] = stderr_fd[0];
+
+  return (pid);
+
+pipe_error:
+  perror ("pipe error:");
+  goto close_pipes;
+
+connect_error:
+  if (VerboseMode()) gprint (GP_ERR, "error while connecting\n");
+
+  /* avoid blocking on waitpid, test every 100 usec, up to 50 msec */
+  request.tv_sec = 0;
+  request.tv_nsec = 100000;
+
+  /* harvest the child process: kill & wait (< 100 ms) for exit */
+  kill (pid, SIGKILL);
+  result = waitpid (pid, &waitstatus, WNOHANG);
+  for (i = 0; (i < 50) && (result == 0); i++) {
+    nanosleep (&request, &remain);
+    result = waitpid (pid, &waitstatus, WNOHANG);
+  }
+
+  if ((result == -1) && (errno != ECHILD)) {
+    gprint (GP_ERR, "unexpected error from waitpid (%d): programming error\n", errno);
+    pcontrol_exit (1);
+  }
+  if (result == 0) {
+    if (VerboseMode()) gprint (GP_ERR, "child did not exit (rconnect)??");
+  }
+  if (result > 0) {
+    if (result != pid) {
+      gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, pid);
+      pcontrol_exit (1);
+    }
+    if (WIFSTOPPED(waitstatus)) {
+      gprint (GP_ERR, "waitpid returns 'stopped': programming error\n");
+      pcontrol_exit (1);
+    }
+  }
+
+close_pipes:
+  if (stdin_fd[0]  != 0) close (stdin_fd[0]);
+  if (stdin_fd[1]  != 0) close (stdin_fd[1]);
+  if (stdout_fd[0] != 0) close (stdout_fd[0]);
+  if (stdout_fd[1] != 0) close (stdout_fd[1]);
+  if (stderr_fd[0] != 0) close (stderr_fd[0]);
+  if (stderr_fd[1] != 0) close (stderr_fd[1]);
+  return (FALSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/run.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/run.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/run.c	(revision 15879)
@@ -0,0 +1,66 @@
+# include "pcontrol.h"
+
+int run (int argc, char **argv) {
+
+  RunLevels level;
+
+  if ((argc > 2) ||
+      get_argument (argc, argv, "help") ||
+      get_argument (argc, argv, "-h") ||
+      get_argument (argc, argv, "--help")) 
+  {
+    if (!strcmp (argv[0], "run")) {
+      gprint (GP_ERR, "USAGE: run [level]\n");
+      gprint (GP_ERR, "  allowed levels:\n");
+      gprint (GP_ERR, "  all (default) : manage machines, spawn jobs, harvest jobs\n");
+      gprint (GP_ERR, "  reap          : manage machines, harvest jobs\n");
+      gprint (GP_ERR, "  hosts         : manage machines, not jobs\n");
+      gprint (GP_ERR, "  none          : all stop\n");
+    } else {
+      gprint (GP_ERR, "USAGE: stop (immediate processing halt)\n");
+    }
+    return (FALSE);
+  }
+
+  level = PCONTROL_RUN_UNKNOWN;
+  if (argc == 1) {
+    if (!strcasecmp (argv[0], "run")) level = PCONTROL_RUN_ALL;
+    if (!strcasecmp (argv[0], "stop")) level = PCONTROL_RUN_NONE;
+  } else {
+    if (!strcasecmp (argv[1], "all")) level = PCONTROL_RUN_ALL;
+    if (!strcasecmp (argv[1], "reap")) level = PCONTROL_RUN_REAP;
+    if (!strcasecmp (argv[1], "host")) level = PCONTROL_RUN_HOSTS;
+    if (!strcasecmp (argv[1], "hosts")) level = PCONTROL_RUN_HOSTS;
+    if (!strcasecmp (argv[1], "none")) level = PCONTROL_RUN_NONE;
+  }
+
+  if (level == PCONTROL_RUN_UNKNOWN) {
+    gprint (GP_ERR, "  unknown run level %s\n", argv[1]);
+    gprint (GP_ERR, "  allowed levels:\n");
+    gprint (GP_ERR, "  all (default) : manage machines, spawn jobs, harvest jobs\n");
+    gprint (GP_ERR, "  reap          : manage machines, harvest jobs\n");
+    gprint (GP_ERR, "  hosts         : manage machines, not jobs\n");
+    gprint (GP_ERR, "  none          : all stop\n");
+    return (FALSE);
+  }
+
+# ifdef THREADED
+  SetRunLevel (level);
+# else
+  if (level == PCONTROL_RUN_NONE) {
+    rl_event_hook = NULL;
+  } else {
+    rl_event_hook = CheckSystem;
+  }
+# endif
+
+  return (TRUE);
+}
+
+/* 
+   run levels:
+   all (manage machines, spawn jobs, harvest jobs)
+   reap (manage machines, harvest jobs)
+   hosts (manage machines, not jobs)
+   none (all stop)
+*/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/status.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/status.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/status.c	(revision 15879)
@@ -0,0 +1,76 @@
+# include "pcontrol.h"
+
+int PrintJobStack (int Nstack);
+int PrintHostStack (int Nstack);
+
+int status (int argc, char **argv) {
+
+  SetCheckPoint ();
+  PrintJobStack (PCONTROL_JOB_PENDING);
+  PrintJobStack (PCONTROL_JOB_BUSY);
+  PrintJobStack (PCONTROL_JOB_DONE);
+  PrintJobStack (PCONTROL_JOB_KILL);
+  PrintJobStack (PCONTROL_JOB_EXIT);
+  PrintJobStack (PCONTROL_JOB_CRASH);
+
+  PrintHostStack (PCONTROL_HOST_OFF);
+  PrintHostStack (PCONTROL_HOST_DOWN);
+  PrintHostStack (PCONTROL_HOST_IDLE);
+  PrintHostStack (PCONTROL_HOST_BUSY);
+  PrintHostStack (PCONTROL_HOST_DONE);
+  ClearCheckPoint ();
+  return (TRUE);
+}
+
+int PrintJobStack (int Nstack) {
+
+  int i, j, Nobject;
+  Stack *stack;
+  Job *job;
+
+  stack = GetJobStack (Nstack);
+  ASSERT (stack != NULL, "programming error");
+
+  LockStack (stack);
+  Nobject = stack[0].Nobject;
+  gprint (GP_LOG, "job stack %s:  %d objects\n", GetJobStackName(Nstack), Nobject);
+
+  for (i = 0; i < Nobject; i++) {
+    job = stack[0].object[i];
+    ASSERT (job != NULL, "programming error");
+    gprint (GP_LOG, "%d  %s  %d  ", i, job[0].hostname, job[0].argc);
+    for (j = 0; j < job[0].argc; j++) {
+      gprint (GP_LOG, "%s ", job[0].argv[j]);
+    }
+    PrintID (GP_LOG, job[0].JobID);
+    gprint (GP_LOG, "\n");
+  }
+  UnlockStack (stack);
+
+  return (TRUE);
+}
+
+int PrintHostStack (int Nstack) {
+
+  int i, Nobject;
+  Stack *stack;
+  Host *host;
+
+  stack = GetHostStack (Nstack);
+
+  LockStack (stack);
+  Nobject = stack[0].Nobject;
+  gprint (GP_LOG, "host stack %s:  %d objects\n", GetHostStackName(Nstack), Nobject);
+
+  for (i = 0; i < Nobject; i++) {
+    host = stack[0].object[i];
+    gprint (GP_LOG, "%d  %s  ", i, host[0].hostname);
+    PrintID (GP_LOG, host[0].HostID);
+    gprint (GP_LOG, "\n");
+  }
+  UnlockStack (stack);
+
+  return (TRUE);
+}
+
+// Safe with PTHREAD_MUTEX_INITIALIZER lock
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/stdout.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/stdout.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/stdout.c	(revision 15879)
@@ -0,0 +1,71 @@
+# include "pcontrol.h"
+
+int stdout_pc (int argc, char **argv) {
+
+  int JobID, StackID;
+  Job *job;
+  IOBuffer *buffer;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: stdout (JobID)\n");
+    gprint (GP_LOG, "STATUS %d\n", -1);
+    return (FALSE);
+  }
+  
+  /* find Job of interest (must be EXIT or CRASH) */
+  JobID = atoi (argv[1]);
+
+  StackID = PCONTROL_JOB_EXIT;
+  job = PullJobFromStackByID (StackID, JobID);
+  if (job != NULL) goto found_stdout;
+
+  StackID = PCONTROL_JOB_CRASH;
+  job = PullJobFromStackByID (StackID, JobID);
+  if (job != NULL) goto found_stdout;
+
+  gprint (GP_ERR, "job not found in EXIT or CRASH\n");
+  gprint (GP_LOG, "STATUS %d\n", -2);
+  return (FALSE);
+
+found_stdout:
+  buffer = &job[0].stdout_buff;
+  fwrite (buffer[0].buffer, 1, buffer[0].Nbuffer, stdout);
+  gprint (GP_LOG, "STATUS %d\n", 0);
+  PutJob (job, StackID, STACK_BOTTOM);
+  return (TRUE);
+}
+
+int stderr_pc (int argc, char **argv) {
+
+  int JobID, StackID;
+  Job *job;
+  IOBuffer *buffer;
+
+  if (argc != 2) {
+    gprint (GP_ERR, "USAGE: stderr (JobID)\n");
+    gprint (GP_LOG, "STATUS %d\n", -1);
+    return (FALSE);
+  }
+  
+  /* find Job of interest (must be EXIT or CRASH) */
+  JobID = atoi (argv[1]);
+
+  StackID = PCONTROL_JOB_EXIT;
+  job = PullJobFromStackByID (StackID, JobID);
+  if (job != NULL) goto found_stderr;
+
+  StackID = PCONTROL_JOB_CRASH;
+  job = PullJobFromStackByID (StackID, JobID);
+  if (job != NULL) goto found_stderr;
+
+  gprint (GP_ERR, "job not found in EXIT or CRASH\n");
+  gprint (GP_LOG, "STATUS %d\n", -2);
+  return (FALSE);
+
+found_stderr:
+  buffer = &job[0].stderr_buff;
+  fwrite (buffer[0].buffer, 1, buffer[0].Nbuffer, stdout);
+  gprint (GP_LOG, "STATUS %d\n", 0);
+  PutJob (job, StackID, STACK_BOTTOM);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/stop.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/stop.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/stop.c	(revision 15879)
@@ -0,0 +1,17 @@
+# include "pcontrol.h"
+
+int stop (int argc, char **argv) {
+
+  if (argc != 1) {
+    gprint (GP_ERR, "USAGE: stop\n");
+    return (FALSE);
+  }
+
+# ifdef THREADED
+  SetRunSystem (FALSE);
+# else
+  rl_event_hook = NULL;
+# endif
+
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/verbose.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/verbose.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/verbose.c	(revision 15879)
@@ -0,0 +1,37 @@
+# include "pcontrol.h"
+
+static int VERBOSE = FALSE;
+
+int verbose (int argc, char **argv) {
+
+  if (argc == 1) {
+    if (VERBOSE) {
+      gprint (GP_ERR, "verbose mode ON\n");
+    } else {
+      gprint (GP_ERR, "verbose mode OFF\n");
+    }
+    return (TRUE);
+  }
+
+  if (argc == 2) {
+    if (!strcasecmp (argv[1], "ON")) {
+      VERBOSE = TRUE;
+      return (TRUE);
+    }
+    if (!strcasecmp (argv[1], "OFF")) {
+      VERBOSE = FALSE;
+      return (TRUE);
+    }
+    if (!strcasecmp (argv[1], "TOGGLE")) {
+      VERBOSE = ~VERBOSE;
+      return (TRUE);
+    }
+  }
+
+  gprint (GP_ERR, "USAGE: verbose (on/off/toggle)\n");
+  return (FALSE);
+}
+
+int VerboseMode () {
+  return (VERBOSE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/version.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/version.c	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/pcontrol/version.c	(revision 15879)
@@ -0,0 +1,17 @@
+# include "pcontrol.h"
+static char *name = "$Name: not supported by cvs2svn $";
+
+int version (int argc, char **argv) {
+
+  char *tmp;
+
+  gprint (GP_LOG, "\n");
+  gprint (GP_LOG, "pcontrol version: %s\n", (tmp = strip_version (name))); free (tmp);
+
+  gprint (GP_LOG, "opihi version: %s\n", (tmp = strip_version (opihi_version()))); free (tmp);
+  gprint (GP_LOG, "ohana version: %s\n", (tmp = strip_version (ohana_version()))); free (tmp);
+  gprint (GP_LOG, "gfits version: %s\n", (tmp = strip_version (gfits_version()))); free (tmp);
+
+  gprint (GP_LOG, "compiled on %s %s\n", __DATE__, __TIME__);
+  return (TRUE);
+}
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/copy.pro
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/copy.pro	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/copy.pro	(revision 15879)
@@ -0,0 +1,136 @@
+
+# identify the images ready for copy 
+task	       new.images
+  command      new.images
+  host         local
+
+  periods      -poll 1
+  periods      -exec 30
+  periods      -timeout 2
+
+  # success
+  task.exit    0
+    push new.images $stdout
+    $new.image.failure = 0
+  end
+
+  # locked list
+  task.exit    1
+    echo       "new.images: exec failure"
+    $new.image.failure ++
+  end
+
+  # default exit status
+  task.exit    -
+    echo       "new.images: unknown exit status: $EXIT"
+    $new.image.failure ++
+  end
+
+  # operation times out?
+  task.exit    timeout
+    echo       "new.images: timeout"
+    $new.image.failure ++
+  end
+end
+
+# copy specific images from the summit
+task           copy.images
+
+  # these define task properties which are fixed
+
+  period       -exec 2
+  period       -poll 1
+  period       -timeout 50
+
+  # these commands are executed at the start of a new task
+  task.exec
+    local        RemoteName
+    local        FileID
+    local        Host
+
+    queuesize  NewImages -var N
+    if ($N > 0) break
+    if ($network == 0) break
+    if ($filesystem == 1) break
+
+    pop NewImages -var line
+    list tmp -split $line
+    $RemoteName = $tmp:0
+    $FileID     = $tmp:1
+    $Host       = $tmp:2
+    $Ntry       = $tmp:3
+
+    stderr       /data/logfiles/copy/$FileID.log
+    stdout       -queue $FileIDlog
+
+    echo $TaskID
+    echo $TaskName
+    spawn copy.images $RemoteName $FileID $Host -host $Host
+  end
+
+  # success
+  task.exit      0
+    $new.image.failure --
+  end
+
+  # summmit connection failed
+  task.exit      1
+    echo         "copy.images: copy failed $RemoteName $FileID"
+    push         NewImages "$RemoteName $FileID $Host 0"
+    $copy.image.failure ++
+  end
+
+  # target disk full
+  task.exit      2
+    echo         "copy.images: disk full"
+    push         NewImages "$RemoteName $FileID $Host 0"
+    $copy.image.failure ++
+  end
+
+  # file not found
+  task.exit      3
+    echo         "copy.images: missing file"
+    # send a message to OTIS?
+  end
+
+  # task timed out
+  task.exit      timeout
+    echo        "copy.images: timeout"
+    push        NewImages "$RemoteName $FileID $Host 0"
+    $copy.image.failure ++
+  end
+end
+
+# identify the images ready for copy 
+TASK	       new.images
+  COMMAND      new.images
+  HOST         -
+  STDERR       /data/logfiles/new.images.log
+  STDOUT       $stdout
+  EXEC_PERIOD  30
+  POLL_PERIOD  1
+
+  # success
+  EXIT         0
+    STDOUT     @new.images
+    $new.image.failure = 0
+  END
+
+  # locked list
+  EXIT         1
+    MESSAGE    "new.images: exec failure"
+    $new.image.failure ++
+  END
+
+  # default exit status
+  EXIT         -
+    MESSAGE    "new.images: unknown exit status: $EXIT"
+    $new.image.failure ++
+  END
+
+  # operation times out?
+  TIMEOUT      2
+    MESSAGE    "new.images: timeout"
+    $new.image.failure ++
+  END
+END
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/copypool.pro
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/copypool.pro	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/copypool.pro	(revision 15879)
@@ -0,0 +1,117 @@
+
+## A test task to demonstrate cycled copying using pending and done pools (directories)
+##   and pending queues
+
+queueinit stdout
+queueinit stderr
+queueinit pending
+
+$indir = dir.01
+$outdir = dir.02
+
+# set the test rate to be 1ms
+pulse 1000
+
+macro init
+  exec rm -r dir.*
+  exec mkdir $indir
+  exec mkdir $outdir
+end
+
+$Nfile = 0
+task pool.create
+  periods -exec 0.02
+  periods -poll 0.02
+
+  task.exec
+    sprintf filename "foo.%04d.dat" $Nfile
+    $Nfile ++
+    host local
+    command copypool.sh -create $indir $filename
+  end
+
+  task.exit  default
+    queueinit stdout
+    queueinit stderr
+  end
+end
+
+task pool.pending
+  command copypool.sh -pending $indir
+  host local
+
+  periods -exec 5
+  periods -poll 1
+
+  # success
+  task.exit    0
+    local i Nstdout
+
+    # keep only new, unique entries (name is key)
+    queuesize stdout -var Nstdout
+    for i 0 $Nstdout
+      queuepop stdout -var line
+      queuepush pending -uniq -key 0 "$line new"
+    end
+    queueprint pending
+  end
+end
+
+task pool.copy
+  host local
+
+  periods -exec 1
+  periods -poll 1
+
+  task.exec
+    local Npending
+    queuesize pending -var Npending
+    if ($Npending == 0) 
+      periods -exec 1
+      periods -poll 1
+      break
+    end
+
+    # if data is available, run fast to clear it out
+    periods -exec 0.002
+    periods -poll 0.002
+
+    # this step grabs and entry by key and updates a field
+    # can we do this in one step?
+    queuepop pending -var line -key 1 new
+    if ("$line" == "NULL") break
+
+    list tmp -split $line
+    $name = $tmp:0
+
+    queuepush pending "$name run"
+
+    host local
+    command copypool.sh -copy $outdir $name
+  end
+
+  # success
+  task.exit 0
+    echo "done with $taskarg:3"
+    queueinit stdout
+    queueinit stderr
+    queuepop pending -key 0 $taskarg:3 -var line
+    # echo "got line: $line"
+
+    if ("$line" == "NULL") 
+      echo "missing entry in pending queue?"
+      break
+    end
+  end
+end
+
+task pool.list
+  host local
+  periods -exec 3
+  command queueprint pending
+
+  task.exit default
+    queueinit stdout
+    queueinit stderr
+  end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/copypool.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/copypool.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/copypool.sh	(revision 15879)
@@ -0,0 +1,31 @@
+#!/bin/csh -f
+
+# copypool.sh -pending (indir)
+# copypool.sh -copy (outdir) (path)
+# copypool.sh -create (outdir) (name)
+
+if ($#argv < 2) then
+  echo "USAGE: copypool.sh -pending (indir)"
+  echo "USAGE: copypool.sh -copy (outdir) (path)"
+  echo "USAGE: copypool.sh -create (outdir) (name)"
+  exit 2
+endif
+
+if ("$1" == "-pending") then
+  set n = `ls $2 | wc -l`
+  if ($n == 0) exit 0
+  ls $2/* | cat
+  exit 0
+endif
+
+if ("$1" == "-copy") then
+  set name = `basename $3`
+  rm $3
+  touch $2/$name
+  exit 0
+endif
+
+if ("$1" == "-create") then
+  touch $2/$3
+  exit 0
+endif
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/diff-opihi
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/diff-opihi	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/diff-opihi	(revision 15879)
@@ -0,0 +1,38 @@
+#!/bin/csh -f
+
+# this just organizes the tagging of the opihi components
+
+if ($#argv != 2) then
+  echo "USAGE: tag-elixir (MODULE) (TAG)"
+  echo "  MODULE choices: base mana dvo dimm pantasks pcontrol pclient"
+  exit 2
+endif
+
+if ("$1" == "base") then
+  cvs diff -r $2 Makefile
+  cvs diff -r $2 Makefile.Common
+  cvs diff -r $2 include
+  cvs diff -r $2 test
+  cvs diff -r $2 lib.data
+  cvs diff -r $2 lib.shell
+  cvs diff -r $2 cmd.astro
+  cvs diff -r $2 cmd.basic
+  cvs diff -r $2 cmd.data
+  cvs diff -r $2 scripts
+  cvs diff -r $2 doc
+  exit 0;
+endif
+
+if ("$1" == "mana") goto valid;
+if ("$1" == "dvo") goto valid;
+if ("$1" == "dimm") goto valid;
+if ("$1" == "pantasks") goto valid;
+if ("$1" == "pclient") goto valid;
+if ("$1" == "pcontrol") goto valid;
+echo "invalid opihi module $1"
+exit 1;
+
+valid:
+  # diff the module ($1) with the specified tag ($2)
+  cvs diff -r $2 $1
+  exit 0;
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/jobs.plot
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/jobs.plot	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/jobs.plot	(revision 15879)
@@ -0,0 +1,24 @@
+
+macro jobs.rates
+ clear -s
+
+ section a 0.0 0.0 1.0 0.5
+ data jobs.stop.dat
+ read t 6
+ set T = t*(t > 30) + (t+60)*(t<30)
+ create n 0 t[]
+ lim T n; box; plot T n
+ subset tf = T if (T > 70)
+ subset nf = n if (T > 70)
+ fit tf nf 1
+ 
+ section b 0.0 0.5 1.0 0.5
+ data jobs.run.dat
+ read t 6
+ set T = t*(t > 30) + (t+60)*(t<30)
+ create n 0 t[]
+ lim T n; box; plot T n
+ subset tf = T if (T > 70)
+ subset nf = n if (T > 70)
+ fit tf nf 1
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/manytasks.pro
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/manytasks.pro	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/manytasks.pro	(revision 15879)
@@ -0,0 +1,72 @@
+
+controller exit true
+controller host add kiawe
+
+$Ntest = 0
+pulse 1000
+controller pulse 1000
+
+macro load.machines
+  if ($0 != 2)
+    echo "load.machines (nmach)"
+    break
+  end
+
+  for i 0 $1
+    $n = $i + 1
+    sprintf host "po%02d" $n
+    controller host add $host
+  end
+end
+
+macro mktask
+  if ($0 != 2)
+    echo "USAGE: mktask (n)"
+    break
+  end
+
+  $N = $1
+
+  task test.$N
+    command partest
+    # polling period is no longer valid: we check for completed controller tasks
+    # correction: still valid for local tasks
+    periods -poll 0.2
+    periods -exec 0.01
+    periods -timeout 10.0
+    nmax 20
+    host anyhost
+
+    # stdout / stderr lines on named queues
+    task.exit 0
+      # echo "task exit 0"
+      queuedelete stdout
+      queuedelete stderr
+      date date
+      queuepush done "$date"
+      $Ntest ++
+    end
+
+    task.exit 1
+      # echo "task exit 1"
+      queuesize stdout
+      queuesize stderr
+    end
+
+    task.exit crash
+      echo "crashed job"
+    end
+
+    task.exit timeout
+      output timeout.log
+      echo $stdout
+      output stdout
+    end
+  end
+end
+
+macro mktasks
+ for i 0 $1
+  mktask $i
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/psched.pro
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/psched.pro	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/psched.pro	(revision 15879)
@@ -0,0 +1,99 @@
+
+controller exit true
+# controller host add kiawe
+$Ntest = 0
+# controller host add alala
+# verbose on
+pulse 1000
+controller pulse 1000
+
+macro load.machines
+  if ($0 != 2)
+    echo "load.machines (nmach)"
+    break
+  end
+
+  for i 0 $1
+    $n = $i + 1
+    sprintf host "po%02d" $n
+    controller host add $host
+  end
+end
+
+task test
+  command partest
+  # polling period is no longer valid: we check for completed controller tasks
+  # correction: still valid for local tasks
+  periods -poll 0.20
+  periods -exec 0.0001
+  periods -timeout 10.0
+  nmax 1024
+#  nmax 100
+  host anyhost
+
+  # stdout / stderr lines on named queues
+  task.exit 0
+    # echo "task exit 0"
+    queuedelete stdout
+    queuedelete stderr
+    date date
+    queuepush done "$date"
+    $Ntest ++
+#   memory leaks
+#   queuesize stdout -var Nstdout
+#    for i 0 $Nstdout
+#      queuepop stdout -var line
+#      queuepush results "$line"
+#    end
+  end
+
+  task.exit 1
+    # echo "task exit 1"
+    queuesize stdout
+    queuesize stderr
+  end
+
+  task.exit crash
+    echo "crashed job"
+  end
+
+  task.exit timeout
+    output timeout.log
+    echo $stdout
+    output stdout
+  end
+end
+
+# pulse == 100ms
+# poll/exit = 0.2  : 29 sec / 100 jobs
+# poll/exit = 0.1  : 20 sec / 100 jobs
+# poll/exit = 0.05 : 17 sec / 100 jobs
+# poll/exit = 0.01 : 18 sec / 100 jobs
+
+# pulse == 10ms
+# poll/exit = 0.2  : 20 sec / 100 jobs
+# poll/exit = 0.10 : 12 sec / 100 jobs
+# poll/exit = 0.05 : 12 sec / 100 jobs
+# poll/exit = 0.01 :  9 sec / 100 jobs
+
+# we are limited here by how quickly we can send data to the 
+# controller.  this is limited by the occasional 'CheckSystem'
+# loops, with ~40ms minimum.
+
+# seems to be faster on po01 from kiawe (less interference?)
+
+# pulse == 1ms, controller pulse == 1ms
+# poll/exit = 0.01 :  3 sec / 100 jobs
+# 2 mach, 3 sec
+# 4 mach, 3 sec
+# 8 mach, 3 sec
+
+# 16 machines, 500 jobs, 13 sec: 26ms / job
+# 32 machines, 1024 jobs, 26 sec: 26ms / job
+# job harvesting rate is still the limitation.  Each job harvest requires:
+#  - jobstack exit
+#  - stdout
+#  - stderr
+#  - delete
+#  - jobstack crash
+
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/queuetests
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/queuetests	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/queuetests	(revision 15879)
@@ -0,0 +1,19 @@
+
+macro test.unique
+  list line -x "cat new.list"
+  for i 0 $line:n
+    push t1 "$line:$i"
+  end
+
+  queuelist
+  queuesize t1
+
+  list line -x "cat copy.list"
+  for i 0 $line:n
+    push t1 "$line:$i" -uniq
+  end
+
+  queuelist
+  queuesize t1
+
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/rdiff-elixir
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/rdiff-elixir	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/rdiff-elixir	(revision 15879)
@@ -0,0 +1,31 @@
+#!/bin/csh -f
+
+# this just organizes the tagging of the elixir components
+
+if ($#argv != 1) then
+  echo "USAGE: rdiff-elixir (TAG)"
+  exit 2
+endif
+
+cvs rdiff -r $1 opihi/Makefile
+cvs rdiff -r $1 opihi/bin/
+cvs rdiff -r $1 opihi/cmd.astro/
+cvs rdiff -r $1 opihi/cmd.basic/
+cvs rdiff -r $1 opihi/cmd.data/
+cvs rdiff -r $1 opihi/doc/
+cvs rdiff -r $1 opihi/dvo/
+cvs rdiff -r $1 opihi/help/
+cvs rdiff -r $1 opihi/include/
+cvs rdiff -r $1 opihi/lib/
+cvs rdiff -r $1 opihi/lib.data/
+cvs rdiff -r $1 opihi/lib.shell/
+cvs rdiff -r $1 opihi/mana/
+cvs rdiff -r $1 opihi/scripts/
+
+# don't place tag on these implementations
+# cvs tag $1 dimm/
+# cvs tag $1 dvo2/
+# cvs tag $1 old/
+# cvs tag $1 pclient/
+# cvs tag $1 pcontrol/
+# cvs tag $1 sched/
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/run.pclient
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/run.pclient	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/run.pclient	(revision 15879)
@@ -0,0 +1,4 @@
+#!/bin/csh -f
+
+# pclient
+mana
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/sample.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/sample.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/sample.sh	(revision 15879)
@@ -0,0 +1,9 @@
+#!/usr/bin/env dvo
+
+echo "test"
+
+for i 0 $argv:n
+ echo $i $argv:$i
+end
+
+exit 0
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/sched.pro
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/sched.pro	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/sched.pro	(revision 15879)
@@ -0,0 +1,43 @@
+
+task test
+  command ls
+  periods -poll 1.0
+  periods -exec 2.0
+  periods -timeout 10.0
+  # trange 07:09 07:10
+  # trange -exclude 07:09:30 07:09:45
+  nmax 5
+  host local
+  # host localhost
+  # local is default 
+
+  task.exec
+    # echo "starting job sched.test"
+  end
+
+  # stdout / stderr lines on named queues
+  task.exit 0
+#    echo "task exit 0"
+#    queuesize stdout
+#    queuesize stderr
+    queuedelete stdout
+    queuedelete stderr
+    memory leaks
+  end
+
+  task.exit 1
+    echo "task exit 1"
+    queuesize stdout
+    queuesize stderr
+  end
+
+  task.exit crash
+    echo "crashed job"
+  end
+
+  task.exit timeout
+    output timeout.log
+    echo $stdout
+    output stdout
+  end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/tag-opihi
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/tag-opihi	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/tag-opihi	(revision 15879)
@@ -0,0 +1,38 @@
+#!/bin/csh -f
+
+# this just organizes the tagging of the opihi components
+
+if ($#argv != 2) then
+  echo "USAGE: tag-elixir (MODULE) (TAG)"
+  echo "  MODULE choices: base mana dvo dimm pantasks pcontrol pclient"
+  exit 2
+endif
+
+if ("$1" == "base") then
+  cvs tag $2 Makefile
+  cvs tag $2 Makefile.Common
+  cvs tag $2 include/
+  cvs tag $2 test/
+  cvs tag $2 lib.data/
+  cvs tag $2 lib.shell/
+  cvs tag $2 cmd.astro/
+  cvs tag $2 cmd.basic/
+  cvs tag $2 cmd.data/
+  cvs tag $2 scripts/
+  cvs tag $2 doc/
+  exit 0;
+endif
+
+if ("$1" == "mana") goto valid;
+if ("$1" == "dvo") goto valid;
+if ("$1" == "dimm") goto valid;
+if ("$1" == "pantasks") goto valid;
+if ("$1" == "pclient") goto valid;
+if ("$1" == "pcontrol") goto valid;
+echo "invalid opihi module $1"
+exit 1;
+
+valid:
+  # tag the module ($1) with the specified tag ($2)
+  cvs tag $2 $1
+  exit 0;
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/test.pro
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/test.pro	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/test.pro	(revision 15879)
@@ -0,0 +1,144 @@
+
+macro testgauss
+ create x -20 20 0.1
+ set dy = zero(x) + 0.03
+ set X = x - $1
+ set y = $3*exp(-0.5*(X^2/$2^2)) + $4 + 0.1*(rnd(X) - 0.5)
+# set y = $3*exp(-0.5*(X^2/$2^2)) + $4
+ lim x y; clear; box; plot x y -dy dy -x 2 -pt 2
+
+ $C0 = $1+5
+ $C1 = $2-10
+ $C2 = $3
+ $C3 = $4
+
+ vgauss x y dy yf
+end
+
+macro testpoor
+ create x -20 20 0.1
+ set dy = zero(x) + 0.03
+ set X = x - $1
+ set y = 3 + zero(x) + 0.1*(rnd(X) - 0.5)
+# set y = (x + 20)/10 + $4 + 0.1*(rnd(X) - 0.5)
+# set y = $3*exp(-0.5*(X^2/$2^2)) + $4
+ lim x y; clear; box; plot x y -dy dy -x 2 -pt 2
+
+ $C0 = $1
+ $C1 = $2
+ $C2 = $3
+ $C3 = $4
+
+ vgauss x y dy yf
+end
+
+macro testfit
+ create x 0 1000
+ set y = 3 + 5*x
+ set dy = 10*(rnd(x) - 0.5)
+ set yr = y + dy
+ fit x yr 1
+ echo $Cn, $Cnv
+ echo $dC
+
+ yr[100] = yr[100] + 50
+ yr[200] = yr[200] - 50
+ yr[300] = yr[300] + 100
+ yr[400] = yr[400] - 500
+ yr[500] = yr[500] + 30
+
+ fit x yr 1
+ echo $Cn, $Cnv
+ echo $dC
+
+ fit x yr 1 -clip 3 3
+ echo $Cn, $Cnv
+ echo $dC
+end
+# expected output:
+# y = 3.013781 x^0 5.000005 x^1
+#     0.063198     0.000110
+# 1, 1000
+# 2.91071543189
+# y = 2.495040 x^0 5.000303 x^1
+#     0.063198     0.000110
+# 1, 1000
+# 16.5928919554
+# y = 3.021974 x^0 4.999991 x^1
+#     0.063419     0.000110
+# 1, 995
+# 2.90820510001
+
+macro testloops
+ for i 0 100
+  if ($i < 20)
+   continue
+  end
+  if ($i > 40)
+   break
+  end
+  echo $i
+ end
+end  
+
+# test math parsing
+macro testvars
+ echo testing variable assignment
+ $a = 1
+ echo $a is 1
+ $b = 5*3 + $a
+ echo $b is 16
+
+ $a = `ls`
+ echo $a
+ exec ls
+
+ echo testing in-line math
+ $a = 1
+ echo {1 + 1} is 2
+ echo {2^3} is 8
+ echo {$a + 2} is 3
+
+ echo testing vector assignment
+ create x 0 10
+ set y = x^2
+ echo x[2] is 2
+ echo y[2] is 4
+ lim x y; clear; box; plot x y
+ label -x "x axis" -y "&s y axis"
+end
+
+macro testspeed
+ exec date
+ create x 0 100000
+ for i 0 5000
+  set y = 3*x + $i
+ end
+ exec date
+end
+
+macro testmemory.buffers
+ mcreate a 2048 2048
+ exec date
+ for i 0 500
+  set b = 3*a + 6
+ end
+ exec date
+end
+
+macro testmemory.macros
+ exec date
+ for i 0 1000
+   for j 0 1000
+    $N = $N + 1
+   end
+ end
+ exec date
+end
+
+macro sample
+ $N = 0
+ for j 0 1000000
+  $N = 100
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/testloops.pro
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/testloops.pro	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/testloops.pro	(revision 15879)
@@ -0,0 +1,90 @@
+
+macro testloop1
+ local i
+ for i 0 10
+  echo "1: $i"
+    end
+end
+
+macro testloop2
+ local i
+ for i 0 5
+   echo "2: $i"
+   testloop1
+end
+end
+
+macro testlocal1
+ local -static foo
+ echo "1 - foo: $foo"
+ $foo = local.1
+ echo "1 - foo: $foo"
+end
+
+macro testlocal2
+ local foo
+ $foo = local.2
+ echo "2 - foo: $foo"
+ testlocal1
+ echo "2 - foo: $foo"
+ testlocal1
+ echo "2 - foo: $foo"
+end
+
+macro test1
+ # echo step $1
+ if ($1 == 1)
+  echo "break here"
+  break
+ end
+ if ($1 == 2)
+  continue
+ end
+end
+
+# continue
+
+macro test2
+ echo "input test"
+ break
+ echo "error, can't get here"
+end
+
+macro testm
+ break -auto off
+ test1 0
+ # echo $STATUS
+ test1 1
+ # echo $STATUS
+ test1 2
+ # echo $STATUS
+ if ($1 == 10) 
+  test1 1
+  if ($STATUS == 0)
+   echo "breaking it"
+   break
+  end
+ end
+ echo done
+end
+
+echo "done loading"
+
+macro test3
+ for i 0 12
+  echo $i
+  testm $i
+  echo "status: $STATUS"
+ end
+end
+
+macro testL
+ for i 0 10
+  for j 0 10
+   for k 0 10
+    echo $i $j $k
+    mcreate a 1024 1024   
+   end
+  end
+ end
+end
Index: /branches/eam_branch_20071222/Ohana/src/opihi/scripts/testscript
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/scripts/testscript	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/scripts/testscript	(revision 15879)
@@ -0,0 +1,16 @@
+#!/bin/csh -f
+
+date
+
+ls -d *
+# sleep 3
+ls foo
+
+foreach f (*)
+  echo $f
+  ls $f/*
+#  sleep 1
+end
+
+date
+#exit 3
Index: /branches/eam_branch_20071222/Ohana/src/opihi/test/basic.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/test/basic.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/test/basic.sh	(revision 15879)
@@ -0,0 +1,9 @@
+
+list testdir
+  cmd.data/test
+  cmd.basic/test
+end
+
+input test/tests.sh
+
+fulltests
Index: /branches/eam_branch_20071222/Ohana/src/opihi/test/pclient.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/test/pclient.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/test/pclient.sh	(revision 15879)
@@ -0,0 +1,8 @@
+
+list testdir
+  pclient/test
+end
+
+input test/tests.sh
+
+fulltests
Index: /branches/eam_branch_20071222/Ohana/src/opihi/test/tests.sh
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/opihi/test/tests.sh	(revision 15879)
+++ /branches/eam_branch_20071222/Ohana/src/opihi/test/tests.sh	(revision 15879)
@@ -0,0 +1,100 @@
+
+if ($?VERBOSE == 0)
+ $VERBOSE = 0
+end
+
+$failtest:n = 0
+$failfile:n = 0
+$faildirs:n = 0
+$currentdir = .
+
+macro fulltests
+  $Npass = 0
+  $Nfail = 0
+  $Ntest = 0
+  break -auto off
+
+  $failtest:n = 0
+  $failfile:n = 0
+  $faildirs:n = 0
+
+  for Ti 0 $testdir:n
+    if ($VERBOSE > 0)
+       echo "directory $testdir:$Ti"
+    end
+    runtestdir $testdir:$Ti
+  end
+
+  echo "completed $Ntest tests"
+  echo "$Npass tests passed"
+  echo "$Nfail tests failed"
+  echo "examined $testdir:n directories"
+
+  if ($Nfail > 0) 
+    echo " ** failed tests **"
+    for i 0 $Nfail
+      echo $faildirs:$i $failfile:$i $failtest:$i
+    end
+  end
+end
+
+macro runtestdir
+  if ($0 != 2)
+    echo "USAGE: runtestdir (testdir)"
+    break -auto on
+    break
+  end
+  
+  pwd -var startdir
+  cd -q $1
+  list testscripts -x "ls *.sh"
+
+  $currentdir = $1
+  for Tj 0 $testscripts:n
+    if ($VERBOSE > 1)
+      echo " running $testscripts:$Tj"
+    end
+    runtests $testscripts:$Tj      
+  end
+  
+  cd -q $startdir
+end
+
+macro runtests
+  if ($0 != 2)
+    echo "USAGE: runtests (script.sh)"
+    break -auto on
+    break
+  end
+  
+  local Tk
+
+  input $1
+  for Tk 0 $tests:n
+    if ($VERBOSE > 2)
+      echo "   running $tests:$Tk"
+    end
+    $PASS = 1
+    $tests:$Tk
+    if ($PASS == 0)
+      echo "   ** failed $tests:$Tk $1"
+      $Nfail ++
+      $n = $failtest:n
+      $failtest:$n = $tests:$Tk
+      $failfile:$n = $1
+      $faildirs:$n = $currentdir
+      $failtest:n ++
+      $failfile:n ++
+      $faildirs:n ++
+    else
+      $Npass ++
+    end
+    $Ntest ++
+    # echo "finished $tests:$Tk"
+  end
+end
+
+echo "USAGE:"
+echo "runtests (script.sh)"
+echo "runtestdir (testdir)"
+echo "set VERBOSE to 0 through 3"
