Index: trunk/ippdb/src/ippdb.h
===================================================================
--- trunk/ippdb/src/ippdb.h	(revision 14451)
+++ trunk/ippdb/src/ippdb.h	(revision 14598)
@@ -20,5 +20,5 @@
 /*
  *
- * This file was generated by glueforge 1.03
+ * This file was generated by glueforge 1.01
  *
  * Do NOT directly edit this file.
@@ -769,5 +769,4 @@
     char            *class;
     char            *class_id;
-    psS64           exp_id;
 } pzPendingImfileRow;
 
@@ -782,6 +781,5 @@
     const char      *telescope,
     const char      *class,
-    const char      *class_id,
-    psS64           exp_id
+    const char      *class_id
 );
 
@@ -817,6 +815,5 @@
     const char      *telescope,
     const char      *class,
-    const char      *class_id,
-    psS64           exp_id
+    const char      *class_id
 );
 
@@ -1180,5 +1177,4 @@
     char            *class;
     char            *class_id;
-    psS64           exp_id;
     char            *uri;
 } pzDoneImfileRow;
@@ -1195,5 +1191,4 @@
     const char      *class,
     const char      *class_id,
-    psS64           exp_id,
     const char      *uri
 );
@@ -1231,5 +1226,4 @@
     const char      *class,
     const char      *class_id,
-    psS64           exp_id,
     const char      *uri
 );
@@ -4539,4 +4533,5 @@
     psF64           bg;
     psF64           bg_stdev;
+    psF64           pixel_fill;
     psS16           fault;
 } warpSkyfileRow;
@@ -4555,4 +4550,5 @@
     psF64           bg,
     psF64           bg_stdev,
+    psF64           pixel_fill,
     psS16           fault
 );
@@ -4592,4 +4588,5 @@
     psF64           bg,
     psF64           bg_stdev,
+    psF64           pixel_fill,
     psS16           fault
 );
@@ -8852,4 +8849,1018 @@
     bool            mdcf                ///< format as mdconfig or simple
 );
+/** magicRunRow data structure
+ *
+ * Structure for representing a single row of magicRun table data.
+ */
+
+typedef struct {
+    psS64           magic_id;
+    char            *state;
+    char            *workdir;
+    char            *workdir_state;
+    char            *label;
+    char            *dvodb;
+    psTime*         registered;
+} magicRunRow;
+
+/** Creates a new magicRunRow object
+ *
+ *  @return A new magicRunRow object or NULL on failure.
+ */
+
+magicRunRow *magicRunRowAlloc(
+    psS64           magic_id,
+    const char      *state,
+    const char      *workdir,
+    const char      *workdir_state,
+    const char      *label,
+    const char      *dvodb,
+    psTime*         registered
+);
+
+/** Creates a new magicRun table
+ *
+ * @return true on success
+ */
+
+bool magicRunCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a magicRun table
+ *
+ * @return true on success
+ */
+
+bool magicRunDropTable(
+    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 magicRunInsert(
+    psDB            *dbh,               ///< Database handle
+    psS64           magic_id,
+    const char      *state,
+    const char      *workdir,
+    const char      *workdir_state,
+    const char      *label,
+    const char      *dvodb,
+    psTime*         registered
+);
+
+/** 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 magicRunDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single magicRunRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicRunInsertObject(
+    psDB            *dbh,               ///< Database handle
+    magicRunRow     *object             ///< magicRunRow object
+);
+
+/** Insert an array of magicRunRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicRunInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of magicRunRow objects
+);
+
+/** Insert data from a binary FITS table magicRunRow 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 magicRunInsertFits(
+    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 magicRunSelectRowsFits(
+    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 magicRunRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *magicRunMetadataFromObject(
+    const magicRunRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A magicRunRow pointer or NULL on error
+ */
+
+magicRunRow *magicRunObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as magicRunRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *magicRunSelectRowObjects(
+    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 magicRun
+ *
+ *  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 magicRunDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const magicRunRow *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 magicRunDeleteRowObjects(
+    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 magicRunRow 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 magicRunPrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of magicRunRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an magicRunRow 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 magicRunPrintObject(
+    FILE            *stream,            ///< a stream
+    magicRunRow *object,    ///< an magicRunRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** magicInputSkyfileRow data structure
+ *
+ * Structure for representing a single row of magicInputSkyfile table data.
+ */
+
+typedef struct {
+    psS64           magic_id;
+    psS64           diff_id;
+    psS32           node;
+} magicInputSkyfileRow;
+
+/** Creates a new magicInputSkyfileRow object
+ *
+ *  @return A new magicInputSkyfileRow object or NULL on failure.
+ */
+
+magicInputSkyfileRow *magicInputSkyfileRowAlloc(
+    psS64           magic_id,
+    psS64           diff_id,
+    psS32           node
+);
+
+/** Creates a new magicInputSkyfile table
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a magicInputSkyfile table
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileDropTable(
+    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 magicInputSkyfileInsert(
+    psDB            *dbh,               ///< Database handle
+    psS64           magic_id,
+    psS64           diff_id,
+    psS32           node
+);
+
+/** 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 magicInputSkyfileDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single magicInputSkyfileRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileInsertObject(
+    psDB            *dbh,               ///< Database handle
+    magicInputSkyfileRow *object             ///< magicInputSkyfileRow object
+);
+
+/** Insert an array of magicInputSkyfileRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicInputSkyfileInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of magicInputSkyfileRow objects
+);
+
+/** Insert data from a binary FITS table magicInputSkyfileRow 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 magicInputSkyfileInsertFits(
+    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 magicInputSkyfileSelectRowsFits(
+    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 magicInputSkyfileRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *magicInputSkyfileMetadataFromObject(
+    const magicInputSkyfileRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A magicInputSkyfileRow pointer or NULL on error
+ */
+
+magicInputSkyfileRow *magicInputSkyfileObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as magicInputSkyfileRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *magicInputSkyfileSelectRowObjects(
+    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 magicInputSkyfile
+ *
+ *  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 magicInputSkyfileDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const magicInputSkyfileRow *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 magicInputSkyfileDeleteRowObjects(
+    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 magicInputSkyfileRow 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 magicInputSkyfilePrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of magicInputSkyfileRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an magicInputSkyfileRow 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 magicInputSkyfilePrintObject(
+    FILE            *stream,            ///< a stream
+    magicInputSkyfileRow *object,    ///< an magicInputSkyfileRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** magicTreeRow data structure
+ *
+ * Structure for representing a single row of magicTree table data.
+ */
+
+typedef struct {
+    psS64           magic_id;
+    char            *node;
+    char            *dep;
+} magicTreeRow;
+
+/** Creates a new magicTreeRow object
+ *
+ *  @return A new magicTreeRow object or NULL on failure.
+ */
+
+magicTreeRow *magicTreeRowAlloc(
+    psS64           magic_id,
+    const char      *node,
+    const char      *dep
+);
+
+/** Creates a new magicTree table
+ *
+ * @return true on success
+ */
+
+bool magicTreeCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a magicTree table
+ *
+ * @return true on success
+ */
+
+bool magicTreeDropTable(
+    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 magicTreeInsert(
+    psDB            *dbh,               ///< Database handle
+    psS64           magic_id,
+    const char      *node,
+    const char      *dep
+);
+
+/** 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 magicTreeDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single magicTreeRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicTreeInsertObject(
+    psDB            *dbh,               ///< Database handle
+    magicTreeRow    *object             ///< magicTreeRow object
+);
+
+/** Insert an array of magicTreeRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicTreeInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of magicTreeRow objects
+);
+
+/** Insert data from a binary FITS table magicTreeRow 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 magicTreeInsertFits(
+    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 magicTreeSelectRowsFits(
+    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 magicTreeRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *magicTreeMetadataFromObject(
+    const magicTreeRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A magicTreeRow pointer or NULL on error
+ */
+
+magicTreeRow *magicTreeObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as magicTreeRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *magicTreeSelectRowObjects(
+    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 magicTree
+ *
+ *  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 magicTreeDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const magicTreeRow *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 magicTreeDeleteRowObjects(
+    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 magicTreeRow 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 magicTreePrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of magicTreeRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an magicTreeRow 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 magicTreePrintObject(
+    FILE            *stream,            ///< a stream
+    magicTreeRow *object,    ///< an magicTreeRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** magicNodeResultRow data structure
+ *
+ * Structure for representing a single row of magicNodeResult table data.
+ */
+
+typedef struct {
+    psS64           magic_id;
+    char            *node;
+    char            *uri;
+} magicNodeResultRow;
+
+/** Creates a new magicNodeResultRow object
+ *
+ *  @return A new magicNodeResultRow object or NULL on failure.
+ */
+
+magicNodeResultRow *magicNodeResultRowAlloc(
+    psS64           magic_id,
+    const char      *node,
+    const char      *uri
+);
+
+/** Creates a new magicNodeResult table
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a magicNodeResult table
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultDropTable(
+    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 magicNodeResultInsert(
+    psDB            *dbh,               ///< Database handle
+    psS64           magic_id,
+    const char      *node,
+    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 magicNodeResultDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single magicNodeResultRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultInsertObject(
+    psDB            *dbh,               ///< Database handle
+    magicNodeResultRow *object             ///< magicNodeResultRow object
+);
+
+/** Insert an array of magicNodeResultRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicNodeResultInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of magicNodeResultRow objects
+);
+
+/** Insert data from a binary FITS table magicNodeResultRow 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 magicNodeResultInsertFits(
+    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 magicNodeResultSelectRowsFits(
+    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 magicNodeResultRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *magicNodeResultMetadataFromObject(
+    const magicNodeResultRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A magicNodeResultRow pointer or NULL on error
+ */
+
+magicNodeResultRow *magicNodeResultObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as magicNodeResultRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *magicNodeResultSelectRowObjects(
+    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 magicNodeResult
+ *
+ *  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 magicNodeResultDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const magicNodeResultRow *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 magicNodeResultDeleteRowObjects(
+    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 magicNodeResultRow 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 magicNodeResultPrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of magicNodeResultRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an magicNodeResultRow 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 magicNodeResultPrintObject(
+    FILE            *stream,            ///< a stream
+    magicNodeResultRow *object,    ///< an magicNodeResultRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** magicMaskRow data structure
+ *
+ * Structure for representing a single row of magicMask table data.
+ */
+
+typedef struct {
+    psS64           magic_id;
+    char            *uri;
+} magicMaskRow;
+
+/** Creates a new magicMaskRow object
+ *
+ *  @return A new magicMaskRow object or NULL on failure.
+ */
+
+magicMaskRow *magicMaskRowAlloc(
+    psS64           magic_id,
+    const char      *uri
+);
+
+/** Creates a new magicMask table
+ *
+ * @return true on success
+ */
+
+bool magicMaskCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a magicMask table
+ *
+ * @return true on success
+ */
+
+bool magicMaskDropTable(
+    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 magicMaskInsert(
+    psDB            *dbh,               ///< Database handle
+    psS64           magic_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 magicMaskDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single magicMaskRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicMaskInsertObject(
+    psDB            *dbh,               ///< Database handle
+    magicMaskRow    *object             ///< magicMaskRow object
+);
+
+/** Insert an array of magicMaskRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool magicMaskInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of magicMaskRow objects
+);
+
+/** Insert data from a binary FITS table magicMaskRow 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 magicMaskInsertFits(
+    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 magicMaskSelectRowsFits(
+    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 magicMaskRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *magicMaskMetadataFromObject(
+    const magicMaskRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A magicMaskRow pointer or NULL on error
+ */
+
+magicMaskRow *magicMaskObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as magicMaskRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *magicMaskSelectRowObjects(
+    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 magicMask
+ *
+ *  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 magicMaskDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const magicMaskRow *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 magicMaskDeleteRowObjects(
+    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 magicMaskRow 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 magicMaskPrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of magicMaskRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
+/** Formats and prints an magicMaskRow 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 magicMaskPrintObject(
+    FILE            *stream,            ///< a stream
+    magicMaskRow *object,    ///< an magicMaskRow object
+    bool            mdcf                ///< format as mdconfig or simple
+);
 
 /// @}
@@ -8859,3 +9870,3 @@
 #endif
 
-#endif // DETREGISTEREDIMFILE_DB_H
+#endif // MAGICMASK_DB_H
