Index: trunk/ippTools/src/warptool.c
===================================================================
--- trunk/ippTools/src/warptool.c	(revision 11791)
+++ trunk/ippTools/src/warptool.c	(revision 11810)
@@ -43,13 +43,4 @@
 static bool warpedMode(pxConfig *config);
 
-#if 0
-static bool tostackedimfileMode(pxConfig *config);
-//static bool addstackedimfileMode(pxConfig *config);
-static bool stackedimfileMode(pxConfig *config);
-static bool todiffimfileMode(pxConfig *config);
-//static bool adddiffimfileMode(pxConfig *config);
-static bool diffimfileMode(pxConfig *config);
-#endif 
-
 static bool parseAndInsertSkyCellMap(pxConfig *config, const char *mapfile);
 static bool setp4RunState(pxConfig *config, const char *p4_id, const char *state);
@@ -81,15 +72,4 @@
         MODECASE(P4TOOL_MODE_ADDWARPED,         addwarpedMode);
         MODECASE(P4TOOL_MODE_WARPED,            warpedMode);
-
-#if 0
-        MODECASE(P4TOOL_MODE_ADDSCFILE,         addscfileMode);
-        MODECASE(P4TOOL_MODE_SCFILE,            scfileMode);
-        MODECASE(P4TOOL_MODE_TOSTACKEDIMFILE,   tostackedimfileMode);
-//        MODECASE(P4TOOL_MODE_ADDSTACKEDIMFILE,  addstackedimfileMode);
-        MODECASE(P4TOOL_MODE_STACKEDIMFILE,     stackedimfileMode);
-        MODECASE(P4TOOL_MODE_TODIFFIMFILE,      todiffimfileMode);
-//        MODECASE(P4TOOL_MODE_ADDDIFFIMFILE,     adddiffimfileMode);
-        MODECASE(P4TOOL_MODE_DIFFIMFILE,        diffimfileMode);
-#endif
         default:
             psAbort("invalid option (this should not happen)");
@@ -944,4 +924,5 @@
 }
 
+
 static bool warpedMode(pxConfig *config)
 {
@@ -1030,408 +1011,4 @@
 }
 
-#if 0
-static bool tostackedimfileMode(pxConfig *config)
-{
-    PS_ASSERT_PTR_NON_NULL(config, NULL);
-
-    psString query = psStringCopy(
-        " SELECT DISTINCT"
-        "   p4WarpedImfile.*,"
-        "   p4Run.workdir"
-        " FROM p4Run"
-        " JOIN p4WarpedImfile"
-        "   USING(p4_id)"
-        " LEFT JOIN p4StackedImfile"
-        "   USING(p4_id, class_id)"
-        " WHERE"
-        "   p4Run.state = 'run'"
-        "   AND p4StackedImfile.p4_id IS NULL"
-        "   AND p4Stackedmfile.class_id IS NULL"
-    );
-
-    if (config->where) {
-        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p4WarpedImfile");
-        psStringAppend(&query, " AND %s", whereClause);
-        psFree(whereClause);
-    }
-
-    if (!p_psDBRunQuery(config->dbh, query)) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        psFree(query);
-        return false;
-    }
-    psFree(query);
-
-    psArray *output = p_psDBFetchResult(config->dbh);
-    if (!output) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        return false;
-    }
-    if (!psArrayLength(output)) {
-        psError(PS_ERR_UNKNOWN, false, "no p4WarpedImfile rows found");
-        psFree(output);
-        return true;
-    }
-
-    bool simple = false;
-    {
-        bool status = false;
-        simple = psMetadataLookupBool(&status, config->args, "-simple");
-        if (!status) {
-            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");
-            return false;
-        }
-    }
-
-    // negative simple so the default is true
-    if (!ippdbPrintMetadatas(stdout, output, "p4WarpedImfile", !simple)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to print array");
-        psFree(output);
-        return false;
-    }
-
-    psFree(output);
-
-    return true;
-}
-
-static bool addstackedimfileMode(pxConfig *config)
-{
-    PS_ASSERT_PTR_NON_NULL(config, NULL);
-
-    bool status = false;
-    psString p4_id = psMetadataLookupStr(&status, config->args, "-p4_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -p4_id");
-        return false;
-    }
-    if (!p4_id) {
-        psError(PS_ERR_UNKNOWN, true, "-p4_id is required");
-        return false;
-    }
-
-    psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class_id");
-        return false;
-    }
-    if (!class_id) {
-        psError(PS_ERR_UNKNOWN, true, "-class_id is required");
-        return false;
-    }
-
-    psString uri = psMetadataLookupStr(&status, config->args, "-uri");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri");
-        return false;
-    }
-    if (!uri) {
-        psError(PS_ERR_UNKNOWN, true, "-uri is required");
-        return false;
-    }
-
-    // optional
-    psString b1_uri = psMetadataLookupStr(&status, config->args, "-b1_uri");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -b1_uri");
-        return false;
-    }
-
-    psString b2_uri = psMetadataLookupStr(&status, config->args, "-b2_uri");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -b2_uri");
-        return false;
-    }
-
-    // XXX need to validate that this coresponds to an p4WarpedImfile
-    if (!p4StackedImfileInsert(config->dbh, 
-            (psS32)atoi(p4_id),
-            class_id,
-            uri,
-            b1_uri,
-            b2_uri
-        )) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        return false;
-    }
-
-    return true;
-}
-
-static bool stackedimfileMode(pxConfig *config)
-{
-    PS_ASSERT_PTR_NON_NULL(config, NULL);
-
-    psString query = psStringCopy(
-        " SELECT DISTINCT"
-        "   p4StackedImfile.*"
-        " FROM p4Run"
-        " JOIN p4StackedImfile"
-        "   USING(p4_id)"
-        " WHERE"
-        "   p4Run.state = 'run'"
-    );
-
-    if (config->where) {
-        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p4StackedImfile");
-        psStringAppend(&query, " AND %s", whereClause);
-        psFree(whereClause);
-    }
-
-    if (!p_psDBRunQuery(config->dbh, query)) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        psFree(query);
-        return false;
-    }
-    psFree(query);
-
-    psArray *output = p_psDBFetchResult(config->dbh);
-    if (!output) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        return false;
-    }
-    if (!psArrayLength(output)) {
-        psError(PS_ERR_UNKNOWN, false, "no p4StackedImfile rows found");
-        psFree(output);
-        return true;
-    }
-
-    bool simple = false;
-    {
-        bool status = false;
-        simple = psMetadataLookupBool(&status, config->args, "-simple");
-        if (!status) {
-            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");
-            return false;
-        }
-    }
-
-    // negative simple so the default is true
-    if (!ippdbPrintMetadatas(stdout, output, "p4StackedImfile", !simple)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to print array");
-        psFree(output);
-        return false;
-    }
-
-    psFree(output);
-
-    return true;
-}
-
-static bool todiffimfileMode(pxConfig *config)
-{
-    PS_ASSERT_PTR_NON_NULL(config, NULL);
-
-    psString query = psStringCopy(
-        " SELECT DISTINCT"
-        "   p4StackedImfile.*,"
-        "   p4WarpedImfile.uri as warped_uri,"
-        "   p4Run.workdir"
-        " FROM p4Run"
-        " JOIN p4StackedImfile"
-        "   USING(p4_id)"
-        " JOIN p4WarpedImfile"
-        "   USING(p4_id, class_id)"
-        " LEFT JOIN p4DiffImfile"
-        "   ON p4WarpedImfile.p4_id = p4DiffImfile.p4_id"
-        "   AND p4WarpedImfile.exp_tag = p4DiffImfile.exp_tag"
-        "   AND p4WarpedImfile.p3_version = p4DiffImfile.p3_version"
-        "   AND p4WarpedImfile.class_id = p4DiffImfile.class_id"
-        " WHERE"
-        "   p4Run.state = 'run'"
-        "   AND p4DiffImfile.p4_id IS NULL"
-        "   AND p4DiffImfile.exp_tag IS NULL"
-        "   AND p4DiffImfile.p3_version IS NULL"
-        "   AND p4DiffImfile.class_id IS NULL"
-    );
-
-    if (config->where) {
-        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p4StackedImfile");
-        psStringAppend(&query, " AND %s", whereClause);
-        psFree(whereClause);
-    }
-
-    if (!p_psDBRunQuery(config->dbh, query)) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        psFree(query);
-        return false;
-    }
-    psFree(query);
-
-    psArray *output = p_psDBFetchResult(config->dbh);
-    if (!output) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        return false;
-    }
-    if (!psArrayLength(output)) {
-        psError(PS_ERR_UNKNOWN, false, "no p4StackedImfile rows found");
-        psFree(output);
-        return true;
-    }
-
-    bool simple = false;
-    {
-        bool status = false;
-        simple = psMetadataLookupBool(&status, config->args, "-simple");
-        if (!status) {
-            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");
-            return false;
-        }
-    }
-
-    // negative simple so the default is true
-    if (!ippdbPrintMetadatas(stdout, output, "p4StackedImfile", !simple)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to print array");
-        psFree(output);
-        return false;
-    }
-
-    psFree(output);
-
-    return true;
-}
-
-static bool adddiffimfileMode(pxConfig *config)
-{
-    PS_ASSERT_PTR_NON_NULL(config, NULL);
-
-    bool status = false;
-    psString p4_id = psMetadataLookupStr(&status, config->args, "-p4_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -p4_id");
-        return false;
-    }
-    if (!p4_id) {
-        psError(PS_ERR_UNKNOWN, true, "-p4_id is required");
-        return false;
-    }
-
-    psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");
-        return false;
-    }
-    if (!exp_tag) {
-        psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");
-        return false;
-    }
-
-    psString class_id = psMetadataLookupStr(&status, config->args, "-class_id");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -class_id");
-        return false;
-    }
-    if (!class_id) {
-        psError(PS_ERR_UNKNOWN, true, "-class_id is required");
-        return false;
-    }
-
-    psString uri = psMetadataLookupStr(&status, config->args, "-uri");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -uri");
-        return false;
-    }
-    if (!uri) {
-        psError(PS_ERR_UNKNOWN, true, "-uri is required");
-        return false;
-    }
-
-    // defaults to 0
-    psS32 p3_version = psMetadataLookupS32(&status, config->args, "-p3_version");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -p3_version");
-        return false;
-    }
-
-    // optional
-    psString b1_uri = psMetadataLookupStr(&status, config->args, "-b1_uri");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -b1_uri");
-        return false;
-    }
-
-    psString b2_uri = psMetadataLookupStr(&status, config->args, "-b2_uri");
-    if (!status) {
-        psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -b2_uri");
-        return false;
-    }
-
-    // XXX need to validate that this coresponds to an p4InputImfile
-    if (!p4DiffImfileInsert(config->dbh, 
-            (psS32)atoi(p4_id),
-            exp_tag,
-            p3_version,
-            class_id,
-            uri,
-            b1_uri,
-            b2_uri
-        )) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        return false;
-    }
-
-    return true;
-}
-
-static bool diffimfileMode(pxConfig *config)
-{
-    PS_ASSERT_PTR_NON_NULL(config, NULL);
-
-    psString query = psStringCopy(
-        " SELECT DISTINCT"
-        "   p4DiffImfile.*"
-        " FROM p4Run"
-        " JOIN p4DiffImfile"
-        "   USING(p4_id)"
-        " WHERE"
-        "   p4Run.state = 'run'"
-    );
-
-    if (config->where) {
-        psString whereClause = psDBGenerateWhereConditionSQL(config->where, "p4DiffImfile");
-        psStringAppend(&query, " AND %s", whereClause);
-        psFree(whereClause);
-    }
-
-    if (!p_psDBRunQuery(config->dbh, query)) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        psFree(query);
-        return false;
-    }
-    psFree(query);
-
-    psArray *output = p_psDBFetchResult(config->dbh);
-    if (!output) {
-        psError(PS_ERR_UNKNOWN, false, "database error");
-        return false;
-    }
-    if (!psArrayLength(output)) {
-        psError(PS_ERR_UNKNOWN, false, "no p4DiffImfile rows found");
-        psFree(output);
-        return true;
-    }
-
-    bool simple = false;
-    {
-        bool status = false;
-        simple = psMetadataLookupBool(&status, config->args, "-simple");
-        if (!status) {
-            psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple");
-            return false;
-        }
-    }
-
-    // negative simple so the default is true
-    if (!ippdbPrintMetadatas(stdout, output, "p4DiffImfile", !simple)) {
-        psError(PS_ERR_UNKNOWN, false, "failed to print array");
-        psFree(output);
-        return false;
-    }
-
-    psFree(output);
-
-    return true;
-}
-#endif
 
 static bool setp4RunState(pxConfig *config, const char *p4_id, const char *state)
@@ -1461,4 +1038,5 @@
     return true;
 }
+
 
 static bool isValidMode(pxConfig *config, const char *mode)
