Index: /trunk/psLib/pslib.kdevelop
===================================================================
--- /trunk/psLib/pslib.kdevelop	(revision 3340)
+++ /trunk/psLib/pslib.kdevelop	(revision 3341)
@@ -24,5 +24,5 @@
     <general>
       <activetarget>src/pslib</activetarget>
-      <useconfiguration>debug</useconfiguration>
+      <useconfiguration>default</useconfiguration>
     </general>
     <run>
Index: /trunk/psLib/pslib.kdevses
===================================================================
--- /trunk/psLib/pslib.kdevses	(revision 3340)
+++ /trunk/psLib/pslib.kdevses	(revision 3341)
@@ -2,23 +2,20 @@
 <!DOCTYPE KDevPrjSession>
 <KDevPrjSession>
- <DocsAndViews NumberOfDocuments="6" >
+ <DocsAndViews NumberOfDocuments="5" >
   <Doc0 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/psMetadata.c" >
-   <View0 line="342" Type="Source" />
+   <View0 line="129" Type="Source" />
   </Doc0>
-  <Doc1 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/test/fileUtils/tst_psFits.c" >
-   <View0 line="193" Type="Source" />
+  <Doc1 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/psMetadata.h" >
+   <View0 line="164" Type="Source" />
   </Doc1>
-  <Doc2 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/collections/psHash.c" >
-   <View0 line="290" Type="Source" />
+  <Doc2 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/astronomy.i" >
+   <View0 line="16" Type="Source" />
   </Doc2>
-  <Doc3 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/fileUtils/psFits.c" >
-   <View0 line="1471" Type="Source" />
+  <Doc3 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/astronomy/psMetadataIO.c" >
+   <View0 line="965" Type="Source" />
   </Doc3>
-  <Doc4 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/sysUtils/psMemory.h" >
-   <View0 line="397" Type="Source" />
+  <Doc4 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/sysUtils/psType.h" >
+   <View0 line="0" Type="Source" />
   </Doc4>
-  <Doc5 NumberOfViews="1" URL="file:/home/desonia/panstarrs/psLib/src/collections/psArray.c" >
-   <View0 line="0" Type="Source" />
-  </Doc5>
  </DocsAndViews>
  <pluginList>
Index: /trunk/psLib/src/astro/psTime.c
===================================================================
--- /trunk/psLib/src/astro/psTime.c	(revision 3340)
+++ /trunk/psLib/src/astro/psTime.c	(revision 3341)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:23 $
+ *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-28 23:34:10 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -215,5 +215,4 @@
     char metadataTableNames[4][MAX_STRING_LENGTH] = {"ser7", "eopc",  "finals", "tai"};
 
-
     // Read time config file
     timeMetadata = psMetadataParseConfig(timeMetadata, &nFail, fileName, true);
@@ -313,5 +312,5 @@
             if(metadataNamesPtr != NULL) {
                 psMetadataAdd(timeMetadata, PS_LIST_TAIL, strcat(metadataTableNames[j], "Table"),
-                              PS_TYPE_PTR, PS_META_LOOKUPTABLE, NULL, table);
+                              PS_META_LOOKUPTABLE, NULL, table);
                 foundTable = true;
             } else if(foundTable==false && j==numTables-1) {
@@ -322,4 +321,5 @@
         psFree(fullTableName);
         psFree(tableName);
+        psFree(table);
         i++;
     }
Index: /trunk/psLib/src/astronomy/astronomy.i
===================================================================
--- /trunk/psLib/src/astronomy/astronomy.i	(revision 3340)
+++ /trunk/psLib/src/astronomy/astronomy.i	(revision 3341)
@@ -15,66 +15,4 @@
 }
 
-// add a method to add primitives to metadata
-%inline %{
-psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name, 
-const char* comment, const char* value) {
-    return psMetadataAdd(md,where,name,PS_TYPE_PTR, PS_META_STR,comment,value);
-}
-psBool psMetadataAddF32(psMetadata* md,
-                        psS32 where,
-                        const char* name,
-                        const char* comment,
-                        psF32 value)
-{
-    return psMetadataAdd(md,where,name,PS_TYPE_F32, PS_META_PRIMITIVE,comment,value);
-}
-
-psBool psMetadataAddF64(psMetadata* md,
-                        psS32 where,
-                        const char* name,
-                        const char* comment,
-                        psF64 value)
-{
-    return psMetadataAdd(md,where,name,PS_TYPE_F64, PS_META_PRIMITIVE,comment,value);
-}
-
-psBool psMetadataAddS32(psMetadata* md,
-                        psS32 where,
-                        const char* name,
-                        const char* comment,
-                        psS32 value)
-{
-    return psMetadataAdd(md,where,name,PS_TYPE_S32, PS_META_PRIMITIVE,comment,value);
-}
-
-psMetadataItem* psMetadataItemAllocStr(const char* name,
-                                       const char* comment,
-                                       const char* value)
-{
-    return psMetadataItemAlloc(name, PS_TYPE_PTR, PS_META_STR, comment, value);
-}
-
-psMetadataItem* psMetadataItemAllocF32(const char* name,
-                                       const char* comment,
-                                       psF32 value)
-{
-    return psMetadataItemAlloc(name, PS_TYPE_F32, PS_META_PRIMITIVE, comment, value);
-}
-
-psMetadataItem* psMetadataItemAllocF64(const char* name,
-                                       const char* comment,
-                                       psF64 value)
-{
-    return psMetadataItemAlloc(name, PS_TYPE_F64, PS_META_PRIMITIVE, comment, value);
-}
-
-psMetadataItem* psMetadataItemAllocS32(const char* name,
-                                       const char* comment,
-                                       psS32 value)
-{
-    return psMetadataItemAlloc(name, PS_TYPE_S32, PS_META_PRIMITIVE, comment, value);
-}
-%}
-
 %apply unsigned int *OUTPUT { unsigned int *nFail }; /* for psMetadataParseConfig */
 %include "psMetadataIO.h"
Index: /trunk/psLib/src/astronomy/psAstronomyErrors.h
===================================================================
--- /trunk/psLib/src/astronomy/psAstronomyErrors.h	(revision 3340)
+++ /trunk/psLib/src/astronomy/psAstronomyErrors.h	(revision 3341)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-25 02:49:00 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-28 23:34:10 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
Index: /trunk/psLib/src/astronomy/psMetadata.c
===================================================================
--- /trunk/psLib/src/astronomy/psMetadata.c	(revision 3340)
+++ /trunk/psLib/src/astronomy/psMetadata.c	(revision 3341)
@@ -12,6 +12,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-18 22:17:20 $
+*  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -80,5 +80,5 @@
     psFree(metadataItem->name);
     psFree(metadataItem->comment);
-    if (type != PS_META_PRIMITIVE) {
+    if (! PS_META_IS_PRIMITIVE(type)) {
         psFree(metadataItem->data.V);
     }
@@ -98,5 +98,5 @@
 /*****************************************************************************/
 
-psMetadataItem* psMetadataItemAlloc(const char *name, psElemType pType, psMetadataType type,
+psMetadataItem* psMetadataItemAlloc(const char *name, psMetadataType type,
                                     const char *comment, ...)
 {
@@ -108,5 +108,5 @@
 
     // Call metadata item allocation
-    metadataItem = psMetadataItemAllocV(name, pType, type, comment, argPtr);
+    metadataItem = psMetadataItemAllocV(name, type, comment, argPtr);
 
     // Clean up stack after variable arguement has been used
@@ -116,5 +116,19 @@
 }
 
-psMetadataItem* psMetadataItemAllocV(const char *name, psElemType pType, psMetadataType type,
+#define METADATAITEM_ALLOC_TYPE(NAME,TYPE,METATYPE) \
+psMetadataItem* psMetadataItemAlloc##NAME(const char* name, \
+        const char* comment, \
+        TYPE value) \
+{ \
+    return psMetadataItemAlloc(name, METATYPE, comment, value); \
+}
+
+METADATAITEM_ALLOC_TYPE(Str,const char*,PS_META_STR)
+METADATAITEM_ALLOC_TYPE(F32,psF32,PS_META_F32)
+METADATAITEM_ALLOC_TYPE(F64,psF64,PS_META_F64)
+METADATAITEM_ALLOC_TYPE(S32,psS32,PS_META_S32)
+METADATAITEM_ALLOC_TYPE(Bool,psBool,PS_META_BOOL)
+
+psMetadataItem* psMetadataItemAllocV(const char *name, psMetadataType type,
                                      const char *comment, va_list argPtr)
 {
@@ -145,5 +159,4 @@
     // Set metadata item type
     metadataItem->type = type;
-    metadataItem->pType = pType;
 
     // Allocate and set metadata item name
@@ -153,23 +166,15 @@
     // Set metadata item value
     switch(type) {
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            metadataItem->data.B = (psBool)va_arg(argPtr, psS32);
-            break;
-        case PS_TYPE_S32:
-            metadataItem->data.S32 = (psS32)va_arg(argPtr, psS32);
-            break;
-        case PS_TYPE_F32:
-            metadataItem->data.F32 = (psF32)va_arg(argPtr, psF64);
-            break;
-        case PS_TYPE_F64:
-            metadataItem->data.F64 = (psF64)va_arg(argPtr, psF64);
-            break;
-        default:
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMetadata_METATYPE_INVALID, type);
-            psFree(metadataItem);
-            metadataItem = NULL;
-        }
+    case PS_META_BOOL:
+        metadataItem->data.B = (psBool)va_arg(argPtr, psS32);
+        break;
+    case PS_META_S32:
+        metadataItem->data.S32 = (psS32)va_arg(argPtr, psS32);
+        break;
+    case PS_META_F32:
+        metadataItem->data.F32 = (psF32)va_arg(argPtr, psF64);
+        break;
+    case PS_META_F64:
+        metadataItem->data.F64 = (psF64)va_arg(argPtr, psF64);
         break;
     case PS_META_STR:
@@ -186,5 +191,5 @@
     case PS_META_UNKNOWN:
         // Copy of input data not performed due to variability of data types
-        metadataItem->data.V = va_arg(argPtr, psPtr);
+        metadataItem->data.V = psMemIncrRefCounter(va_arg(argPtr, psPtr));
         break;
     default:
@@ -256,5 +261,5 @@
 
             // Leaf node replaces another leaf. Make new folder node and add leaves.
-            newFolderEntry = psMetadataItemAlloc(key, PS_TYPE_PTR, PS_META_LIST, NULL, NULL);
+            newFolderEntry = psMetadataItemAlloc(key, PS_META_LIST, NULL, NULL);
             newFolderEntry->data.list = psListAlloc(NULL);
 
@@ -328,5 +333,5 @@
 }
 
-psBool psMetadataAdd(psMetadata *md, psS32 where, const char *name, psElemType pType,
+psBool psMetadataAdd(psMetadata *md, psS32 where, const char *name,
                      psMetadataType type, const char *comment, ...)
 {
@@ -335,5 +340,5 @@
 
     va_start(argPtr, comment);
-    metadataItem = psMetadataItemAllocV(name, pType, type, comment, argPtr);
+    metadataItem = psMetadataItemAllocV(name, type, comment, argPtr);
     va_end(argPtr);
 
@@ -348,4 +353,21 @@
     return true;
 }
+
+#define METADATA_ADD_TYPE(NAME,TYPE,METATYPE) \
+psBool psMetadataAdd##NAME(psMetadata* md, psS32 where, const char* name, \
+                           const char* comment, TYPE value) { \
+    return psMetadataAdd(md,where,name, METATYPE,comment,value); \
+}
+
+METADATA_ADD_TYPE(S32,psS32,PS_META_S32)
+METADATA_ADD_TYPE(F32,psF32,PS_META_F32)
+METADATA_ADD_TYPE(F64,psF64,PS_META_F64)
+METADATA_ADD_TYPE(List,psList*,PS_META_LIST)
+METADATA_ADD_TYPE(Str,const char*,PS_META_STR)
+METADATA_ADD_TYPE(Vector,psVector*,PS_META_VEC)
+METADATA_ADD_TYPE(Image,psImage*,PS_META_IMG)
+METADATA_ADD_TYPE(Hash,psHash*,PS_META_HASH)
+METADATA_ADD_TYPE(LookupTable,psLookupTable*,PS_META_LOOKUPTABLE)
+METADATA_ADD_TYPE(Unknown,void*,PS_META_UNKNOWN)
 
 psBool psMetadataRemove(psMetadata *md, psS32 where, const char *key)
@@ -435,12 +457,11 @@
     }
 
-    if(metadataItem->type == PS_META_PRIMITIVE && metadataItem->pType != PS_TYPE_PTR) {
+    if(PS_META_IS_PRIMITIVE(metadataItem->type)) {
         if (status) {
             *status = false;
         }
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                PS_ERRORTEXT_psMetadata_METATYPE_MISMATCH,
-                metadataItem->pType,
-                PS_TYPE_PTR);
+                PS_ERRORTEXT_psMetadata_METATYPE_INVALID,
+                metadataItem->type);
         return NULL;
     } else {
@@ -467,31 +488,25 @@
     } \
     \
-    if (metadataItem->type == PS_META_PRIMITIVE) { \
-        switch (metadataItem->pType) { \
-        case PS_TYPE_S32: \
-            value = (ps##TYPE)metadataItem->data.S32; \
-            break; \
-        case PS_TYPE_F32: \
-            value = (ps##TYPE)metadataItem->data.F32; \
-            break; \
-        case PS_TYPE_F64: \
-            value = (ps##TYPE)metadataItem->data.F64; \
-            break; \
-        case PS_TYPE_BOOL: \
-            if (metadataItem->data.B) { \
-                value = 1; \
-            } \
-            break; \
-        default: \
-            /* if you get to this point, the value is not a number. */ \
-            if (status) { \
-                *status = false; \
-            } \
-            break; \
+    switch (metadataItem->type) { \
+    case PS_META_S32: \
+        value = (ps##TYPE)metadataItem->data.S32; \
+        break; \
+    case PS_META_F32: \
+        value = (ps##TYPE)metadataItem->data.F32; \
+        break; \
+    case PS_META_F64: \
+        value = (ps##TYPE)metadataItem->data.F64; \
+        break; \
+    case PS_META_BOOL: \
+        if (metadataItem->data.B) { \
+            value = 1; \
         } \
-    } else { \
+        break; \
+    default: \
+        /* if you get to this point, the value is not a number. */ \
         if (status) { \
             *status = false; \
         } \
+        break; \
     } \
     \
Index: /trunk/psLib/src/astronomy/psMetadata.h
===================================================================
--- /trunk/psLib/src/astronomy/psMetadata.h	(revision 3340)
+++ /trunk/psLib/src/astronomy/psMetadata.h	(revision 3341)
@@ -11,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-17 19:26:23 $
+*  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -24,4 +24,6 @@
 #include "psHash.h"
 #include "psList.h"
+#include "psImage.h"
+#include "psLookupTable.h"
 
 /// @addtogroup Metadata
@@ -33,5 +35,8 @@
  */
 typedef enum {
-    PS_META_PRIMITIVE,                 ///< Primitive data.
+    PS_META_S32,                       ///< Primitive data.
+    PS_META_F32,                       ///< Primitive data.
+    PS_META_F64,                       ///< Primitive data.
+    PS_META_BOOL,                       ///< Primitive data.
     PS_META_LIST,                      ///< List data (Stored as item.data.list).
     PS_META_STR,                       ///< String data (Stored as item.data.V).
@@ -47,4 +52,16 @@
 } psMetadataType;
 
+#define PS_META_IS_PRIMITIVE(TYPE) \
+(TYPE == PS_META_S32 || \
+ TYPE == PS_META_F32 || \
+ TYPE == PS_META_F64 || \
+ TYPE == PS_META_BOOL)
+
+#define PS_META_PRIMITIVE_TYPE(METATYPE) ( \
+        (METATYPE==PS_META_S32) ? PS_TYPE_S32 : \
+        (METATYPE==PS_META_F32) ? PS_TYPE_F32 : \
+        (METATYPE==PS_META_F64) ? PS_TYPE_F64 : \
+        (METATYPE==PS_META_BOOL) ? PS_TYPE_BOOL : PS_TYPE_PTR )
+
 /** Option flags for psMetadata functions
  *
@@ -55,5 +72,5 @@
 typedef enum {
     PS_META_DEFAULT = 0,               ///< default behaviour (duplicate entry is an error)
-    PS_META_REPLACE                    ///< allow entry to be replaced
+    PS_META_REPLACE = 0x10000          ///< allow entry to be replaced
 } psMetadataFlags;
 
@@ -82,5 +99,4 @@
     char *name;                        ///< Name of metadata item.
     psMetadataType type;               ///< Type of metadata item.
-    psElemType pType;                  ///< Primitive data type
     union {
         psBool B;                      ///< boolean data
@@ -113,8 +129,37 @@
 psMetadataItem* psMetadataItemAlloc(
     const char *name,                  ///< Name of metadata item.
-    psElemType pType,                  ///< Primitive type.
     psMetadataType type,               ///< Type of metadata item.
     const char *comment,               ///< Comment for metadata item.
     ...                                ///< Arguments for name formatting and metadata item data.
+);
+
+psMetadataItem* psMetadataItemAllocStr(
+    const char* name,
+    const char* comment,
+    const char* value
+);
+
+psMetadataItem* psMetadataItemAllocF32(
+    const char* name,
+    const char* comment,
+    psF32 value
+);
+
+psMetadataItem* psMetadataItemAllocF64(
+    const char* name,
+    const char* comment,
+    psF64 value
+);
+
+psMetadataItem* psMetadataItemAllocS32(
+    const char* name,
+    const char* comment,
+    psS32 value
+);
+
+psMetadataItem* psMetadataItemAllocBool(
+    const char* name,
+    const char* comment,
+    psBool value
 );
 
@@ -137,5 +182,4 @@
 psMetadataItem* psMetadataItemAllocV(
     const char *name,                  ///< Name of metadata item.
-    psElemType pType,                  ///< Primitive type.
     psMetadataType type,               ///< Type of metadata item.
     const char *comment,               ///< Comment for metadata item.
@@ -161,7 +205,7 @@
  */
 psBool psMetadataAddItem(
-    psMetadata*  md,          ///< Metadata collection to insert metadat item.
-    psMetadataItem*  item,    ///< Metadata item to be added.
-    psS32 location            ///< Location to be added.
+    psMetadata*  md,                   ///< Metadata collection to insert metadat item.
+    psMetadataItem*  item,             ///< Metadata item to be added.
+    psS32 location                     ///< Location to be added.
 );
 
@@ -173,12 +217,33 @@
  */
 psBool psMetadataAdd(
-    psMetadata* md,           ///< Metadata collection to insert metadat item.
-    psS32 where,              ///< Location to be added.
-    const char *name,         ///< Name of metadata item.
-    psElemType pType,         ///< Primitive type.
-    psMetadataType type,      ///< Type of metadata item.
-    const char *comment,      ///< Comment for metadata item.
-    ...                       ///< Arguments for name formatting and metadata item data.
-);
+    psMetadata* md,                    ///< Metadata collection to insert metadat item.
+    psS32 where,                       ///< Location to be added.
+    const char *name,                  ///< Name of metadata item.
+    psMetadataType type,               ///< Type of metadata item.
+    const char *comment,               ///< Comment for metadata item.
+    ...                                ///< Arguments for name formatting and metadata item data.
+);
+
+psBool psMetadataAddS32(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, psS32 value);
+psBool psMetadataAddF32(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, psF32 value);
+psBool psMetadataAddF64(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, psF64 value);
+psBool psMetadataAddList(psMetadata* md, psS32 where, const char* name,
+                         const char* comment, psList* value);
+psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, const char* value);
+psBool psMetadataAddVector(psMetadata* md, psS32 where, const char* name,
+                           const char* comment, psVector* value);
+psBool psMetadataAddImage(psMetadata* md, psS32 where, const char* name,
+                          const char* comment, psImage* value);
+psBool psMetadataAddHash(psMetadata* md, psS32 where, const char* name,
+                         const char* comment, psHash* value);
+psBool psMetadataAddLookupTable(psMetadata* md, psS32 where, const char* name,
+                                const char* comment, psLookupTable* value);
+psBool psMetadataAddUnknown(psMetadata* md, psS32 where, const char* name,
+                            const char* comment, psPtr value);
+
 
 /** Remove an item from metadata collection.
Index: /trunk/psLib/src/astronomy/psMetadataIO.c
===================================================================
--- /trunk/psLib/src/astronomy/psMetadataIO.c	(revision 3340)
+++ /trunk/psLib/src/astronomy/psMetadataIO.c	(revision 3341)
@@ -9,6 +9,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-17 19:26:23 $
+*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -101,8 +101,8 @@
 /*****************************************************************************/
 
-static void p_saxEndElement(void *ctx, const xmlChar *tagName);
-static void p_psInitVectorXml(void *ctx, char *tagName);
-static void p_psInitMetadataItemXml(void *ctx, char *tagName);
-static void p_saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts);
+static void saxEndElement(void *ctx, const xmlChar *tagName);
+static void initVectorXml(void *ctx, char *tagName);
+static void initMetadataItemXml(void *ctx, char *tagName);
+static void saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts);
 
 /** Determines if a line is blank (whitespace only) or a commentline. It returns true if so. The input string
@@ -307,5 +307,4 @@
 {
     psMetadataType type;
-    psElemType pType;
     psBool success = true;
 
@@ -315,25 +314,17 @@
 
     type = metadataItem->type;
-    pType = metadataItem->pType;
 
     switch(type) {
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            fprintf(fd, format, metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            fprintf(fd,format, metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            fprintf(fd, format, metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            fprintf(fd, format, metadataItem->data.F64);
-            break;
-        default:
-            psError(PS_ERR_BAD_PARAMETER_TYPE,true, PS_ERRORTEXT_psMetadata_METATYPE_INVALID, (int)pType);
-            success = false;
-        }
+    case PS_META_BOOL:
+        fprintf(fd, format, metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        fprintf(fd,format, metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        fprintf(fd, format, metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        fprintf(fd, format, metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -419,19 +410,19 @@
         switch (keyType) {
         case 'I':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_S32, PS_META_PRIMITIVE,
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_S32,
                                     keyComment, atoi(keyValue));
             break;
         case 'F':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_F64, PS_META_PRIMITIVE,
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_F64,
                                     keyComment, atof(keyValue));
             break;
         case 'C':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_PTR, PS_META_STR, keyComment,
-                                    keyValue);
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_STR,
+                                    keyComment, keyValue);
             break;
         case 'L':
             tempBool = (keyValue[0] == 'T') ? 1 : 0;
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_BOOL, PS_META_PRIMITIVE, keyComment,
-                                    tempBool);
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_BOOL,
+                                    keyComment, tempBool);
             break;
         case 'U':
@@ -460,4 +451,5 @@
     char *strComment = NULL;
     char *linePtr = NULL;
+    psElemType vecType = PS_TYPE_PTR;
     psS32 status = 0;
     psU32 lineCount = 0;
@@ -467,5 +459,4 @@
     psVector *tempVec = NULL;
     FILE *fp = NULL;
-    psElemType pType;
     psMetadataType mdType;
 
@@ -535,20 +526,14 @@
             } else if(!strncmp(strType, "*", 1)) {
                 mdType = PS_META_LIST;
-                pType = PS_TYPE_PTR;
             } else if(!strncmp(strType, "STR", 3)) {
                 mdType = PS_META_STR;
-                pType = PS_TYPE_PTR;
-            } else if(!strncmp(strType, "BOOL", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_BOOL;
+            } else if(!strncmp(strType, "BOOL", 4)) {
+                mdType = PS_META_BOOL;
             } else if(!strncmp(strType, "S32", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_S32;
+                mdType = PS_META_S32;
             } else if(!strncmp(strType, "F32", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_F32;
+                mdType = PS_META_F32;
             } else if(!strncmp(strType, "F64", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_F64;
+                mdType = PS_META_F64;
             } else {
                 (*nFail)++;
@@ -559,4 +544,5 @@
 
             if(*strName == '@') {
+                vecType = PS_META_PRIMITIVE_TYPE(mdType);
                 mdType = PS_META_VEC;
             }
@@ -604,13 +590,26 @@
             switch (mdType) {
             case PS_META_LIST:
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, NULL);
+                psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, NULL);
                 break;
             case PS_META_STR:
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, strValue);
+                psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, strValue);
                 break;
             case PS_META_VEC:
-                tempVec = parseVector(strValue, pType, &status);
+                tempVec = parseVector(strValue, vecType, &status);
                 if(!status) {
-                    psMetadataAdd(md, PS_LIST_TAIL, strName+1, pType, mdType, strComment, tempVec);
+                    psMetadataAdd(md, PS_LIST_TAIL, strName+1, mdType, strComment, tempVec);
+                } else {
+                    status = 0;
+                    (*nFail)++;
+                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
+                            strType, lineCount, fileName);
+                    continue;
+                }
+                psFree(tempVec);
+                break;
+            case PS_META_BOOL:
+                tempBool = parseBool(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempBool);
                 } else {
                     status = 0;
@@ -621,50 +620,29 @@
                 }
                 break;
-            case PS_META_PRIMITIVE:
-                switch (pType) {
-                case PS_TYPE_BOOL:
-                    tempBool = parseBool(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempBool);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
-                                strType, lineCount, fileName);
-                        continue;
-                    }
-                    break;
-                case PS_TYPE_S32:
-                    tempInt = (psS32)parseValue(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempInt);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
-                                strType, lineCount, fileName);
-                        continue;
-                    }
-                    break;
-                case PS_TYPE_F32:
-                case PS_TYPE_F64:
-                    tempDbl = parseValue(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempDbl);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true,
-                                PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType, lineCount,
-                                fileName);
-                        continue;
-                    }
-                    break;
-                default:
+            case PS_META_S32:
+                tempInt = (psS32)parseValue(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempInt);
+                } else {
+                    status = 0;
                     (*nFail)++;
-                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID, mdType, lineCount,
+                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
+                            strType, lineCount, fileName);
+                    continue;
+                }
+                break;
+            case PS_META_F32:
+            case PS_META_F64:
+                tempDbl = parseValue(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempDbl);
+                } else {
+                    status = 0;
+                    (*nFail)++;
+                    psError(PS_ERR_IO, true,
+                            PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType, lineCount,
                             fileName);
                     continue;
-                } // switch
+                }
                 break;
             default:
@@ -682,5 +660,5 @@
 }
 
-static void p_saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts)
+static void saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts)
 {
     psU64 i = 0;
@@ -709,4 +687,5 @@
     // Metadata containter for housing element attributes used by other SAX events
     htAtts = psHashAlloc(10);
+
 
     // Get tag name
@@ -745,12 +724,14 @@
 
     // Add attributes to metadata
-    psMetadataAdd(md, PS_LIST_TAIL, "htAtts", PS_TYPE_PTR, PS_META_HASH, NULL, htAtts);
+
+    psMetadataAdd(md, PS_LIST_TAIL, "htAtts", PS_META_HASH, NULL, htAtts);
 
     psFree(psTagName);
+    psFree(htAtts);
 
     return;
 }
 
-static void p_psInitMetadataItemXml(void *ctx, char *tagName)
+static void initMetadataItemXml(void *ctx, char *tagName)
 {
     psBool overwrite = false;
@@ -760,6 +741,5 @@
     psF64 tempDbl = 0.0;
     psS32 tempInt = 0.0;
-    psElemType pType = PS_TYPE_PTR;
-    psMetadataType mdType = PS_META_PRIMITIVE;
+    psMetadataType mdType = PS_META_UNKNOWN;
     char *fileName = NULL;
     char *strName = NULL;
@@ -802,17 +782,12 @@
         if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psString")) {
             mdType = PS_META_STR;
-            pType = PS_TYPE_PTR;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_U8;
+            mdType = PS_META_BOOL;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psS32")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_S32;
+            mdType = PS_META_S32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF32")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_F32;
+            mdType = PS_META_F32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF64")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_F64;
+            mdType = PS_META_F64;
         } else {
             psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_TYPE_INVALID_LINE_FILE, strType, lineNumber,
@@ -853,45 +828,39 @@
     switch(mdType) {
     case PS_META_LIST:
-        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, NULL);
+        psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, NULL);
         break;
     case PS_META_STR:
-        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, strValue);
+        psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, strValue);
         break;
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            tempBool = parseBool((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempBool);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        case PS_TYPE_S32:
-            tempInt = (psS32)parseValue((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempInt);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        case PS_TYPE_F32:
-        case PS_TYPE_F64:
-            tempDbl = parseValue((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempDbl);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        default:
-            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID, strType, lineNumber, fileName);
-        } // End switch
+    case PS_META_BOOL:
+        tempBool = parseBool((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempBool);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
+        break;
+    case PS_META_S32:
+        tempInt = (psS32)parseValue((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempInt);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
+        break;
+    case PS_META_F32:
+    case PS_META_F64:
+        tempDbl = parseValue((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempDbl);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
         break;
     default:
@@ -899,10 +868,9 @@
     } // End switch
 
-
     return;
 }
 
 
-static void p_psInitVectorXml(void *ctx, char *tagName)
+static void initVectorXml(void *ctx, char *tagName)
 {
     bool overwrite = false;
@@ -910,5 +878,4 @@
     psU32 lineNumber = 0;
     psElemType pType = PS_TYPE_PTR;
-    psMetadataType mdType = PS_META_PRIMITIVE;
     char *strName = NULL;
     char *strType = NULL;
@@ -952,18 +919,11 @@
     strType = psHashLookup(htAtts, "psType");
     if(strType!= NULL) {
-        if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psString")) {
-            mdType = PS_META_STR;
-            pType = PS_TYPE_PTR;
-        } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
-            mdType = PS_META_PRIMITIVE;
+        if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
             pType = PS_TYPE_U8;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psS32")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_S32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF32")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_F32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF64")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_F64;
         } else {
@@ -1006,5 +966,5 @@
     vec = parseVector((char*)strValue, pType, &status);
     if(!status) {
-        psMetadataAdd(md, PS_LIST_TAIL, strName+1, pType, mdType, NULL, vec);
+        psMetadataAdd(md, PS_LIST_TAIL, strName+1, PS_META_VEC, NULL, vec);
     } else {
         psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
@@ -1014,5 +974,5 @@
 }
 
-static void p_saxEndElement(void *ctx, const xmlChar *tagName)
+static void saxEndElement(void *ctx, const xmlChar *tagName)
 {
     char *psStartTagName = NULL;
@@ -1052,7 +1012,7 @@
     // Initialize psLib structs
     if(!strcmp(psEndTagName, "psMetadataItem")) {
-        p_psInitMetadataItemXml(ctx, psEndTagName);
+        initMetadataItemXml(ctx, psEndTagName);
     } else if(!strcmp(psEndTagName, "psVector")) {
-        p_psInitVectorXml(ctx, psEndTagName);
+        initVectorXml(ctx, psEndTagName);
     } else if(strcmp(psEndTagName, "psRoot")) {
         psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_TAG_UNKNOWN, psEndTagName);
@@ -1095,6 +1055,6 @@
     saxHandler.startDocument            = NULL;
     saxHandler.endDocument              = NULL;
-    saxHandler.startElement             = p_saxStartElement;
-    saxHandler.endElement               = p_saxEndElement;
+    saxHandler.startElement             = saxStartElement;
+    saxHandler.endElement               = saxEndElement;
     saxHandler.reference                = NULL;
     saxHandler.characters               = NULL;
Index: /trunk/psLib/src/astronomy/psTime.c
===================================================================
--- /trunk/psLib/src/astronomy/psTime.c	(revision 3340)
+++ /trunk/psLib/src/astronomy/psTime.c	(revision 3341)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:23 $
+ *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-28 23:34:10 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -215,5 +215,4 @@
     char metadataTableNames[4][MAX_STRING_LENGTH] = {"ser7", "eopc",  "finals", "tai"};
 
-
     // Read time config file
     timeMetadata = psMetadataParseConfig(timeMetadata, &nFail, fileName, true);
@@ -313,5 +312,5 @@
             if(metadataNamesPtr != NULL) {
                 psMetadataAdd(timeMetadata, PS_LIST_TAIL, strcat(metadataTableNames[j], "Table"),
-                              PS_TYPE_PTR, PS_META_LOOKUPTABLE, NULL, table);
+                              PS_META_LOOKUPTABLE, NULL, table);
                 foundTable = true;
             } else if(foundTable==false && j==numTables-1) {
@@ -322,4 +321,5 @@
         psFree(fullTableName);
         psFree(tableName);
+        psFree(table);
         i++;
     }
Index: /trunk/psLib/src/collections/psMetadata.c
===================================================================
--- /trunk/psLib/src/collections/psMetadata.c	(revision 3340)
+++ /trunk/psLib/src/collections/psMetadata.c	(revision 3341)
@@ -12,6 +12,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-18 22:17:20 $
+*  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -80,5 +80,5 @@
     psFree(metadataItem->name);
     psFree(metadataItem->comment);
-    if (type != PS_META_PRIMITIVE) {
+    if (! PS_META_IS_PRIMITIVE(type)) {
         psFree(metadataItem->data.V);
     }
@@ -98,5 +98,5 @@
 /*****************************************************************************/
 
-psMetadataItem* psMetadataItemAlloc(const char *name, psElemType pType, psMetadataType type,
+psMetadataItem* psMetadataItemAlloc(const char *name, psMetadataType type,
                                     const char *comment, ...)
 {
@@ -108,5 +108,5 @@
 
     // Call metadata item allocation
-    metadataItem = psMetadataItemAllocV(name, pType, type, comment, argPtr);
+    metadataItem = psMetadataItemAllocV(name, type, comment, argPtr);
 
     // Clean up stack after variable arguement has been used
@@ -116,5 +116,19 @@
 }
 
-psMetadataItem* psMetadataItemAllocV(const char *name, psElemType pType, psMetadataType type,
+#define METADATAITEM_ALLOC_TYPE(NAME,TYPE,METATYPE) \
+psMetadataItem* psMetadataItemAlloc##NAME(const char* name, \
+        const char* comment, \
+        TYPE value) \
+{ \
+    return psMetadataItemAlloc(name, METATYPE, comment, value); \
+}
+
+METADATAITEM_ALLOC_TYPE(Str,const char*,PS_META_STR)
+METADATAITEM_ALLOC_TYPE(F32,psF32,PS_META_F32)
+METADATAITEM_ALLOC_TYPE(F64,psF64,PS_META_F64)
+METADATAITEM_ALLOC_TYPE(S32,psS32,PS_META_S32)
+METADATAITEM_ALLOC_TYPE(Bool,psBool,PS_META_BOOL)
+
+psMetadataItem* psMetadataItemAllocV(const char *name, psMetadataType type,
                                      const char *comment, va_list argPtr)
 {
@@ -145,5 +159,4 @@
     // Set metadata item type
     metadataItem->type = type;
-    metadataItem->pType = pType;
 
     // Allocate and set metadata item name
@@ -153,23 +166,15 @@
     // Set metadata item value
     switch(type) {
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            metadataItem->data.B = (psBool)va_arg(argPtr, psS32);
-            break;
-        case PS_TYPE_S32:
-            metadataItem->data.S32 = (psS32)va_arg(argPtr, psS32);
-            break;
-        case PS_TYPE_F32:
-            metadataItem->data.F32 = (psF32)va_arg(argPtr, psF64);
-            break;
-        case PS_TYPE_F64:
-            metadataItem->data.F64 = (psF64)va_arg(argPtr, psF64);
-            break;
-        default:
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMetadata_METATYPE_INVALID, type);
-            psFree(metadataItem);
-            metadataItem = NULL;
-        }
+    case PS_META_BOOL:
+        metadataItem->data.B = (psBool)va_arg(argPtr, psS32);
+        break;
+    case PS_META_S32:
+        metadataItem->data.S32 = (psS32)va_arg(argPtr, psS32);
+        break;
+    case PS_META_F32:
+        metadataItem->data.F32 = (psF32)va_arg(argPtr, psF64);
+        break;
+    case PS_META_F64:
+        metadataItem->data.F64 = (psF64)va_arg(argPtr, psF64);
         break;
     case PS_META_STR:
@@ -186,5 +191,5 @@
     case PS_META_UNKNOWN:
         // Copy of input data not performed due to variability of data types
-        metadataItem->data.V = va_arg(argPtr, psPtr);
+        metadataItem->data.V = psMemIncrRefCounter(va_arg(argPtr, psPtr));
         break;
     default:
@@ -256,5 +261,5 @@
 
             // Leaf node replaces another leaf. Make new folder node and add leaves.
-            newFolderEntry = psMetadataItemAlloc(key, PS_TYPE_PTR, PS_META_LIST, NULL, NULL);
+            newFolderEntry = psMetadataItemAlloc(key, PS_META_LIST, NULL, NULL);
             newFolderEntry->data.list = psListAlloc(NULL);
 
@@ -328,5 +333,5 @@
 }
 
-psBool psMetadataAdd(psMetadata *md, psS32 where, const char *name, psElemType pType,
+psBool psMetadataAdd(psMetadata *md, psS32 where, const char *name,
                      psMetadataType type, const char *comment, ...)
 {
@@ -335,5 +340,5 @@
 
     va_start(argPtr, comment);
-    metadataItem = psMetadataItemAllocV(name, pType, type, comment, argPtr);
+    metadataItem = psMetadataItemAllocV(name, type, comment, argPtr);
     va_end(argPtr);
 
@@ -348,4 +353,21 @@
     return true;
 }
+
+#define METADATA_ADD_TYPE(NAME,TYPE,METATYPE) \
+psBool psMetadataAdd##NAME(psMetadata* md, psS32 where, const char* name, \
+                           const char* comment, TYPE value) { \
+    return psMetadataAdd(md,where,name, METATYPE,comment,value); \
+}
+
+METADATA_ADD_TYPE(S32,psS32,PS_META_S32)
+METADATA_ADD_TYPE(F32,psF32,PS_META_F32)
+METADATA_ADD_TYPE(F64,psF64,PS_META_F64)
+METADATA_ADD_TYPE(List,psList*,PS_META_LIST)
+METADATA_ADD_TYPE(Str,const char*,PS_META_STR)
+METADATA_ADD_TYPE(Vector,psVector*,PS_META_VEC)
+METADATA_ADD_TYPE(Image,psImage*,PS_META_IMG)
+METADATA_ADD_TYPE(Hash,psHash*,PS_META_HASH)
+METADATA_ADD_TYPE(LookupTable,psLookupTable*,PS_META_LOOKUPTABLE)
+METADATA_ADD_TYPE(Unknown,void*,PS_META_UNKNOWN)
 
 psBool psMetadataRemove(psMetadata *md, psS32 where, const char *key)
@@ -435,12 +457,11 @@
     }
 
-    if(metadataItem->type == PS_META_PRIMITIVE && metadataItem->pType != PS_TYPE_PTR) {
+    if(PS_META_IS_PRIMITIVE(metadataItem->type)) {
         if (status) {
             *status = false;
         }
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                PS_ERRORTEXT_psMetadata_METATYPE_MISMATCH,
-                metadataItem->pType,
-                PS_TYPE_PTR);
+                PS_ERRORTEXT_psMetadata_METATYPE_INVALID,
+                metadataItem->type);
         return NULL;
     } else {
@@ -467,31 +488,25 @@
     } \
     \
-    if (metadataItem->type == PS_META_PRIMITIVE) { \
-        switch (metadataItem->pType) { \
-        case PS_TYPE_S32: \
-            value = (ps##TYPE)metadataItem->data.S32; \
-            break; \
-        case PS_TYPE_F32: \
-            value = (ps##TYPE)metadataItem->data.F32; \
-            break; \
-        case PS_TYPE_F64: \
-            value = (ps##TYPE)metadataItem->data.F64; \
-            break; \
-        case PS_TYPE_BOOL: \
-            if (metadataItem->data.B) { \
-                value = 1; \
-            } \
-            break; \
-        default: \
-            /* if you get to this point, the value is not a number. */ \
-            if (status) { \
-                *status = false; \
-            } \
-            break; \
+    switch (metadataItem->type) { \
+    case PS_META_S32: \
+        value = (ps##TYPE)metadataItem->data.S32; \
+        break; \
+    case PS_META_F32: \
+        value = (ps##TYPE)metadataItem->data.F32; \
+        break; \
+    case PS_META_F64: \
+        value = (ps##TYPE)metadataItem->data.F64; \
+        break; \
+    case PS_META_BOOL: \
+        if (metadataItem->data.B) { \
+            value = 1; \
         } \
-    } else { \
+        break; \
+    default: \
+        /* if you get to this point, the value is not a number. */ \
         if (status) { \
             *status = false; \
         } \
+        break; \
     } \
     \
Index: /trunk/psLib/src/collections/psMetadata.h
===================================================================
--- /trunk/psLib/src/collections/psMetadata.h	(revision 3340)
+++ /trunk/psLib/src/collections/psMetadata.h	(revision 3341)
@@ -11,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-17 19:26:23 $
+*  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -24,4 +24,6 @@
 #include "psHash.h"
 #include "psList.h"
+#include "psImage.h"
+#include "psLookupTable.h"
 
 /// @addtogroup Metadata
@@ -33,5 +35,8 @@
  */
 typedef enum {
-    PS_META_PRIMITIVE,                 ///< Primitive data.
+    PS_META_S32,                       ///< Primitive data.
+    PS_META_F32,                       ///< Primitive data.
+    PS_META_F64,                       ///< Primitive data.
+    PS_META_BOOL,                       ///< Primitive data.
     PS_META_LIST,                      ///< List data (Stored as item.data.list).
     PS_META_STR,                       ///< String data (Stored as item.data.V).
@@ -47,4 +52,16 @@
 } psMetadataType;
 
+#define PS_META_IS_PRIMITIVE(TYPE) \
+(TYPE == PS_META_S32 || \
+ TYPE == PS_META_F32 || \
+ TYPE == PS_META_F64 || \
+ TYPE == PS_META_BOOL)
+
+#define PS_META_PRIMITIVE_TYPE(METATYPE) ( \
+        (METATYPE==PS_META_S32) ? PS_TYPE_S32 : \
+        (METATYPE==PS_META_F32) ? PS_TYPE_F32 : \
+        (METATYPE==PS_META_F64) ? PS_TYPE_F64 : \
+        (METATYPE==PS_META_BOOL) ? PS_TYPE_BOOL : PS_TYPE_PTR )
+
 /** Option flags for psMetadata functions
  *
@@ -55,5 +72,5 @@
 typedef enum {
     PS_META_DEFAULT = 0,               ///< default behaviour (duplicate entry is an error)
-    PS_META_REPLACE                    ///< allow entry to be replaced
+    PS_META_REPLACE = 0x10000          ///< allow entry to be replaced
 } psMetadataFlags;
 
@@ -82,5 +99,4 @@
     char *name;                        ///< Name of metadata item.
     psMetadataType type;               ///< Type of metadata item.
-    psElemType pType;                  ///< Primitive data type
     union {
         psBool B;                      ///< boolean data
@@ -113,8 +129,37 @@
 psMetadataItem* psMetadataItemAlloc(
     const char *name,                  ///< Name of metadata item.
-    psElemType pType,                  ///< Primitive type.
     psMetadataType type,               ///< Type of metadata item.
     const char *comment,               ///< Comment for metadata item.
     ...                                ///< Arguments for name formatting and metadata item data.
+);
+
+psMetadataItem* psMetadataItemAllocStr(
+    const char* name,
+    const char* comment,
+    const char* value
+);
+
+psMetadataItem* psMetadataItemAllocF32(
+    const char* name,
+    const char* comment,
+    psF32 value
+);
+
+psMetadataItem* psMetadataItemAllocF64(
+    const char* name,
+    const char* comment,
+    psF64 value
+);
+
+psMetadataItem* psMetadataItemAllocS32(
+    const char* name,
+    const char* comment,
+    psS32 value
+);
+
+psMetadataItem* psMetadataItemAllocBool(
+    const char* name,
+    const char* comment,
+    psBool value
 );
 
@@ -137,5 +182,4 @@
 psMetadataItem* psMetadataItemAllocV(
     const char *name,                  ///< Name of metadata item.
-    psElemType pType,                  ///< Primitive type.
     psMetadataType type,               ///< Type of metadata item.
     const char *comment,               ///< Comment for metadata item.
@@ -161,7 +205,7 @@
  */
 psBool psMetadataAddItem(
-    psMetadata*  md,          ///< Metadata collection to insert metadat item.
-    psMetadataItem*  item,    ///< Metadata item to be added.
-    psS32 location            ///< Location to be added.
+    psMetadata*  md,                   ///< Metadata collection to insert metadat item.
+    psMetadataItem*  item,             ///< Metadata item to be added.
+    psS32 location                     ///< Location to be added.
 );
 
@@ -173,12 +217,33 @@
  */
 psBool psMetadataAdd(
-    psMetadata* md,           ///< Metadata collection to insert metadat item.
-    psS32 where,              ///< Location to be added.
-    const char *name,         ///< Name of metadata item.
-    psElemType pType,         ///< Primitive type.
-    psMetadataType type,      ///< Type of metadata item.
-    const char *comment,      ///< Comment for metadata item.
-    ...                       ///< Arguments for name formatting and metadata item data.
-);
+    psMetadata* md,                    ///< Metadata collection to insert metadat item.
+    psS32 where,                       ///< Location to be added.
+    const char *name,                  ///< Name of metadata item.
+    psMetadataType type,               ///< Type of metadata item.
+    const char *comment,               ///< Comment for metadata item.
+    ...                                ///< Arguments for name formatting and metadata item data.
+);
+
+psBool psMetadataAddS32(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, psS32 value);
+psBool psMetadataAddF32(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, psF32 value);
+psBool psMetadataAddF64(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, psF64 value);
+psBool psMetadataAddList(psMetadata* md, psS32 where, const char* name,
+                         const char* comment, psList* value);
+psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, const char* value);
+psBool psMetadataAddVector(psMetadata* md, psS32 where, const char* name,
+                           const char* comment, psVector* value);
+psBool psMetadataAddImage(psMetadata* md, psS32 where, const char* name,
+                          const char* comment, psImage* value);
+psBool psMetadataAddHash(psMetadata* md, psS32 where, const char* name,
+                         const char* comment, psHash* value);
+psBool psMetadataAddLookupTable(psMetadata* md, psS32 where, const char* name,
+                                const char* comment, psLookupTable* value);
+psBool psMetadataAddUnknown(psMetadata* md, psS32 where, const char* name,
+                            const char* comment, psPtr value);
+
 
 /** Remove an item from metadata collection.
Index: /trunk/psLib/src/collections/psMetadataIO.c
===================================================================
--- /trunk/psLib/src/collections/psMetadataIO.c	(revision 3340)
+++ /trunk/psLib/src/collections/psMetadataIO.c	(revision 3341)
@@ -9,6 +9,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-17 19:26:23 $
+*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -101,8 +101,8 @@
 /*****************************************************************************/
 
-static void p_saxEndElement(void *ctx, const xmlChar *tagName);
-static void p_psInitVectorXml(void *ctx, char *tagName);
-static void p_psInitMetadataItemXml(void *ctx, char *tagName);
-static void p_saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts);
+static void saxEndElement(void *ctx, const xmlChar *tagName);
+static void initVectorXml(void *ctx, char *tagName);
+static void initMetadataItemXml(void *ctx, char *tagName);
+static void saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts);
 
 /** Determines if a line is blank (whitespace only) or a commentline. It returns true if so. The input string
@@ -307,5 +307,4 @@
 {
     psMetadataType type;
-    psElemType pType;
     psBool success = true;
 
@@ -315,25 +314,17 @@
 
     type = metadataItem->type;
-    pType = metadataItem->pType;
 
     switch(type) {
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            fprintf(fd, format, metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            fprintf(fd,format, metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            fprintf(fd, format, metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            fprintf(fd, format, metadataItem->data.F64);
-            break;
-        default:
-            psError(PS_ERR_BAD_PARAMETER_TYPE,true, PS_ERRORTEXT_psMetadata_METATYPE_INVALID, (int)pType);
-            success = false;
-        }
+    case PS_META_BOOL:
+        fprintf(fd, format, metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        fprintf(fd,format, metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        fprintf(fd, format, metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        fprintf(fd, format, metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -419,19 +410,19 @@
         switch (keyType) {
         case 'I':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_S32, PS_META_PRIMITIVE,
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_S32,
                                     keyComment, atoi(keyValue));
             break;
         case 'F':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_F64, PS_META_PRIMITIVE,
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_F64,
                                     keyComment, atof(keyValue));
             break;
         case 'C':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_PTR, PS_META_STR, keyComment,
-                                    keyValue);
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_STR,
+                                    keyComment, keyValue);
             break;
         case 'L':
             tempBool = (keyValue[0] == 'T') ? 1 : 0;
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_BOOL, PS_META_PRIMITIVE, keyComment,
-                                    tempBool);
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_BOOL,
+                                    keyComment, tempBool);
             break;
         case 'U':
@@ -460,4 +451,5 @@
     char *strComment = NULL;
     char *linePtr = NULL;
+    psElemType vecType = PS_TYPE_PTR;
     psS32 status = 0;
     psU32 lineCount = 0;
@@ -467,5 +459,4 @@
     psVector *tempVec = NULL;
     FILE *fp = NULL;
-    psElemType pType;
     psMetadataType mdType;
 
@@ -535,20 +526,14 @@
             } else if(!strncmp(strType, "*", 1)) {
                 mdType = PS_META_LIST;
-                pType = PS_TYPE_PTR;
             } else if(!strncmp(strType, "STR", 3)) {
                 mdType = PS_META_STR;
-                pType = PS_TYPE_PTR;
-            } else if(!strncmp(strType, "BOOL", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_BOOL;
+            } else if(!strncmp(strType, "BOOL", 4)) {
+                mdType = PS_META_BOOL;
             } else if(!strncmp(strType, "S32", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_S32;
+                mdType = PS_META_S32;
             } else if(!strncmp(strType, "F32", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_F32;
+                mdType = PS_META_F32;
             } else if(!strncmp(strType, "F64", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_F64;
+                mdType = PS_META_F64;
             } else {
                 (*nFail)++;
@@ -559,4 +544,5 @@
 
             if(*strName == '@') {
+                vecType = PS_META_PRIMITIVE_TYPE(mdType);
                 mdType = PS_META_VEC;
             }
@@ -604,13 +590,26 @@
             switch (mdType) {
             case PS_META_LIST:
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, NULL);
+                psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, NULL);
                 break;
             case PS_META_STR:
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, strValue);
+                psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, strValue);
                 break;
             case PS_META_VEC:
-                tempVec = parseVector(strValue, pType, &status);
+                tempVec = parseVector(strValue, vecType, &status);
                 if(!status) {
-                    psMetadataAdd(md, PS_LIST_TAIL, strName+1, pType, mdType, strComment, tempVec);
+                    psMetadataAdd(md, PS_LIST_TAIL, strName+1, mdType, strComment, tempVec);
+                } else {
+                    status = 0;
+                    (*nFail)++;
+                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
+                            strType, lineCount, fileName);
+                    continue;
+                }
+                psFree(tempVec);
+                break;
+            case PS_META_BOOL:
+                tempBool = parseBool(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempBool);
                 } else {
                     status = 0;
@@ -621,50 +620,29 @@
                 }
                 break;
-            case PS_META_PRIMITIVE:
-                switch (pType) {
-                case PS_TYPE_BOOL:
-                    tempBool = parseBool(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempBool);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
-                                strType, lineCount, fileName);
-                        continue;
-                    }
-                    break;
-                case PS_TYPE_S32:
-                    tempInt = (psS32)parseValue(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempInt);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
-                                strType, lineCount, fileName);
-                        continue;
-                    }
-                    break;
-                case PS_TYPE_F32:
-                case PS_TYPE_F64:
-                    tempDbl = parseValue(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempDbl);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true,
-                                PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType, lineCount,
-                                fileName);
-                        continue;
-                    }
-                    break;
-                default:
+            case PS_META_S32:
+                tempInt = (psS32)parseValue(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempInt);
+                } else {
+                    status = 0;
                     (*nFail)++;
-                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID, mdType, lineCount,
+                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
+                            strType, lineCount, fileName);
+                    continue;
+                }
+                break;
+            case PS_META_F32:
+            case PS_META_F64:
+                tempDbl = parseValue(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempDbl);
+                } else {
+                    status = 0;
+                    (*nFail)++;
+                    psError(PS_ERR_IO, true,
+                            PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType, lineCount,
                             fileName);
                     continue;
-                } // switch
+                }
                 break;
             default:
@@ -682,5 +660,5 @@
 }
 
-static void p_saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts)
+static void saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts)
 {
     psU64 i = 0;
@@ -709,4 +687,5 @@
     // Metadata containter for housing element attributes used by other SAX events
     htAtts = psHashAlloc(10);
+
 
     // Get tag name
@@ -745,12 +724,14 @@
 
     // Add attributes to metadata
-    psMetadataAdd(md, PS_LIST_TAIL, "htAtts", PS_TYPE_PTR, PS_META_HASH, NULL, htAtts);
+
+    psMetadataAdd(md, PS_LIST_TAIL, "htAtts", PS_META_HASH, NULL, htAtts);
 
     psFree(psTagName);
+    psFree(htAtts);
 
     return;
 }
 
-static void p_psInitMetadataItemXml(void *ctx, char *tagName)
+static void initMetadataItemXml(void *ctx, char *tagName)
 {
     psBool overwrite = false;
@@ -760,6 +741,5 @@
     psF64 tempDbl = 0.0;
     psS32 tempInt = 0.0;
-    psElemType pType = PS_TYPE_PTR;
-    psMetadataType mdType = PS_META_PRIMITIVE;
+    psMetadataType mdType = PS_META_UNKNOWN;
     char *fileName = NULL;
     char *strName = NULL;
@@ -802,17 +782,12 @@
         if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psString")) {
             mdType = PS_META_STR;
-            pType = PS_TYPE_PTR;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_U8;
+            mdType = PS_META_BOOL;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psS32")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_S32;
+            mdType = PS_META_S32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF32")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_F32;
+            mdType = PS_META_F32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF64")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_F64;
+            mdType = PS_META_F64;
         } else {
             psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_TYPE_INVALID_LINE_FILE, strType, lineNumber,
@@ -853,45 +828,39 @@
     switch(mdType) {
     case PS_META_LIST:
-        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, NULL);
+        psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, NULL);
         break;
     case PS_META_STR:
-        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, strValue);
+        psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, strValue);
         break;
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            tempBool = parseBool((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempBool);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        case PS_TYPE_S32:
-            tempInt = (psS32)parseValue((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempInt);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        case PS_TYPE_F32:
-        case PS_TYPE_F64:
-            tempDbl = parseValue((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempDbl);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        default:
-            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID, strType, lineNumber, fileName);
-        } // End switch
+    case PS_META_BOOL:
+        tempBool = parseBool((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempBool);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
+        break;
+    case PS_META_S32:
+        tempInt = (psS32)parseValue((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempInt);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
+        break;
+    case PS_META_F32:
+    case PS_META_F64:
+        tempDbl = parseValue((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempDbl);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
         break;
     default:
@@ -899,10 +868,9 @@
     } // End switch
 
-
     return;
 }
 
 
-static void p_psInitVectorXml(void *ctx, char *tagName)
+static void initVectorXml(void *ctx, char *tagName)
 {
     bool overwrite = false;
@@ -910,5 +878,4 @@
     psU32 lineNumber = 0;
     psElemType pType = PS_TYPE_PTR;
-    psMetadataType mdType = PS_META_PRIMITIVE;
     char *strName = NULL;
     char *strType = NULL;
@@ -952,18 +919,11 @@
     strType = psHashLookup(htAtts, "psType");
     if(strType!= NULL) {
-        if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psString")) {
-            mdType = PS_META_STR;
-            pType = PS_TYPE_PTR;
-        } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
-            mdType = PS_META_PRIMITIVE;
+        if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
             pType = PS_TYPE_U8;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psS32")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_S32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF32")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_F32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF64")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_F64;
         } else {
@@ -1006,5 +966,5 @@
     vec = parseVector((char*)strValue, pType, &status);
     if(!status) {
-        psMetadataAdd(md, PS_LIST_TAIL, strName+1, pType, mdType, NULL, vec);
+        psMetadataAdd(md, PS_LIST_TAIL, strName+1, PS_META_VEC, NULL, vec);
     } else {
         psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
@@ -1014,5 +974,5 @@
 }
 
-static void p_saxEndElement(void *ctx, const xmlChar *tagName)
+static void saxEndElement(void *ctx, const xmlChar *tagName)
 {
     char *psStartTagName = NULL;
@@ -1052,7 +1012,7 @@
     // Initialize psLib structs
     if(!strcmp(psEndTagName, "psMetadataItem")) {
-        p_psInitMetadataItemXml(ctx, psEndTagName);
+        initMetadataItemXml(ctx, psEndTagName);
     } else if(!strcmp(psEndTagName, "psVector")) {
-        p_psInitVectorXml(ctx, psEndTagName);
+        initVectorXml(ctx, psEndTagName);
     } else if(strcmp(psEndTagName, "psRoot")) {
         psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_TAG_UNKNOWN, psEndTagName);
@@ -1095,6 +1055,6 @@
     saxHandler.startDocument            = NULL;
     saxHandler.endDocument              = NULL;
-    saxHandler.startElement             = p_saxStartElement;
-    saxHandler.endElement               = p_saxEndElement;
+    saxHandler.startElement             = saxStartElement;
+    saxHandler.endElement               = saxEndElement;
     saxHandler.reference                = NULL;
     saxHandler.characters               = NULL;
Index: /trunk/psLib/src/dataIO/psFits.c
===================================================================
--- /trunk/psLib/src/dataIO/psFits.c	(revision 3340)
+++ /trunk/psLib/src/dataIO/psFits.c	(revision 3341)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-22 19:25:52 $
+ *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-28 23:34:10 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -162,17 +162,17 @@
 }
 
-static bool convertPsTypeToBinaryTForm(psElemType type, char** fitsType)
+static bool convertMetadataTypeToBinaryTForm(psMetadataType type, char** fitsType)
 {
     switch (type) {
-    case PS_TYPE_BOOL:
+    case PS_META_BOOL:
         *fitsType = psStringCopy("1L");
         break;
-    case PS_TYPE_S32:
+    case PS_META_S32:
         *fitsType = psStringCopy("1J");
         break;
-    case PS_TYPE_F32:
+    case PS_META_F32:
         *fitsType = psStringCopy("1E");
         break;
-    case PS_TYPE_F64:
+    case PS_META_F64:
         *fitsType = psStringCopy("1D");
         break;
@@ -506,6 +506,5 @@
                                         PS_LIST_TAIL,
                                         keyName,
-                                        PS_TYPE_S32,
-                                        PS_META_PRIMITIVE,
+                                        PS_META_S32,
                                         keyComment,
                                         atoi(keyValue));
@@ -517,6 +516,5 @@
                                         PS_LIST_TAIL,
                                         keyName,
-                                        PS_TYPE_F64,
-                                        PS_META_PRIMITIVE,
+                                        PS_META_F64,
                                         keyComment,
                                         atof(keyValue));
@@ -529,5 +527,4 @@
                                             PS_LIST_TAIL,
                                             keyName,
-                                            PS_TYPE_PTR,
                                             PS_META_STR,
                                             keyComment,
@@ -537,5 +534,4 @@
                                             PS_LIST_TAIL,
                                             keyName,
-                                            PS_TYPE_PTR,
                                             PS_META_STR,
                                             keyComment,
@@ -548,6 +544,5 @@
                                         PS_LIST_TAIL,
                                         keyName,
-                                        PS_TYPE_BOOL,
-                                        PS_META_PRIMITIVE,
+                                        PS_META_BOOL,
                                         keyComment,
                                         tempBool);
@@ -1072,47 +1067,40 @@
     psMetadataItem* item;
     while ( (item=psListGetAndIncrement(iter)) != NULL ) {
-        if (item->type == PS_META_PRIMITIVE) { // we only write primitive data types.
-            switch (item->pType) {
-            case PS_TYPE_BOOL: {
-                    int value = item->data.B;
-                    fits_update_key(fits->p_fd,
-                                    TLOGICAL,
-                                    item->name,
-                                    &value,
-                                    item->comment,
-                                    &status);
-                    break;
-                }
-            case PS_TYPE_S32:
+        switch (item->type) {
+        case PS_META_BOOL: {
+                int value = item->data.B;
                 fits_update_key(fits->p_fd,
-                                TINT,
+                                TLOGICAL,
                                 item->name,
-                                &item->data.S32,
+                                &value,
                                 item->comment,
                                 &status);
                 break;
-            case PS_TYPE_F32:
-                fits_update_key(fits->p_fd,
-                                TFLOAT,
-                                item->name,
-                                &item->data.F32,
-                                item->comment,
-                                &status);
-                break;
-            case PS_TYPE_F64:
-                fits_update_key(fits->p_fd,
-                                TDOUBLE,
-                                item->name,
-                                &item->data.F64,
-                                item->comment,
-                                &status);
-                break;
-            default:
-                psError(PS_ERR_BAD_PARAMETER_TYPE, true,
-                        PS_ERRORTEXT_psFits_METADATA_PTYPE_UNSUPPORTED,
-                        item->pType);
-                break;
             }
-        } else if (item->type == PS_META_STR) {
+        case PS_META_S32:
+            fits_update_key(fits->p_fd,
+                            TINT,
+                            item->name,
+                            &item->data.S32,
+                            item->comment,
+                            &status);
+            break;
+        case PS_META_F32:
+            fits_update_key(fits->p_fd,
+                            TFLOAT,
+                            item->name,
+                            &item->data.F32,
+                            item->comment,
+                            &status);
+            break;
+        case PS_META_F64:
+            fits_update_key(fits->p_fd,
+                            TDOUBLE,
+                            item->name,
+                            &item->data.F64,
+                            item->comment,
+                            &status);
+            break;
+        case PS_META_STR:
             fits_update_key(fits->p_fd,
                             TSTRING,
@@ -1121,4 +1109,7 @@
                             item->comment,
                             &status);
+            break;
+        default:  // all other META types are ignored
+            break;
         }
 
@@ -1214,5 +1205,5 @@
                               1, 1, NULL, &value, &anynul, &status); \
                 psMetadataAdd(data,PS_LIST_TAIL, name, \
-                              PS_TYPE_##TYPE, PS_META_PRIMITIVE, \
+                              PS_META_##TYPE, \
                               "", (ps##TYPE)value); \
                 break; \
@@ -1234,5 +1225,5 @@
                     if (anynul == 0) {
                         psMetadataAdd(data,PS_LIST_TAIL, name,
-                                      PS_TYPE_PTR, PS_META_STR,
+                                      PS_META_STR,
                                       "", value);
                     }
@@ -1487,5 +1478,5 @@
                                    PS_LIST_HEAD,true);
             while ( (item=psListGetAndIncrement(iter)) != NULL) {
-                if (item->type == PS_META_PRIMITIVE) {
+                if (PS_META_IS_PRIMITIVE(item->type)) {
                     bool found = false;
                     for (int n=0; n < columns->n && ! found; n++) {
@@ -1515,6 +1506,6 @@
         char* fitsType;
         columnNames->data[n] = psMemIncrRefCounter(((psMetadataItem*)columns->data[n])->name);
-        if ( ! convertPsTypeToBinaryTForm(((psMetadataItem*)columns->data[n])->pType,
-                                          &fitsType)) {
+        if ( ! convertMetadataTypeToBinaryTForm(((psMetadataItem*)columns->data[n])->type,
+                                                &fitsType)) {
             // XXX: error message
             return false;
@@ -1540,9 +1531,9 @@
         int row;
         item = columns->data[n];
-
-        if (item->type == PS_META_PRIMITIVE) {
-            psVector* col = psVectorAlloc(table->n, item->pType);
-            switch (item->pType) {
-            case PS_TYPE_S32:
+        if (PS_META_IS_PRIMITIVE(item->type)) {
+            psVector* col = NULL;
+            switch (item->type) {
+            case PS_META_S32:
+                col = psVectorAlloc(table->n, PS_TYPE_S32);
                 for (row = 0; row < table->n; row++) {
                     col->data.S32[row] = psMetadataLookupS32(NULL,
@@ -1558,5 +1549,6 @@
                                    &status);
                 break;
-            case PS_TYPE_F32:
+            case PS_META_F32:
+                col = psVectorAlloc(table->n, PS_TYPE_F32);
                 for (row = 0; row < table->n; row++) {
                     col->data.F32[row] = psMetadataLookupF32(NULL,
@@ -1572,5 +1564,6 @@
                                    &status);
                 break;
-            case PS_TYPE_F64:
+            case PS_META_F64:
+                col = psVectorAlloc(table->n, PS_TYPE_F64);
                 for (row = 0; row < table->n; row++) {
                     col->data.F64[row] = psMetadataLookupF64(NULL,
@@ -1586,5 +1579,6 @@
                                    &status);
                 break;
-            case PS_TYPE_BOOL:
+            case PS_META_BOOL:
+                col = psVectorAlloc(table->n, PS_TYPE_BOOL);
                 for (row = 0; row < table->n; row++) {
                     col->data.S8[row] = psMetadataLookupBool(NULL,
@@ -1601,5 +1595,5 @@
                 break;
             default:
-                // XXX: error message
+                // XXX: error message?
                 break;
             }
Index: /trunk/psLib/src/dataManip/psMatrix.c
===================================================================
--- /trunk/psLib/src/dataManip/psMatrix.c	(revision 3340)
+++ /trunk/psLib/src/dataManip/psMatrix.c	(revision 3341)
@@ -21,6 +21,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-24 00:19:51 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-28 23:34:10 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -452,4 +452,5 @@
     if(numRowsIn!=numColsOut && numRowsOut!=numColsIn) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMatrix_TRANSPOSE_MISMATCH);
+        TRANSPOSE_CLEANUP;
     }
 
@@ -542,5 +543,5 @@
                 "Image does not have dim with 1 col or 1 row: (%d x %d).",
                 inImage->numRows, inImage->numCols);
-        return outVector;
+        psMatrixToVector_EXIT;
     }
 
@@ -557,5 +558,5 @@
                     "Image and vector sizes differ: (%d vs %d).",
                     inImage->numRows, outVector->n);
-            return outVector;
+            psMatrixToVector_EXIT;
         }
 
@@ -573,5 +574,5 @@
                     "Image and vector sizes differ: (%d vs %d).",
                     inImage->numCols, outVector->n);
-            return outVector;
+            psMatrixToVector_EXIT;
         }
 
@@ -603,10 +604,10 @@
                     "Image has more than 1 column: numCols = %d.",
                     outImage->numCols);
-            return outImage;
+            VECTORTOMATRIX_CLEANUP;
         } else if (outImage->numRows != inVector->n) {
             psError(PS_ERR_BAD_PARAMETER_SIZE, true,
                     "Image and vector sizes differ: (%d vs %d).",
                     outImage->numRows, inVector->n);
-            return outImage;
+            VECTORTOMATRIX_CLEANUP;
         }
 
@@ -622,10 +623,10 @@
                     "Image has more than 1 row: numRows = %d.",
                     outImage->numRows);
-            return outImage;
+            VECTORTOMATRIX_CLEANUP;
         } else if (outImage->numCols != inVector->n) {
             psError(PS_ERR_BAD_PARAMETER_SIZE, true,
                     "Image and vector sizes differ: (%d vs %d).",
                     outImage->numCols, inVector->n);
-            return outImage;
+            VECTORTOMATRIX_CLEANUP;
         }
 
Index: /trunk/psLib/src/fileUtils/psFits.c
===================================================================
--- /trunk/psLib/src/fileUtils/psFits.c	(revision 3340)
+++ /trunk/psLib/src/fileUtils/psFits.c	(revision 3341)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-22 19:25:52 $
+ *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-28 23:34:10 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -162,17 +162,17 @@
 }
 
-static bool convertPsTypeToBinaryTForm(psElemType type, char** fitsType)
+static bool convertMetadataTypeToBinaryTForm(psMetadataType type, char** fitsType)
 {
     switch (type) {
-    case PS_TYPE_BOOL:
+    case PS_META_BOOL:
         *fitsType = psStringCopy("1L");
         break;
-    case PS_TYPE_S32:
+    case PS_META_S32:
         *fitsType = psStringCopy("1J");
         break;
-    case PS_TYPE_F32:
+    case PS_META_F32:
         *fitsType = psStringCopy("1E");
         break;
-    case PS_TYPE_F64:
+    case PS_META_F64:
         *fitsType = psStringCopy("1D");
         break;
@@ -506,6 +506,5 @@
                                         PS_LIST_TAIL,
                                         keyName,
-                                        PS_TYPE_S32,
-                                        PS_META_PRIMITIVE,
+                                        PS_META_S32,
                                         keyComment,
                                         atoi(keyValue));
@@ -517,6 +516,5 @@
                                         PS_LIST_TAIL,
                                         keyName,
-                                        PS_TYPE_F64,
-                                        PS_META_PRIMITIVE,
+                                        PS_META_F64,
                                         keyComment,
                                         atof(keyValue));
@@ -529,5 +527,4 @@
                                             PS_LIST_TAIL,
                                             keyName,
-                                            PS_TYPE_PTR,
                                             PS_META_STR,
                                             keyComment,
@@ -537,5 +534,4 @@
                                             PS_LIST_TAIL,
                                             keyName,
-                                            PS_TYPE_PTR,
                                             PS_META_STR,
                                             keyComment,
@@ -548,6 +544,5 @@
                                         PS_LIST_TAIL,
                                         keyName,
-                                        PS_TYPE_BOOL,
-                                        PS_META_PRIMITIVE,
+                                        PS_META_BOOL,
                                         keyComment,
                                         tempBool);
@@ -1072,47 +1067,40 @@
     psMetadataItem* item;
     while ( (item=psListGetAndIncrement(iter)) != NULL ) {
-        if (item->type == PS_META_PRIMITIVE) { // we only write primitive data types.
-            switch (item->pType) {
-            case PS_TYPE_BOOL: {
-                    int value = item->data.B;
-                    fits_update_key(fits->p_fd,
-                                    TLOGICAL,
-                                    item->name,
-                                    &value,
-                                    item->comment,
-                                    &status);
-                    break;
-                }
-            case PS_TYPE_S32:
+        switch (item->type) {
+        case PS_META_BOOL: {
+                int value = item->data.B;
                 fits_update_key(fits->p_fd,
-                                TINT,
+                                TLOGICAL,
                                 item->name,
-                                &item->data.S32,
+                                &value,
                                 item->comment,
                                 &status);
                 break;
-            case PS_TYPE_F32:
-                fits_update_key(fits->p_fd,
-                                TFLOAT,
-                                item->name,
-                                &item->data.F32,
-                                item->comment,
-                                &status);
-                break;
-            case PS_TYPE_F64:
-                fits_update_key(fits->p_fd,
-                                TDOUBLE,
-                                item->name,
-                                &item->data.F64,
-                                item->comment,
-                                &status);
-                break;
-            default:
-                psError(PS_ERR_BAD_PARAMETER_TYPE, true,
-                        PS_ERRORTEXT_psFits_METADATA_PTYPE_UNSUPPORTED,
-                        item->pType);
-                break;
             }
-        } else if (item->type == PS_META_STR) {
+        case PS_META_S32:
+            fits_update_key(fits->p_fd,
+                            TINT,
+                            item->name,
+                            &item->data.S32,
+                            item->comment,
+                            &status);
+            break;
+        case PS_META_F32:
+            fits_update_key(fits->p_fd,
+                            TFLOAT,
+                            item->name,
+                            &item->data.F32,
+                            item->comment,
+                            &status);
+            break;
+        case PS_META_F64:
+            fits_update_key(fits->p_fd,
+                            TDOUBLE,
+                            item->name,
+                            &item->data.F64,
+                            item->comment,
+                            &status);
+            break;
+        case PS_META_STR:
             fits_update_key(fits->p_fd,
                             TSTRING,
@@ -1121,4 +1109,7 @@
                             item->comment,
                             &status);
+            break;
+        default:  // all other META types are ignored
+            break;
         }
 
@@ -1214,5 +1205,5 @@
                               1, 1, NULL, &value, &anynul, &status); \
                 psMetadataAdd(data,PS_LIST_TAIL, name, \
-                              PS_TYPE_##TYPE, PS_META_PRIMITIVE, \
+                              PS_META_##TYPE, \
                               "", (ps##TYPE)value); \
                 break; \
@@ -1234,5 +1225,5 @@
                     if (anynul == 0) {
                         psMetadataAdd(data,PS_LIST_TAIL, name,
-                                      PS_TYPE_PTR, PS_META_STR,
+                                      PS_META_STR,
                                       "", value);
                     }
@@ -1487,5 +1478,5 @@
                                    PS_LIST_HEAD,true);
             while ( (item=psListGetAndIncrement(iter)) != NULL) {
-                if (item->type == PS_META_PRIMITIVE) {
+                if (PS_META_IS_PRIMITIVE(item->type)) {
                     bool found = false;
                     for (int n=0; n < columns->n && ! found; n++) {
@@ -1515,6 +1506,6 @@
         char* fitsType;
         columnNames->data[n] = psMemIncrRefCounter(((psMetadataItem*)columns->data[n])->name);
-        if ( ! convertPsTypeToBinaryTForm(((psMetadataItem*)columns->data[n])->pType,
-                                          &fitsType)) {
+        if ( ! convertMetadataTypeToBinaryTForm(((psMetadataItem*)columns->data[n])->type,
+                                                &fitsType)) {
             // XXX: error message
             return false;
@@ -1540,9 +1531,9 @@
         int row;
         item = columns->data[n];
-
-        if (item->type == PS_META_PRIMITIVE) {
-            psVector* col = psVectorAlloc(table->n, item->pType);
-            switch (item->pType) {
-            case PS_TYPE_S32:
+        if (PS_META_IS_PRIMITIVE(item->type)) {
+            psVector* col = NULL;
+            switch (item->type) {
+            case PS_META_S32:
+                col = psVectorAlloc(table->n, PS_TYPE_S32);
                 for (row = 0; row < table->n; row++) {
                     col->data.S32[row] = psMetadataLookupS32(NULL,
@@ -1558,5 +1549,6 @@
                                    &status);
                 break;
-            case PS_TYPE_F32:
+            case PS_META_F32:
+                col = psVectorAlloc(table->n, PS_TYPE_F32);
                 for (row = 0; row < table->n; row++) {
                     col->data.F32[row] = psMetadataLookupF32(NULL,
@@ -1572,5 +1564,6 @@
                                    &status);
                 break;
-            case PS_TYPE_F64:
+            case PS_META_F64:
+                col = psVectorAlloc(table->n, PS_TYPE_F64);
                 for (row = 0; row < table->n; row++) {
                     col->data.F64[row] = psMetadataLookupF64(NULL,
@@ -1586,5 +1579,6 @@
                                    &status);
                 break;
-            case PS_TYPE_BOOL:
+            case PS_META_BOOL:
+                col = psVectorAlloc(table->n, PS_TYPE_BOOL);
                 for (row = 0; row < table->n; row++) {
                     col->data.S8[row] = psMetadataLookupBool(NULL,
@@ -1601,5 +1595,5 @@
                 break;
             default:
-                // XXX: error message
+                // XXX: error message?
                 break;
             }
Index: /trunk/psLib/src/fits/psFits.c
===================================================================
--- /trunk/psLib/src/fits/psFits.c	(revision 3340)
+++ /trunk/psLib/src/fits/psFits.c	(revision 3341)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-22 19:25:52 $
+ *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-28 23:34:10 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -162,17 +162,17 @@
 }
 
-static bool convertPsTypeToBinaryTForm(psElemType type, char** fitsType)
+static bool convertMetadataTypeToBinaryTForm(psMetadataType type, char** fitsType)
 {
     switch (type) {
-    case PS_TYPE_BOOL:
+    case PS_META_BOOL:
         *fitsType = psStringCopy("1L");
         break;
-    case PS_TYPE_S32:
+    case PS_META_S32:
         *fitsType = psStringCopy("1J");
         break;
-    case PS_TYPE_F32:
+    case PS_META_F32:
         *fitsType = psStringCopy("1E");
         break;
-    case PS_TYPE_F64:
+    case PS_META_F64:
         *fitsType = psStringCopy("1D");
         break;
@@ -506,6 +506,5 @@
                                         PS_LIST_TAIL,
                                         keyName,
-                                        PS_TYPE_S32,
-                                        PS_META_PRIMITIVE,
+                                        PS_META_S32,
                                         keyComment,
                                         atoi(keyValue));
@@ -517,6 +516,5 @@
                                         PS_LIST_TAIL,
                                         keyName,
-                                        PS_TYPE_F64,
-                                        PS_META_PRIMITIVE,
+                                        PS_META_F64,
                                         keyComment,
                                         atof(keyValue));
@@ -529,5 +527,4 @@
                                             PS_LIST_TAIL,
                                             keyName,
-                                            PS_TYPE_PTR,
                                             PS_META_STR,
                                             keyComment,
@@ -537,5 +534,4 @@
                                             PS_LIST_TAIL,
                                             keyName,
-                                            PS_TYPE_PTR,
                                             PS_META_STR,
                                             keyComment,
@@ -548,6 +544,5 @@
                                         PS_LIST_TAIL,
                                         keyName,
-                                        PS_TYPE_BOOL,
-                                        PS_META_PRIMITIVE,
+                                        PS_META_BOOL,
                                         keyComment,
                                         tempBool);
@@ -1072,47 +1067,40 @@
     psMetadataItem* item;
     while ( (item=psListGetAndIncrement(iter)) != NULL ) {
-        if (item->type == PS_META_PRIMITIVE) { // we only write primitive data types.
-            switch (item->pType) {
-            case PS_TYPE_BOOL: {
-                    int value = item->data.B;
-                    fits_update_key(fits->p_fd,
-                                    TLOGICAL,
-                                    item->name,
-                                    &value,
-                                    item->comment,
-                                    &status);
-                    break;
-                }
-            case PS_TYPE_S32:
+        switch (item->type) {
+        case PS_META_BOOL: {
+                int value = item->data.B;
                 fits_update_key(fits->p_fd,
-                                TINT,
+                                TLOGICAL,
                                 item->name,
-                                &item->data.S32,
+                                &value,
                                 item->comment,
                                 &status);
                 break;
-            case PS_TYPE_F32:
-                fits_update_key(fits->p_fd,
-                                TFLOAT,
-                                item->name,
-                                &item->data.F32,
-                                item->comment,
-                                &status);
-                break;
-            case PS_TYPE_F64:
-                fits_update_key(fits->p_fd,
-                                TDOUBLE,
-                                item->name,
-                                &item->data.F64,
-                                item->comment,
-                                &status);
-                break;
-            default:
-                psError(PS_ERR_BAD_PARAMETER_TYPE, true,
-                        PS_ERRORTEXT_psFits_METADATA_PTYPE_UNSUPPORTED,
-                        item->pType);
-                break;
             }
-        } else if (item->type == PS_META_STR) {
+        case PS_META_S32:
+            fits_update_key(fits->p_fd,
+                            TINT,
+                            item->name,
+                            &item->data.S32,
+                            item->comment,
+                            &status);
+            break;
+        case PS_META_F32:
+            fits_update_key(fits->p_fd,
+                            TFLOAT,
+                            item->name,
+                            &item->data.F32,
+                            item->comment,
+                            &status);
+            break;
+        case PS_META_F64:
+            fits_update_key(fits->p_fd,
+                            TDOUBLE,
+                            item->name,
+                            &item->data.F64,
+                            item->comment,
+                            &status);
+            break;
+        case PS_META_STR:
             fits_update_key(fits->p_fd,
                             TSTRING,
@@ -1121,4 +1109,7 @@
                             item->comment,
                             &status);
+            break;
+        default:  // all other META types are ignored
+            break;
         }
 
@@ -1214,5 +1205,5 @@
                               1, 1, NULL, &value, &anynul, &status); \
                 psMetadataAdd(data,PS_LIST_TAIL, name, \
-                              PS_TYPE_##TYPE, PS_META_PRIMITIVE, \
+                              PS_META_##TYPE, \
                               "", (ps##TYPE)value); \
                 break; \
@@ -1234,5 +1225,5 @@
                     if (anynul == 0) {
                         psMetadataAdd(data,PS_LIST_TAIL, name,
-                                      PS_TYPE_PTR, PS_META_STR,
+                                      PS_META_STR,
                                       "", value);
                     }
@@ -1487,5 +1478,5 @@
                                    PS_LIST_HEAD,true);
             while ( (item=psListGetAndIncrement(iter)) != NULL) {
-                if (item->type == PS_META_PRIMITIVE) {
+                if (PS_META_IS_PRIMITIVE(item->type)) {
                     bool found = false;
                     for (int n=0; n < columns->n && ! found; n++) {
@@ -1515,6 +1506,6 @@
         char* fitsType;
         columnNames->data[n] = psMemIncrRefCounter(((psMetadataItem*)columns->data[n])->name);
-        if ( ! convertPsTypeToBinaryTForm(((psMetadataItem*)columns->data[n])->pType,
-                                          &fitsType)) {
+        if ( ! convertMetadataTypeToBinaryTForm(((psMetadataItem*)columns->data[n])->type,
+                                                &fitsType)) {
             // XXX: error message
             return false;
@@ -1540,9 +1531,9 @@
         int row;
         item = columns->data[n];
-
-        if (item->type == PS_META_PRIMITIVE) {
-            psVector* col = psVectorAlloc(table->n, item->pType);
-            switch (item->pType) {
-            case PS_TYPE_S32:
+        if (PS_META_IS_PRIMITIVE(item->type)) {
+            psVector* col = NULL;
+            switch (item->type) {
+            case PS_META_S32:
+                col = psVectorAlloc(table->n, PS_TYPE_S32);
                 for (row = 0; row < table->n; row++) {
                     col->data.S32[row] = psMetadataLookupS32(NULL,
@@ -1558,5 +1549,6 @@
                                    &status);
                 break;
-            case PS_TYPE_F32:
+            case PS_META_F32:
+                col = psVectorAlloc(table->n, PS_TYPE_F32);
                 for (row = 0; row < table->n; row++) {
                     col->data.F32[row] = psMetadataLookupF32(NULL,
@@ -1572,5 +1564,6 @@
                                    &status);
                 break;
-            case PS_TYPE_F64:
+            case PS_META_F64:
+                col = psVectorAlloc(table->n, PS_TYPE_F64);
                 for (row = 0; row < table->n; row++) {
                     col->data.F64[row] = psMetadataLookupF64(NULL,
@@ -1586,5 +1579,6 @@
                                    &status);
                 break;
-            case PS_TYPE_BOOL:
+            case PS_META_BOOL:
+                col = psVectorAlloc(table->n, PS_TYPE_BOOL);
                 for (row = 0; row < table->n; row++) {
                     col->data.S8[row] = psMetadataLookupBool(NULL,
@@ -1601,5 +1595,5 @@
                 break;
             default:
-                // XXX: error message
+                // XXX: error message?
                 break;
             }
Index: /trunk/psLib/src/math/psMatrix.c
===================================================================
--- /trunk/psLib/src/math/psMatrix.c	(revision 3340)
+++ /trunk/psLib/src/math/psMatrix.c	(revision 3341)
@@ -21,6 +21,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-24 00:19:51 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-28 23:34:10 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -452,4 +452,5 @@
     if(numRowsIn!=numColsOut && numRowsOut!=numColsIn) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMatrix_TRANSPOSE_MISMATCH);
+        TRANSPOSE_CLEANUP;
     }
 
@@ -542,5 +543,5 @@
                 "Image does not have dim with 1 col or 1 row: (%d x %d).",
                 inImage->numRows, inImage->numCols);
-        return outVector;
+        psMatrixToVector_EXIT;
     }
 
@@ -557,5 +558,5 @@
                     "Image and vector sizes differ: (%d vs %d).",
                     inImage->numRows, outVector->n);
-            return outVector;
+            psMatrixToVector_EXIT;
         }
 
@@ -573,5 +574,5 @@
                     "Image and vector sizes differ: (%d vs %d).",
                     inImage->numCols, outVector->n);
-            return outVector;
+            psMatrixToVector_EXIT;
         }
 
@@ -603,10 +604,10 @@
                     "Image has more than 1 column: numCols = %d.",
                     outImage->numCols);
-            return outImage;
+            VECTORTOMATRIX_CLEANUP;
         } else if (outImage->numRows != inVector->n) {
             psError(PS_ERR_BAD_PARAMETER_SIZE, true,
                     "Image and vector sizes differ: (%d vs %d).",
                     outImage->numRows, inVector->n);
-            return outImage;
+            VECTORTOMATRIX_CLEANUP;
         }
 
@@ -622,10 +623,10 @@
                     "Image has more than 1 row: numRows = %d.",
                     outImage->numRows);
-            return outImage;
+            VECTORTOMATRIX_CLEANUP;
         } else if (outImage->numCols != inVector->n) {
             psError(PS_ERR_BAD_PARAMETER_SIZE, true,
                     "Image and vector sizes differ: (%d vs %d).",
                     outImage->numCols, inVector->n);
-            return outImage;
+            VECTORTOMATRIX_CLEANUP;
         }
 
Index: /trunk/psLib/src/sys/psType.h
===================================================================
--- /trunk/psLib/src/sys/psType.h	(revision 3340)
+++ /trunk/psLib/src/sys/psType.h	(revision 3341)
@@ -1,3 +1,2 @@
-
 /** @file  psType.h
 *
@@ -11,6 +10,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
Index: /trunk/psLib/src/sysUtils/psType.h
===================================================================
--- /trunk/psLib/src/sysUtils/psType.h	(revision 3340)
+++ /trunk/psLib/src/sysUtils/psType.h	(revision 3341)
@@ -1,3 +1,2 @@
-
 /** @file  psType.h
 *
@@ -11,6 +10,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
Index: /trunk/psLib/src/types/psMetadata.c
===================================================================
--- /trunk/psLib/src/types/psMetadata.c	(revision 3340)
+++ /trunk/psLib/src/types/psMetadata.c	(revision 3341)
@@ -12,6 +12,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-18 22:17:20 $
+*  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -80,5 +80,5 @@
     psFree(metadataItem->name);
     psFree(metadataItem->comment);
-    if (type != PS_META_PRIMITIVE) {
+    if (! PS_META_IS_PRIMITIVE(type)) {
         psFree(metadataItem->data.V);
     }
@@ -98,5 +98,5 @@
 /*****************************************************************************/
 
-psMetadataItem* psMetadataItemAlloc(const char *name, psElemType pType, psMetadataType type,
+psMetadataItem* psMetadataItemAlloc(const char *name, psMetadataType type,
                                     const char *comment, ...)
 {
@@ -108,5 +108,5 @@
 
     // Call metadata item allocation
-    metadataItem = psMetadataItemAllocV(name, pType, type, comment, argPtr);
+    metadataItem = psMetadataItemAllocV(name, type, comment, argPtr);
 
     // Clean up stack after variable arguement has been used
@@ -116,5 +116,19 @@
 }
 
-psMetadataItem* psMetadataItemAllocV(const char *name, psElemType pType, psMetadataType type,
+#define METADATAITEM_ALLOC_TYPE(NAME,TYPE,METATYPE) \
+psMetadataItem* psMetadataItemAlloc##NAME(const char* name, \
+        const char* comment, \
+        TYPE value) \
+{ \
+    return psMetadataItemAlloc(name, METATYPE, comment, value); \
+}
+
+METADATAITEM_ALLOC_TYPE(Str,const char*,PS_META_STR)
+METADATAITEM_ALLOC_TYPE(F32,psF32,PS_META_F32)
+METADATAITEM_ALLOC_TYPE(F64,psF64,PS_META_F64)
+METADATAITEM_ALLOC_TYPE(S32,psS32,PS_META_S32)
+METADATAITEM_ALLOC_TYPE(Bool,psBool,PS_META_BOOL)
+
+psMetadataItem* psMetadataItemAllocV(const char *name, psMetadataType type,
                                      const char *comment, va_list argPtr)
 {
@@ -145,5 +159,4 @@
     // Set metadata item type
     metadataItem->type = type;
-    metadataItem->pType = pType;
 
     // Allocate and set metadata item name
@@ -153,23 +166,15 @@
     // Set metadata item value
     switch(type) {
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            metadataItem->data.B = (psBool)va_arg(argPtr, psS32);
-            break;
-        case PS_TYPE_S32:
-            metadataItem->data.S32 = (psS32)va_arg(argPtr, psS32);
-            break;
-        case PS_TYPE_F32:
-            metadataItem->data.F32 = (psF32)va_arg(argPtr, psF64);
-            break;
-        case PS_TYPE_F64:
-            metadataItem->data.F64 = (psF64)va_arg(argPtr, psF64);
-            break;
-        default:
-            psError(PS_ERR_BAD_PARAMETER_VALUE, true, PS_ERRORTEXT_psMetadata_METATYPE_INVALID, type);
-            psFree(metadataItem);
-            metadataItem = NULL;
-        }
+    case PS_META_BOOL:
+        metadataItem->data.B = (psBool)va_arg(argPtr, psS32);
+        break;
+    case PS_META_S32:
+        metadataItem->data.S32 = (psS32)va_arg(argPtr, psS32);
+        break;
+    case PS_META_F32:
+        metadataItem->data.F32 = (psF32)va_arg(argPtr, psF64);
+        break;
+    case PS_META_F64:
+        metadataItem->data.F64 = (psF64)va_arg(argPtr, psF64);
         break;
     case PS_META_STR:
@@ -186,5 +191,5 @@
     case PS_META_UNKNOWN:
         // Copy of input data not performed due to variability of data types
-        metadataItem->data.V = va_arg(argPtr, psPtr);
+        metadataItem->data.V = psMemIncrRefCounter(va_arg(argPtr, psPtr));
         break;
     default:
@@ -256,5 +261,5 @@
 
             // Leaf node replaces another leaf. Make new folder node and add leaves.
-            newFolderEntry = psMetadataItemAlloc(key, PS_TYPE_PTR, PS_META_LIST, NULL, NULL);
+            newFolderEntry = psMetadataItemAlloc(key, PS_META_LIST, NULL, NULL);
             newFolderEntry->data.list = psListAlloc(NULL);
 
@@ -328,5 +333,5 @@
 }
 
-psBool psMetadataAdd(psMetadata *md, psS32 where, const char *name, psElemType pType,
+psBool psMetadataAdd(psMetadata *md, psS32 where, const char *name,
                      psMetadataType type, const char *comment, ...)
 {
@@ -335,5 +340,5 @@
 
     va_start(argPtr, comment);
-    metadataItem = psMetadataItemAllocV(name, pType, type, comment, argPtr);
+    metadataItem = psMetadataItemAllocV(name, type, comment, argPtr);
     va_end(argPtr);
 
@@ -348,4 +353,21 @@
     return true;
 }
+
+#define METADATA_ADD_TYPE(NAME,TYPE,METATYPE) \
+psBool psMetadataAdd##NAME(psMetadata* md, psS32 where, const char* name, \
+                           const char* comment, TYPE value) { \
+    return psMetadataAdd(md,where,name, METATYPE,comment,value); \
+}
+
+METADATA_ADD_TYPE(S32,psS32,PS_META_S32)
+METADATA_ADD_TYPE(F32,psF32,PS_META_F32)
+METADATA_ADD_TYPE(F64,psF64,PS_META_F64)
+METADATA_ADD_TYPE(List,psList*,PS_META_LIST)
+METADATA_ADD_TYPE(Str,const char*,PS_META_STR)
+METADATA_ADD_TYPE(Vector,psVector*,PS_META_VEC)
+METADATA_ADD_TYPE(Image,psImage*,PS_META_IMG)
+METADATA_ADD_TYPE(Hash,psHash*,PS_META_HASH)
+METADATA_ADD_TYPE(LookupTable,psLookupTable*,PS_META_LOOKUPTABLE)
+METADATA_ADD_TYPE(Unknown,void*,PS_META_UNKNOWN)
 
 psBool psMetadataRemove(psMetadata *md, psS32 where, const char *key)
@@ -435,12 +457,11 @@
     }
 
-    if(metadataItem->type == PS_META_PRIMITIVE && metadataItem->pType != PS_TYPE_PTR) {
+    if(PS_META_IS_PRIMITIVE(metadataItem->type)) {
         if (status) {
             *status = false;
         }
         psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                PS_ERRORTEXT_psMetadata_METATYPE_MISMATCH,
-                metadataItem->pType,
-                PS_TYPE_PTR);
+                PS_ERRORTEXT_psMetadata_METATYPE_INVALID,
+                metadataItem->type);
         return NULL;
     } else {
@@ -467,31 +488,25 @@
     } \
     \
-    if (metadataItem->type == PS_META_PRIMITIVE) { \
-        switch (metadataItem->pType) { \
-        case PS_TYPE_S32: \
-            value = (ps##TYPE)metadataItem->data.S32; \
-            break; \
-        case PS_TYPE_F32: \
-            value = (ps##TYPE)metadataItem->data.F32; \
-            break; \
-        case PS_TYPE_F64: \
-            value = (ps##TYPE)metadataItem->data.F64; \
-            break; \
-        case PS_TYPE_BOOL: \
-            if (metadataItem->data.B) { \
-                value = 1; \
-            } \
-            break; \
-        default: \
-            /* if you get to this point, the value is not a number. */ \
-            if (status) { \
-                *status = false; \
-            } \
-            break; \
+    switch (metadataItem->type) { \
+    case PS_META_S32: \
+        value = (ps##TYPE)metadataItem->data.S32; \
+        break; \
+    case PS_META_F32: \
+        value = (ps##TYPE)metadataItem->data.F32; \
+        break; \
+    case PS_META_F64: \
+        value = (ps##TYPE)metadataItem->data.F64; \
+        break; \
+    case PS_META_BOOL: \
+        if (metadataItem->data.B) { \
+            value = 1; \
         } \
-    } else { \
+        break; \
+    default: \
+        /* if you get to this point, the value is not a number. */ \
         if (status) { \
             *status = false; \
         } \
+        break; \
     } \
     \
Index: /trunk/psLib/src/types/psMetadata.h
===================================================================
--- /trunk/psLib/src/types/psMetadata.h	(revision 3340)
+++ /trunk/psLib/src/types/psMetadata.h	(revision 3341)
@@ -11,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-17 19:26:23 $
+*  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -24,4 +24,6 @@
 #include "psHash.h"
 #include "psList.h"
+#include "psImage.h"
+#include "psLookupTable.h"
 
 /// @addtogroup Metadata
@@ -33,5 +35,8 @@
  */
 typedef enum {
-    PS_META_PRIMITIVE,                 ///< Primitive data.
+    PS_META_S32,                       ///< Primitive data.
+    PS_META_F32,                       ///< Primitive data.
+    PS_META_F64,                       ///< Primitive data.
+    PS_META_BOOL,                       ///< Primitive data.
     PS_META_LIST,                      ///< List data (Stored as item.data.list).
     PS_META_STR,                       ///< String data (Stored as item.data.V).
@@ -47,4 +52,16 @@
 } psMetadataType;
 
+#define PS_META_IS_PRIMITIVE(TYPE) \
+(TYPE == PS_META_S32 || \
+ TYPE == PS_META_F32 || \
+ TYPE == PS_META_F64 || \
+ TYPE == PS_META_BOOL)
+
+#define PS_META_PRIMITIVE_TYPE(METATYPE) ( \
+        (METATYPE==PS_META_S32) ? PS_TYPE_S32 : \
+        (METATYPE==PS_META_F32) ? PS_TYPE_F32 : \
+        (METATYPE==PS_META_F64) ? PS_TYPE_F64 : \
+        (METATYPE==PS_META_BOOL) ? PS_TYPE_BOOL : PS_TYPE_PTR )
+
 /** Option flags for psMetadata functions
  *
@@ -55,5 +72,5 @@
 typedef enum {
     PS_META_DEFAULT = 0,               ///< default behaviour (duplicate entry is an error)
-    PS_META_REPLACE                    ///< allow entry to be replaced
+    PS_META_REPLACE = 0x10000          ///< allow entry to be replaced
 } psMetadataFlags;
 
@@ -82,5 +99,4 @@
     char *name;                        ///< Name of metadata item.
     psMetadataType type;               ///< Type of metadata item.
-    psElemType pType;                  ///< Primitive data type
     union {
         psBool B;                      ///< boolean data
@@ -113,8 +129,37 @@
 psMetadataItem* psMetadataItemAlloc(
     const char *name,                  ///< Name of metadata item.
-    psElemType pType,                  ///< Primitive type.
     psMetadataType type,               ///< Type of metadata item.
     const char *comment,               ///< Comment for metadata item.
     ...                                ///< Arguments for name formatting and metadata item data.
+);
+
+psMetadataItem* psMetadataItemAllocStr(
+    const char* name,
+    const char* comment,
+    const char* value
+);
+
+psMetadataItem* psMetadataItemAllocF32(
+    const char* name,
+    const char* comment,
+    psF32 value
+);
+
+psMetadataItem* psMetadataItemAllocF64(
+    const char* name,
+    const char* comment,
+    psF64 value
+);
+
+psMetadataItem* psMetadataItemAllocS32(
+    const char* name,
+    const char* comment,
+    psS32 value
+);
+
+psMetadataItem* psMetadataItemAllocBool(
+    const char* name,
+    const char* comment,
+    psBool value
 );
 
@@ -137,5 +182,4 @@
 psMetadataItem* psMetadataItemAllocV(
     const char *name,                  ///< Name of metadata item.
-    psElemType pType,                  ///< Primitive type.
     psMetadataType type,               ///< Type of metadata item.
     const char *comment,               ///< Comment for metadata item.
@@ -161,7 +205,7 @@
  */
 psBool psMetadataAddItem(
-    psMetadata*  md,          ///< Metadata collection to insert metadat item.
-    psMetadataItem*  item,    ///< Metadata item to be added.
-    psS32 location            ///< Location to be added.
+    psMetadata*  md,                   ///< Metadata collection to insert metadat item.
+    psMetadataItem*  item,             ///< Metadata item to be added.
+    psS32 location                     ///< Location to be added.
 );
 
@@ -173,12 +217,33 @@
  */
 psBool psMetadataAdd(
-    psMetadata* md,           ///< Metadata collection to insert metadat item.
-    psS32 where,              ///< Location to be added.
-    const char *name,         ///< Name of metadata item.
-    psElemType pType,         ///< Primitive type.
-    psMetadataType type,      ///< Type of metadata item.
-    const char *comment,      ///< Comment for metadata item.
-    ...                       ///< Arguments for name formatting and metadata item data.
-);
+    psMetadata* md,                    ///< Metadata collection to insert metadat item.
+    psS32 where,                       ///< Location to be added.
+    const char *name,                  ///< Name of metadata item.
+    psMetadataType type,               ///< Type of metadata item.
+    const char *comment,               ///< Comment for metadata item.
+    ...                                ///< Arguments for name formatting and metadata item data.
+);
+
+psBool psMetadataAddS32(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, psS32 value);
+psBool psMetadataAddF32(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, psF32 value);
+psBool psMetadataAddF64(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, psF64 value);
+psBool psMetadataAddList(psMetadata* md, psS32 where, const char* name,
+                         const char* comment, psList* value);
+psBool psMetadataAddStr(psMetadata* md, psS32 where, const char* name,
+                        const char* comment, const char* value);
+psBool psMetadataAddVector(psMetadata* md, psS32 where, const char* name,
+                           const char* comment, psVector* value);
+psBool psMetadataAddImage(psMetadata* md, psS32 where, const char* name,
+                          const char* comment, psImage* value);
+psBool psMetadataAddHash(psMetadata* md, psS32 where, const char* name,
+                         const char* comment, psHash* value);
+psBool psMetadataAddLookupTable(psMetadata* md, psS32 where, const char* name,
+                                const char* comment, psLookupTable* value);
+psBool psMetadataAddUnknown(psMetadata* md, psS32 where, const char* name,
+                            const char* comment, psPtr value);
+
 
 /** Remove an item from metadata collection.
Index: /trunk/psLib/src/types/psMetadataConfig.c
===================================================================
--- /trunk/psLib/src/types/psMetadataConfig.c	(revision 3340)
+++ /trunk/psLib/src/types/psMetadataConfig.c	(revision 3341)
@@ -9,6 +9,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-17 19:26:23 $
+*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -101,8 +101,8 @@
 /*****************************************************************************/
 
-static void p_saxEndElement(void *ctx, const xmlChar *tagName);
-static void p_psInitVectorXml(void *ctx, char *tagName);
-static void p_psInitMetadataItemXml(void *ctx, char *tagName);
-static void p_saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts);
+static void saxEndElement(void *ctx, const xmlChar *tagName);
+static void initVectorXml(void *ctx, char *tagName);
+static void initMetadataItemXml(void *ctx, char *tagName);
+static void saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts);
 
 /** Determines if a line is blank (whitespace only) or a commentline. It returns true if so. The input string
@@ -307,5 +307,4 @@
 {
     psMetadataType type;
-    psElemType pType;
     psBool success = true;
 
@@ -315,25 +314,17 @@
 
     type = metadataItem->type;
-    pType = metadataItem->pType;
 
     switch(type) {
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            fprintf(fd, format, metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            fprintf(fd,format, metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            fprintf(fd, format, metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            fprintf(fd, format, metadataItem->data.F64);
-            break;
-        default:
-            psError(PS_ERR_BAD_PARAMETER_TYPE,true, PS_ERRORTEXT_psMetadata_METATYPE_INVALID, (int)pType);
-            success = false;
-        }
+    case PS_META_BOOL:
+        fprintf(fd, format, metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        fprintf(fd,format, metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        fprintf(fd, format, metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        fprintf(fd, format, metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -419,19 +410,19 @@
         switch (keyType) {
         case 'I':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_S32, PS_META_PRIMITIVE,
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_S32,
                                     keyComment, atoi(keyValue));
             break;
         case 'F':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_F64, PS_META_PRIMITIVE,
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_F64,
                                     keyComment, atof(keyValue));
             break;
         case 'C':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_PTR, PS_META_STR, keyComment,
-                                    keyValue);
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_STR,
+                                    keyComment, keyValue);
             break;
         case 'L':
             tempBool = (keyValue[0] == 'T') ? 1 : 0;
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_BOOL, PS_META_PRIMITIVE, keyComment,
-                                    tempBool);
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_BOOL,
+                                    keyComment, tempBool);
             break;
         case 'U':
@@ -460,4 +451,5 @@
     char *strComment = NULL;
     char *linePtr = NULL;
+    psElemType vecType = PS_TYPE_PTR;
     psS32 status = 0;
     psU32 lineCount = 0;
@@ -467,5 +459,4 @@
     psVector *tempVec = NULL;
     FILE *fp = NULL;
-    psElemType pType;
     psMetadataType mdType;
 
@@ -535,20 +526,14 @@
             } else if(!strncmp(strType, "*", 1)) {
                 mdType = PS_META_LIST;
-                pType = PS_TYPE_PTR;
             } else if(!strncmp(strType, "STR", 3)) {
                 mdType = PS_META_STR;
-                pType = PS_TYPE_PTR;
-            } else if(!strncmp(strType, "BOOL", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_BOOL;
+            } else if(!strncmp(strType, "BOOL", 4)) {
+                mdType = PS_META_BOOL;
             } else if(!strncmp(strType, "S32", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_S32;
+                mdType = PS_META_S32;
             } else if(!strncmp(strType, "F32", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_F32;
+                mdType = PS_META_F32;
             } else if(!strncmp(strType, "F64", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_F64;
+                mdType = PS_META_F64;
             } else {
                 (*nFail)++;
@@ -559,4 +544,5 @@
 
             if(*strName == '@') {
+                vecType = PS_META_PRIMITIVE_TYPE(mdType);
                 mdType = PS_META_VEC;
             }
@@ -604,13 +590,26 @@
             switch (mdType) {
             case PS_META_LIST:
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, NULL);
+                psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, NULL);
                 break;
             case PS_META_STR:
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, strValue);
+                psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, strValue);
                 break;
             case PS_META_VEC:
-                tempVec = parseVector(strValue, pType, &status);
+                tempVec = parseVector(strValue, vecType, &status);
                 if(!status) {
-                    psMetadataAdd(md, PS_LIST_TAIL, strName+1, pType, mdType, strComment, tempVec);
+                    psMetadataAdd(md, PS_LIST_TAIL, strName+1, mdType, strComment, tempVec);
+                } else {
+                    status = 0;
+                    (*nFail)++;
+                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
+                            strType, lineCount, fileName);
+                    continue;
+                }
+                psFree(tempVec);
+                break;
+            case PS_META_BOOL:
+                tempBool = parseBool(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempBool);
                 } else {
                     status = 0;
@@ -621,50 +620,29 @@
                 }
                 break;
-            case PS_META_PRIMITIVE:
-                switch (pType) {
-                case PS_TYPE_BOOL:
-                    tempBool = parseBool(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempBool);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
-                                strType, lineCount, fileName);
-                        continue;
-                    }
-                    break;
-                case PS_TYPE_S32:
-                    tempInt = (psS32)parseValue(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempInt);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
-                                strType, lineCount, fileName);
-                        continue;
-                    }
-                    break;
-                case PS_TYPE_F32:
-                case PS_TYPE_F64:
-                    tempDbl = parseValue(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempDbl);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true,
-                                PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType, lineCount,
-                                fileName);
-                        continue;
-                    }
-                    break;
-                default:
+            case PS_META_S32:
+                tempInt = (psS32)parseValue(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempInt);
+                } else {
+                    status = 0;
                     (*nFail)++;
-                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID, mdType, lineCount,
+                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
+                            strType, lineCount, fileName);
+                    continue;
+                }
+                break;
+            case PS_META_F32:
+            case PS_META_F64:
+                tempDbl = parseValue(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempDbl);
+                } else {
+                    status = 0;
+                    (*nFail)++;
+                    psError(PS_ERR_IO, true,
+                            PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType, lineCount,
                             fileName);
                     continue;
-                } // switch
+                }
                 break;
             default:
@@ -682,5 +660,5 @@
 }
 
-static void p_saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts)
+static void saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts)
 {
     psU64 i = 0;
@@ -709,4 +687,5 @@
     // Metadata containter for housing element attributes used by other SAX events
     htAtts = psHashAlloc(10);
+
 
     // Get tag name
@@ -745,12 +724,14 @@
 
     // Add attributes to metadata
-    psMetadataAdd(md, PS_LIST_TAIL, "htAtts", PS_TYPE_PTR, PS_META_HASH, NULL, htAtts);
+
+    psMetadataAdd(md, PS_LIST_TAIL, "htAtts", PS_META_HASH, NULL, htAtts);
 
     psFree(psTagName);
+    psFree(htAtts);
 
     return;
 }
 
-static void p_psInitMetadataItemXml(void *ctx, char *tagName)
+static void initMetadataItemXml(void *ctx, char *tagName)
 {
     psBool overwrite = false;
@@ -760,6 +741,5 @@
     psF64 tempDbl = 0.0;
     psS32 tempInt = 0.0;
-    psElemType pType = PS_TYPE_PTR;
-    psMetadataType mdType = PS_META_PRIMITIVE;
+    psMetadataType mdType = PS_META_UNKNOWN;
     char *fileName = NULL;
     char *strName = NULL;
@@ -802,17 +782,12 @@
         if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psString")) {
             mdType = PS_META_STR;
-            pType = PS_TYPE_PTR;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_U8;
+            mdType = PS_META_BOOL;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psS32")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_S32;
+            mdType = PS_META_S32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF32")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_F32;
+            mdType = PS_META_F32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF64")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_F64;
+            mdType = PS_META_F64;
         } else {
             psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_TYPE_INVALID_LINE_FILE, strType, lineNumber,
@@ -853,45 +828,39 @@
     switch(mdType) {
     case PS_META_LIST:
-        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, NULL);
+        psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, NULL);
         break;
     case PS_META_STR:
-        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, strValue);
+        psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, strValue);
         break;
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            tempBool = parseBool((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempBool);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        case PS_TYPE_S32:
-            tempInt = (psS32)parseValue((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempInt);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        case PS_TYPE_F32:
-        case PS_TYPE_F64:
-            tempDbl = parseValue((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempDbl);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        default:
-            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID, strType, lineNumber, fileName);
-        } // End switch
+    case PS_META_BOOL:
+        tempBool = parseBool((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempBool);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
+        break;
+    case PS_META_S32:
+        tempInt = (psS32)parseValue((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempInt);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
+        break;
+    case PS_META_F32:
+    case PS_META_F64:
+        tempDbl = parseValue((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempDbl);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
         break;
     default:
@@ -899,10 +868,9 @@
     } // End switch
 
-
     return;
 }
 
 
-static void p_psInitVectorXml(void *ctx, char *tagName)
+static void initVectorXml(void *ctx, char *tagName)
 {
     bool overwrite = false;
@@ -910,5 +878,4 @@
     psU32 lineNumber = 0;
     psElemType pType = PS_TYPE_PTR;
-    psMetadataType mdType = PS_META_PRIMITIVE;
     char *strName = NULL;
     char *strType = NULL;
@@ -952,18 +919,11 @@
     strType = psHashLookup(htAtts, "psType");
     if(strType!= NULL) {
-        if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psString")) {
-            mdType = PS_META_STR;
-            pType = PS_TYPE_PTR;
-        } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
-            mdType = PS_META_PRIMITIVE;
+        if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
             pType = PS_TYPE_U8;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psS32")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_S32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF32")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_F32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF64")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_F64;
         } else {
@@ -1006,5 +966,5 @@
     vec = parseVector((char*)strValue, pType, &status);
     if(!status) {
-        psMetadataAdd(md, PS_LIST_TAIL, strName+1, pType, mdType, NULL, vec);
+        psMetadataAdd(md, PS_LIST_TAIL, strName+1, PS_META_VEC, NULL, vec);
     } else {
         psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
@@ -1014,5 +974,5 @@
 }
 
-static void p_saxEndElement(void *ctx, const xmlChar *tagName)
+static void saxEndElement(void *ctx, const xmlChar *tagName)
 {
     char *psStartTagName = NULL;
@@ -1052,7 +1012,7 @@
     // Initialize psLib structs
     if(!strcmp(psEndTagName, "psMetadataItem")) {
-        p_psInitMetadataItemXml(ctx, psEndTagName);
+        initMetadataItemXml(ctx, psEndTagName);
     } else if(!strcmp(psEndTagName, "psVector")) {
-        p_psInitVectorXml(ctx, psEndTagName);
+        initVectorXml(ctx, psEndTagName);
     } else if(strcmp(psEndTagName, "psRoot")) {
         psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_TAG_UNKNOWN, psEndTagName);
@@ -1095,6 +1055,6 @@
     saxHandler.startDocument            = NULL;
     saxHandler.endDocument              = NULL;
-    saxHandler.startElement             = p_saxStartElement;
-    saxHandler.endElement               = p_saxEndElement;
+    saxHandler.startElement             = saxStartElement;
+    saxHandler.endElement               = saxEndElement;
     saxHandler.reference                = NULL;
     saxHandler.characters               = NULL;
Index: /trunk/psLib/src/xml/psXML.c
===================================================================
--- /trunk/psLib/src/xml/psXML.c	(revision 3340)
+++ /trunk/psLib/src/xml/psXML.c	(revision 3341)
@@ -9,6 +9,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-17 19:26:23 $
+*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -101,8 +101,8 @@
 /*****************************************************************************/
 
-static void p_saxEndElement(void *ctx, const xmlChar *tagName);
-static void p_psInitVectorXml(void *ctx, char *tagName);
-static void p_psInitMetadataItemXml(void *ctx, char *tagName);
-static void p_saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts);
+static void saxEndElement(void *ctx, const xmlChar *tagName);
+static void initVectorXml(void *ctx, char *tagName);
+static void initMetadataItemXml(void *ctx, char *tagName);
+static void saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts);
 
 /** Determines if a line is blank (whitespace only) or a commentline. It returns true if so. The input string
@@ -307,5 +307,4 @@
 {
     psMetadataType type;
-    psElemType pType;
     psBool success = true;
 
@@ -315,25 +314,17 @@
 
     type = metadataItem->type;
-    pType = metadataItem->pType;
 
     switch(type) {
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            fprintf(fd, format, metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            fprintf(fd,format, metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            fprintf(fd, format, metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            fprintf(fd, format, metadataItem->data.F64);
-            break;
-        default:
-            psError(PS_ERR_BAD_PARAMETER_TYPE,true, PS_ERRORTEXT_psMetadata_METATYPE_INVALID, (int)pType);
-            success = false;
-        }
+    case PS_META_BOOL:
+        fprintf(fd, format, metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        fprintf(fd,format, metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        fprintf(fd, format, metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        fprintf(fd, format, metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -419,19 +410,19 @@
         switch (keyType) {
         case 'I':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_S32, PS_META_PRIMITIVE,
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_S32,
                                     keyComment, atoi(keyValue));
             break;
         case 'F':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_F64, PS_META_PRIMITIVE,
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_F64,
                                     keyComment, atof(keyValue));
             break;
         case 'C':
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_PTR, PS_META_STR, keyComment,
-                                    keyValue);
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_STR,
+                                    keyComment, keyValue);
             break;
         case 'L':
             tempBool = (keyValue[0] == 'T') ? 1 : 0;
-            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_TYPE_BOOL, PS_META_PRIMITIVE, keyComment,
-                                    tempBool);
+            success = psMetadataAdd(output, PS_LIST_TAIL, keyName, PS_META_BOOL,
+                                    keyComment, tempBool);
             break;
         case 'U':
@@ -460,4 +451,5 @@
     char *strComment = NULL;
     char *linePtr = NULL;
+    psElemType vecType = PS_TYPE_PTR;
     psS32 status = 0;
     psU32 lineCount = 0;
@@ -467,5 +459,4 @@
     psVector *tempVec = NULL;
     FILE *fp = NULL;
-    psElemType pType;
     psMetadataType mdType;
 
@@ -535,20 +526,14 @@
             } else if(!strncmp(strType, "*", 1)) {
                 mdType = PS_META_LIST;
-                pType = PS_TYPE_PTR;
             } else if(!strncmp(strType, "STR", 3)) {
                 mdType = PS_META_STR;
-                pType = PS_TYPE_PTR;
-            } else if(!strncmp(strType, "BOOL", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_BOOL;
+            } else if(!strncmp(strType, "BOOL", 4)) {
+                mdType = PS_META_BOOL;
             } else if(!strncmp(strType, "S32", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_S32;
+                mdType = PS_META_S32;
             } else if(!strncmp(strType, "F32", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_F32;
+                mdType = PS_META_F32;
             } else if(!strncmp(strType, "F64", 3)) {
-                mdType = PS_META_PRIMITIVE;
-                pType = PS_TYPE_F64;
+                mdType = PS_META_F64;
             } else {
                 (*nFail)++;
@@ -559,4 +544,5 @@
 
             if(*strName == '@') {
+                vecType = PS_META_PRIMITIVE_TYPE(mdType);
                 mdType = PS_META_VEC;
             }
@@ -604,13 +590,26 @@
             switch (mdType) {
             case PS_META_LIST:
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, NULL);
+                psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, NULL);
                 break;
             case PS_META_STR:
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, strValue);
+                psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, strValue);
                 break;
             case PS_META_VEC:
-                tempVec = parseVector(strValue, pType, &status);
+                tempVec = parseVector(strValue, vecType, &status);
                 if(!status) {
-                    psMetadataAdd(md, PS_LIST_TAIL, strName+1, pType, mdType, strComment, tempVec);
+                    psMetadataAdd(md, PS_LIST_TAIL, strName+1, mdType, strComment, tempVec);
+                } else {
+                    status = 0;
+                    (*nFail)++;
+                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
+                            strType, lineCount, fileName);
+                    continue;
+                }
+                psFree(tempVec);
+                break;
+            case PS_META_BOOL:
+                tempBool = parseBool(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempBool);
                 } else {
                     status = 0;
@@ -621,50 +620,29 @@
                 }
                 break;
-            case PS_META_PRIMITIVE:
-                switch (pType) {
-                case PS_TYPE_BOOL:
-                    tempBool = parseBool(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempBool);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
-                                strType, lineCount, fileName);
-                        continue;
-                    }
-                    break;
-                case PS_TYPE_S32:
-                    tempInt = (psS32)parseValue(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempInt);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
-                                strType, lineCount, fileName);
-                        continue;
-                    }
-                    break;
-                case PS_TYPE_F32:
-                case PS_TYPE_F64:
-                    tempDbl = parseValue(strValue, &status);
-                    if(!status) {
-                        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, strComment, tempDbl);
-                    } else {
-                        status = 0;
-                        (*nFail)++;
-                        psError(PS_ERR_IO, true,
-                                PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType, lineCount,
-                                fileName);
-                        continue;
-                    }
-                    break;
-                default:
+            case PS_META_S32:
+                tempInt = (psS32)parseValue(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempInt);
+                } else {
+                    status = 0;
                     (*nFail)++;
-                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID, mdType, lineCount,
+                    psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName,
+                            strType, lineCount, fileName);
+                    continue;
+                }
+                break;
+            case PS_META_F32:
+            case PS_META_F64:
+                tempDbl = parseValue(strValue, &status);
+                if(!status) {
+                    psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, strComment, tempDbl);
+                } else {
+                    status = 0;
+                    (*nFail)++;
+                    psError(PS_ERR_IO, true,
+                            PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType, lineCount,
                             fileName);
                     continue;
-                } // switch
+                }
                 break;
             default:
@@ -682,5 +660,5 @@
 }
 
-static void p_saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts)
+static void saxStartElement(void *ctx, const xmlChar *tagName, const xmlChar **atts)
 {
     psU64 i = 0;
@@ -709,4 +687,5 @@
     // Metadata containter for housing element attributes used by other SAX events
     htAtts = psHashAlloc(10);
+
 
     // Get tag name
@@ -745,12 +724,14 @@
 
     // Add attributes to metadata
-    psMetadataAdd(md, PS_LIST_TAIL, "htAtts", PS_TYPE_PTR, PS_META_HASH, NULL, htAtts);
+
+    psMetadataAdd(md, PS_LIST_TAIL, "htAtts", PS_META_HASH, NULL, htAtts);
 
     psFree(psTagName);
+    psFree(htAtts);
 
     return;
 }
 
-static void p_psInitMetadataItemXml(void *ctx, char *tagName)
+static void initMetadataItemXml(void *ctx, char *tagName)
 {
     psBool overwrite = false;
@@ -760,6 +741,5 @@
     psF64 tempDbl = 0.0;
     psS32 tempInt = 0.0;
-    psElemType pType = PS_TYPE_PTR;
-    psMetadataType mdType = PS_META_PRIMITIVE;
+    psMetadataType mdType = PS_META_UNKNOWN;
     char *fileName = NULL;
     char *strName = NULL;
@@ -802,17 +782,12 @@
         if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psString")) {
             mdType = PS_META_STR;
-            pType = PS_TYPE_PTR;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_U8;
+            mdType = PS_META_BOOL;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psS32")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_S32;
+            mdType = PS_META_S32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF32")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_F32;
+            mdType = PS_META_F32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF64")) {
-            mdType = PS_META_PRIMITIVE;
-            pType = PS_TYPE_F64;
+            mdType = PS_META_F64;
         } else {
             psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_TYPE_INVALID_LINE_FILE, strType, lineNumber,
@@ -853,45 +828,39 @@
     switch(mdType) {
     case PS_META_LIST:
-        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, NULL);
+        psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, NULL);
         break;
     case PS_META_STR:
-        psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, strValue);
+        psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, strValue);
         break;
-    case PS_META_PRIMITIVE:
-        switch(pType) {
-        case PS_TYPE_BOOL:
-            tempBool = parseBool((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempBool);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        case PS_TYPE_S32:
-            tempInt = (psS32)parseValue((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempInt);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        case PS_TYPE_F32:
-        case PS_TYPE_F64:
-            tempDbl = parseValue((char*)strValue, &status);
-            if(!status) {
-                psMetadataAdd(md, PS_LIST_TAIL, strName, pType, mdType, NULL, tempDbl);
-            } else {
-                status = 0;
-                psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
-                        lineNumber, fileName);
-            }
-            break;
-        default:
-            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_FILE_TYPE_INVALID, strType, lineNumber, fileName);
-        } // End switch
+    case PS_META_BOOL:
+        tempBool = parseBool((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempBool);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
+        break;
+    case PS_META_S32:
+        tempInt = (psS32)parseValue((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempInt);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
+        break;
+    case PS_META_F32:
+    case PS_META_F64:
+        tempDbl = parseValue((char*)strValue, &status);
+        if(!status) {
+            psMetadataAdd(md, PS_LIST_TAIL, strName, mdType, NULL, tempDbl);
+        } else {
+            status = 0;
+            psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
+                    lineNumber, fileName);
+        }
         break;
     default:
@@ -899,10 +868,9 @@
     } // End switch
 
-
     return;
 }
 
 
-static void p_psInitVectorXml(void *ctx, char *tagName)
+static void initVectorXml(void *ctx, char *tagName)
 {
     bool overwrite = false;
@@ -910,5 +878,4 @@
     psU32 lineNumber = 0;
     psElemType pType = PS_TYPE_PTR;
-    psMetadataType mdType = PS_META_PRIMITIVE;
     char *strName = NULL;
     char *strType = NULL;
@@ -952,18 +919,11 @@
     strType = psHashLookup(htAtts, "psType");
     if(strType!= NULL) {
-        if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psString")) {
-            mdType = PS_META_STR;
-            pType = PS_TYPE_PTR;
-        } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
-            mdType = PS_META_PRIMITIVE;
+        if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psBool")) {
             pType = PS_TYPE_U8;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psS32")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_S32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF32")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_F32;
         } else if(xmlStrEqual(BAD_CAST strType, BAD_CAST "psF64")) {
-            mdType = PS_META_PRIMITIVE;
             pType = PS_TYPE_F64;
         } else {
@@ -1006,5 +966,5 @@
     vec = parseVector((char*)strValue, pType, &status);
     if(!status) {
-        psMetadataAdd(md, PS_LIST_TAIL, strName+1, pType, mdType, NULL, vec);
+        psMetadataAdd(md, PS_LIST_TAIL, strName+1, PS_META_VEC, NULL, vec);
     } else {
         psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_PARSE_FAILED, strValue, strName, strType,
@@ -1014,5 +974,5 @@
 }
 
-static void p_saxEndElement(void *ctx, const xmlChar *tagName)
+static void saxEndElement(void *ctx, const xmlChar *tagName)
 {
     char *psStartTagName = NULL;
@@ -1052,7 +1012,7 @@
     // Initialize psLib structs
     if(!strcmp(psEndTagName, "psMetadataItem")) {
-        p_psInitMetadataItemXml(ctx, psEndTagName);
+        initMetadataItemXml(ctx, psEndTagName);
     } else if(!strcmp(psEndTagName, "psVector")) {
-        p_psInitVectorXml(ctx, psEndTagName);
+        initVectorXml(ctx, psEndTagName);
     } else if(strcmp(psEndTagName, "psRoot")) {
         psError(PS_ERR_IO, true, PS_ERRORTEXT_psMetadataIO_TAG_UNKNOWN, psEndTagName);
@@ -1095,6 +1055,6 @@
     saxHandler.startDocument            = NULL;
     saxHandler.endDocument              = NULL;
-    saxHandler.startElement             = p_saxStartElement;
-    saxHandler.endElement               = p_saxEndElement;
+    saxHandler.startElement             = saxStartElement;
+    saxHandler.endElement               = saxEndElement;
     saxHandler.reference                = NULL;
     saxHandler.characters               = NULL;
Index: /trunk/psLib/test/astronomy/tst_psAstrometry.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psAstrometry.c	(revision 3340)
+++ /trunk/psLib/test/astronomy/tst_psAstrometry.c	(revision 3341)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-02-17 19:26:24 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-02-28 23:34:10 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -53,5 +53,4 @@
     psExposure* exp = psExposureAlloc(1.0, 2.0, 3.0, 4.0, 5.0,
                                       now, 6.0f, 7.0f, 8.0f, 9.0f, 10.0f, 11.0f, obs);
-
 
     if (fabs(exp->ra - 1.0) > DBL_EPSILON) {
Index: /trunk/psLib/test/astronomy/tst_psMetadataIO.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadataIO.c	(revision 3340)
+++ /trunk/psLib/test/astronomy/tst_psMetadataIO.c	(revision 3341)
@@ -13,6 +13,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -66,5 +66,4 @@
 {
     printf("%sKey Name: %8s  ", spaces, metadataItem->name);
-    printf("Key pType: %d  ", metadataItem->pType);
     printf("Key mdType: %d  ", metadataItem->type);
 
@@ -73,21 +72,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
Index: /trunk/psLib/test/astronomy/tst_psMetadata_01.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadata_01.c	(revision 3340)
+++ /trunk/psLib/test/astronomy/tst_psMetadata_01.c	(revision 3341)
@@ -18,6 +18,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.20 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.21 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -72,5 +72,4 @@
 {
     printf("%sKey Name: %8s  ", spaces, metadataItem->name);
-    printf("Key pType: %d  ", metadataItem->pType);
     printf("Key mdType: %d  ", metadataItem->type);
 
@@ -79,21 +78,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
Index: /trunk/psLib/test/astronomy/tst_psMetadata_02.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadata_02.c	(revision 3340)
+++ /trunk/psLib/test/astronomy/tst_psMetadata_02.c	(revision 3341)
@@ -14,6 +14,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -28,5 +28,4 @@
 {
     printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key pType: %2d  ", metadataItem->pType);
     printf("Key mdType: %2d  ", metadataItem->type);
 
@@ -35,21 +34,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -76,9 +69,9 @@
     // Test A - Allocate metadata items
     printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
-    item1 = psMetadataItemAlloc("myItem1", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a signed integer", 111);
-    item3 = psMetadataItemAlloc("myItem3", PS_TYPE_F32, PS_META_PRIMITIVE, "I am a single precision floating point", 222.222);
-    item4 = psMetadataItemAlloc("myItem4", PS_TYPE_F64, PS_META_PRIMITIVE, "I am a double precision floating point", 333.333);
-    item5 = psMetadataItemAlloc("myItem5", PS_TYPE_PTR, PS_META_STR, "I am a string", "HELLO WORLD");
+    item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a signed integer", 111);
+    item3 = psMetadataItemAlloc("myItem3", PS_META_F32, "I am a single precision floating point", 222.222);
+    item4 = psMetadataItemAlloc("myItem4", PS_META_F64, "I am a double precision floating point", 333.333);
+    item5 = psMetadataItemAlloc("myItem5", PS_META_STR, "I am a string", "HELLO WORLD");
     printMetadataItem(item1);
     printMetadataItem(item2);
@@ -93,5 +86,5 @@
                             "Null value for name not allowed", 0);
     psLogMsg(__func__,PS_LOG_INFO,"Following should produce error for null name.");
-    badItem = psMetadataItemAlloc(NULL, PS_TYPE_PTR, PS_META_STR, "I am a string", "HELLO WORLD");
+    badItem = psMetadataItemAlloc(NULL, PS_META_STR, "I am a string", "HELLO WORLD");
     if (badItem != NULL) {
         psError(PS_ERR_UNKNOWN, true,"psMetadataItemAlloc did not return null with null name item.");
@@ -104,5 +97,5 @@
     printNegativeTestHeader(stdout,"psMetadata", "Test C - Attempt to create metadata item with invalid type",
                             "Invalid psMetadataType: 6", 0);
-    badItem = psMetadataItemAlloc("badItem", PS_TYPE_PTR, PS_META_NTYPE, "I am bad", "Bad comment");
+    badItem = psMetadataItemAlloc("badItem", PS_META_NTYPE, "I am bad", "Bad comment");
     printFooter(stdout, "psMetadata", "Test C - Attempt to create metadata item with invalid type", true);
 
Index: /trunk/psLib/test/astronomy/tst_psMetadata_03.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadata_03.c	(revision 3340)
+++ /trunk/psLib/test/astronomy/tst_psMetadata_03.c	(revision 3341)
@@ -18,6 +18,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.13 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -32,5 +32,4 @@
 {
     printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key pType: %2d  ", metadataItem->pType);
     printf("Key mdType: %2d  ", metadataItem->type);
 
@@ -39,21 +38,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -83,9 +76,9 @@
     printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
     metadata = psMetadataAlloc();
-    item1 = psMetadataItemAlloc("myItem1", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 55);
-    item3 = psMetadataItemAlloc("myItem3", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", false);
-    item4 = psMetadataItemAlloc("myItem4", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 66);
-    errItem = psMetadataItemAlloc("errItem", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 99);
+    item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
+    item3 = psMetadataItemAlloc("myItem3", PS_META_BOOL, "I am a boolean", false);
+    item4 = psMetadataItemAlloc("myItem4", PS_META_S32, "I am a integer", 66);
+    errItem = psMetadataItemAlloc("errItem", PS_META_S32, "I am a integer", 99);
     printMetadataItem(item1);
     printMetadataItem(item2);
@@ -101,5 +94,5 @@
         return 10;
     }
-    if(!psMetadataAdd(metadata,PS_LIST_HEAD,"myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am S32 integer",77)) {
+    if(!psMetadataAdd(metadata,PS_LIST_HEAD,"myItem2", PS_META_S32, "I am S32 integer",77)) {
         psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by name.");
         return 11;
@@ -122,5 +115,5 @@
         return 14;
     }
-    if ( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem4", PS_TYPE_S32, PS_META_PRIMITIVE, "I am S32 integer",88) ) {
+    if ( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem4", PS_META_S32, "I am S32 integer",88) ) {
         psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by index.");
         return 15;
@@ -217,5 +210,5 @@
     mdTable = errMetadata->table;
     errMetadata->table = NULL;
-    if (psMetadataAdd(errMetadata, PS_LIST_HEAD, "errItem", PS_TYPE_S32, PS_META_PRIMITIVE, "Integer",22) ) {
+    if (psMetadataAdd(errMetadata, PS_LIST_HEAD, "errItem", PS_META_S32, "Integer",22) ) {
         psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table.");
         return 24;
Index: /trunk/psLib/test/astronomy/tst_psMetadata_04.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadata_04.c	(revision 3340)
+++ /trunk/psLib/test/astronomy/tst_psMetadata_04.c	(revision 3341)
@@ -23,6 +23,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.15 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -37,5 +37,4 @@
 {
     printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key pType: %2d  ", metadataItem->pType);
     printf("Key mdType: %2d  ", metadataItem->type);
 
@@ -44,21 +43,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -91,10 +84,10 @@
     psVector *vec = psVectorAlloc(5, PS_TYPE_S32);
     metadata = psMetadataAlloc();
-    item1 = psMetadataItemAlloc("myItem1", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 55);
-    item3 = psMetadataItemAlloc("myItem3", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", false);
-    item4 = psMetadataItemAlloc("myItem4", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 66);
-    item5 = psMetadataItemAlloc("myItem5", PS_TYPE_F64, PS_META_PRIMITIVE, "I am a double", 3.14);
-    item6 = psMetadataItemAlloc("myItem6", PS_TYPE_PTR, PS_META_VEC, "I am a vector", vec);
+    item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
+    item3 = psMetadataItemAlloc("myItem3", PS_META_BOOL, "I am a boolean", false);
+    item4 = psMetadataItemAlloc("myItem4", PS_META_S32, "I am a integer", 66);
+    item5 = psMetadataItemAlloc("myItem5", PS_META_F64, "I am a double", 3.14);
+    item6 = psMetadataItemAlloc("myItem6", PS_META_VEC, "I am a vector", vec);
     printMetadataItem(item1);
     printMetadataItem(item2);
@@ -108,4 +101,5 @@
     psMetadataAddItem(metadata, item5, PS_LIST_HEAD);
     psMetadataAddItem(metadata, item6, PS_LIST_HEAD);
+    psFree(vec);
     printFooter(stdout, "psMetadata", "Test A - Allocate metadata items", true);
 
Index: /trunk/psLib/test/astronomy/tst_psMetadata_05.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadata_05.c	(revision 3340)
+++ /trunk/psLib/test/astronomy/tst_psMetadata_05.c	(revision 3341)
@@ -22,6 +22,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.19 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.20 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -36,5 +36,4 @@
 {
     printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key pType: %2d  ", metadataItem->pType);
     printf("Key mdType: %2d  ", metadataItem->type);
 
@@ -43,21 +42,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -87,11 +80,11 @@
     printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
     metadata = psMetadataAlloc();
-    item1 = psMetadataItemAlloc("myItem1", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 55);
-    item3 = psMetadataItemAlloc("myItem3", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", false);
-    item4 = psMetadataItemAlloc("myItem4", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 66);
-    item5 = psMetadataItemAlloc("myItem5", PS_TYPE_F32, PS_META_PRIMITIVE, "I am a float", 3.14);
-    item6 = psMetadataItemAlloc("myItem6", PS_TYPE_F64, PS_META_PRIMITIVE,"I am a double", 6.28);
-    item7 = psMetadataItemAlloc("myItem7", PS_TYPE_PTR, PS_META_STR, "I am a string", "GNIRTS");
+    item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
+    item3 = psMetadataItemAlloc("myItem3", PS_META_BOOL, "I am a boolean", false);
+    item4 = psMetadataItemAlloc("myItem4", PS_META_S32, "I am a integer", 66);
+    item5 = psMetadataItemAlloc("myItem5", PS_META_F32, "I am a float", 3.14);
+    item6 = psMetadataItemAlloc("myItem6", PS_META_F64,"I am a double", 6.28);
+    item7 = psMetadataItemAlloc("myItem7", PS_META_STR, "I am a string", "GNIRTS");
     //    item8 = psMetadataItemAlloc("myItem8", PS_TYPE_PTR, PS_META_UNKNOWN, "I am unknown");
     printMetadataItem(item1);
Index: /trunk/psLib/test/astronomy/tst_psMetadata_06.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadata_06.c	(revision 3340)
+++ /trunk/psLib/test/astronomy/tst_psMetadata_06.c	(revision 3341)
@@ -13,6 +13,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -27,5 +27,4 @@
 {
     printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key pType: %2d  ", metadataItem->pType);
     printf("Key mdType: %2d  ", metadataItem->type);
 
@@ -34,21 +33,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -74,9 +67,9 @@
     // Test A - Allocate metadata and items
     printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata and items");
-    item1a = psMetadataItemAlloc("myItem1", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", true);
-    item1b = psMetadataItemAlloc("myItem1", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a signed integer", 111);
-    item1c = psMetadataItemAlloc("myItem1", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a signed integer", 222);
-    item2a = psMetadataItemAlloc("myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a signed integer", 333);
-    item2b = psMetadataItemAlloc("myItem2", PS_TYPE_PTR, PS_META_LIST, "I am a folder node", NULL);
+    item1a = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item1b = psMetadataItemAlloc("myItem1", PS_META_S32, "I am a signed integer", 111);
+    item1c = psMetadataItemAlloc("myItem1", PS_META_S32, "I am a signed integer", 222);
+    item2a = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a signed integer", 333);
+    item2b = psMetadataItemAlloc("myItem2", PS_META_LIST, "I am a folder node", NULL);
     metadata = psMetadataAlloc();
     printMetadataItem(item1a);
Index: /trunk/psLib/test/astronomy/tst_psMetadata_07.c
===================================================================
--- /trunk/psLib/test/astronomy/tst_psMetadata_07.c	(revision 3340)
+++ /trunk/psLib/test/astronomy/tst_psMetadata_07.c	(revision 3341)
@@ -9,6 +9,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.8 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -30,7 +30,7 @@
         printf("psMetadataParseConfigXml returned error %d\n", res);
     }
+
     psFree(md);
     printFooter(stdout, "psMetadata", "Test A - Read an XML config file", true);
-
 
     // Test B - Free data
Index: /trunk/psLib/test/astronomy/verified/tst_psMetadataIO.stdout
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psMetadataIO.stdout	(revision 3340)
+++ /trunk/psLib/test/astronomy/verified/tst_psMetadataIO.stdout	(revision 3341)
@@ -7,41 +7,41 @@
 Failed lines: 6 Expected: 6
 Contents of metadata list:
- Key Name:       pi  Key pType: 1032  Key mdType: 0  Key Value:           3.142  Key Comment: Definition of pi
- Key Name: altitude  Key pType: 260  Key mdType: 0  Key Value:           10000  Key Comment: 
- Key Name:     time  Key pType: 1028  Key mdType: 0  Key Value:        1234.568  Key Comment: 
- Key Name:   myBool  Key pType: 4865  Key mdType: 0  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
- Key Name:   title1  Key pType: 0  Key mdType: 2  Key Value:     Hello world  Key Comment: This is a comment for the string value
- Key Name:   title2  Key pType: 0  Key mdType: 2  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
- Key Name:   primes  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: These are prime numbers
- Key Name: negatives  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            This  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              is  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              an  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            ugly  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:         comment  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:             but  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           still  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           valid  Key Comment: 
- Key Name:    speed  Key pType: 1028  Key mdType: 0  Key Value:          66.660  Key Comment: 
+ Key Name:       pi  Key mdType: 2  Key Value:           3.142  Key Comment: Definition of pi
+ Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment: 
+ Key Name:     time  Key mdType: 1  Key Value:        1234.568  Key Comment: 
+ Key Name:   myBool  Key mdType: 3  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
+ Key Name:   title1  Key mdType: 5  Key Value:     Hello world  Key Comment: This is a comment for the string value
+ Key Name:   title2  Key mdType: 5  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
+ Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
+ Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:            This  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:              is  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:              an  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:            ugly  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:         comment  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:             but  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:           still  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:           valid  Key Comment: 
+ Key Name:    speed  Key mdType: 1  Key Value:          66.660  Key Comment: 
 
 Contents of metadata table:
- Key Name:  comment  Key pType: 0  Key mdType: 1  Key Value:                  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            This  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              is  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              an  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            ugly  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:         comment  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:             but  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           still  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           valid  Key Comment: 
- Key Name:   title2  Key pType: 0  Key mdType: 2  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
- Key Name:     time  Key pType: 1028  Key mdType: 0  Key Value:        1234.568  Key Comment: 
- Key Name: negatives  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: 
- Key Name:       pi  Key pType: 1032  Key mdType: 0  Key Value:           3.142  Key Comment: Definition of pi
- Key Name:   myBool  Key pType: 4865  Key mdType: 0  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
- Key Name:   primes  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: These are prime numbers
- Key Name: altitude  Key pType: 260  Key mdType: 0  Key Value:           10000  Key Comment: 
- Key Name:    speed  Key pType: 1028  Key mdType: 0  Key Value:          66.660  Key Comment: 
- Key Name:   title1  Key pType: 0  Key mdType: 2  Key Value:     Hello world  Key Comment: This is a comment for the string value
+ Key Name:  comment  Key mdType: 4  Key Value:                  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:            This  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:              is  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:              an  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:            ugly  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:         comment  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:             but  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:           still  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:           valid  Key Comment: 
+ Key Name:   title2  Key mdType: 5  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
+ Key Name:     time  Key mdType: 1  Key Value:        1234.568  Key Comment: 
+ Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment: 
+ Key Name:       pi  Key mdType: 2  Key Value:           3.142  Key Comment: Definition of pi
+ Key Name:   myBool  Key mdType: 3  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
+ Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
+ Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment: 
+ Key Name:    speed  Key mdType: 1  Key Value:          66.660  Key Comment: 
+ Key Name:   title1  Key mdType: 5  Key Value:     Hello world  Key Comment: This is a comment for the string value
 
 ---> TESTPOINT PASSED (psMetadata{Test A - Read config file with overwrite set true} | tst_psMetadataIO.c)
@@ -54,41 +54,41 @@
 
 Failed lines: 7 Expected: 7 Contents of metadata list:
- Key Name:       pi  Key pType: 1032  Key mdType: 0  Key Value:           3.142  Key Comment: Definition of pi
- Key Name: altitude  Key pType: 260  Key mdType: 0  Key Value:           10000  Key Comment: 
- Key Name:     time  Key pType: 1028  Key mdType: 0  Key Value:        1234.568  Key Comment: 
- Key Name:   myBool  Key pType: 4865  Key mdType: 0  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
- Key Name:   title1  Key pType: 0  Key mdType: 2  Key Value:     Hello world  Key Comment: This is a comment for the string value
- Key Name:   title2  Key pType: 0  Key mdType: 2  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
- Key Name:   primes  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: These are prime numbers
- Key Name: negatives  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            This  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              is  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              an  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            ugly  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:         comment  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:             but  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           still  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           valid  Key Comment: 
- Key Name:    speed  Key pType: 1028  Key mdType: 0  Key Value:          55.550  Key Comment: 
+ Key Name:       pi  Key mdType: 2  Key Value:           3.142  Key Comment: Definition of pi
+ Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment: 
+ Key Name:     time  Key mdType: 1  Key Value:        1234.568  Key Comment: 
+ Key Name:   myBool  Key mdType: 3  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
+ Key Name:   title1  Key mdType: 5  Key Value:     Hello world  Key Comment: This is a comment for the string value
+ Key Name:   title2  Key mdType: 5  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
+ Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
+ Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:            This  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:              is  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:              an  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:            ugly  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:         comment  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:             but  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:           still  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:           valid  Key Comment: 
+ Key Name:    speed  Key mdType: 1  Key Value:          55.550  Key Comment: 
 
 Contents of metadata table:
- Key Name:  comment  Key pType: 0  Key mdType: 1  Key Value:                  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            This  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              is  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              an  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            ugly  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:         comment  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:             but  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           still  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           valid  Key Comment: 
- Key Name:   title2  Key pType: 0  Key mdType: 2  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
- Key Name:     time  Key pType: 1028  Key mdType: 0  Key Value:        1234.568  Key Comment: 
- Key Name: negatives  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: 
- Key Name:       pi  Key pType: 1032  Key mdType: 0  Key Value:           3.142  Key Comment: Definition of pi
- Key Name:   myBool  Key pType: 4865  Key mdType: 0  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
- Key Name:   primes  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: These are prime numbers
- Key Name: altitude  Key pType: 260  Key mdType: 0  Key Value:           10000  Key Comment: 
- Key Name:    speed  Key pType: 1028  Key mdType: 0  Key Value:          55.550  Key Comment: 
- Key Name:   title1  Key pType: 0  Key mdType: 2  Key Value:     Hello world  Key Comment: This is a comment for the string value
+ Key Name:  comment  Key mdType: 4  Key Value:                  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:            This  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:              is  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:              an  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:            ugly  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:         comment  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:             but  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:           still  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:           valid  Key Comment: 
+ Key Name:   title2  Key mdType: 5  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
+ Key Name:     time  Key mdType: 1  Key Value:        1234.568  Key Comment: 
+ Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment: 
+ Key Name:       pi  Key mdType: 2  Key Value:           3.142  Key Comment: Definition of pi
+ Key Name:   myBool  Key mdType: 3  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
+ Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
+ Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment: 
+ Key Name:    speed  Key mdType: 1  Key Value:          55.550  Key Comment: 
+ Key Name:   title1  Key mdType: 5  Key Value:     Hello world  Key Comment: This is a comment for the string value
 
 ---> TESTPOINT PASSED (psMetadata{Test B - Read config file with overwrite set false} | tst_psMetadataIO.c)
@@ -101,41 +101,41 @@
 
 Failed lines: 6 Expected: 6 Contents of metadata list:
- Key Name:       pi  Key pType: 1032  Key mdType: 0  Key Value:           3.142  Key Comment: Definition of pi
- Key Name: altitude  Key pType: 260  Key mdType: 0  Key Value:           10000  Key Comment: 
- Key Name:     time  Key pType: 1028  Key mdType: 0  Key Value:        1234.568  Key Comment: 
- Key Name:   myBool  Key pType: 4865  Key mdType: 0  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
- Key Name:   title1  Key pType: 0  Key mdType: 2  Key Value:     Hello world  Key Comment: This is a comment for the string value
- Key Name:   title2  Key pType: 0  Key mdType: 2  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
- Key Name:   primes  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: These are prime numbers
- Key Name: negatives  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            This  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              is  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              an  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            ugly  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:         comment  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:             but  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           still  Key Comment: 
- Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           valid  Key Comment: 
- Key Name:    speed  Key pType: 1028  Key mdType: 0  Key Value:          66.660  Key Comment: 
+ Key Name:       pi  Key mdType: 2  Key Value:           3.142  Key Comment: Definition of pi
+ Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment: 
+ Key Name:     time  Key mdType: 1  Key Value:        1234.568  Key Comment: 
+ Key Name:   myBool  Key mdType: 3  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
+ Key Name:   title1  Key mdType: 5  Key Value:     Hello world  Key Comment: This is a comment for the string value
+ Key Name:   title2  Key mdType: 5  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
+ Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
+ Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:            This  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:              is  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:              an  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:            ugly  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:         comment  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:             but  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:           still  Key Comment: 
+ Key Name:  comment  Key mdType: 5  Key Value:           valid  Key Comment: 
+ Key Name:    speed  Key mdType: 1  Key Value:          66.660  Key Comment: 
 
 Contents of metadata table:
- Key Name:  comment  Key pType: 0  Key mdType: 1  Key Value:                  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            This  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              is  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:              an  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:            ugly  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:         comment  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:             but  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           still  Key Comment: 
-    Key Name:  comment  Key pType: 0  Key mdType: 2  Key Value:           valid  Key Comment: 
- Key Name:   title2  Key pType: 0  Key mdType: 2  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
- Key Name:     time  Key pType: 1028  Key mdType: 0  Key Value:        1234.568  Key Comment: 
- Key Name: negatives  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: 
- Key Name:       pi  Key pType: 1032  Key mdType: 0  Key Value:           3.142  Key Comment: Definition of pi
- Key Name:   myBool  Key pType: 4865  Key mdType: 0  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
- Key Name:   primes  Key pType: 260  Key mdType: 3  Bad type: 3 Key Comment: These are prime numbers
- Key Name: altitude  Key pType: 260  Key mdType: 0  Key Value:           10000  Key Comment: 
- Key Name:    speed  Key pType: 1028  Key mdType: 0  Key Value:          66.660  Key Comment: 
- Key Name:   title1  Key pType: 0  Key mdType: 2  Key Value:     Hello world  Key Comment: This is a comment for the string value
+ Key Name:  comment  Key mdType: 4  Key Value:                  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:            This  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:              is  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:              an  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:            ugly  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:         comment  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:             but  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:           still  Key Comment: 
+    Key Name:  comment  Key mdType: 5  Key Value:           valid  Key Comment: 
+ Key Name:   title2  Key mdType: 5  Key Value:  Good bye world  Key Comment: STRING or STR may be used as the string type
+ Key Name:     time  Key mdType: 1  Key Value:        1234.568  Key Comment: 
+ Key Name: negatives  Key mdType: 6  Bad type: 6 Key Comment: 
+ Key Name:       pi  Key mdType: 2  Key Value:           3.142  Key Comment: Definition of pi
+ Key Name:   myBool  Key mdType: 3  Key Value:               0  Key Comment: F, f, 0, T, t, 1 are also acceptable
+ Key Name:   primes  Key mdType: 6  Bad type: 6 Key Comment: These are prime numbers
+ Key Name: altitude  Key mdType: 0  Key Value:           10000  Key Comment: 
+ Key Name:    speed  Key mdType: 1  Key Value:          66.660  Key Comment: 
+ Key Name:   title1  Key mdType: 5  Key Value:     Hello world  Key Comment: This is a comment for the string value
 
 ---> TESTPOINT PASSED (psMetadata{Test C - Read config file without auto-allocation of metadata} | tst_psMetadataIO.c)
Index: /trunk/psLib/test/astronomy/verified/tst_psMetadata_01.stdout
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psMetadata_01.stdout	(revision 3340)
+++ /trunk/psLib/test/astronomy/verified/tst_psMetadata_01.stdout	(revision 3341)
@@ -6,14 +6,14 @@
 
 Contents of metadata list:
- Key Name:   SIMPLE  Key pType: 4865  Key mdType: 0  Key Value:               1  Key Comment: file does conform to FITS standard
- Key Name:   BITPIX  Key pType: 260  Key mdType: 0  Key Value:               8  Key Comment: number of bits per data pixel
- Key Name:    NAXIS  Key pType: 260  Key mdType: 0  Key Value:               0  Key Comment: number of data axes
- Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name:   SIMPLE  Key mdType: 3  Key Value:               1  Key Comment: file does conform to FITS standard
+ Key Name:   BITPIX  Key mdType: 0  Key Value:               8  Key Comment: number of bits per data pixel
+ Key Name:    NAXIS  Key mdType: 0  Key Value:               0  Key Comment: number of data axes
+ Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
 
 Contents of metadata table:
- Key Name:    NAXIS  Key pType: 260  Key mdType: 0  Key Value:               0  Key Comment: number of data axes
- Key Name:   SIMPLE  Key pType: 4865  Key mdType: 0  Key Value:               1  Key Comment: file does conform to FITS standard
- Key Name:   BITPIX  Key pType: 260  Key mdType: 0  Key Value:               8  Key Comment: number of bits per data pixel
- Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name:    NAXIS  Key mdType: 0  Key Value:               0  Key Comment: number of data axes
+ Key Name:   SIMPLE  Key mdType: 3  Key Value:               1  Key Comment: file does conform to FITS standard
+ Key Name:   BITPIX  Key mdType: 0  Key Value:               8  Key Comment: number of bits per data pixel
+ Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
 
 ---> TESTPOINT PASSED (psMetadata{Test A - Read 1st hdr from simple FITS file} | tst_psMetadata_01.c)
@@ -26,32 +26,32 @@
 
 Contents of metadata list:
- Key Name: XTENSION  Key pType: 0  Key mdType: 2  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
- Key Name:   BITPIX  Key pType: 260  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
- Key Name:    NAXIS  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
- Key Name:   NAXIS1  Key pType: 260  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
- Key Name:   PCOUNT  Key pType: 260  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
- Key Name:   GCOUNT  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
- Key Name:   BITPIX  Key pType: 260  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
- Key Name:  EXTNAME  Key pType: 0  Key mdType: 2  Key Value:     'MY_DATA_1'  Key Comment: 
- Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
- Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
- Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
- Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
+ Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
+ Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
+ Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
+ Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
+ Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
+ Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
+ Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_1'  Key Comment: 
+ Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
 
 Contents of metadata table:
- Key Name:    NAXIS  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
- Key Name:   NAXIS1  Key pType: 260  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
- Key Name:   PCOUNT  Key pType: 260  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
- Key Name: XTENSION  Key pType: 0  Key mdType: 2  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
- Key Name:   BITPIX  Key pType: 0  Key mdType: 1  Key Value:                  Key Comment: 
-    Key Name:   BITPIX  Key pType: 260  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
-    Key Name:   BITPIX  Key pType: 260  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
- Key Name:   GCOUNT  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
- Key Name:  HISTORY  Key pType: 0  Key mdType: 1  Key Value:                  Key Comment: 
-    Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
-    Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
-    Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
-    Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
- Key Name:  EXTNAME  Key pType: 0  Key mdType: 2  Key Value:     'MY_DATA_1'  Key Comment: 
+ Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
+ Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
+ Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
+ Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
+ Key Name:   BITPIX  Key mdType: 4  Key Value:                  Key Comment: 
+    Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
+    Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
+ Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
+ Key Name:  HISTORY  Key mdType: 4  Key Value:                  Key Comment: 
+    Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+    Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+    Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+    Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_1'  Key Comment: 
 
 ---> TESTPOINT PASSED (psMetadata{Test B - Read 2nd hdr from complex FITS file} | tst_psMetadata_01.c)
@@ -64,25 +64,25 @@
 
 Contents of metadata list:
- Key Name: XTENSION  Key pType: 0  Key mdType: 2  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
- Key Name:   BITPIX  Key pType: 260  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
- Key Name:    NAXIS  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
- Key Name:   NAXIS1  Key pType: 260  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
- Key Name:   PCOUNT  Key pType: 260  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
- Key Name:   GCOUNT  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
- Key Name:  EXTNAME  Key pType: 0  Key mdType: 2  Key Value:     'MY_DATA_2'  Key Comment: 
- Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
- Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
+ Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
+ Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
+ Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
+ Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
+ Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
+ Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_2'  Key Comment: 
+ Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
 
 Contents of metadata table:
- Key Name:    NAXIS  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
- Key Name:   NAXIS1  Key pType: 260  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
- Key Name:   PCOUNT  Key pType: 260  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
- Key Name: XTENSION  Key pType: 0  Key mdType: 2  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
- Key Name:   GCOUNT  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
- Key Name:   BITPIX  Key pType: 260  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
- Key Name:  HISTORY  Key pType: 0  Key mdType: 1  Key Value:                  Key Comment: 
-    Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
-    Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
- Key Name:  EXTNAME  Key pType: 0  Key mdType: 2  Key Value:     'MY_DATA_2'  Key Comment: 
+ Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
+ Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
+ Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
+ Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
+ Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
+ Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
+ Key Name:  HISTORY  Key mdType: 4  Key Value:                  Key Comment: 
+    Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+    Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_2'  Key Comment: 
 
 ---> TESTPOINT PASSED (psMetadata{Test C - Read named hdr from complex FITS file} | tst_psMetadata_01.c)
@@ -97,25 +97,25 @@
 
 Contents of metadata list:
- Key Name: XTENSION  Key pType: 0  Key mdType: 2  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
- Key Name:   BITPIX  Key pType: 260  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
- Key Name:    NAXIS  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
- Key Name:   NAXIS1  Key pType: 260  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
- Key Name:   PCOUNT  Key pType: 260  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
- Key Name:   GCOUNT  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
- Key Name:  EXTNAME  Key pType: 0  Key mdType: 2  Key Value:     'MY_DATA_2'  Key Comment: 
- Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
- Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
+ Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
+ Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
+ Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
+ Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
+ Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
+ Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_2'  Key Comment: 
+ Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
 
 Contents of metadata table:
- Key Name:    NAXIS  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
- Key Name:   NAXIS1  Key pType: 260  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
- Key Name:   PCOUNT  Key pType: 260  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
- Key Name: XTENSION  Key pType: 0  Key mdType: 2  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
- Key Name:   GCOUNT  Key pType: 260  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
- Key Name:   BITPIX  Key pType: 260  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
- Key Name:  HISTORY  Key pType: 0  Key mdType: 1  Key Value:                  Key Comment: 
-    Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
-    Key Name:  HISTORY  Key pType: 0  Key mdType: 2  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
- Key Name:  EXTNAME  Key pType: 0  Key mdType: 2  Key Value:     'MY_DATA_2'  Key Comment: 
+ Key Name:    NAXIS  Key mdType: 0  Key Value:               1  Key Comment: number of data axes
+ Key Name:   NAXIS1  Key mdType: 0  Key Value:              64  Key Comment: length of data axis 1
+ Key Name:   PCOUNT  Key mdType: 0  Key Value:               0  Key Comment: required keyword; must = 0
+ Key Name: XTENSION  Key mdType: 5  Key Value:      'IMAGE   '  Key Comment: IMAGE extension
+ Key Name:   GCOUNT  Key mdType: 0  Key Value:               1  Key Comment: required keyword; must = 1
+ Key Name:   BITPIX  Key mdType: 0  Key Value:             -64  Key Comment: number of bits per data pixel
+ Key Name:  HISTORY  Key mdType: 4  Key Value:                  Key Comment: 
+    Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+    Key Name:  HISTORY  Key mdType: 5  Key Value:                  Key Comment: File modified by user 'harman' with fv  on 2004-08-04T<DATE>
+ Key Name:  EXTNAME  Key mdType: 5  Key Value:     'MY_DATA_2'  Key Comment: 
 
 ---> TESTPOINT PASSED (psMetadata{Test D - Remove items with same name from all metadata} | tst_psMetadata_01.c)
Index: /trunk/psLib/test/astronomy/verified/tst_psMetadata_02.stderr
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psMetadata_02.stderr	(revision 3340)
+++ /trunk/psLib/test/astronomy/verified/tst_psMetadata_02.stderr	(revision 3341)
@@ -4,5 +4,5 @@
     Unallowable operation: name is NULL.
 <DATE><TIME>|<HOST>|E|psMetadataItemAllocV (FILE:LINENO)
-    Specified psMetadataType, 11, is not supported.
+    Specified psMetadataType, 14, is not supported.
 <DATE><TIME>|<HOST>|E|psMetadataAddItem (FILE:LINENO)
     Unallowable operation: md is NULL.
Index: /trunk/psLib/test/astronomy/verified/tst_psMetadata_02.stdout
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psMetadata_02.stdout	(revision 3340)
+++ /trunk/psLib/test/astronomy/verified/tst_psMetadata_02.stdout	(revision 3341)
@@ -5,9 +5,9 @@
 \**********************************************************************************/
 
-Key Name:  myItem1  Key pType: 4865  Key mdType:  0  Key Value:               1  Key Comment: I am a boolean
-Key Name:  myItem2  Key pType: 260  Key mdType:  0  Key Value:             111  Key Comment: I am a signed integer
-Key Name:  myItem3  Key pType: 1028  Key mdType:  0  Key Value:         222.222  Key Comment: I am a single precision floating point
-Key Name:  myItem4  Key pType: 1032  Key mdType:  0  Key Value:         333.333  Key Comment: I am a double precision floating point
-Key Name:  myItem5  Key pType:  0  Key mdType:  2  Key Value:     HELLO WORLD  Key Comment: I am a string
+Key Name:  myItem1  Key mdType:  3  Key Value:               1  Key Comment: I am a boolean
+Key Name:  myItem2  Key mdType:  0  Key Value:             111  Key Comment: I am a signed integer
+Key Name:  myItem3  Key mdType:  1  Key Value:         222.222  Key Comment: I am a single precision floating point
+Key Name:  myItem4  Key mdType:  2  Key Value:         333.333  Key Comment: I am a double precision floating point
+Key Name:  myItem5  Key mdType:  5  Key Value:     HELLO WORLD  Key Comment: I am a string
 
 ---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_02.c)
Index: /trunk/psLib/test/astronomy/verified/tst_psMetadata_03.stdout
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psMetadata_03.stdout	(revision 3340)
+++ /trunk/psLib/test/astronomy/verified/tst_psMetadata_03.stdout	(revision 3341)
@@ -5,8 +5,8 @@
 \**********************************************************************************/
 
-Key Name:  myItem1  Key pType: 4865  Key mdType:  0  Key Value:               1  Key Comment: I am a boolean
-Key Name:  myItem2  Key pType: 260  Key mdType:  0  Key Value:              55  Key Comment: I am a integer
-Key Name:  myItem3  Key pType: 4865  Key mdType:  0  Key Value:               0  Key Comment: I am a boolean
-Key Name:  myItem4  Key pType: 260  Key mdType:  0  Key Value:              66  Key Comment: I am a integer
+Key Name:  myItem1  Key mdType:  3  Key Value:               1  Key Comment: I am a boolean
+Key Name:  myItem2  Key mdType:  0  Key Value:              55  Key Comment: I am a integer
+Key Name:  myItem3  Key mdType:  3  Key Value:               0  Key Comment: I am a boolean
+Key Name:  myItem4  Key mdType:  0  Key Value:              66  Key Comment: I am a integer
 
 ---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_03.c)
Index: /trunk/psLib/test/astronomy/verified/tst_psMetadata_04.stdout
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psMetadata_04.stdout	(revision 3340)
+++ /trunk/psLib/test/astronomy/verified/tst_psMetadata_04.stdout	(revision 3341)
@@ -5,9 +5,9 @@
 \**********************************************************************************/
 
-Key Name:  myItem1  Key pType: 4865  Key mdType:  0  Key Value:               1  Key Comment: I am a boolean
-Key Name:  myItem2  Key pType: 260  Key mdType:  0  Key Value:              55  Key Comment: I am a integer
-Key Name:  myItem3  Key pType: 4865  Key mdType:  0  Key Value:               0  Key Comment: I am a boolean
-Key Name:  myItem4  Key pType: 260  Key mdType:  0  Key Value:              66  Key Comment: I am a integer
-Key Name:  myItem5  Key pType: 1032  Key mdType:  0  Key Value:           3.140  Key Comment: I am a double
+Key Name:  myItem1  Key mdType:  3  Key Value:               1  Key Comment: I am a boolean
+Key Name:  myItem2  Key mdType:  0  Key Value:              55  Key Comment: I am a integer
+Key Name:  myItem3  Key mdType:  3  Key Value:               0  Key Comment: I am a boolean
+Key Name:  myItem4  Key mdType:  0  Key Value:              66  Key Comment: I am a integer
+Key Name:  myItem5  Key mdType:  2  Key Value:           3.140  Key Comment: I am a double
 
 ---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_04.c)
Index: /trunk/psLib/test/astronomy/verified/tst_psMetadata_05.stdout
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psMetadata_05.stdout	(revision 3340)
+++ /trunk/psLib/test/astronomy/verified/tst_psMetadata_05.stdout	(revision 3341)
@@ -5,8 +5,8 @@
 \**********************************************************************************/
 
-Key Name:  myItem1  Key pType: 4865  Key mdType:  0  Key Value:               1  Key Comment: I am a boolean
-Key Name:  myItem2  Key pType: 260  Key mdType:  0  Key Value:              55  Key Comment: I am a integer
-Key Name:  myItem3  Key pType: 4865  Key mdType:  0  Key Value:               0  Key Comment: I am a boolean
-Key Name:  myItem4  Key pType: 260  Key mdType:  0  Key Value:              66  Key Comment: I am a integer
+Key Name:  myItem1  Key mdType:  3  Key Value:               1  Key Comment: I am a boolean
+Key Name:  myItem2  Key mdType:  0  Key Value:              55  Key Comment: I am a integer
+Key Name:  myItem3  Key mdType:  3  Key Value:               0  Key Comment: I am a boolean
+Key Name:  myItem4  Key mdType:  0  Key Value:              66  Key Comment: I am a integer
 
 ---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata items} | tst_psMetadata_05.c)
Index: /trunk/psLib/test/astronomy/verified/tst_psMetadata_06.stdout
===================================================================
--- /trunk/psLib/test/astronomy/verified/tst_psMetadata_06.stdout	(revision 3340)
+++ /trunk/psLib/test/astronomy/verified/tst_psMetadata_06.stdout	(revision 3341)
@@ -5,9 +5,9 @@
 \**********************************************************************************/
 
-Key Name:  myItem1  Key pType: 4865  Key mdType:  0  Key Value:               1  Key Comment: I am a boolean
-Key Name:  myItem1  Key pType: 260  Key mdType:  0  Key Value:             111  Key Comment: I am a signed integer
-Key Name:  myItem1  Key pType: 260  Key mdType:  0  Key Value:             222  Key Comment: I am a signed integer
-Key Name:  myItem2  Key pType: 260  Key mdType:  0  Key Value:             333  Key Comment: I am a signed integer
-Key Name:  myItem2  Key pType:  0  Key mdType:  1  Key Value:                  Key Comment: I am a folder node
+Key Name:  myItem1  Key mdType:  3  Key Value:               1  Key Comment: I am a boolean
+Key Name:  myItem1  Key mdType:  0  Key Value:             111  Key Comment: I am a signed integer
+Key Name:  myItem1  Key mdType:  0  Key Value:             222  Key Comment: I am a signed integer
+Key Name:  myItem2  Key mdType:  0  Key Value:             333  Key Comment: I am a signed integer
+Key Name:  myItem2  Key mdType:  4  Key Value:                  Key Comment: I am a folder node
 
 ---> TESTPOINT PASSED (psMetadata{Test A - Allocate metadata and items} | tst_psMetadata_06.c)
Index: /trunk/psLib/test/collections/tst_psMetadataIO.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadataIO.c	(revision 3340)
+++ /trunk/psLib/test/collections/tst_psMetadataIO.c	(revision 3341)
@@ -13,6 +13,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -66,5 +66,4 @@
 {
     printf("%sKey Name: %8s  ", spaces, metadataItem->name);
-    printf("Key pType: %d  ", metadataItem->pType);
     printf("Key mdType: %d  ", metadataItem->type);
 
@@ -73,21 +72,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
Index: /trunk/psLib/test/collections/tst_psMetadata_01.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadata_01.c	(revision 3340)
+++ /trunk/psLib/test/collections/tst_psMetadata_01.c	(revision 3341)
@@ -18,6 +18,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.20 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.21 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -72,5 +72,4 @@
 {
     printf("%sKey Name: %8s  ", spaces, metadataItem->name);
-    printf("Key pType: %d  ", metadataItem->pType);
     printf("Key mdType: %d  ", metadataItem->type);
 
@@ -79,21 +78,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
Index: /trunk/psLib/test/collections/tst_psMetadata_02.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadata_02.c	(revision 3340)
+++ /trunk/psLib/test/collections/tst_psMetadata_02.c	(revision 3341)
@@ -14,6 +14,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.11 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.12 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -28,5 +28,4 @@
 {
     printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key pType: %2d  ", metadataItem->pType);
     printf("Key mdType: %2d  ", metadataItem->type);
 
@@ -35,21 +34,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -76,9 +69,9 @@
     // Test A - Allocate metadata items
     printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
-    item1 = psMetadataItemAlloc("myItem1", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a signed integer", 111);
-    item3 = psMetadataItemAlloc("myItem3", PS_TYPE_F32, PS_META_PRIMITIVE, "I am a single precision floating point", 222.222);
-    item4 = psMetadataItemAlloc("myItem4", PS_TYPE_F64, PS_META_PRIMITIVE, "I am a double precision floating point", 333.333);
-    item5 = psMetadataItemAlloc("myItem5", PS_TYPE_PTR, PS_META_STR, "I am a string", "HELLO WORLD");
+    item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a signed integer", 111);
+    item3 = psMetadataItemAlloc("myItem3", PS_META_F32, "I am a single precision floating point", 222.222);
+    item4 = psMetadataItemAlloc("myItem4", PS_META_F64, "I am a double precision floating point", 333.333);
+    item5 = psMetadataItemAlloc("myItem5", PS_META_STR, "I am a string", "HELLO WORLD");
     printMetadataItem(item1);
     printMetadataItem(item2);
@@ -93,5 +86,5 @@
                             "Null value for name not allowed", 0);
     psLogMsg(__func__,PS_LOG_INFO,"Following should produce error for null name.");
-    badItem = psMetadataItemAlloc(NULL, PS_TYPE_PTR, PS_META_STR, "I am a string", "HELLO WORLD");
+    badItem = psMetadataItemAlloc(NULL, PS_META_STR, "I am a string", "HELLO WORLD");
     if (badItem != NULL) {
         psError(PS_ERR_UNKNOWN, true,"psMetadataItemAlloc did not return null with null name item.");
@@ -104,5 +97,5 @@
     printNegativeTestHeader(stdout,"psMetadata", "Test C - Attempt to create metadata item with invalid type",
                             "Invalid psMetadataType: 6", 0);
-    badItem = psMetadataItemAlloc("badItem", PS_TYPE_PTR, PS_META_NTYPE, "I am bad", "Bad comment");
+    badItem = psMetadataItemAlloc("badItem", PS_META_NTYPE, "I am bad", "Bad comment");
     printFooter(stdout, "psMetadata", "Test C - Attempt to create metadata item with invalid type", true);
 
Index: /trunk/psLib/test/collections/tst_psMetadata_03.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadata_03.c	(revision 3340)
+++ /trunk/psLib/test/collections/tst_psMetadata_03.c	(revision 3341)
@@ -18,6 +18,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.13 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -32,5 +32,4 @@
 {
     printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key pType: %2d  ", metadataItem->pType);
     printf("Key mdType: %2d  ", metadataItem->type);
 
@@ -39,21 +38,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -83,9 +76,9 @@
     printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
     metadata = psMetadataAlloc();
-    item1 = psMetadataItemAlloc("myItem1", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 55);
-    item3 = psMetadataItemAlloc("myItem3", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", false);
-    item4 = psMetadataItemAlloc("myItem4", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 66);
-    errItem = psMetadataItemAlloc("errItem", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 99);
+    item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
+    item3 = psMetadataItemAlloc("myItem3", PS_META_BOOL, "I am a boolean", false);
+    item4 = psMetadataItemAlloc("myItem4", PS_META_S32, "I am a integer", 66);
+    errItem = psMetadataItemAlloc("errItem", PS_META_S32, "I am a integer", 99);
     printMetadataItem(item1);
     printMetadataItem(item2);
@@ -101,5 +94,5 @@
         return 10;
     }
-    if(!psMetadataAdd(metadata,PS_LIST_HEAD,"myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am S32 integer",77)) {
+    if(!psMetadataAdd(metadata,PS_LIST_HEAD,"myItem2", PS_META_S32, "I am S32 integer",77)) {
         psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by name.");
         return 11;
@@ -122,5 +115,5 @@
         return 14;
     }
-    if ( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem4", PS_TYPE_S32, PS_META_PRIMITIVE, "I am S32 integer",88) ) {
+    if ( ! psMetadataAdd(metadata,PS_LIST_HEAD,"myItem4", PS_META_S32, "I am S32 integer",88) ) {
         psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return true when adding by index.");
         return 15;
@@ -217,5 +210,5 @@
     mdTable = errMetadata->table;
     errMetadata->table = NULL;
-    if (psMetadataAdd(errMetadata, PS_LIST_HEAD, "errItem", PS_TYPE_S32, PS_META_PRIMITIVE, "Integer",22) ) {
+    if (psMetadataAdd(errMetadata, PS_LIST_HEAD, "errItem", PS_META_S32, "Integer",22) ) {
         psError(PS_ERR_UNKNOWN, true,"psMetadataAddItem did not return false w/ invalid metadata struct w/o hash table.");
         return 24;
Index: /trunk/psLib/test/collections/tst_psMetadata_04.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadata_04.c	(revision 3340)
+++ /trunk/psLib/test/collections/tst_psMetadata_04.c	(revision 3341)
@@ -23,6 +23,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.14 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.15 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -37,5 +37,4 @@
 {
     printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key pType: %2d  ", metadataItem->pType);
     printf("Key mdType: %2d  ", metadataItem->type);
 
@@ -44,21 +43,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -91,10 +84,10 @@
     psVector *vec = psVectorAlloc(5, PS_TYPE_S32);
     metadata = psMetadataAlloc();
-    item1 = psMetadataItemAlloc("myItem1", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 55);
-    item3 = psMetadataItemAlloc("myItem3", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", false);
-    item4 = psMetadataItemAlloc("myItem4", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 66);
-    item5 = psMetadataItemAlloc("myItem5", PS_TYPE_F64, PS_META_PRIMITIVE, "I am a double", 3.14);
-    item6 = psMetadataItemAlloc("myItem6", PS_TYPE_PTR, PS_META_VEC, "I am a vector", vec);
+    item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
+    item3 = psMetadataItemAlloc("myItem3", PS_META_BOOL, "I am a boolean", false);
+    item4 = psMetadataItemAlloc("myItem4", PS_META_S32, "I am a integer", 66);
+    item5 = psMetadataItemAlloc("myItem5", PS_META_F64, "I am a double", 3.14);
+    item6 = psMetadataItemAlloc("myItem6", PS_META_VEC, "I am a vector", vec);
     printMetadataItem(item1);
     printMetadataItem(item2);
@@ -108,4 +101,5 @@
     psMetadataAddItem(metadata, item5, PS_LIST_HEAD);
     psMetadataAddItem(metadata, item6, PS_LIST_HEAD);
+    psFree(vec);
     printFooter(stdout, "psMetadata", "Test A - Allocate metadata items", true);
 
Index: /trunk/psLib/test/collections/tst_psMetadata_05.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadata_05.c	(revision 3340)
+++ /trunk/psLib/test/collections/tst_psMetadata_05.c	(revision 3341)
@@ -22,6 +22,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.19 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.20 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -36,5 +36,4 @@
 {
     printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key pType: %2d  ", metadataItem->pType);
     printf("Key mdType: %2d  ", metadataItem->type);
 
@@ -43,21 +42,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -87,11 +80,11 @@
     printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata items");
     metadata = psMetadataAlloc();
-    item1 = psMetadataItemAlloc("myItem1", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", true);
-    item2 = psMetadataItemAlloc("myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 55);
-    item3 = psMetadataItemAlloc("myItem3", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", false);
-    item4 = psMetadataItemAlloc("myItem4", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a integer", 66);
-    item5 = psMetadataItemAlloc("myItem5", PS_TYPE_F32, PS_META_PRIMITIVE, "I am a float", 3.14);
-    item6 = psMetadataItemAlloc("myItem6", PS_TYPE_F64, PS_META_PRIMITIVE,"I am a double", 6.28);
-    item7 = psMetadataItemAlloc("myItem7", PS_TYPE_PTR, PS_META_STR, "I am a string", "GNIRTS");
+    item1 = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item2 = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a integer", 55);
+    item3 = psMetadataItemAlloc("myItem3", PS_META_BOOL, "I am a boolean", false);
+    item4 = psMetadataItemAlloc("myItem4", PS_META_S32, "I am a integer", 66);
+    item5 = psMetadataItemAlloc("myItem5", PS_META_F32, "I am a float", 3.14);
+    item6 = psMetadataItemAlloc("myItem6", PS_META_F64,"I am a double", 6.28);
+    item7 = psMetadataItemAlloc("myItem7", PS_META_STR, "I am a string", "GNIRTS");
     //    item8 = psMetadataItemAlloc("myItem8", PS_TYPE_PTR, PS_META_UNKNOWN, "I am unknown");
     printMetadataItem(item1);
Index: /trunk/psLib/test/collections/tst_psMetadata_06.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadata_06.c	(revision 3340)
+++ /trunk/psLib/test/collections/tst_psMetadata_06.c	(revision 3341)
@@ -13,6 +13,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.10 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -27,5 +27,4 @@
 {
     printf("Key Name: %8s  ", metadataItem->name);
-    printf("Key pType: %2d  ", metadataItem->pType);
     printf("Key mdType: %2d  ", metadataItem->type);
 
@@ -34,21 +33,15 @@
         printf("Key Value: %17c", ' ');
         break;
-    case PS_META_PRIMITIVE:
-        switch(metadataItem->pType) {
-        case PS_TYPE_BOOL:
-            printf("Key Value: %15d  ", metadataItem->data.B);
-            break;
-        case PS_TYPE_S32:
-            printf("Key Value: %15d  ", metadataItem->data.S32);
-            break;
-        case PS_TYPE_F32:
-            printf("Key Value: %15.3f  ", metadataItem->data.F32);
-            break;
-        case PS_TYPE_F64:
-            printf("Key Value: %15.3f  ", metadataItem->data.F64);
-            break;
-        default:
-            printf("Bad type: %d ", metadataItem->pType);
-        }
+    case PS_META_BOOL:
+        printf("Key Value: %15d  ", metadataItem->data.B);
+        break;
+    case PS_META_S32:
+        printf("Key Value: %15d  ", metadataItem->data.S32);
+        break;
+    case PS_META_F32:
+        printf("Key Value: %15.3f  ", metadataItem->data.F32);
+        break;
+    case PS_META_F64:
+        printf("Key Value: %15.3f  ", metadataItem->data.F64);
         break;
     case PS_META_STR:
@@ -74,9 +67,9 @@
     // Test A - Allocate metadata and items
     printPositiveTestHeader(stdout, "psMetadata", "Test A - Allocate metadata and items");
-    item1a = psMetadataItemAlloc("myItem1", PS_TYPE_BOOL, PS_META_PRIMITIVE, "I am a boolean", true);
-    item1b = psMetadataItemAlloc("myItem1", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a signed integer", 111);
-    item1c = psMetadataItemAlloc("myItem1", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a signed integer", 222);
-    item2a = psMetadataItemAlloc("myItem2", PS_TYPE_S32, PS_META_PRIMITIVE, "I am a signed integer", 333);
-    item2b = psMetadataItemAlloc("myItem2", PS_TYPE_PTR, PS_META_LIST, "I am a folder node", NULL);
+    item1a = psMetadataItemAlloc("myItem1", PS_META_BOOL, "I am a boolean", true);
+    item1b = psMetadataItemAlloc("myItem1", PS_META_S32, "I am a signed integer", 111);
+    item1c = psMetadataItemAlloc("myItem1", PS_META_S32, "I am a signed integer", 222);
+    item2a = psMetadataItemAlloc("myItem2", PS_META_S32, "I am a signed integer", 333);
+    item2b = psMetadataItemAlloc("myItem2", PS_META_LIST, "I am a folder node", NULL);
     metadata = psMetadataAlloc();
     printMetadataItem(item1a);
Index: /trunk/psLib/test/collections/tst_psMetadata_07.c
===================================================================
--- /trunk/psLib/test/collections/tst_psMetadata_07.c	(revision 3340)
+++ /trunk/psLib/test/collections/tst_psMetadata_07.c	(revision 3341)
@@ -9,6 +9,6 @@
 *  @author  Ross Harman, MHPCC
 *
-*  @version $Revision: 1.8 $  $Name: not supported by cvs2svn $
-*  @date  $Date: 2005-02-17 19:26:24 $
+*  @version $Revision: 1.9 $  $Name: not supported by cvs2svn $
+*  @date  $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -30,7 +30,7 @@
         printf("psMetadataParseConfigXml returned error %d\n", res);
     }
+
     psFree(md);
     printFooter(stdout, "psMetadata", "Test A - Read an XML config file", true);
-
 
     // Test B - Free data
Index: /trunk/psLib/test/dataIO/tst_psFits.c
===================================================================
--- /trunk/psLib/test/dataIO/tst_psFits.c	(revision 3340)
+++ /trunk/psLib/test/dataIO/tst_psFits.c	(revision 3341)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-22 19:25:53 $
+*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -93,22 +93,22 @@
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYINT",
-                      PS_TYPE_S32, PS_META_PRIMITIVE,
+                      PS_META_S32,
                       "psS32 Item", (psS32)lcv);
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYFLT",
-                      PS_TYPE_F32, PS_META_PRIMITIVE,
+                      PS_META_F32,
                       "psF32 Item", (float)(1.0f/(float)(1+lcv)));
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYDBL",
-                      PS_TYPE_F64, PS_META_PRIMITIVE,
+                      PS_META_F64,
                       "psF64 Item", (double)(1.0/(double)(1+lcv)));
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYBOOL",
-                      PS_TYPE_BOOL, PS_META_PRIMITIVE,
+                      PS_META_BOOL,
                       "psBool Item",
                       (lcv%2 == 0));
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYSTR",
-                      PS_TYPE_PTR, PS_META_STR,
+                      PS_META_STR,
                       "String Item",
                       extname);
@@ -162,17 +162,17 @@
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYINT",
-                      PS_TYPE_S32, PS_META_PRIMITIVE,
+                      PS_META_S32,
                       "psS32 Item", (psS32)row);
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYFLT",
-                      PS_TYPE_F32, PS_META_PRIMITIVE,
+                      PS_META_F32,
                       "psF32 Item", (float)(1.0f/(float)(1+row)));
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYDBL",
-                      PS_TYPE_F64, PS_META_PRIMITIVE,
+                      PS_META_F64,
                       "psF64 Item", (double)(1.0/(double)(1+row)));
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYBOOL",
-                      PS_TYPE_BOOL, PS_META_PRIMITIVE,
+                      PS_META_BOOL,
                       "psBool Item",
                       (row%2 == 0));
@@ -648,6 +648,5 @@
 
         if (boolItem == NULL ||
-                boolItem->type != PS_META_PRIMITIVE ||
-                boolItem->pType != PS_TYPE_BOOL) {
+                boolItem->type != PS_META_BOOL) {
             psError(PS_ERR_UNKNOWN, true,
                     "Failed to retrieve psBool metadata item from file.");
Index: /trunk/psLib/test/fileUtils/tst_psFits.c
===================================================================
--- /trunk/psLib/test/fileUtils/tst_psFits.c	(revision 3340)
+++ /trunk/psLib/test/fileUtils/tst_psFits.c	(revision 3341)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-02-22 19:25:53 $
+*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-02-28 23:34:10 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -93,22 +93,22 @@
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYINT",
-                      PS_TYPE_S32, PS_META_PRIMITIVE,
+                      PS_META_S32,
                       "psS32 Item", (psS32)lcv);
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYFLT",
-                      PS_TYPE_F32, PS_META_PRIMITIVE,
+                      PS_META_F32,
                       "psF32 Item", (float)(1.0f/(float)(1+lcv)));
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYDBL",
-                      PS_TYPE_F64, PS_META_PRIMITIVE,
+                      PS_META_F64,
                       "psF64 Item", (double)(1.0/(double)(1+lcv)));
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYBOOL",
-                      PS_TYPE_BOOL, PS_META_PRIMITIVE,
+                      PS_META_BOOL,
                       "psBool Item",
                       (lcv%2 == 0));
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYSTR",
-                      PS_TYPE_PTR, PS_META_STR,
+                      PS_META_STR,
                       "String Item",
                       extname);
@@ -162,17 +162,17 @@
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYINT",
-                      PS_TYPE_S32, PS_META_PRIMITIVE,
+                      PS_META_S32,
                       "psS32 Item", (psS32)row);
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYFLT",
-                      PS_TYPE_F32, PS_META_PRIMITIVE,
+                      PS_META_F32,
                       "psF32 Item", (float)(1.0f/(float)(1+row)));
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYDBL",
-                      PS_TYPE_F64, PS_META_PRIMITIVE,
+                      PS_META_F64,
                       "psF64 Item", (double)(1.0/(double)(1+row)));
 
         psMetadataAdd(header,PS_LIST_TAIL, "MYBOOL",
-                      PS_TYPE_BOOL, PS_META_PRIMITIVE,
+                      PS_META_BOOL,
                       "psBool Item",
                       (row%2 == 0));
@@ -648,6 +648,5 @@
 
         if (boolItem == NULL ||
-                boolItem->type != PS_META_PRIMITIVE ||
-                boolItem->pType != PS_TYPE_BOOL) {
+                boolItem->type != PS_META_BOOL) {
             psError(PS_ERR_UNKNOWN, true,
                     "Failed to retrieve psBool metadata item from file.");
