Index: /trunk/psLib/src/types/psMetadata.h
===================================================================
--- /trunk/psLib/src/types/psMetadata.h	(revision 21214)
+++ /trunk/psLib/src/types/psMetadata.h	(revision 21215)
@@ -9,6 +9,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.106 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2009-01-27 06:39:38 $
+*  @version $Revision: 1.107 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2009-01-29 03:06:43 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -609,331 +609,41 @@
 
 
-/** Add a bool value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddBool(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    bool value                         ///< Value for metadata item data
-);
-
-
-/** Add a psS8 value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddS8(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psS8 value                         ///< Value for metadata item data
-);
-
-
-/** Add a psS16 value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddS16(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psS16 value                        ///< Value for metadata item data
-);
-
-
-/** Add a psS32 value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddS32(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psS32 value                        ///< Value for metadata item data
-);
-
-
-/** Add a psS64 value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddS64(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psS64 value                        ///< Value for metadata item data
-);
-
-
-/** Add a psU8 value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddU8(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psU8 value                         ///< Value for metadata item data
-);
-
-
-/** Add a psU16 value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddU16(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psU16 value                        ///< Value for metadata item data
-);
-
-
-/** Add a psU32 value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddU32(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psU32 value                        ///< Value for metadata item data
-);
-
-
-/** Add a psU64 value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddU64(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psU64 value                        ///< Value for metadata item data
-);
-
-
-/** Add a psF32 value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
-*/
-bool psMetadataAddF32(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psF32 value                        ///< Value for metadata item data
-);
-
-
-/** Add a psF64 value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
-*/
-bool psMetadataAddF64(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psF64 value                        ///< Value for metadata item data
-);
-
-
-/** Add a psMaskType value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddMask(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psMaskType value			///< Value for metadata item data
-);
-
-
-/** Add a psVectorMaskType value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddVectorMask(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psVectorMaskType value			///< Value for metadata item data
-);
-
-
-/** Add a psImageMaskType value to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddImageMask(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psImageMaskType value			///< Value for metadata item data
-);
-
-
-
-/** Add a psList to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddList(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psList* value                      ///< psList for metadata item data
-);
-
-
-/** Add a string to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddStr(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    const char* value                  ///< String for metadata item data
-);
-
-
-/** Add a vector to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddVector(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psVector* value                    ///< Vector for metadata item data
-);
-
-
-/** Add a array to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddArray(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psArray* value                     ///< Vector for metadata item data
-);
-
-
-/** Add an Image to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddImage(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psImage* value                     ///< Image for metadata item data
-);
-
-
-/** Add a Time to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddTime(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psTime* value                      ///< Time for metadata item data
-);
-
-
-/** Add a Hash to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddHash(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psHash* value                      ///< Hash for metadata item data
-);
-
-
-/** Add a LookupTable to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddLookupTable(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psLookupTable* value               ///< LookupTable for metadata item data
-);
-
-
-/** Add an Unknown (psPtr) to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddUnknown(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psPtr value                        ///< Unknown for metadata item data
-);
-
-
-/** Add a psPtr to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
+#define PS_METADATA_ADD_TYPE_DECL(NAME, TYPE) \
+bool psMetadataAdd##NAME( \
+    psMetadata* md,                    /* Metadata collection to insert metadata item */ \
+    long location,                     /* Index number, PS_LIST_HEAD, or PS_LIST_TAIL */ \
+    const char* name,                  /* Name of metadata item */ \
+    int format,                        /* psMetadataFlag options/flags */ \
+    const char* comment,               /* Comment for metadata item */ \
+    TYPE value                         /* Value for metadata item data */ \
+)
+
+PS_METADATA_ADD_TYPE_DECL(Bool, psBool);
+PS_METADATA_ADD_TYPE_DECL(S8,   psS8);
+PS_METADATA_ADD_TYPE_DECL(S16,  psS16);
+PS_METADATA_ADD_TYPE_DECL(S32,  psS32);
+PS_METADATA_ADD_TYPE_DECL(S64,  psS64);
+PS_METADATA_ADD_TYPE_DECL(U8,   psU8);
+PS_METADATA_ADD_TYPE_DECL(U16,  psU16);
+PS_METADATA_ADD_TYPE_DECL(U32,  psU32);
+PS_METADATA_ADD_TYPE_DECL(U64,  psU64);
+PS_METADATA_ADD_TYPE_DECL(F32,  psF32);
+PS_METADATA_ADD_TYPE_DECL(F64,  psF64);
+
+PS_METADATA_ADD_TYPE_DECL(Mask, psMaskType);
+PS_METADATA_ADD_TYPE_DECL(VectorMask, psVectorMaskType);
+PS_METADATA_ADD_TYPE_DECL(ImageMask, psImageMaskType);
+
+PS_METADATA_ADD_TYPE_DECL(List, psList*);
+PS_METADATA_ADD_TYPE_DECL(Str, const char*);
+PS_METADATA_ADD_TYPE_DECL(Vector, psVector*);
+PS_METADATA_ADD_TYPE_DECL(Array, psArray*);
+PS_METADATA_ADD_TYPE_DECL(Image, psImage*);
+PS_METADATA_ADD_TYPE_DECL(Time, psTime*);
+PS_METADATA_ADD_TYPE_DECL(Hash, psHash*);
+PS_METADATA_ADD_TYPE_DECL(LookupTable, psLookupTable*);
+PS_METADATA_ADD_TYPE_DECL(Metadata, psMetadata*);
+PS_METADATA_ADD_TYPE_DECL(Unknown, psPtr);
+
 bool psMetadataAddPtr(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
@@ -945,18 +655,5 @@
 );
 
-
-/** Add Metadata to metadata collection.
- *
- *  @return bool:  True for success, False for failure.
- */
-bool psMetadataAddMetadata(
-    psMetadata* md,                    ///< Metadata collection to insert metadata item
-    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
-    const char* name,                  ///< Name of metadata item
-    int format,                        ///< psMetadataFlag options/flags
-    const char* comment,               ///< Comment for metadata item
-    psMetadata* value                  ///< Metadata for metadata item data
-);
-
+#undef PS_METADATA_ADD_TYPE_DECL
 
 /** Removes an item from metadata by key name.
@@ -994,228 +691,33 @@
 
 
-/** Find an item in the metadata collection based on key name and return its double precision value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psF64 : Value of metadata item.
- */
-psF64 psMetadataLookupF64(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its single precision value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psF32 : Value of metadata item.
- */
-psF32 psMetadataLookupF32(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psS8 : Value of metadata item.
- */
-psS8 psMetadataLookupS8(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psS16 : Value of metadata item.
- */
-psS16 psMetadataLookupS16(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psS32 : Value of metadata item.
- */
-psS32 psMetadataLookupS32(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psS64 : Value of metadata item.
- */
-psS64 psMetadataLookupS64(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psU8 : Value of metadata item.
- */
-psU8 psMetadataLookupU8(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psU16 : Value of metadata item.
- */
-psU16 psMetadataLookupU16(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psU32 : Value of metadata item.
- */
-psU32 psMetadataLookupU32(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psU64 : Value of metadata item.
- */
-psU64 psMetadataLookupU64(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psMaskType : Value of metadata item.
- */
-psMaskType psMetadataLookupMask(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psVectorMaskType : Value of metadata item.
- */
-psVectorMaskType psMetadataLookupVectorMask(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return psImageMaskType : Value of metadata item.
- */
-psImageMaskType psMetadataLookupImageMask(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its boolean value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return bool : Value of metadata item.
- */
-bool psMetadataLookupBool(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its integer value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- * @return void* : Value of metadata item.
- */
-psPtr psMetadataLookupPtr(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata* md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
+#define PS_METADATA_LOOKUP_TYPE_DECL(NAME, TYPE) \
+TYPE psMetadataLookup##NAME( \
+    bool *status,                      /* Status of lookup */ \
+    const psMetadata *md,              /* Metadata collection to lookup metadata item */ \
+    const char *key                    /* Name of metadata key */ \
+);
+
+PS_METADATA_LOOKUP_TYPE_DECL(Bool, psBool);
+PS_METADATA_LOOKUP_TYPE_DECL(S8,   psS8);
+PS_METADATA_LOOKUP_TYPE_DECL(S16,  psS16);
+PS_METADATA_LOOKUP_TYPE_DECL(S32,  psS32);
+PS_METADATA_LOOKUP_TYPE_DECL(S64,  psS64);
+PS_METADATA_LOOKUP_TYPE_DECL(U8,   psU8);
+PS_METADATA_LOOKUP_TYPE_DECL(U16,  psU16);
+PS_METADATA_LOOKUP_TYPE_DECL(U32,  psU32);
+PS_METADATA_LOOKUP_TYPE_DECL(U64,  psU64);
+PS_METADATA_LOOKUP_TYPE_DECL(F32,  psF32);
+PS_METADATA_LOOKUP_TYPE_DECL(F64,  psF64);
+
+PS_METADATA_LOOKUP_TYPE_DECL(Mask, psMaskType);
+PS_METADATA_LOOKUP_TYPE_DECL(VectorMask, psVectorMaskType);
+PS_METADATA_LOOKUP_TYPE_DECL(ImageMask, psImageMaskType);
+
+PS_METADATA_LOOKUP_TYPE_DECL(Ptr, psPtr);
+PS_METADATA_LOOKUP_TYPE_DECL(Str, psString);
+PS_METADATA_LOOKUP_TYPE_DECL(Metadata, psMetadata*);
+PS_METADATA_LOOKUP_TYPE_DECL(Time, psTime*);
+
+#undef PS_METADATA_LOOKUP_TYPE_DECL
 
 /** Find an item in the metadata collection based on list index.
@@ -1298,49 +800,4 @@
 
 
-/** Find an item in the metadata collection based on key name and return its metadata value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- *  @return psMetadata*:        Value of metadata item.
- */
-psMetadata *psMetadataLookupMetadata(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return its string value.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- *  @return psString:           Value of metadata item.
- */
-psString psMetadataLookupStr(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
-
-/** Find an item in the metadata collection based on key name and return it as a psTime pointer.
- *
- *  Items may be found in the metadata by providing a key. If the key is
- *  non-unique, the value of the first item is returned. If the item is not
- *  found, zero is returned.
- *
- *  @return psTime:           Value of metadata item.
- */
-
-psTime *psMetadataLookupTime(
-    bool *status,                      ///< Status of lookup.
-    const psMetadata *md,              ///< Metadata collection to lookup metadata item.
-    const char *key                    ///< Name of metadata key.
-);
-
 /// Return a list of keys for a metadata
 psList *psMetadataKeys(psMetadata *md   ///< Metadata for which to return keys
