Index: trunk/ippTools/src/camtool.c
===================================================================
--- trunk/ippTools/src/camtool.c	(revision 11997)
+++ trunk/ippTools/src/camtool.c	(revision 12024)
@@ -96,21 +96,21 @@
     psString query = psStringCopy(
             "SELECT"
-            "   p3PendingExp.*,"
+            "   camPendingExp.*,"
             "   rawExp.camera,"
             "   rawExp.workdir"
-            " FROM p3PendingExp"
+            " FROM camPendingExp"
             " JOIN rawExp"
             "   USING(exp_tag)"
-            " LEFT JOIN p3ProcessedExp"
+            " LEFT JOIN camProcessedExp"
             "   USING(exp_tag)"
-            " LEFT JOIN p3Mask"
-            "   ON p3PendingExp.label = p3Mask.label"
+            " LEFT JOIN camMask"
+            "   ON camPendingExp.label = camMask.label"
             " WHERE"
-            "   p3ProcessedExp.exp_tag IS NULL"
-            "   AND p3Mask.label IS NULL"
+            "   camProcessedExp.exp_tag IS NULL"
+            "   AND camMask.label IS NULL"
     );
 
     if (config->where) {
-        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p3PendingExp");
+        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "camPendingExp");
         psStringAppend(&query, " AND %s", whereClause);
         psFree(whereClause);
@@ -138,5 +138,5 @@
     if (!psArrayLength(output)) {
         // XXX check psError here
-        psError(PS_ERR_UNKNOWN, false, "no p3PendingExp rows found");
+        psError(PS_ERR_UNKNOWN, false, "no camPendingExp rows found");
         psFree(output);
         return true;
@@ -154,5 +154,5 @@
 
     // negate simple so the default is true
-    if (!ippdbPrintMetadatas(stdout, output, "p3PendingExp", !simple)) {
+    if (!ippdbPrintMetadatas(stdout, output, "camPendingExp", !simple)) {
         psError(PS_ERR_UNKNOWN, false, "failed to print array");
         psFree(output);
@@ -171,23 +171,23 @@
     psString query = psStringCopy(
             "SELECT"
-            "   p2ProcessedImfile.*,"
+            "   chipProcessedImfile.*,"
             "   rawExp.camera,"   
             "   rawExp.workdir"   
-            " FROM p3PendingExp"
-            " JOIN p2ProcessedImfile"
-            "   USING(exp_tag, p2_version)"
+            " FROM camPendingExp"
+            " JOIN chipProcessedImfile"
+            "   USING(exp_tag, chip_version)"
             " JOIN rawExp"
             "   USING(exp_tag)"
-            " LEFT JOIN p3ProcessedExp"
+            " LEFT JOIN camProcessedExp"
             "   USING(exp_tag)"
-            " LEFT JOIN p3Mask"
-            "   ON p3PendingExp.label = p3Mask.label"
+            " LEFT JOIN camMask"
+            "   ON camPendingExp.label = camMask.label"
             " WHERE"
-            "   p3ProcessedExp.exp_tag IS NULL"
-            "   AND p3Mask.label IS NULL"
+            "   camProcessedExp.exp_tag IS NULL"
+            "   AND camMask.label IS NULL"
     );
 
     if (config->where) {
-        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p2ProcessedImfile");
+        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "chipProcessedImfile");
         psStringAppend(&query, " AND %s", whereClause);
         psFree(whereClause);
@@ -208,5 +208,5 @@
     if (!psArrayLength(output)) {
         // XXX check psError here
-        psError(PS_ERR_UNKNOWN, false, "no pending p2ProcessedImfile rows found");
+        psError(PS_ERR_UNKNOWN, false, "no pending chipProcessedImfile rows found");
         psFree(output);
         return true;
@@ -224,5 +224,5 @@
 
     // negate simple so the default is true
-    if (!ippdbPrintMetadatas(stdout, output, "p2ProcessedImfile", !simple)) {
+    if (!ippdbPrintMetadatas(stdout, output, "chipProcessedImfile", !simple)) {
         psError(PS_ERR_UNKNOWN, false, "failed to print array");
         psFree(output);
@@ -362,11 +362,11 @@
 
     psString query = psStringCopy(
-        "SELECT p3PendingExp.*"
-        " FROM p3PendingExp"
-        " LEFT JOIN p3ProcessedExp"
+        "SELECT camPendingExp.*"
+        " FROM camPendingExp"
+        " LEFT JOIN camProcessedExp"
         "   USING(exp_tag)"
         " WHERE"
-        "   p3ProcessedExp.exp_tag IS NULL"
-        "   AND p3PendingExp.exp_tag = '%s'"
+        "   camProcessedExp.exp_tag IS NULL"
+        "   AND camPendingExp.exp_tag = '%s'"
     );
 
@@ -384,5 +384,5 @@
     }
     if (!psArrayLength(output)) {
-        psError(PS_ERR_UNKNOWN, false, "no p3PendingExp rows found");
+        psError(PS_ERR_UNKNOWN, false, "no camPendingExp rows found");
         psFree(output);
         return true;
@@ -390,5 +390,5 @@
 
     // start a transaction so we don't end up with an exp_tag is both
-    // p3PendingExp & p3ProcessedExp
+    // camPendingExp & camProcessedExp
     if (!psDBTransaction(config->dbh)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
@@ -397,11 +397,11 @@
     }
 
-    p3PendingExpRow *pendingRow = p3PendingExpObjectFromMetadata(output->data[0]);
+    camPendingExpRow *pendingRow = camPendingExpObjectFromMetadata(output->data[0]);
     psFree(output);
-    // create a new p3ProcessedImfile object
-    p3ProcessedExpRow *row = p3ProcessedExpRowAlloc(
+    // create a new camProcessedImfile object
+    camProcessedExpRow *row = camProcessedExpRowAlloc(
         exp_tag,
-        pendingRow->p3_version,
-        pendingRow->p2_version,
+        pendingRow->cam_version,
+        pendingRow->chip_version,
         pendingRow->label,
         uri,
@@ -422,6 +422,6 @@
     );
 
-    // insert the new row into the p3ProcessedImfile table
-    if (!p3ProcessedExpInsertObject(config->dbh, row)) {
+    // insert the new row into the camProcessedImfile table
+    if (!camProcessedExpInsertObject(config->dbh, row)) {
         // rollback
         if (!psDBRollback(config->dbh)) {
@@ -435,6 +435,6 @@
     psFree(row);
 
-    // delete the p3PendingExp row from the database
-    if (!p3PendingExpDeleteObject(config->dbh, pendingRow)) {
+    // delete the camPendingExp row from the database
+    if (!camPendingExpDeleteObject(config->dbh, pendingRow)) {
         // rollback
         if (!psDBRollback(config->dbh)) {
@@ -448,5 +448,5 @@
     psFree(pendingRow);
 
-    // point of no return for p3PendingExp -> p3ProcessedExp
+    // point of no return for camPendingExp -> camProcessedExp
     if (!psDBCommit(config->dbh)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
@@ -476,12 +476,12 @@
     psString query = psStringCopy(
             "SELECT"
-            "   p3ProcessedExp.*,"
+            "   camProcessedExp.*,"
             "   rawExp.camera,"
             "   rawExp.workdir"
-            " FROM p3ProcessedExp"
+            " FROM camProcessedExp"
             " JOIN rawExp"
             "   USING(exp_tag)"   
             " WHERE"
-            "   p3ProcessedExp.exp_tag IS NOT NULL"
+            "   camProcessedExp.exp_tag IS NOT NULL"
     );
 
@@ -494,8 +494,8 @@
     if (faulted) {
         // list only faulted rows
-        psStringAppend(&query, " %s", "AND p3ProcessedExp.fault != 0");
+        psStringAppend(&query, " %s", "AND camProcessedExp.fault != 0");
     } else {
         // don't list faulted rows
-        psStringAppend(&query, " %s", "AND p3ProcessedExp.fault = 0");
+        psStringAppend(&query, " %s", "AND camProcessedExp.fault = 0");
     }
 
@@ -521,5 +521,5 @@
     if (!psArrayLength(output)) {
         // XXX check psError here
-        psError(PS_ERR_UNKNOWN, false, "no p3ProcessedExp rows found");
+        psError(PS_ERR_UNKNOWN, false, "no camProcessedExp rows found");
         psFree(output);
         return true;
@@ -537,5 +537,5 @@
 
     // negate simple so the default is true
-    if (!ippdbPrintMetadatas(stdout, output, "p3ProcessedExp", !simple)) {
+    if (!ippdbPrintMetadatas(stdout, output, "camProcessedExp", !simple)) {
         psError(PS_ERR_UNKNOWN, false, "failed to print array");
         psFree(output);
@@ -560,5 +560,5 @@
     }
 
-    if (!pxSetFaultCode(config->dbh, "p3ProcessedExp", config->where, code)) {
+    if (!pxSetFaultCode(config->dbh, "camProcessedExp", config->where, code)) {
         psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
         return false;
@@ -584,5 +584,5 @@
     }
 
-    if (!p3MaskInsert(config->dbh, label)) {
+    if (!camMaskInsert(config->dbh, label)) {
         psError(PS_ERR_UNKNOWN, false, "database error");
         return false;
@@ -596,5 +596,5 @@
     PS_ASSERT_PTR_NON_NULL(config, false);
 
-    psString query = psStringCopy("SELECT * FROM p3Mask");
+    psString query = psStringCopy("SELECT * FROM camMask");
 
     if (!p_psDBRunQuery(config->dbh, query)) {
@@ -612,5 +612,5 @@
     if (!psArrayLength(output)) {
         // XXX check psError here
-        psError(PS_ERR_UNKNOWN, false, "no p3Mask rows found");
+        psError(PS_ERR_UNKNOWN, false, "no camMask rows found");
         psFree(output);
         return true;
@@ -628,5 +628,5 @@
 
     // negative simple so the default is true
-    if (!ippdbPrintMetadatas(stdout, output, "p3Mask", !simple)) {
+    if (!ippdbPrintMetadatas(stdout, output, "camMask", !simple)) {
         psError(PS_ERR_UNKNOWN, false, "failed to print array");
         psFree(output);
@@ -654,5 +654,5 @@
     }
 
-    char *query = "DELETE FROM p3Mask WHERE label = '%s'";
+    char *query = "DELETE FROM camMask WHERE label = '%s'";
 
     if (!p_psDBRunQuery(config->dbh, query, label)) {
