Index: trunk/ippdb/src/ippdb.h
===================================================================
--- trunk/ippdb/src/ippdb.h	(revision 9242)
+++ trunk/ippdb/src/ippdb.h	(revision 9301)
@@ -5399,4 +5399,267 @@
     bool            mdcf                ///< format as mdconfig or simple
 );
+/** p3ProcessedExpRow data structure
+ *
+ * Structure for representing a single row of p3ProcessedExp table data.
+ */
+
+typedef struct {
+    char            *exp_tag;
+    char            *uri;
+    char            *recipe;
+    psF64           bg;
+    psF64           bg_stdev;
+    psF64           bg_mean_stdev;
+    psF32           sigma_ra;
+    psF32           sigma_dec;
+    psS32           nastro;
+    char            *b1_uri;
+    char            *b2_uri;
+    psS32           p2_version;
+    psS32           p3_version;
+} p3ProcessedExpRow;
+
+/** Creates a new p3ProcessedExpRow object
+ *
+ *  @return A new p3ProcessedExpRow object or NULL on failure.
+ */
+
+p3ProcessedExpRow *p3ProcessedExpRowAlloc(
+    const char      *exp_tag,
+    const char      *uri,
+    const char      *recipe,
+    psF64           bg,
+    psF64           bg_stdev,
+    psF64           bg_mean_stdev,
+    psF32           sigma_ra,
+    psF32           sigma_dec,
+    psS32           nastro,
+    const char      *b1_uri,
+    const char      *b2_uri,
+    psS32           p2_version,
+    psS32           p3_version
+);
+
+/** Creates a new p3ProcessedExp table
+ *
+ * @return true on success
+ */
+
+bool p3ProcessedExpCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a p3ProcessedExp table
+ *
+ * @return true on success
+ */
+
+bool p3ProcessedExpDropTable(
+    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 p3ProcessedExpInsert(
+    psDB            *dbh,               ///< Database handle
+    const char      *exp_tag,
+    const char      *uri,
+    const char      *recipe,
+    psF64           bg,
+    psF64           bg_stdev,
+    psF64           bg_mean_stdev,
+    psF32           sigma_ra,
+    psF32           sigma_dec,
+    psS32           nastro,
+    const char      *b1_uri,
+    const char      *b2_uri,
+    psS32           p2_version,
+    psS32           p3_version
+);
+
+/** 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 p3ProcessedExpDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Removes the last row from the database and returns it
+ *
+ * @return true on success
+ */
+
+bool p3ProcessedExpPop(
+    psDB            *dbh,               ///< Database handle
+    char            **exp_tag,
+    char            **uri,
+    char            **recipe,
+    psF64           *bg,
+    psF64           *bg_stdev,
+    psF64           *bg_mean_stdev,
+    psF32           *sigma_ra,
+    psF32           *sigma_dec,
+    psS32           *nastro,
+    char            **b1_uri,
+    char            **b2_uri,
+    psS32           *p2_version,
+    psS32           *p3_version
+);
+
+/** Insert a single p3ProcessedExpRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool p3ProcessedExpInsertObject(
+    psDB            *dbh,               ///< Database handle
+    p3ProcessedExpRow *object             ///< p3ProcessedExpRow object
+);
+
+/** Insert an array of p3ProcessedExpRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool p3ProcessedExpInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of p3ProcessedExpRow objects
+);
+
+/** Removes the last row from the database and returns it
+ *
+ * @return A new p3ProcessedExpRow on success or NULL on failure.
+ */
+
+p3ProcessedExpRow *p3ProcessedExpPopObject(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Insert data from a binary FITS table p3ProcessedExpRow 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 p3ProcessedExpInsertFits(
+    psDB            *dbh,               ///< Database handle
+    const psFits    *fits               ///< psFits object
+);
+
+/** Removes the last limit row 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. 
+ *
+ * @return true on success
+ */
+
+bool p3ProcessedExpPopFits(
+    psDB            *dbh,               ///< Database handle
+    psFits          *fits,              ///< psFits object
+    unsigned long long limit            ///< Maximum number of elements to return
+);
+
+/** 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 p3ProcessedExpSelectRowsFits(
+    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 p3ProcessedExpRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *p3ProcessedExpMetadataFromObject(
+    const p3ProcessedExpRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A p3ProcessedExpRow pointer or NULL on error
+ */
+
+p3ProcessedExpRow *p3ProcessedExpObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as p3ProcessedExpRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *p3ProcessedExpSelectRowObjects(
+    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 p3ProcessedExp
+ *
+ *  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 p3ProcessedExpDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const p3ProcessedExpRow *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 p3ProcessedExpDeleteRowObjects(
+    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 p3ProcessedExpRow 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 p3ProcessedExpPrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of p3ProcessedExpRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
 /** detRunRow data structure
  *
