Index: trunk/psLib/src/collections/psMetadata.h
===================================================================
--- trunk/psLib/src/collections/psMetadata.h	(revision 4401)
+++ trunk/psLib/src/collections/psMetadata.h	(revision 4457)
@@ -11,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-06-27 20:38:12 $
+*  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-07-06 03:04:35 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -55,5 +55,4 @@
     PS_META_ARRAY                      ///< Array data (Stored as item.data.V).
 } psMetadataType;
-
 #define PS_META_IS_PRIMITIVE(TYPE) \
 (TYPE == PS_META_S32 || \
@@ -77,5 +76,6 @@
     PS_META_DEFAULT = 0,               ///< default behaviour (duplicate entry is an error)
     PS_META_REPLACE = 0x1000000,       ///< allow entry to be replaced
-    PS_META_DUPLICATE_OK = 0x2000000   ///< allow duplicate entries
+    PS_META_DUPLICATE_OK = 0x2000000,  ///< allow duplicate entries
+    PS_META_NULL = 0x4000000           ///< psMetadataItem.data is a NULL value
 } psMetadataFlags;
 
@@ -94,4 +94,5 @@
     psList*  list;                     ///< Metadata in linked-list
     psHash*  table;                    ///< Metadata in a hash table
+    void *lock;                        ///< Optional lock for thread safety
 }
 psMetadata;
@@ -104,5 +105,5 @@
 {
     psListIterator* iter;              ///< iterator for the psMetadata's psList
-    regex_t* preg;                     ///< the subsetting regular expression
+    regex_t* regex;                    ///< the subsetting regular expression
 }
 psMetadataIterator;
@@ -116,5 +117,5 @@
 {
     const psS32 id;                    ///< Unique ID for metadata item.
-    char *name;                        ///< Name of metadata item.
+    psString name;                     ///< Name of metadata item.
     psMetadataType type;               ///< Type of metadata item.
     union {
@@ -127,5 +128,5 @@
         psPtr V;                       ///< Pointer to other type of data.
     } data;                            ///< Union for data types.
-    char *comment;                     ///< Optional comment ("", not NULL).
+    psString comment;                  ///< Optional comment ("", not NULL).
 }
 psMetadataItem;
@@ -151,5 +152,6 @@
     const char *comment,               ///< Comment for metadata item.
     ...                                ///< Arguments for name formatting and metadata item data.
-);
+)
+;
 
 /** Create a metadata item with specified string data.
@@ -261,5 +263,5 @@
     psMetadata*  md,                   ///< Metadata collection to insert metadat item.
     const psMetadataItem* item,        ///< Metadata item to be added.
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     psS32 flags                        ///< Options flag mask, see psMetadataFlags enum
 );
@@ -273,5 +275,5 @@
 bool psMetadataAdd(
     psMetadata* md,                    ///< Metadata collection to insert metadata item.
-    int location,                      ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char *name,                  ///< Name of metadata item.
     int format,                        ///< Type of metadata item (psMetadataType) and options (psMetadataFlags)
@@ -289,5 +291,5 @@
 bool psMetadataAddV(
     psMetadata* md,                    ///< Metadata collection to insert metadata item.
-    int location,                      ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char *name,                  ///< Name of metadata item.
     int format,                        ///< Type of metadata item (psMetadataType) and options (psMetadataFlags)
@@ -298,10 +300,10 @@
 
 /** Add a psS32 value to metadata collection.
- *  
- *  @return bool:  True for success, False for failure. 
+ *
+ *  @return bool:  True for success, False for failure.
  */
 bool psMetadataAddS32(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -310,10 +312,10 @@
 
 /** 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
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -322,10 +324,10 @@
 
 /** 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
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -334,10 +336,10 @@
 
 /** Add a psList to metadata collection.
- *       
+ *
  *  @return psBool:  True for success, False for failure.
  */
 psBool psMetadataAddList(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -346,10 +348,10 @@
 
 /** Add a string to metadata collection.
- *  
+ *
  *  @return bool:  True for success, False for failure.
  */
 bool psMetadataAddStr(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -358,10 +360,10 @@
 
 /** Add a vector to metadata collection.
- *  
+ *
  *  @return psBool:  True for success, False for failure.
  */
 psBool psMetadataAddVector(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -370,10 +372,10 @@
 
 /** Add a array to metadata collection.
- *  
+ *
  *  @return psBool:  True for success, False for failure.
  */
 psBool psMetadataAddArray(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -382,10 +384,10 @@
 
 /** Add an Image to metadata collection.
- *  
+ *
  *  @return psBool:  True for success, False for failure.
  */
 psBool psMetadataAddImage(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -394,10 +396,10 @@
 
 /** Add a Hash to metadata collection.
- *  
+ *
  *  @return psBool:  True for success, False for failure.
  */
 psBool psMetadataAddHash(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -406,10 +408,10 @@
 
 /** Add a LookupTable to metadata collection.
- *  
+ *
  *  @return psBool:  True for success, False for failure.
  */
 psBool psMetadataAddLookupTable(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -418,10 +420,10 @@
 
 /** Add an Unknown (psPtr) to metadata collection.
- *  
+ *
  *  @return psBool:  True for success, False for failure.
  */
 psBool psMetadataAddUnknown(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -430,10 +432,10 @@
 
 /** Add Metadata to metadata collection.
- *  
+ *
  *  @return psBool:  True for success, False for failure.
  */
 psBool psMetadataAddMetadata(
     psMetadata* md,                    ///< Metadata collection to insert metadata item
-    psS32 location,                    ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* name,                  ///< Name of metadata item
     const char* comment,               ///< Comment for metadata item
@@ -453,5 +455,5 @@
 bool psMetadataRemove(
     psMetadata*  md,                   ///< Metadata collection to remove metadata item.
-    int location,                      ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char * key                   ///< Name of metadata key.
 );
@@ -549,5 +551,5 @@
 psMetadataItem* psMetadataGet(
     const psMetadata* md,              ///< Metadata collection to retrieve metadata item.
-    int location                       ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location                      ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
 );
 
@@ -562,5 +564,5 @@
 psMetadataIterator* psMetadataIteratorAlloc(
     psMetadata* md,                    ///< the psMetadata to iterate with
-    int location,                      ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location,                     ///< Index number, PS_LIST_HEAD, or PS_LIST_TAIL
     const char* regex
     ///< A regular expression for subsetting the psMetadata.  If NULL, no
@@ -575,5 +577,5 @@
 bool psMetadataIteratorSet(
     psMetadataIterator* iterator,      ///< psMetadata iterator
-    int location                       ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
+    long location                      ///< index number, PS_LIST_HEAD, or PS_LIST_TAIL
 );
 
