Index: /trunk/psLib/src/astronomy/psMetadata.c
===================================================================
--- /trunk/psLib/src/astronomy/psMetadata.c	(revision 1620)
+++ /trunk/psLib/src/astronomy/psMetadata.c	(revision 1621)
@@ -12,6 +12,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-14 02:55:46 $
+*  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-25 20:21:25 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -39,8 +39,14 @@
 /******************************************************************************/
 
-#define FITS_ERROR(STRING,PS_ERROR)                  \
-fits_get_errstatus(status, fitsErr);             \
-psError( __func__, STRING, PS_ERROR, fitsErr);   \
-status = 0;                                      \
+#define FITS_ERROR(STRING,PS_ERROR)                                                                          \
+fits_get_errstatus(status, fitsErr);                                                                     \
+psError(__func__, STRING, PS_ERROR, fitsErr);                                                            \
+status = 0;                                                                                              \
+fits_close_file(fd, &status);                                                                            \
+if(status){                                                                                              \
+    fits_get_errstatus(status, fitsErr);                                                                  \
+    psError(__func__, "Couldn't close FITS file. FITS error: %s", fitsErr);                               \
+}                                                                                                        \
+status = 0;                                                                                              \
 return output;
 
@@ -657,5 +663,5 @@
 }
 
-psMetadata* psMetadataFReadHeader(psMetadata* output, char *extName, int extNum, fitsfile * fd)
+psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, int extNum, char *fileName)
 {
     bool tempBool;
@@ -672,7 +678,14 @@
     int keyNum = 0;
     psMetadataType metadataItemType;
-
-    if (fd == NULL) {
-        psError(__func__, "Null FITS file descriptor not allowed");
+    fitsfile *fd = NULL;
+
+    if(fileName == NULL) {
+        psError(__func__, "Null fileName not allowed");
+        return NULL;
+    }
+
+    fits_open_file(&fd, fileName, READONLY, &status);
+    if(fd == NULL || status != 0) {
+        FITS_ERROR("FITS error while opening file: %s %s", fileName);
         return NULL;
     }
@@ -685,8 +698,10 @@
         return NULL;
     }
+
     // Allocate metadata if user didn't
     if (output == NULL) {
         output = psMetadataAlloc();
     }
+
     // Move to user designated HDU number or HDU name in FITS file. HDU numbers starts at one.
     if (extName != NULL) {
@@ -704,4 +719,5 @@
         FITS_ERROR("FITS error while reading key %d: %s", keyNum);
     }
+
     // Get each key name. Keywords start at one.
     for (i = 1; i <= numKeys; i++) {
@@ -714,6 +730,5 @@
                 FITS_ERROR("FITS error while determining key %d type: %s", keyNum);
             } else {
-                // Some keywords are still valid even though they don't have a type, like COMMENTS and
-                // HISTORY
+                // Some keywords are still valid if they don't have a type (like COMMENTS and HISTORY)
                 keyType = 'C';
                 status = 0;
Index: /trunk/psLib/src/astronomy/psMetadata.h
===================================================================
--- /trunk/psLib/src/astronomy/psMetadata.h	(revision 1620)
+++ /trunk/psLib/src/astronomy/psMetadata.h	(revision 1621)
@@ -11,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-12 01:23:20 $
+*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-25 20:21:41 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -72,6 +72,6 @@
 /** Metadata data structure.
  *
- *  Struct for holding metadata items. Metadata items are held in two 
- *  containers. The first employs a doubly-linked list to preserve the order 
+ *  Struct for holding metadata items. Metadata items are held in two
+ *  containers. The first employs a doubly-linked list to preserve the order
  *  of the metadata. The second container employs a hash table which
  *  allows fast lookup when given a metadata keyword.
@@ -92,13 +92,13 @@
 /** Create a metadata item.
  *
- *  Returns a fill psMetadataItem ready for insertion into the psMetadata 
- *  struct. The name argument specifies the name to use for this item, and 
+ *  Returns a fill psMetadataItem ready for insertion into the psMetadata
+ *  struct. The name argument specifies the name to use for this item, and
  *  may include sprintf formatting codes. The format entry specifies both
- *  the metadata type and optional flags and is created by bit-wise or of the 
- *  appropriate type and flag. The comment argument is a fixed string used to 
- *  comment the metadata item. The arguments to the name formatting codes and 
- *  the metadata itself are passed as arguments following the comment string. 
- *  The data must be a pointer for any of the elements stored in data.void. 
- *  The argument list must be interpreted appropriately by the va_list 
+ *  the metadata type and optional flags and is created by bit-wise or of the
+ *  appropriate type and flag. The comment argument is a fixed string used to
+ *  comment the metadata item. The arguments to the name formatting codes and
+ *  the metadata itself are passed as arguments following the comment string.
+ *  The data must be a pointer for any of the elements stored in data.void.
+ *  The argument list must be interpreted appropriately by the va_list
  *  operators in the function specified size and type.
  *
@@ -114,13 +114,13 @@
 /** Create a metadata item with va_list.
  *
- *  Returns a fill psMetadataItem ready for insertion into the psMetadata 
+ *  Returns a fill psMetadataItem ready for insertion into the psMetadata
  *  struct. The name argument specifies the name to use for this item, and
  *  may include sprintf formatting codes. The format entry specifies both
- *  the metadata type and optional flags and is created by bit-wise or of the 
- *  appropriate type and flag. The comment argument is a fixed string used to 
- *  comment the metadata item. The arguments to the name formatting codes and 
- *  the metadata itself are passed as arguments following the comment string. 
- *  The data must be a pointer for any of the elements stored in data.void. 
- *  The argument list must be interpreted appropriately by the va_list 
+ *  the metadata type and optional flags and is created by bit-wise or of the
+ *  appropriate type and flag. The comment argument is a fixed string used to
+ *  comment the metadata item. The arguments to the name formatting codes and
+ *  the metadata itself are passed as arguments following the comment string.
+ *  The data must be a pointer for any of the elements stored in data.void.
+ *  The argument list must be interpreted appropriately by the va_list
  *  operators in the function specified size and type.
  *
@@ -136,5 +136,5 @@
 /** Create a metadata collection.
  *
- *  Returns an empty metadata container with fully allocated internal metadata 
+ *  Returns an empty metadata container with fully allocated internal metadata
  *  containers.
  *
@@ -145,5 +145,5 @@
 /** Add existing metadata item to metadata collection.
  *
- *  Add a metadata item that has already been created to the metadata 
+ *  Add a metadata item that has already been created to the metadata
  *  collection.
  *
@@ -173,8 +173,8 @@
 /** Remove an item from metadata collection.
  *
- *  Items may be removed from metadata by specifing a key or location. If the 
- *  name is null, the where argument is used instead. If name is not null, 
- *  where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from 
- *  the metadata and true is returned.  If the key is not unique, then all 
+ *  Items may be removed from metadata by specifing a key or location. If the
+ *  name is null, the where argument is used instead. If name is not null,
+ *  where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from
+ *  the metadata and true is returned.  If the key is not unique, then all
  *  items corresponding to it are removed.
  *
@@ -189,6 +189,6 @@
 /** Find an item in the metadata collection based on key name.
  *
- *  Items may be found in the metadata by providing a key. If the key is 
- *  non-unique, the first item is returned. If the item is not found, null is 
+ *  Items may be found in the metadata by providing a key. If the key is
+ *  non-unique, the first item is returned. If the item is not found, null is
  *  returned.
  *
@@ -202,5 +202,5 @@
 /** Find an item in the metadata collection based on list index.
  *
- *  Items may be found in the metadata by their entry position in the list 
+ *  Items may be found in the metadata by their entry position in the list
  *  container.
  *
@@ -214,5 +214,5 @@
 /** Set or reset metadata iterator.
  *
- *  Metadata may be iterated by setting or resetting an iterator to a location 
+ *  Metadata may be iterated by setting or resetting an iterator to a location
  *  in the metadata list.
  *
@@ -250,9 +250,9 @@
 /** Print metadata item to file.
  *
- *  Metadata items may be printed to an open file descriptor based on a 
- *  provided format. The format is a sprintf format statement with exactly 
- *  one % formatting command. If the metadata item type is a numeric type, 
- *  this formatting command must also be numeric, and the type conversion 
- *  performed to the value to match the format type. If the metadata type is 
+ *  Metadata items may be printed to an open file descriptor based on a
+ *  provided format. The format is a sprintf format statement with exactly
+ *  one % formatting command. If the metadata item type is a numeric type,
+ *  this formatting command must also be numeric, and the type conversion
+ *  performed to the value to match the format type. If the metadata type is
  *  a string, the fromatting command must also be for a string. If the
  *  metadata type is any other data type, printing is not allowed.
@@ -268,5 +268,5 @@
 /** Read metadata header.
  *
- *  Read a metadata header from file. If the file is not found, an error is 
+ *  Read a metadata header from file. If the file is not found, an error is
  *  reported. This file is currently unimplemented.
  *
@@ -275,21 +275,7 @@
 psMetadata* psMetadataReadHeader(
     psMetadata* output,                ///< Resulting metadata from read.
-    char *extname,                     ///< File name extension string.
-    int extnum,                        ///< File name extension number. Starts at 1.
-    char *filename                     ///< Name of file to read.
-);
-
-/** Read metadata header.
- *
- *  Read a metadata header from file. If the file is not found, an error is 
- *  reported.
- *
- *  @return psMetadata* : Pointer metadata.
- */
-psMetadata* psMetadataFReadHeader(
-    psMetadata* output,                ///< Resulting metadata from read.
     char *extName,                     ///< File name extension string.
-    int extNum,                        ///< File name extension number.
-    fitsfile * fd                      ///< Pointer to file to read.
+    int extNum,                        ///< File name extension number. Starts at 1.
+    char *fileName                     ///< Name of file to read.
 );
 
Index: /trunk/psLib/src/collections/psMetadata.c
===================================================================
--- /trunk/psLib/src/collections/psMetadata.c	(revision 1620)
+++ /trunk/psLib/src/collections/psMetadata.c	(revision 1621)
@@ -12,6 +12,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-14 02:55:46 $
+*  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-25 20:21:25 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -39,8 +39,14 @@
 /******************************************************************************/
 
-#define FITS_ERROR(STRING,PS_ERROR)                  \
-fits_get_errstatus(status, fitsErr);             \
-psError( __func__, STRING, PS_ERROR, fitsErr);   \
-status = 0;                                      \
+#define FITS_ERROR(STRING,PS_ERROR)                                                                          \
+fits_get_errstatus(status, fitsErr);                                                                     \
+psError(__func__, STRING, PS_ERROR, fitsErr);                                                            \
+status = 0;                                                                                              \
+fits_close_file(fd, &status);                                                                            \
+if(status){                                                                                              \
+    fits_get_errstatus(status, fitsErr);                                                                  \
+    psError(__func__, "Couldn't close FITS file. FITS error: %s", fitsErr);                               \
+}                                                                                                        \
+status = 0;                                                                                              \
 return output;
 
@@ -657,5 +663,5 @@
 }
 
-psMetadata* psMetadataFReadHeader(psMetadata* output, char *extName, int extNum, fitsfile * fd)
+psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, int extNum, char *fileName)
 {
     bool tempBool;
@@ -672,7 +678,14 @@
     int keyNum = 0;
     psMetadataType metadataItemType;
-
-    if (fd == NULL) {
-        psError(__func__, "Null FITS file descriptor not allowed");
+    fitsfile *fd = NULL;
+
+    if(fileName == NULL) {
+        psError(__func__, "Null fileName not allowed");
+        return NULL;
+    }
+
+    fits_open_file(&fd, fileName, READONLY, &status);
+    if(fd == NULL || status != 0) {
+        FITS_ERROR("FITS error while opening file: %s %s", fileName);
         return NULL;
     }
@@ -685,8 +698,10 @@
         return NULL;
     }
+
     // Allocate metadata if user didn't
     if (output == NULL) {
         output = psMetadataAlloc();
     }
+
     // Move to user designated HDU number or HDU name in FITS file. HDU numbers starts at one.
     if (extName != NULL) {
@@ -704,4 +719,5 @@
         FITS_ERROR("FITS error while reading key %d: %s", keyNum);
     }
+
     // Get each key name. Keywords start at one.
     for (i = 1; i <= numKeys; i++) {
@@ -714,6 +730,5 @@
                 FITS_ERROR("FITS error while determining key %d type: %s", keyNum);
             } else {
-                // Some keywords are still valid even though they don't have a type, like COMMENTS and
-                // HISTORY
+                // Some keywords are still valid if they don't have a type (like COMMENTS and HISTORY)
                 keyType = 'C';
                 status = 0;
Index: /trunk/psLib/src/collections/psMetadata.h
===================================================================
--- /trunk/psLib/src/collections/psMetadata.h	(revision 1620)
+++ /trunk/psLib/src/collections/psMetadata.h	(revision 1621)
@@ -11,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-12 01:23:20 $
+*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-25 20:21:41 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -72,6 +72,6 @@
 /** Metadata data structure.
  *
- *  Struct for holding metadata items. Metadata items are held in two 
- *  containers. The first employs a doubly-linked list to preserve the order 
+ *  Struct for holding metadata items. Metadata items are held in two
+ *  containers. The first employs a doubly-linked list to preserve the order
  *  of the metadata. The second container employs a hash table which
  *  allows fast lookup when given a metadata keyword.
@@ -92,13 +92,13 @@
 /** Create a metadata item.
  *
- *  Returns a fill psMetadataItem ready for insertion into the psMetadata 
- *  struct. The name argument specifies the name to use for this item, and 
+ *  Returns a fill psMetadataItem ready for insertion into the psMetadata
+ *  struct. The name argument specifies the name to use for this item, and
  *  may include sprintf formatting codes. The format entry specifies both
- *  the metadata type and optional flags and is created by bit-wise or of the 
- *  appropriate type and flag. The comment argument is a fixed string used to 
- *  comment the metadata item. The arguments to the name formatting codes and 
- *  the metadata itself are passed as arguments following the comment string. 
- *  The data must be a pointer for any of the elements stored in data.void. 
- *  The argument list must be interpreted appropriately by the va_list 
+ *  the metadata type and optional flags and is created by bit-wise or of the
+ *  appropriate type and flag. The comment argument is a fixed string used to
+ *  comment the metadata item. The arguments to the name formatting codes and
+ *  the metadata itself are passed as arguments following the comment string.
+ *  The data must be a pointer for any of the elements stored in data.void.
+ *  The argument list must be interpreted appropriately by the va_list
  *  operators in the function specified size and type.
  *
@@ -114,13 +114,13 @@
 /** Create a metadata item with va_list.
  *
- *  Returns a fill psMetadataItem ready for insertion into the psMetadata 
+ *  Returns a fill psMetadataItem ready for insertion into the psMetadata
  *  struct. The name argument specifies the name to use for this item, and
  *  may include sprintf formatting codes. The format entry specifies both
- *  the metadata type and optional flags and is created by bit-wise or of the 
- *  appropriate type and flag. The comment argument is a fixed string used to 
- *  comment the metadata item. The arguments to the name formatting codes and 
- *  the metadata itself are passed as arguments following the comment string. 
- *  The data must be a pointer for any of the elements stored in data.void. 
- *  The argument list must be interpreted appropriately by the va_list 
+ *  the metadata type and optional flags and is created by bit-wise or of the
+ *  appropriate type and flag. The comment argument is a fixed string used to
+ *  comment the metadata item. The arguments to the name formatting codes and
+ *  the metadata itself are passed as arguments following the comment string.
+ *  The data must be a pointer for any of the elements stored in data.void.
+ *  The argument list must be interpreted appropriately by the va_list
  *  operators in the function specified size and type.
  *
@@ -136,5 +136,5 @@
 /** Create a metadata collection.
  *
- *  Returns an empty metadata container with fully allocated internal metadata 
+ *  Returns an empty metadata container with fully allocated internal metadata
  *  containers.
  *
@@ -145,5 +145,5 @@
 /** Add existing metadata item to metadata collection.
  *
- *  Add a metadata item that has already been created to the metadata 
+ *  Add a metadata item that has already been created to the metadata
  *  collection.
  *
@@ -173,8 +173,8 @@
 /** Remove an item from metadata collection.
  *
- *  Items may be removed from metadata by specifing a key or location. If the 
- *  name is null, the where argument is used instead. If name is not null, 
- *  where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from 
- *  the metadata and true is returned.  If the key is not unique, then all 
+ *  Items may be removed from metadata by specifing a key or location. If the
+ *  name is null, the where argument is used instead. If name is not null,
+ *  where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from
+ *  the metadata and true is returned.  If the key is not unique, then all
  *  items corresponding to it are removed.
  *
@@ -189,6 +189,6 @@
 /** Find an item in the metadata collection based on key name.
  *
- *  Items may be found in the metadata by providing a key. If the key is 
- *  non-unique, the first item is returned. If the item is not found, null is 
+ *  Items may be found in the metadata by providing a key. If the key is
+ *  non-unique, the first item is returned. If the item is not found, null is
  *  returned.
  *
@@ -202,5 +202,5 @@
 /** Find an item in the metadata collection based on list index.
  *
- *  Items may be found in the metadata by their entry position in the list 
+ *  Items may be found in the metadata by their entry position in the list
  *  container.
  *
@@ -214,5 +214,5 @@
 /** Set or reset metadata iterator.
  *
- *  Metadata may be iterated by setting or resetting an iterator to a location 
+ *  Metadata may be iterated by setting or resetting an iterator to a location
  *  in the metadata list.
  *
@@ -250,9 +250,9 @@
 /** Print metadata item to file.
  *
- *  Metadata items may be printed to an open file descriptor based on a 
- *  provided format. The format is a sprintf format statement with exactly 
- *  one % formatting command. If the metadata item type is a numeric type, 
- *  this formatting command must also be numeric, and the type conversion 
- *  performed to the value to match the format type. If the metadata type is 
+ *  Metadata items may be printed to an open file descriptor based on a
+ *  provided format. The format is a sprintf format statement with exactly
+ *  one % formatting command. If the metadata item type is a numeric type,
+ *  this formatting command must also be numeric, and the type conversion
+ *  performed to the value to match the format type. If the metadata type is
  *  a string, the fromatting command must also be for a string. If the
  *  metadata type is any other data type, printing is not allowed.
@@ -268,5 +268,5 @@
 /** Read metadata header.
  *
- *  Read a metadata header from file. If the file is not found, an error is 
+ *  Read a metadata header from file. If the file is not found, an error is
  *  reported. This file is currently unimplemented.
  *
@@ -275,21 +275,7 @@
 psMetadata* psMetadataReadHeader(
     psMetadata* output,                ///< Resulting metadata from read.
-    char *extname,                     ///< File name extension string.
-    int extnum,                        ///< File name extension number. Starts at 1.
-    char *filename                     ///< Name of file to read.
-);
-
-/** Read metadata header.
- *
- *  Read a metadata header from file. If the file is not found, an error is 
- *  reported.
- *
- *  @return psMetadata* : Pointer metadata.
- */
-psMetadata* psMetadataFReadHeader(
-    psMetadata* output,                ///< Resulting metadata from read.
     char *extName,                     ///< File name extension string.
-    int extNum,                        ///< File name extension number.
-    fitsfile * fd                      ///< Pointer to file to read.
+    int extNum,                        ///< File name extension number. Starts at 1.
+    char *fileName                     ///< Name of file to read.
 );
 
Index: /trunk/psLib/src/types/psMetadata.c
===================================================================
--- /trunk/psLib/src/types/psMetadata.c	(revision 1620)
+++ /trunk/psLib/src/types/psMetadata.c	(revision 1621)
@@ -12,6 +12,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-14 02:55:46 $
+*  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-25 20:21:25 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -39,8 +39,14 @@
 /******************************************************************************/
 
-#define FITS_ERROR(STRING,PS_ERROR)                  \
-fits_get_errstatus(status, fitsErr);             \
-psError( __func__, STRING, PS_ERROR, fitsErr);   \
-status = 0;                                      \
+#define FITS_ERROR(STRING,PS_ERROR)                                                                          \
+fits_get_errstatus(status, fitsErr);                                                                     \
+psError(__func__, STRING, PS_ERROR, fitsErr);                                                            \
+status = 0;                                                                                              \
+fits_close_file(fd, &status);                                                                            \
+if(status){                                                                                              \
+    fits_get_errstatus(status, fitsErr);                                                                  \
+    psError(__func__, "Couldn't close FITS file. FITS error: %s", fitsErr);                               \
+}                                                                                                        \
+status = 0;                                                                                              \
 return output;
 
@@ -657,5 +663,5 @@
 }
 
-psMetadata* psMetadataFReadHeader(psMetadata* output, char *extName, int extNum, fitsfile * fd)
+psMetadata* psMetadataReadHeader(psMetadata* output, char *extName, int extNum, char *fileName)
 {
     bool tempBool;
@@ -672,7 +678,14 @@
     int keyNum = 0;
     psMetadataType metadataItemType;
-
-    if (fd == NULL) {
-        psError(__func__, "Null FITS file descriptor not allowed");
+    fitsfile *fd = NULL;
+
+    if(fileName == NULL) {
+        psError(__func__, "Null fileName not allowed");
+        return NULL;
+    }
+
+    fits_open_file(&fd, fileName, READONLY, &status);
+    if(fd == NULL || status != 0) {
+        FITS_ERROR("FITS error while opening file: %s %s", fileName);
         return NULL;
     }
@@ -685,8 +698,10 @@
         return NULL;
     }
+
     // Allocate metadata if user didn't
     if (output == NULL) {
         output = psMetadataAlloc();
     }
+
     // Move to user designated HDU number or HDU name in FITS file. HDU numbers starts at one.
     if (extName != NULL) {
@@ -704,4 +719,5 @@
         FITS_ERROR("FITS error while reading key %d: %s", keyNum);
     }
+
     // Get each key name. Keywords start at one.
     for (i = 1; i <= numKeys; i++) {
@@ -714,6 +730,5 @@
                 FITS_ERROR("FITS error while determining key %d type: %s", keyNum);
             } else {
-                // Some keywords are still valid even though they don't have a type, like COMMENTS and
-                // HISTORY
+                // Some keywords are still valid if they don't have a type (like COMMENTS and HISTORY)
                 keyType = 'C';
                 status = 0;
Index: /trunk/psLib/src/types/psMetadata.h
===================================================================
--- /trunk/psLib/src/types/psMetadata.h	(revision 1620)
+++ /trunk/psLib/src/types/psMetadata.h	(revision 1621)
@@ -11,6 +11,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-08-12 01:23:20 $
+*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-08-25 20:21:41 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -72,6 +72,6 @@
 /** Metadata data structure.
  *
- *  Struct for holding metadata items. Metadata items are held in two 
- *  containers. The first employs a doubly-linked list to preserve the order 
+ *  Struct for holding metadata items. Metadata items are held in two
+ *  containers. The first employs a doubly-linked list to preserve the order
  *  of the metadata. The second container employs a hash table which
  *  allows fast lookup when given a metadata keyword.
@@ -92,13 +92,13 @@
 /** Create a metadata item.
  *
- *  Returns a fill psMetadataItem ready for insertion into the psMetadata 
- *  struct. The name argument specifies the name to use for this item, and 
+ *  Returns a fill psMetadataItem ready for insertion into the psMetadata
+ *  struct. The name argument specifies the name to use for this item, and
  *  may include sprintf formatting codes. The format entry specifies both
- *  the metadata type and optional flags and is created by bit-wise or of the 
- *  appropriate type and flag. The comment argument is a fixed string used to 
- *  comment the metadata item. The arguments to the name formatting codes and 
- *  the metadata itself are passed as arguments following the comment string. 
- *  The data must be a pointer for any of the elements stored in data.void. 
- *  The argument list must be interpreted appropriately by the va_list 
+ *  the metadata type and optional flags and is created by bit-wise or of the
+ *  appropriate type and flag. The comment argument is a fixed string used to
+ *  comment the metadata item. The arguments to the name formatting codes and
+ *  the metadata itself are passed as arguments following the comment string.
+ *  The data must be a pointer for any of the elements stored in data.void.
+ *  The argument list must be interpreted appropriately by the va_list
  *  operators in the function specified size and type.
  *
@@ -114,13 +114,13 @@
 /** Create a metadata item with va_list.
  *
- *  Returns a fill psMetadataItem ready for insertion into the psMetadata 
+ *  Returns a fill psMetadataItem ready for insertion into the psMetadata
  *  struct. The name argument specifies the name to use for this item, and
  *  may include sprintf formatting codes. The format entry specifies both
- *  the metadata type and optional flags and is created by bit-wise or of the 
- *  appropriate type and flag. The comment argument is a fixed string used to 
- *  comment the metadata item. The arguments to the name formatting codes and 
- *  the metadata itself are passed as arguments following the comment string. 
- *  The data must be a pointer for any of the elements stored in data.void. 
- *  The argument list must be interpreted appropriately by the va_list 
+ *  the metadata type and optional flags and is created by bit-wise or of the
+ *  appropriate type and flag. The comment argument is a fixed string used to
+ *  comment the metadata item. The arguments to the name formatting codes and
+ *  the metadata itself are passed as arguments following the comment string.
+ *  The data must be a pointer for any of the elements stored in data.void.
+ *  The argument list must be interpreted appropriately by the va_list
  *  operators in the function specified size and type.
  *
@@ -136,5 +136,5 @@
 /** Create a metadata collection.
  *
- *  Returns an empty metadata container with fully allocated internal metadata 
+ *  Returns an empty metadata container with fully allocated internal metadata
  *  containers.
  *
@@ -145,5 +145,5 @@
 /** Add existing metadata item to metadata collection.
  *
- *  Add a metadata item that has already been created to the metadata 
+ *  Add a metadata item that has already been created to the metadata
  *  collection.
  *
@@ -173,8 +173,8 @@
 /** Remove an item from metadata collection.
  *
- *  Items may be removed from metadata by specifing a key or location. If the 
- *  name is null, the where argument is used instead. If name is not null, 
- *  where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from 
- *  the metadata and true is returned.  If the key is not unique, then all 
+ *  Items may be removed from metadata by specifing a key or location. If the
+ *  name is null, the where argument is used instead. If name is not null,
+ *  where is set to PS_LIST_UNKNOWN. If the item is found, it is removed from
+ *  the metadata and true is returned.  If the key is not unique, then all
  *  items corresponding to it are removed.
  *
@@ -189,6 +189,6 @@
 /** Find an item in the metadata collection based on key name.
  *
- *  Items may be found in the metadata by providing a key. If the key is 
- *  non-unique, the first item is returned. If the item is not found, null is 
+ *  Items may be found in the metadata by providing a key. If the key is
+ *  non-unique, the first item is returned. If the item is not found, null is
  *  returned.
  *
@@ -202,5 +202,5 @@
 /** Find an item in the metadata collection based on list index.
  *
- *  Items may be found in the metadata by their entry position in the list 
+ *  Items may be found in the metadata by their entry position in the list
  *  container.
  *
@@ -214,5 +214,5 @@
 /** Set or reset metadata iterator.
  *
- *  Metadata may be iterated by setting or resetting an iterator to a location 
+ *  Metadata may be iterated by setting or resetting an iterator to a location
  *  in the metadata list.
  *
@@ -250,9 +250,9 @@
 /** Print metadata item to file.
  *
- *  Metadata items may be printed to an open file descriptor based on a 
- *  provided format. The format is a sprintf format statement with exactly 
- *  one % formatting command. If the metadata item type is a numeric type, 
- *  this formatting command must also be numeric, and the type conversion 
- *  performed to the value to match the format type. If the metadata type is 
+ *  Metadata items may be printed to an open file descriptor based on a
+ *  provided format. The format is a sprintf format statement with exactly
+ *  one % formatting command. If the metadata item type is a numeric type,
+ *  this formatting command must also be numeric, and the type conversion
+ *  performed to the value to match the format type. If the metadata type is
  *  a string, the fromatting command must also be for a string. If the
  *  metadata type is any other data type, printing is not allowed.
@@ -268,5 +268,5 @@
 /** Read metadata header.
  *
- *  Read a metadata header from file. If the file is not found, an error is 
+ *  Read a metadata header from file. If the file is not found, an error is
  *  reported. This file is currently unimplemented.
  *
@@ -275,21 +275,7 @@
 psMetadata* psMetadataReadHeader(
     psMetadata* output,                ///< Resulting metadata from read.
-    char *extname,                     ///< File name extension string.
-    int extnum,                        ///< File name extension number. Starts at 1.
-    char *filename                     ///< Name of file to read.
-);
-
-/** Read metadata header.
- *
- *  Read a metadata header from file. If the file is not found, an error is 
- *  reported.
- *
- *  @return psMetadata* : Pointer metadata.
- */
-psMetadata* psMetadataFReadHeader(
-    psMetadata* output,                ///< Resulting metadata from read.
     char *extName,                     ///< File name extension string.
-    int extNum,                        ///< File name extension number.
-    fitsfile * fd                      ///< Pointer to file to read.
+    int extNum,                        ///< File name extension number. Starts at 1.
+    char *fileName                     ///< Name of file to read.
 );
 
