Index: trunk/archive/pslib/include/psMetadata.h
===================================================================
--- trunk/archive/pslib/include/psMetadata.h	(revision 619)
+++ trunk/archive/pslib/include/psMetadata.h	(revision 753)
@@ -10,6 +10,7 @@
 typedef enum {				///< type of val is:
     PS_META_ITEM_SET = 0,		///< NULL; metadata is in psMetadataType.items
-    PS_META_FLOAT,			///< float (.f)
-    PS_META_INT,			///< int (.i)
+    PS_META_S32,			///< int (.i)
+    PS_META_F32,			///< float (.f)
+    PS_META_F64,			///< float (.f)
     PS_META_STR,			///< string (.v)
     PS_META_IMG,			///< image (.v)
@@ -34,10 +35,10 @@
     psMetadataType type;		///< type of this item
     psMetadataFlags flags;		///< flags associated with this item
-    const union {
-	double d;			///< double value
-	float f;			///< floating value
-	int i;				///< integer value
-	void *v;			///< other type
-    } val;				///< value of metadata
+    union {
+	psS32 S32;			///< integer value
+	psF32 F32;			///< floating value
+	psF64 F64;			///< double value
+	void *V;			///< other type
+    } data;				///< value of metadata
     char *comment;			///< optional comment ("", not NULL)
     psDlist *restrict items;		///< list of psMetadataItems with the same name
@@ -56,29 +57,27 @@
 
 /** Constructor */
-psMetadataItem *psMetadataItemAlloc(int typeFlags, ///< type of this piece of metadata + flags
-				    const void *val, ///< value of new item N.b. a pointer even if the item
-					             ///< is of type e.g. int
+psMetadataItem *psMetadataItemAlloc(const char *name, ///< name of new item of metadata (sprintf format)
+				    int format, ///< type of this piece of metadata + flags
 				    const char *comment, ///< comment associated with item
-				    const char *name, ///< name of new item of metadata (may be in sprintf
-						      ///< format)
-				    ...	///< possible arguments for name format
-    );
-psMetadataItem *psVMetadataItemAlloc(
-    int typeFlags,			// type of this piece of metadata + flags
-    const void *data,			// value of new item
-    const char *comment,		// comment associated with item; may be NULL
-    const char *name,			// name of new item of metadata (may be an sprintf format)
-    va_list ap				// possible arguments for name format
-    );
+				    ...)	///< arguments for name and data
+;
+
+psMetadataItem *psMetadataItemAllocV(const char *name, ///< name of new item of metadata (sprintf format)
+				    int format, ///< type of this piece of metadata + flags
+				    const char *comment, ///< comment associated with item
+				    va_list ap)	///< arguments for name and data
+;
 
 /** Destructor */
-void psMetadataItemFree(psMetadataItem *ms ///< piece of metadata to destroy
-    );
+void psMetadataItemFree(psMetadataItem *ms) ///< piece of metadata to destroy
+;
+
 /** Constructor */
-psMetadata *psMetadataAlloc(void);   ///< make a new set of metadata
+psMetadata *psMetadataAlloc(void)   ///< make a new set of metadata
+;
 
 /** Destructor */
-void psMetadataFree(psMetadata *md ///< destroy a set of metadata
-    );
+void psMetadataFree(psMetadata *md) ///< destroy a set of metadata
+;
 
 /**** Utilities **********************************************************************/
@@ -86,17 +85,14 @@
 /// Add item to the end of the metadata
 psMetadataItem *psMetadataAppendItem(psMetadata *restrict md, ///< metadata to add to
-				     psMetadataItem *restrict item ///< Metatdata item to add
-    );
+				     psMetadataItem *restrict item) ///< Metatdata item to add
+;
 
 /// Add item to the end of the metadata.  Combines psMetadataItemAlloc and psMetadataAppendItem
 psMetadataItem *psMetadataAppend(psMetadata *restrict md, ///< Metadata to add to
-				 int typeFlags, ///< type of this piece of metadata + flags
-				 const void *val, ///< value of new item N.b. a pointer even if the item
-				                  ///< is of type e.g. int
+				 const char *name, ///< name of new item of metadata (sprintf format)
+				 int format, ///< type of this piece of metadata + flags
 				 const char *comment, ///< comment associated with item
-				 const char *name, ///< name of new item of metadata (may be in sprintf
-				                   ///< format)
-				 ...	///< possible arguments for name format
-    );
+				 ...)	///< possible arguments for name format
+;
 
 /// delete item from the metadata
@@ -125,4 +121,21 @@
 			 const char *prefix	   ///< print this at the beginning of each line
     );
+
+/// Read only header from image file.
+psMetadata *
+psMetadataReadHeader(psMetadata *out,	///< read data to this structure
+		     const char *ext,	///< MEF extension name ("PHU" for primary header)
+		     int extnum,	///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)
+		     const char *file)	///< file to read from
+;
+
+/// Read only header from image file descriptor.
+psMetadata *
+psMetadataFReadHeader(psMetadata *out,	///< read data to this structure
+		      const char *ext,	///< MEF extension name ("PHU" for primary header)
+		      int extnum,	///< MEF extension number (-1 for "PHU", 0 : Nextend - 1)
+		      FILE *f)		///< file descriptor to read from
+;
+
 /* \} */ // End of AstroGroup Functions
 #endif
