Index: trunk/ippTools/src/warptool.c
===================================================================
--- trunk/ippTools/src/warptool.c	(revision 11736)
+++ trunk/ippTools/src/warptool.c	(revision 11763)
@@ -34,7 +34,14 @@
 static bool updaterunMode(pxConfig *config);
 static bool addinputexpMode(pxConfig *config);
-static bool toscfileMode(pxConfig *config);
-static bool addscfileMode(pxConfig *config);
-static bool scfileMode(pxConfig *config);
+static bool expMode(pxConfig *config);
+static bool imfileMode(pxConfig *config);
+static bool tooverlapMode(pxConfig *config);
+static bool addoverlapMode(pxConfig *config);
+static bool scmapMode(pxConfig *config);
+static bool towarpedMode(pxConfig *config);
+static bool addwarpedMode(pxConfig *config);
+static bool warpedMode(pxConfig *config);
+
+#if 0
 static bool tostackedimfileMode(pxConfig *config);
 //static bool addstackedimfileMode(pxConfig *config);
@@ -43,4 +50,5 @@
 //static bool adddiffimfileMode(pxConfig *config);
 static bool diffimfileMode(pxConfig *config);
+#endif 
 
 static bool setp4RunState(pxConfig *config, const char *p4_id, const char *state);
@@ -64,5 +72,14 @@
         MODECASE(P4TOOL_MODE_UPDATERUN,         updaterunMode);
         MODECASE(P4TOOL_MODE_ADDINPUTEXP,       addinputexpMode);
-        MODECASE(P4TOOL_MODE_TOSCFILE,          toscfileMode);
+        MODECASE(P4TOOL_MODE_EXP,               expMode);
+        MODECASE(P4TOOL_MODE_IMFILE,            imfileMode);
+        MODECASE(P4TOOL_MODE_TOOVERLAP,         tooverlapMode);
+        MODECASE(P4TOOL_MODE_ADDOVERLAP,        addoverlapMode);
+        MODECASE(P4TOOL_MODE_SCMAP,             scmapMode);
+        MODECASE(P4TOOL_MODE_TOWARPED,          towarpedMode);
+        MODECASE(P4TOOL_MODE_ADDWARPED,         addwarpedMode);
+        MODECASE(P4TOOL_MODE_WARPED,            warpedMode);
+
+#if 0
         MODECASE(P4TOOL_MODE_ADDSCFILE,         addscfileMode);
         MODECASE(P4TOOL_MODE_SCFILE,            scfileMode);
@@ -73,4 +90,5 @@
 //        MODECASE(P4TOOL_MODE_ADDDIFFIMFILE,     adddiffimfileMode);
         MODECASE(P4TOOL_MODE_DIFFIMFILE,        diffimfileMode);
+#endif
         default:
             psAbort("invalid option (this should not happen)");
@@ -255,4 +273,6 @@
 
     // XXX need to validate the p4_id here
+    // XXX instead of validiting it here we should just use forgein key
+    // constrants
     if (!p4InputExpInsert(config->dbh, 
             (psS32)atoi(p4_id),
@@ -268,5 +288,20 @@
 }
 
-static bool toscfileMode(pxConfig *config)
+
+static bool expMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, NULL);
+    return true;
+}
+
+
+static bool imfileMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, NULL);
+    return true;
+}
+
+
+static bool tooverlapMode(pxConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(config, NULL);
@@ -274,12 +309,13 @@
     psString query = psStringCopy(
         " SELECT DISTINCT"
-        "   p4InputImfile.p4_id,"
+        "   p4InputExp.p4_id,"
         "   p2ProcessedImfile.*,"
         "   p4Run.workdir"
         " FROM p4Run"
-        " JOIN p4InputImfile"
+        " JOIN p4InputExp"
         "   USING(p4_id)"
-        " LEFT JOIN p4WarpedImfile"
-        "   USING(p4_id, exp_tag, p3_version, class_id)"
+        " LEFT JOIN p4Scfile"
+        "   ON p4Run.p4_id = p4Scfile.p4_id"
+        "   AND exp_tag, p3_version, class_id)"
         " JOIN p3ProcessedExp"
         "   ON p4InputImfile.exp_tag = p3ProcessedExp.exp_tag"
@@ -343,5 +379,27 @@
 }
 
-static bool addscfileMode(pxConfig *config)
+
+static bool addoverlapMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, NULL);
+    return true;
+}
+
+
+static bool scmapMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, NULL);
+    return true;
+}
+
+
+static bool towarpedMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, NULL);
+    return true;
+}
+
+
+static bool addwarpedMode(pxConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(config, NULL);
@@ -437,5 +495,5 @@
 }
 
-static bool scfileMode(pxConfig *config)
+static bool warpedMode(pxConfig *config)
 {
     PS_ASSERT_PTR_NON_NULL(config, NULL);
@@ -497,4 +555,5 @@
 }
 
+#if 0
 static bool tostackedimfileMode(pxConfig *config)
 {
@@ -562,5 +621,4 @@
 }
 
-#if 0
 static bool addstackedimfileMode(pxConfig *config)
 {
@@ -625,5 +683,4 @@
     return true;
 }
-#endif
 
 static bool stackedimfileMode(pxConfig *config)
@@ -760,5 +817,4 @@
 }
 
-#if 0
 static bool adddiffimfileMode(pxConfig *config)
 {
@@ -842,5 +898,4 @@
     return true;
 }
-#endif
 
 static bool diffimfileMode(pxConfig *config)
@@ -903,4 +958,5 @@
     return true;
 }
+#endif
 
 static bool setp4RunState(pxConfig *config, const char *p4_id, const char *state)
