Index: trunk/Ohana/src/opihi/include/dvomath.h
===================================================================
--- trunk/Ohana/src/opihi/include/dvomath.h	(revision 15878)
+++ trunk/Ohana/src/opihi/include/dvomath.h	(revision 20936)
@@ -4,8 +4,27 @@
 # define DVOMATH_H
 
+# define OPIHI_NAME_SIZE 1024
+
 # define NCHARS 256
+# define opihi_flt double
+# define opihi_int int
+// NOTE: if opihi_int is changed to unsigned, all subtraction and negation operations
+// need to result in a float value (or 3 - 5 will yield the unexpected value 2^32 - 2)
+
+# define REQUIRE_VECTOR_FLT(VECT,RVAL) { \
+  if (VECT->type != OPIHI_FLT) { \
+    gprint (GP_ERR, "function requires vector of type FLT\n"); \
+    return (RVAL); \
+  } }
+
+# define REQUIRE_VECTOR_INT(VECT,RVAL) {	\
+  if (VECT->type != OPIHI_INT) { \
+    gprint (GP_ERR, "function requires vector of type INT\n"); \
+    return (RVAL); \
+  } }
 
 enum {ANYVECTOR, NEWVECTOR, OLDVECTOR};
 enum {ANYBUFFER, NEWBUFFER, OLDBUFFER};
+enum {OPIHI_FLT, OPIHI_INT};
 
 typedef struct {			/* representation of a variable (0-D) */
@@ -15,12 +34,17 @@
 
 typedef struct {			/* representation of a vector (1-D) */
-  char name[1024];
-  float *elements;
+  char name[OPIHI_NAME_SIZE];
+  char type;
+  union {
+    void      *Ptr;
+    opihi_flt *Flt;
+    opihi_int *Int;
+  } elements;
   int Nelements;
 } Vector;
 
 typedef struct {			/* representation of buffer (image) */
-  char name[1024];
-  char file[1024];
+  char name[OPIHI_NAME_SIZE];
+  char file[OPIHI_NAME_SIZE];
   Header header;
   Matrix matrix;
@@ -32,8 +56,8 @@
   char   *name;
   char    type;
-  float  *ptr;
   Buffer *buffer;
   Vector *vector;
-  float   Float;
+  opihi_flt FltValue;
+  opihi_int IntValue;
 } StackVar;
 
@@ -87,4 +111,8 @@
 void          InitVectors           PROTO((void));
 int           CopyVector            PROTO((Vector *out, Vector *in));
+int           ResetVector           PROTO((Vector *vec, char type, int Nelements));
+int           SetVector             PROTO((Vector *vec, char type, int Nelements));
+int           CastVector            PROTO((Vector *vec, char type));
+int           MatchVector           PROTO((Vector *out, Vector *in, char type));
 int           MoveVector            PROTO((Vector *out, Vector *in));
 int           DeleteVector          PROTO((Vector *vec));
