Index: /trunk/psLib/src/astronomy/psMetadata.h
===================================================================
--- /trunk/psLib/src/astronomy/psMetadata.h	(revision 1286)
+++ /trunk/psLib/src/astronomy/psMetadata.h	(revision 1286)
@@ -0,0 +1,149 @@
+/** @file  psMetadata.h
+ *
+ *  @brief Contains metadata struuctures, enumerations and functions prototypes
+ *
+ *  This file defines metadata item, metadata type, metadata flags, metadata containers, and function
+ *  prototypes necessary creating psLib metadata APIs
+ *
+ *  @ingroup Metadata
+ *
+ *  @author Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-23 01:30:29 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+# ifndef PS_METADATA_H
+# define PS_METADATA_H
+
+#include "psType.h"
+#include "psList.h"
+#include "psHash.h"
+
+/// @addtogroup Metadata
+/// @{
+
+/** Metadata item type.
+ *
+ * Enumeration for maintaining metadata item types.
+ */
+typedef enum {
+    PS_META_ITEM_SET = 0,               ///< Null. Metadata is in psMetadataItem.items
+    PS_META_S32,                        ///< Signed 32-bit integer data.
+    PS_META_F32,                        ///< Single-precision float data.
+    PS_META_F64,                        ///< Double-precision float data.
+    PS_META_STR,                        ///< String data (Stored in as void *).
+    PS_META_IMG,                        ///< Image data (Stored in as void *).
+    PS_META_JPG,                        ///< JPEG data (Stored in as void .
+    PS_META_PNG,                        ///< PNG data (Stored in as void *).
+    PS_META_ASTROM,                     ///< Astrometric coefficients (Stored in as void *).
+    PS_META_UNKNOWN,                    ///< Other data (Stored in as void *).
+    PS_META_NTYPE                       ///< Number of types. Must be last.
+} psMetadataType;
+
+/** Metadata item flags.
+ *
+ * Enumeration for maintaining optional metadata item flags.
+ */
+typedef enum {
+    PS_META_TYPE_MASK  =  0xffff,       ///< Mask to hold metadata type enum.
+    PS_META_UNIQUE     = 0x10000,       ///< Metadata item name is unique (default).
+    PS_META_NON_UNIQUE = 0x20000        ///< Metadata item name may be repeated.
+}psMetadataFlags;
+
+/** Metadata item data structure.
+ *
+ * Struct for maintaining metadata items of varying types. It also contains
+ * information about the item name, flags, comments, and other items with the same name.
+ */
+typedef struct psMetadataItem
+{
+    const int id;                       ///< Unique ID for metadata item.
+    char *restrict name;                ///< Name of metadata item.
+    psMetadataType type;                ///< Type of metadata item.
+    psMetadataFlags flags;              ///< Flags associated with metadata item
+    const union
+    {
+        psS32   S32;                    ///< Signed 32-bit integer data.
+        psF32   F32;                    ///< Single-precision float data.
+        psF64   F64;                    ///< Double-precision float data.
+        psPTR     V;                    ///< Pointer to other type of data.
+    }
+    data;                             ///< Union for data types.
+    char *comment;                      ///< Optional comment ("", not NULL).
+    psList *restrict items;             ///< List of psMetadataItems with same name.
+}
+psMetadataItem;
+
+/** 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 of the metadata. The second container employs a hash table which
+ * allows fast lookup when given a metadata keyword.
+ */
+typedef struct psMetadata
+{
+    psList *restrict list;
+    psList *restrict table;
+}
+psMetadata;
+
+
+/*****************************************************************************/
+/* FUNCTION PROTOTYPES                                                       */
+/*****************************************************************************/
+
+/** 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 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 operators in the function.
+ * specified size and type.
+ *
+ * @return psMetadataItem*: Pointer metadata item.
+ */
+psMetadataItem *psMetadataItemAlloc(
+    const char *name,                   ///< Name of metadata item.
+    int format,                         ///< Binary OR combination of metadata type and metadata flag.
+    const char *comment,                ///< Comment for metadata item.
+    ...                                 ///< Arguments for name formatting and metadata item data.
+);
+
+/** Create a metadata item with va_list.
+ *
+ * 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 operators in the function.
+ * specified size and type.
+ *
+ * @return psMetadataItem*: Pointer metadata item.
+ */
+psMetadataItem *psMetadataItemAllocV(
+    const char *name,                   ///< Name of metadata item.
+    int format,                         ///< Binary OR combination of metadata type and metadata flag.
+    const char *comment,                ///< Comment for metadata item.
+    va_list list                        ///< Arguments for name formatting and metadata item data.
+);
+
+/** Create a metadata collection.
+ *
+ * Returns an empty metadata container with fully allocated internal metadata containers.
+ *
+ * @return psMetadata*: Pointer metadata.
+ */
+psMetadata *psMetadataAlloc(
+    void                                ///< Void
+);
+
+/// @}
+
+#endif
Index: /trunk/psLib/src/collections/psMetadata.h
===================================================================
--- /trunk/psLib/src/collections/psMetadata.h	(revision 1286)
+++ /trunk/psLib/src/collections/psMetadata.h	(revision 1286)
@@ -0,0 +1,149 @@
+/** @file  psMetadata.h
+ *
+ *  @brief Contains metadata struuctures, enumerations and functions prototypes
+ *
+ *  This file defines metadata item, metadata type, metadata flags, metadata containers, and function
+ *  prototypes necessary creating psLib metadata APIs
+ *
+ *  @ingroup Metadata
+ *
+ *  @author Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-23 01:30:29 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+# ifndef PS_METADATA_H
+# define PS_METADATA_H
+
+#include "psType.h"
+#include "psList.h"
+#include "psHash.h"
+
+/// @addtogroup Metadata
+/// @{
+
+/** Metadata item type.
+ *
+ * Enumeration for maintaining metadata item types.
+ */
+typedef enum {
+    PS_META_ITEM_SET = 0,               ///< Null. Metadata is in psMetadataItem.items
+    PS_META_S32,                        ///< Signed 32-bit integer data.
+    PS_META_F32,                        ///< Single-precision float data.
+    PS_META_F64,                        ///< Double-precision float data.
+    PS_META_STR,                        ///< String data (Stored in as void *).
+    PS_META_IMG,                        ///< Image data (Stored in as void *).
+    PS_META_JPG,                        ///< JPEG data (Stored in as void .
+    PS_META_PNG,                        ///< PNG data (Stored in as void *).
+    PS_META_ASTROM,                     ///< Astrometric coefficients (Stored in as void *).
+    PS_META_UNKNOWN,                    ///< Other data (Stored in as void *).
+    PS_META_NTYPE                       ///< Number of types. Must be last.
+} psMetadataType;
+
+/** Metadata item flags.
+ *
+ * Enumeration for maintaining optional metadata item flags.
+ */
+typedef enum {
+    PS_META_TYPE_MASK  =  0xffff,       ///< Mask to hold metadata type enum.
+    PS_META_UNIQUE     = 0x10000,       ///< Metadata item name is unique (default).
+    PS_META_NON_UNIQUE = 0x20000        ///< Metadata item name may be repeated.
+}psMetadataFlags;
+
+/** Metadata item data structure.
+ *
+ * Struct for maintaining metadata items of varying types. It also contains
+ * information about the item name, flags, comments, and other items with the same name.
+ */
+typedef struct psMetadataItem
+{
+    const int id;                       ///< Unique ID for metadata item.
+    char *restrict name;                ///< Name of metadata item.
+    psMetadataType type;                ///< Type of metadata item.
+    psMetadataFlags flags;              ///< Flags associated with metadata item
+    const union
+    {
+        psS32   S32;                    ///< Signed 32-bit integer data.
+        psF32   F32;                    ///< Single-precision float data.
+        psF64   F64;                    ///< Double-precision float data.
+        psPTR     V;                    ///< Pointer to other type of data.
+    }
+    data;                             ///< Union for data types.
+    char *comment;                      ///< Optional comment ("", not NULL).
+    psList *restrict items;             ///< List of psMetadataItems with same name.
+}
+psMetadataItem;
+
+/** 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 of the metadata. The second container employs a hash table which
+ * allows fast lookup when given a metadata keyword.
+ */
+typedef struct psMetadata
+{
+    psList *restrict list;
+    psList *restrict table;
+}
+psMetadata;
+
+
+/*****************************************************************************/
+/* FUNCTION PROTOTYPES                                                       */
+/*****************************************************************************/
+
+/** 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 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 operators in the function.
+ * specified size and type.
+ *
+ * @return psMetadataItem*: Pointer metadata item.
+ */
+psMetadataItem *psMetadataItemAlloc(
+    const char *name,                   ///< Name of metadata item.
+    int format,                         ///< Binary OR combination of metadata type and metadata flag.
+    const char *comment,                ///< Comment for metadata item.
+    ...                                 ///< Arguments for name formatting and metadata item data.
+);
+
+/** Create a metadata item with va_list.
+ *
+ * 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 operators in the function.
+ * specified size and type.
+ *
+ * @return psMetadataItem*: Pointer metadata item.
+ */
+psMetadataItem *psMetadataItemAllocV(
+    const char *name,                   ///< Name of metadata item.
+    int format,                         ///< Binary OR combination of metadata type and metadata flag.
+    const char *comment,                ///< Comment for metadata item.
+    va_list list                        ///< Arguments for name formatting and metadata item data.
+);
+
+/** Create a metadata collection.
+ *
+ * Returns an empty metadata container with fully allocated internal metadata containers.
+ *
+ * @return psMetadata*: Pointer metadata.
+ */
+psMetadata *psMetadataAlloc(
+    void                                ///< Void
+);
+
+/// @}
+
+#endif
Index: /trunk/psLib/src/types/psMetadata.h
===================================================================
--- /trunk/psLib/src/types/psMetadata.h	(revision 1286)
+++ /trunk/psLib/src/types/psMetadata.h	(revision 1286)
@@ -0,0 +1,149 @@
+/** @file  psMetadata.h
+ *
+ *  @brief Contains metadata struuctures, enumerations and functions prototypes
+ *
+ *  This file defines metadata item, metadata type, metadata flags, metadata containers, and function
+ *  prototypes necessary creating psLib metadata APIs
+ *
+ *  @ingroup Metadata
+ *
+ *  @author Ross Harman, MHPCC
+ *
+ *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-07-23 01:30:29 $
+ *
+ *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
+ */
+# ifndef PS_METADATA_H
+# define PS_METADATA_H
+
+#include "psType.h"
+#include "psList.h"
+#include "psHash.h"
+
+/// @addtogroup Metadata
+/// @{
+
+/** Metadata item type.
+ *
+ * Enumeration for maintaining metadata item types.
+ */
+typedef enum {
+    PS_META_ITEM_SET = 0,               ///< Null. Metadata is in psMetadataItem.items
+    PS_META_S32,                        ///< Signed 32-bit integer data.
+    PS_META_F32,                        ///< Single-precision float data.
+    PS_META_F64,                        ///< Double-precision float data.
+    PS_META_STR,                        ///< String data (Stored in as void *).
+    PS_META_IMG,                        ///< Image data (Stored in as void *).
+    PS_META_JPG,                        ///< JPEG data (Stored in as void .
+    PS_META_PNG,                        ///< PNG data (Stored in as void *).
+    PS_META_ASTROM,                     ///< Astrometric coefficients (Stored in as void *).
+    PS_META_UNKNOWN,                    ///< Other data (Stored in as void *).
+    PS_META_NTYPE                       ///< Number of types. Must be last.
+} psMetadataType;
+
+/** Metadata item flags.
+ *
+ * Enumeration for maintaining optional metadata item flags.
+ */
+typedef enum {
+    PS_META_TYPE_MASK  =  0xffff,       ///< Mask to hold metadata type enum.
+    PS_META_UNIQUE     = 0x10000,       ///< Metadata item name is unique (default).
+    PS_META_NON_UNIQUE = 0x20000        ///< Metadata item name may be repeated.
+}psMetadataFlags;
+
+/** Metadata item data structure.
+ *
+ * Struct for maintaining metadata items of varying types. It also contains
+ * information about the item name, flags, comments, and other items with the same name.
+ */
+typedef struct psMetadataItem
+{
+    const int id;                       ///< Unique ID for metadata item.
+    char *restrict name;                ///< Name of metadata item.
+    psMetadataType type;                ///< Type of metadata item.
+    psMetadataFlags flags;              ///< Flags associated with metadata item
+    const union
+    {
+        psS32   S32;                    ///< Signed 32-bit integer data.
+        psF32   F32;                    ///< Single-precision float data.
+        psF64   F64;                    ///< Double-precision float data.
+        psPTR     V;                    ///< Pointer to other type of data.
+    }
+    data;                             ///< Union for data types.
+    char *comment;                      ///< Optional comment ("", not NULL).
+    psList *restrict items;             ///< List of psMetadataItems with same name.
+}
+psMetadataItem;
+
+/** 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 of the metadata. The second container employs a hash table which
+ * allows fast lookup when given a metadata keyword.
+ */
+typedef struct psMetadata
+{
+    psList *restrict list;
+    psList *restrict table;
+}
+psMetadata;
+
+
+/*****************************************************************************/
+/* FUNCTION PROTOTYPES                                                       */
+/*****************************************************************************/
+
+/** 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 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 operators in the function.
+ * specified size and type.
+ *
+ * @return psMetadataItem*: Pointer metadata item.
+ */
+psMetadataItem *psMetadataItemAlloc(
+    const char *name,                   ///< Name of metadata item.
+    int format,                         ///< Binary OR combination of metadata type and metadata flag.
+    const char *comment,                ///< Comment for metadata item.
+    ...                                 ///< Arguments for name formatting and metadata item data.
+);
+
+/** Create a metadata item with va_list.
+ *
+ * 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 operators in the function.
+ * specified size and type.
+ *
+ * @return psMetadataItem*: Pointer metadata item.
+ */
+psMetadataItem *psMetadataItemAllocV(
+    const char *name,                   ///< Name of metadata item.
+    int format,                         ///< Binary OR combination of metadata type and metadata flag.
+    const char *comment,                ///< Comment for metadata item.
+    va_list list                        ///< Arguments for name formatting and metadata item data.
+);
+
+/** Create a metadata collection.
+ *
+ * Returns an empty metadata container with fully allocated internal metadata containers.
+ *
+ * @return psMetadata*: Pointer metadata.
+ */
+psMetadata *psMetadataAlloc(
+    void                                ///< Void
+);
+
+/// @}
+
+#endif
