Index: trunk/ippdb/src/ippdb.h
===================================================================
--- trunk/ippdb/src/ippdb.h	(revision 11733)
+++ trunk/ippdb/src/ippdb.h	(revision 11780)
@@ -6836,5 +6836,5 @@
 
 typedef struct {
-    psS32           p4a_id;
+    psS32           p4_id;
     char            *mode;
     char            *state;
@@ -6849,5 +6849,5 @@
 
 p4RunRow *p4RunRowAlloc(
-    psS32           p4a_id,
+    psS32           p4_id,
     const char      *mode,
     const char      *state,
@@ -6883,5 +6883,5 @@
 bool p4RunInsert(
     psDB            *dbh,               ///< Database handle
-    psS32           p4a_id,
+    psS32           p4_id,
     const char      *mode,
     const char      *state,
@@ -7043,5 +7043,5 @@
 
 typedef struct {
-    psS32           p4a_id;
+    psS32           p4_id;
     char            *exp_tag;
     psS32           p3_version;
@@ -7055,5 +7055,5 @@
 
 p4InputExpRow *p4InputExpRowAlloc(
-    psS32           p4a_id,
+    psS32           p4_id,
     const char      *exp_tag,
     psS32           p3_version,
@@ -7088,5 +7088,5 @@
 bool p4InputExpInsert(
     psDB            *dbh,               ///< Database handle
-    psS32           p4a_id,
+    psS32           p4_id,
     const char      *exp_tag,
     psS32           p3_version,
@@ -7241,4 +7241,214 @@
     bool            mdcf                ///< format as mdconfig or simple
 );
+/** p4SkyCellMapRow data structure
+ *
+ * Structure for representing a single row of p4SkyCellMap table data.
+ */
+
+typedef struct {
+    psS32           p4_id;
+    char            *skycell_id;
+    char            *tess_id;
+    char            *exp_tag;
+    psS32           p3_version;
+    char            *class_id;
+} p4SkyCellMapRow;
+
+/** Creates a new p4SkyCellMapRow object
+ *
+ *  @return A new p4SkyCellMapRow object or NULL on failure.
+ */
+
+p4SkyCellMapRow *p4SkyCellMapRowAlloc(
+    psS32           p4_id,
+    const char      *skycell_id,
+    const char      *tess_id,
+    const char      *exp_tag,
+    psS32           p3_version,
+    const char      *class_id
+);
+
+/** Creates a new p4SkyCellMap table
+ *
+ * @return true on success
+ */
+
+bool p4SkyCellMapCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a p4SkyCellMap table
+ *
+ * @return true on success
+ */
+
+bool p4SkyCellMapDropTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Insert a single row into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool p4SkyCellMapInsert(
+    psDB            *dbh,               ///< Database handle
+    psS32           p4_id,
+    const char      *skycell_id,
+    const char      *tess_id,
+    const char      *exp_tag,
+    psS32           p3_version,
+    const char      *class_id
+);
+
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long p4SkyCellMapDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single p4SkyCellMapRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool p4SkyCellMapInsertObject(
+    psDB            *dbh,               ///< Database handle
+    p4SkyCellMapRow *object             ///< p4SkyCellMapRow object
+);
+
+/** Insert an array of p4SkyCellMapRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool p4SkyCellMapInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of p4SkyCellMapRow objects
+);
+
+/** Insert data from a binary FITS table p4SkyCellMapRow into the database
+ *
+ * This function expects a psFits object with a FITS table as the first
+ * extension.  The table must have at least one row of data in it, that is of
+ * the appropriate format (number of columns and their type).  All other
+ * extensions are ignored.
+ *
+ * @return true on success
+ */
+
+bool p4SkyCellMapInsertFits(
+    psDB            *dbh,               ///< Database handle
+    const psFits    *fits               ///< psFits object
+);
+
+/** Selects up to limit from the database and returns them in a binary FITS table
+ *
+ * This function assumes an empty psFits object and will create a FITS table
+ * as the first extension.
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return true on success
+ */
+
+bool p4SkyCellMapSelectRowsFits(
+    psDB            *dbh,               ///< Database handle
+    psFits          *fits,              ///< psFits object
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+
+/** Convert a p4SkyCellMapRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *p4SkyCellMapMetadataFromObject(
+    const p4SkyCellMapRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A p4SkyCellMapRow pointer or NULL on error
+ */
+
+p4SkyCellMapRow *p4SkyCellMapObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as p4SkyCellMapRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *p4SkyCellMapSelectRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+/** Deletes a row from the database coresponding to an p4SkyCellMap
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+bool p4SkyCellMapDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const p4SkyCellMapRow *object    ///< Object to delete
+);
+/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
+ *
+ *  Note that a 'where' search psMetadata is constructed from each object and
+ *  used to find rows to delete.
+ *
+ * @return A The number of rows removed or a negative value on error
+ */
+
+long long p4SkyCellMapDeleteRowObjects(
+    psDB            *dbh,               ///< Database handle
+    const psArray   *objects,           ///< Array of objects to delete
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+/** Formats and prints an array of p4SkyCellMapRow objects
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool p4SkyCellMapPrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of p4SkyCellMapRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an p4SkyCellMapRow object
+ *
+ * When mdcf is set the formated output is in psMetadataConfig
+ * format, otherwise it is in a simple tabular format.
+ *
+ * @return true on success
+ */
+
+bool p4SkyCellMapPrintObject(
+    FILE            *stream,            ///< a stream
+    p4SkyCellMapRow *object,    ///< an p4SkyCellMapRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
 /** p4ScfileRow data structure
  *
@@ -7247,5 +7457,5 @@
 
 typedef struct {
-    psS32           p4a_id;
+    psS32           p4_id;
     char            *skycell_id;
     char            *tess_id;
@@ -7263,5 +7473,5 @@
 
 p4ScfileRow *p4ScfileRowAlloc(
-    psS32           p4a_id,
+    psS32           p4_id,
     const char      *skycell_id,
     const char      *tess_id,
@@ -7300,5 +7510,5 @@
 bool p4ScfileInsert(
     psDB            *dbh,               ///< Database handle
-    psS32           p4a_id,
+    psS32           p4_id,
     const char      *skycell_id,
     const char      *tess_id,
@@ -7457,1063 +7667,4 @@
     bool            mdcf                ///< format as mdconfig or simple
 );
-/** p4InputScfileRow data structure
- *
- * Structure for representing a single row of p4InputScfile table data.
- */
-
-typedef struct {
-    psS32           p4b_id;
-    char            *skycell_id;
-    char            *tess_id;
-    char            *exp_tag;
-    psS32           p3_version;
-    char            *kind;
-} p4InputScfileRow;
-
-/** Creates a new p4InputScfileRow object
- *
- *  @return A new p4InputScfileRow object or NULL on failure.
- */
-
-p4InputScfileRow *p4InputScfileRowAlloc(
-    psS32           p4b_id,
-    const char      *skycell_id,
-    const char      *tess_id,
-    const char      *exp_tag,
-    psS32           p3_version,
-    const char      *kind
-);
-
-/** Creates a new p4InputScfile table
- *
- * @return true on success
- */
-
-bool p4InputScfileCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a p4InputScfile table
- *
- * @return true on success
- */
-
-bool p4InputScfileDropTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Insert a single row into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool p4InputScfileInsert(
-    psDB            *dbh,               ///< Database handle
-    psS32           p4b_id,
-    const char      *skycell_id,
-    const char      *tess_id,
-    const char      *exp_tag,
-    psS32           p3_version,
-    const char      *kind
-);
-
-/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-long long p4InputScfileDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single p4InputScfileRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool p4InputScfileInsertObject(
-    psDB            *dbh,               ///< Database handle
-    p4InputScfileRow *object             ///< p4InputScfileRow object
-);
-
-/** Insert an array of p4InputScfileRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool p4InputScfileInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of p4InputScfileRow objects
-);
-
-/** Insert data from a binary FITS table p4InputScfileRow into the database
- *
- * This function expects a psFits object with a FITS table as the first
- * extension.  The table must have at least one row of data in it, that is of
- * the appropriate format (number of columns and their type).  All other
- * extensions are ignored.
- *
- * @return true on success
- */
-
-bool p4InputScfileInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** Selects up to limit from the database and returns them in a binary FITS table
- *
- * This function assumes an empty psFits object and will create a FITS table
- * as the first extension.
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return true on success
- */
-
-bool p4InputScfileSelectRowsFits(
-    psDB            *dbh,               ///< Database handle
-    psFits          *fits,              ///< psFits object
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to return
-);
-
-/** Convert a p4InputScfileRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *p4InputScfileMetadataFromObject(
-    const p4InputScfileRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A p4InputScfileRow pointer or NULL on error
- */
-
-p4InputScfileRow *p4InputScfileObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as p4InputScfileRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *p4InputScfileSelectRowObjects(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to return
-);
-/** Deletes a row from the database coresponding to an p4InputScfile
- *
- *  Note that a 'where' search psMetadata is constructed from each object and
- *  used to find rows to delete.
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-bool p4InputScfileDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const p4InputScfileRow *object    ///< Object to delete
-);
-/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
- *
- *  Note that a 'where' search psMetadata is constructed from each object and
- *  used to find rows to delete.
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-long long p4InputScfileDeleteRowObjects(
-    psDB            *dbh,               ///< Database handle
-    const psArray   *objects,           ///< Array of objects to delete
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-/** Formats and prints an array of p4InputScfileRow objects
- *
- * When mdcf is set the formated output is in psMetadataConfig
- * format, otherwise it is in a simple tabular format.
- *
- * @return true on success
- */
-
-bool p4InputScfilePrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of p4InputScfileRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** Formats and prints an p4InputScfileRow object
- *
- * When mdcf is set the formated output is in psMetadataConfig
- * format, otherwise it is in a simple tabular format.
- *
- * @return true on success
- */
-
-bool p4InputScfilePrintObject(
-    FILE            *stream,            ///< a stream
-    p4InputScfileRow *object,    ///< an p4InputScfileRow object
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** p4DiffScfileRow data structure
- *
- * Structure for representing a single row of p4DiffScfile table data.
- */
-
-typedef struct {
-    psS32           p4b_id;
-    char            *skycell_id;
-    char            *tess_id;
-    char            *exp_tag;
-    psS32           p3_version;
-    char            *uri;
-    psF64           bg;
-    psF64           bg_mean_stdev;
-} p4DiffScfileRow;
-
-/** Creates a new p4DiffScfileRow object
- *
- *  @return A new p4DiffScfileRow object or NULL on failure.
- */
-
-p4DiffScfileRow *p4DiffScfileRowAlloc(
-    psS32           p4b_id,
-    const char      *skycell_id,
-    const char      *tess_id,
-    const char      *exp_tag,
-    psS32           p3_version,
-    const char      *uri,
-    psF64           bg,
-    psF64           bg_mean_stdev
-);
-
-/** Creates a new p4DiffScfile table
- *
- * @return true on success
- */
-
-bool p4DiffScfileCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a p4DiffScfile table
- *
- * @return true on success
- */
-
-bool p4DiffScfileDropTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Insert a single row into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool p4DiffScfileInsert(
-    psDB            *dbh,               ///< Database handle
-    psS32           p4b_id,
-    const char      *skycell_id,
-    const char      *tess_id,
-    const char      *exp_tag,
-    psS32           p3_version,
-    const char      *uri,
-    psF64           bg,
-    psF64           bg_mean_stdev
-);
-
-/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-long long p4DiffScfileDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single p4DiffScfileRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool p4DiffScfileInsertObject(
-    psDB            *dbh,               ///< Database handle
-    p4DiffScfileRow *object             ///< p4DiffScfileRow object
-);
-
-/** Insert an array of p4DiffScfileRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool p4DiffScfileInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of p4DiffScfileRow objects
-);
-
-/** Insert data from a binary FITS table p4DiffScfileRow into the database
- *
- * This function expects a psFits object with a FITS table as the first
- * extension.  The table must have at least one row of data in it, that is of
- * the appropriate format (number of columns and their type).  All other
- * extensions are ignored.
- *
- * @return true on success
- */
-
-bool p4DiffScfileInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** Selects up to limit from the database and returns them in a binary FITS table
- *
- * This function assumes an empty psFits object and will create a FITS table
- * as the first extension.
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return true on success
- */
-
-bool p4DiffScfileSelectRowsFits(
-    psDB            *dbh,               ///< Database handle
-    psFits          *fits,              ///< psFits object
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to return
-);
-
-/** Convert a p4DiffScfileRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *p4DiffScfileMetadataFromObject(
-    const p4DiffScfileRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A p4DiffScfileRow pointer or NULL on error
- */
-
-p4DiffScfileRow *p4DiffScfileObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as p4DiffScfileRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *p4DiffScfileSelectRowObjects(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to return
-);
-/** Deletes a row from the database coresponding to an p4DiffScfile
- *
- *  Note that a 'where' search psMetadata is constructed from each object and
- *  used to find rows to delete.
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-bool p4DiffScfileDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const p4DiffScfileRow *object    ///< Object to delete
-);
-/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
- *
- *  Note that a 'where' search psMetadata is constructed from each object and
- *  used to find rows to delete.
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-long long p4DiffScfileDeleteRowObjects(
-    psDB            *dbh,               ///< Database handle
-    const psArray   *objects,           ///< Array of objects to delete
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-/** Formats and prints an array of p4DiffScfileRow objects
- *
- * When mdcf is set the formated output is in psMetadataConfig
- * format, otherwise it is in a simple tabular format.
- *
- * @return true on success
- */
-
-bool p4DiffScfilePrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of p4DiffScfileRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** Formats and prints an p4DiffScfileRow object
- *
- * When mdcf is set the formated output is in psMetadataConfig
- * format, otherwise it is in a simple tabular format.
- *
- * @return true on success
- */
-
-bool p4DiffScfilePrintObject(
-    FILE            *stream,            ///< a stream
-    p4DiffScfileRow *object,    ///< an p4DiffScfileRow object
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** p4MagicMaskImfileRow data structure
- *
- * Structure for representing a single row of p4MagicMaskImfile table data.
- */
-
-typedef struct {
-    psS32           p4c_id;
-    char            *exp_tag;
-    psS32           p3_version;
-    char            *class_id;
-    char            *uri;
-} p4MagicMaskImfileRow;
-
-/** Creates a new p4MagicMaskImfileRow object
- *
- *  @return A new p4MagicMaskImfileRow object or NULL on failure.
- */
-
-p4MagicMaskImfileRow *p4MagicMaskImfileRowAlloc(
-    psS32           p4c_id,
-    const char      *exp_tag,
-    psS32           p3_version,
-    const char      *class_id,
-    const char      *uri
-);
-
-/** Creates a new p4MagicMaskImfile table
- *
- * @return true on success
- */
-
-bool p4MagicMaskImfileCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a p4MagicMaskImfile table
- *
- * @return true on success
- */
-
-bool p4MagicMaskImfileDropTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Insert a single row into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool p4MagicMaskImfileInsert(
-    psDB            *dbh,               ///< Database handle
-    psS32           p4c_id,
-    const char      *exp_tag,
-    psS32           p3_version,
-    const char      *class_id,
-    const char      *uri
-);
-
-/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-long long p4MagicMaskImfileDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single p4MagicMaskImfileRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool p4MagicMaskImfileInsertObject(
-    psDB            *dbh,               ///< Database handle
-    p4MagicMaskImfileRow *object             ///< p4MagicMaskImfileRow object
-);
-
-/** Insert an array of p4MagicMaskImfileRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool p4MagicMaskImfileInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of p4MagicMaskImfileRow objects
-);
-
-/** Insert data from a binary FITS table p4MagicMaskImfileRow into the database
- *
- * This function expects a psFits object with a FITS table as the first
- * extension.  The table must have at least one row of data in it, that is of
- * the appropriate format (number of columns and their type).  All other
- * extensions are ignored.
- *
- * @return true on success
- */
-
-bool p4MagicMaskImfileInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** Selects up to limit from the database and returns them in a binary FITS table
- *
- * This function assumes an empty psFits object and will create a FITS table
- * as the first extension.
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return true on success
- */
-
-bool p4MagicMaskImfileSelectRowsFits(
-    psDB            *dbh,               ///< Database handle
-    psFits          *fits,              ///< psFits object
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to return
-);
-
-/** Convert a p4MagicMaskImfileRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *p4MagicMaskImfileMetadataFromObject(
-    const p4MagicMaskImfileRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A p4MagicMaskImfileRow pointer or NULL on error
- */
-
-p4MagicMaskImfileRow *p4MagicMaskImfileObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as p4MagicMaskImfileRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *p4MagicMaskImfileSelectRowObjects(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to return
-);
-/** Deletes a row from the database coresponding to an p4MagicMaskImfile
- *
- *  Note that a 'where' search psMetadata is constructed from each object and
- *  used to find rows to delete.
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-bool p4MagicMaskImfileDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const p4MagicMaskImfileRow *object    ///< Object to delete
-);
-/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
- *
- *  Note that a 'where' search psMetadata is constructed from each object and
- *  used to find rows to delete.
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-long long p4MagicMaskImfileDeleteRowObjects(
-    psDB            *dbh,               ///< Database handle
-    const psArray   *objects,           ///< Array of objects to delete
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-/** Formats and prints an array of p4MagicMaskImfileRow objects
- *
- * When mdcf is set the formated output is in psMetadataConfig
- * format, otherwise it is in a simple tabular format.
- *
- * @return true on success
- */
-
-bool p4MagicMaskImfilePrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of p4MagicMaskImfileRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** Formats and prints an p4MagicMaskImfileRow object
- *
- * When mdcf is set the formated output is in psMetadataConfig
- * format, otherwise it is in a simple tabular format.
- *
- * @return true on success
- */
-
-bool p4MagicMaskImfilePrintObject(
-    FILE            *stream,            ///< a stream
-    p4MagicMaskImfileRow *object,    ///< an p4MagicMaskImfileRow object
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** skyCellRow data structure
- *
- * Structure for representing a single row of skyCell table data.
- */
-
-typedef struct {
-    char            *skycell_id;
-    char            *tess_id;
-    psF64           ra1;
-    psF64           decl1;
-    psF64           ra2;
-    psF64           decl2;
-    psF64           ra3;
-    psF64           decl3;
-    psF64           ra4;
-    psF64           decl4;
-} skyCellRow;
-
-/** Creates a new skyCellRow object
- *
- *  @return A new skyCellRow object or NULL on failure.
- */
-
-skyCellRow *skyCellRowAlloc(
-    const char      *skycell_id,
-    const char      *tess_id,
-    psF64           ra1,
-    psF64           decl1,
-    psF64           ra2,
-    psF64           decl2,
-    psF64           ra3,
-    psF64           decl3,
-    psF64           ra4,
-    psF64           decl4
-);
-
-/** Creates a new skyCell table
- *
- * @return true on success
- */
-
-bool skyCellCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a skyCell table
- *
- * @return true on success
- */
-
-bool skyCellDropTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Insert a single row into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyCellInsert(
-    psDB            *dbh,               ///< Database handle
-    const char      *skycell_id,
-    const char      *tess_id,
-    psF64           ra1,
-    psF64           decl1,
-    psF64           ra2,
-    psF64           decl2,
-    psF64           ra3,
-    psF64           decl3,
-    psF64           ra4,
-    psF64           decl4
-);
-
-/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-long long skyCellDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single skyCellRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyCellInsertObject(
-    psDB            *dbh,               ///< Database handle
-    skyCellRow      *object             ///< skyCellRow object
-);
-
-/** Insert an array of skyCellRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyCellInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of skyCellRow objects
-);
-
-/** Insert data from a binary FITS table skyCellRow into the database
- *
- * This function expects a psFits object with a FITS table as the first
- * extension.  The table must have at least one row of data in it, that is of
- * the appropriate format (number of columns and their type).  All other
- * extensions are ignored.
- *
- * @return true on success
- */
-
-bool skyCellInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** Selects up to limit from the database and returns them in a binary FITS table
- *
- * This function assumes an empty psFits object and will create a FITS table
- * as the first extension.
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return true on success
- */
-
-bool skyCellSelectRowsFits(
-    psDB            *dbh,               ///< Database handle
-    psFits          *fits,              ///< psFits object
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to return
-);
-
-/** Convert a skyCellRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *skyCellMetadataFromObject(
-    const skyCellRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A skyCellRow pointer or NULL on error
- */
-
-skyCellRow *skyCellObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as skyCellRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *skyCellSelectRowObjects(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to return
-);
-/** Deletes a row from the database coresponding to an skyCell
- *
- *  Note that a 'where' search psMetadata is constructed from each object and
- *  used to find rows to delete.
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-bool skyCellDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const skyCellRow *object    ///< Object to delete
-);
-/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
- *
- *  Note that a 'where' search psMetadata is constructed from each object and
- *  used to find rows to delete.
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-long long skyCellDeleteRowObjects(
-    psDB            *dbh,               ///< Database handle
-    const psArray   *objects,           ///< Array of objects to delete
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-/** Formats and prints an array of skyCellRow objects
- *
- * When mdcf is set the formated output is in psMetadataConfig
- * format, otherwise it is in a simple tabular format.
- *
- * @return true on success
- */
-
-bool skyCellPrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of skyCellRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** Formats and prints an skyCellRow object
- *
- * When mdcf is set the formated output is in psMetadataConfig
- * format, otherwise it is in a simple tabular format.
- *
- * @return true on success
- */
-
-bool skyCellPrintObject(
-    FILE            *stream,            ///< a stream
-    skyCellRow *object,    ///< an skyCellRow object
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** skyCellMapRow data structure
- *
- * Structure for representing a single row of skyCellMap table data.
- */
-
-typedef struct {
-    char            *skycell_id;
-    char            *tess_id;
-    char            *exp_tag;
-    char            *class_id;
-} skyCellMapRow;
-
-/** Creates a new skyCellMapRow object
- *
- *  @return A new skyCellMapRow object or NULL on failure.
- */
-
-skyCellMapRow *skyCellMapRowAlloc(
-    const char      *skycell_id,
-    const char      *tess_id,
-    const char      *exp_tag,
-    const char      *class_id
-);
-
-/** Creates a new skyCellMap table
- *
- * @return true on success
- */
-
-bool skyCellMapCreateTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Deletes a skyCellMap table
- *
- * @return true on success
- */
-
-bool skyCellMapDropTable(
-    psDB            *dbh                ///< Database handle
-);
-
-/** Insert a single row into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyCellMapInsert(
-    psDB            *dbh,               ///< Database handle
-    const char      *skycell_id,
-    const char      *tess_id,
-    const char      *exp_tag,
-    const char      *class_id
-);
-
-/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-long long skyCellMapDelete(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-
-/** Insert a single skyCellMapRow object into a table
- *
- * This function constructs and inserts a single row based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyCellMapInsertObject(
-    psDB            *dbh,               ///< Database handle
-    skyCellMapRow   *object             ///< skyCellMapRow object
-);
-
-/** Insert an array of skyCellMapRow object into a table
- *
- * This function constructs and inserts multiple rows based on it's parameters.
- *
- * @return true on success
- */
-
-bool skyCellMapInsertObjects(
-    psDB            *dbh,               ///< Database handle
-    psArray         *objects            ///< array of skyCellMapRow objects
-);
-
-/** Insert data from a binary FITS table skyCellMapRow into the database
- *
- * This function expects a psFits object with a FITS table as the first
- * extension.  The table must have at least one row of data in it, that is of
- * the appropriate format (number of columns and their type).  All other
- * extensions are ignored.
- *
- * @return true on success
- */
-
-bool skyCellMapInsertFits(
-    psDB            *dbh,               ///< Database handle
-    const psFits    *fits               ///< psFits object
-);
-
-/** Selects up to limit from the database and returns them in a binary FITS table
- *
- * This function assumes an empty psFits object and will create a FITS table
- * as the first extension.
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return true on success
- */
-
-bool skyCellMapSelectRowsFits(
-    psDB            *dbh,               ///< Database handle
-    psFits          *fits,              ///< psFits object
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to return
-);
-
-/** Convert a skyCellMapRow into an equivalent psMetadata
- *
- * @return A psMetadata pointer or NULL on error
- */
-
-psMetadata *skyCellMapMetadataFromObject(
-    const skyCellMapRow *object             ///< fooRow to convert into a psMetadata
-);
-
-/** Convert a psMetadata into an equivalent fooRow
- *
- * @return A skyCellMapRow pointer or NULL on error
- */
-
-skyCellMapRow *skyCellMapObjectFromMetadata(
-    psMetadata      *md                 ///< psMetadata to convert into a fooRow
-);
-/** Selects up to limit rows from the database and returns as skyCellMapRow objects in a psArray
- *
- *  See psDBSelectRows() for documentation on the format of where.
- *
- * @return A psArray pointer or NULL on error
- */
-
-psArray *skyCellMapSelectRowObjects(
-    psDB            *dbh,               ///< Database handle
-    const psMetadata *where,            ///< Row match criteria
-    unsigned long long limit            ///< Maximum number of elements to return
-);
-/** Deletes a row from the database coresponding to an skyCellMap
- *
- *  Note that a 'where' search psMetadata is constructed from each object and
- *  used to find rows to delete.
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-bool skyCellMapDeleteObject(
-    psDB            *dbh,               ///< Database handle
-    const skyCellMapRow *object    ///< Object to delete
-);
-/** Deletes up to limit rows from the database and returns the number of rows actually deleted. 
- *
- *  Note that a 'where' search psMetadata is constructed from each object and
- *  used to find rows to delete.
- *
- * @return A The number of rows removed or a negative value on error
- */
-
-long long skyCellMapDeleteRowObjects(
-    psDB            *dbh,               ///< Database handle
-    const psArray   *objects,           ///< Array of objects to delete
-    unsigned long long limit            ///< Maximum number of elements to delete 
-);
-/** Formats and prints an array of skyCellMapRow objects
- *
- * When mdcf is set the formated output is in psMetadataConfig
- * format, otherwise it is in a simple tabular format.
- *
- * @return true on success
- */
-
-bool skyCellMapPrintObjects(
-    FILE            *stream,            ///< a stream
-    psArray         *objects,           ///< An array of skyCellMapRow objects
-    bool            mdcf                ///< format as mdconfig or simple
-);
-/** Formats and prints an skyCellMapRow object
- *
- * When mdcf is set the formated output is in psMetadataConfig
- * format, otherwise it is in a simple tabular format.
- *
- * @return true on success
- */
-
-bool skyCellMapPrintObject(
-    FILE            *stream,            ///< a stream
-    skyCellMapRow *object,    ///< an skyCellMapRow object
-    bool            mdcf                ///< format as mdconfig or simple
-);
 
 /// @}
@@ -8523,3 +7674,3 @@
 #endif
 
-#endif // SKYCELLMAP_DB_H
+#endif // P4SCFILE_DB_H
