Index: trunk/ippdb/src/ippdb.h
===================================================================
--- trunk/ippdb/src/ippdb.h	(revision 10060)
+++ trunk/ippdb/src/ippdb.h	(revision 10110)
@@ -125,4 +125,186 @@
 );
 
+/** expTagCounterRow data structure
+ *
+ * Structure for representing a single row of expTagCounter table data.
+ */
+
+typedef struct {
+    psU64           counter;
+} expTagCounterRow;
+
+/** Creates a new expTagCounterRow object
+ *
+ *  @return A new expTagCounterRow object or NULL on failure.
+ */
+
+expTagCounterRow *expTagCounterRowAlloc(
+    psU64           counter
+);
+
+/** Creates a new expTagCounter table
+ *
+ * @return true on success
+ */
+
+bool expTagCounterCreateTable(
+    psDB            *dbh                ///< Database handle
+);
+
+/** Deletes a expTagCounter table
+ *
+ * @return true on success
+ */
+
+bool expTagCounterDropTable(
+    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 expTagCounterInsert(
+    psDB            *dbh,               ///< Database handle
+    psU64           counter
+);
+
+/** 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 expTagCounterDelete(
+    psDB            *dbh,               ///< Database handle
+    const psMetadata *where,            ///< Row match criteria
+    unsigned long long limit            ///< Maximum number of elements to delete 
+);
+
+/** Insert a single expTagCounterRow object into a table
+ *
+ * This function constructs and inserts a single row based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool expTagCounterInsertObject(
+    psDB            *dbh,               ///< Database handle
+    expTagCounterRow *object             ///< expTagCounterRow object
+);
+
+/** Insert an array of expTagCounterRow object into a table
+ *
+ * This function constructs and inserts multiple rows based on it's parameters.
+ *
+ * @return true on success
+ */
+
+bool expTagCounterInsertObjects(
+    psDB            *dbh,               ///< Database handle
+    psArray         *objects            ///< array of expTagCounterRow objects
+);
+
+/** Insert data from a binary FITS table expTagCounterRow 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 expTagCounterInsertFits(
+    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 expTagCounterSelectRowsFits(
+    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 expTagCounterRow into an equivalent psMetadata
+ *
+ * @return A psMetadata pointer or NULL on error
+ */
+
+psMetadata *expTagCounterMetadataFromObject(
+    const expTagCounterRow *object             ///< fooRow to convert into a psMetadata
+);
+
+/** Convert a psMetadata into an equivalent fooRow
+ *
+ * @return A expTagCounterRow pointer or NULL on error
+ */
+
+expTagCounterRow *expTagCounterObjectFromMetadata(
+    psMetadata      *md                 ///< psMetadata to convert into a fooRow
+);
+/** Selects up to limit rows from the database and returns as expTagCounterRow objects in a psArray
+ *
+ *  See psDBSelectRows() for documentation on the format of where.
+ *
+ * @return A psArray pointer or NULL on error
+ */
+
+psArray *expTagCounterSelectRowObjects(
+    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 expTagCounter
+ *
+ *  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 expTagCounterDeleteObject(
+    psDB            *dbh,               ///< Database handle
+    const expTagCounterRow *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 expTagCounterDeleteRowObjects(
+    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 expTagCounterRow 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 expTagCounterPrintObjects(
+    FILE            *stream,            ///< a stream
+    psArray         *objects,           ///< An array of expTagCounterRow objects
+    bool            mdcf                ///< format as mdconfig or simple
+);
 /** summitExpRow data structure
  *
@@ -1307,5 +1489,5 @@
 
 typedef struct {
-    psU64           exp_tag;
+    char            *exp_tag;
     char            *exp_id;
     char            *camera;
@@ -1322,5 +1504,5 @@
 
 newExpRow *newExpRowAlloc(
-    psU64           exp_tag,
+    const char      *exp_tag,
     const char      *exp_id,
     const char      *camera,
@@ -1358,5 +1540,5 @@
 bool newExpInsert(
     psDB            *dbh,               ///< Database handle
-    psU64           exp_tag,
+    const char      *exp_tag,
     const char      *exp_id,
     const char      *camera,
