Changeset 14102 for trunk/ippTools/src/warptool.c
- Timestamp:
- Jul 10, 2007, 11:49:55 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/warptool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/warptool.c
r13821 r14102 42 42 static bool addwarpedMode(pxConfig *config); 43 43 static bool warpedMode(pxConfig *config); 44 static bool revertwarpedMode(pxConfig *config); 44 45 45 46 static bool parseAndInsertSkyCellMap(pxConfig *config, const char *mapfile); … … 77 78 MODECASE(WARPTOOL_MODE_ADDWARPED, addwarpedMode); 78 79 MODECASE(WARPTOOL_MODE_WARPED, warpedMode); 80 MODECASE(WARPTOOL_MODE_REVERTWARPED, revertwarpedMode); 79 81 default: 80 82 psAbort("invalid option (this should not happen)"); … … 884 886 } 885 887 888 // default values 889 psS16 code = psMetadataLookupS16(&status, config->args, "-code"); 890 if (!status) { 891 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code"); 892 return false; 893 } 894 886 895 // we don't want to insert the last skyfile in a run but then not mark the 887 896 // run as 'stop' … … 899 908 path_base, 900 909 bg, 901 bg_stdev 910 bg_stdev, 911 code 902 912 )) { 903 913 if (!psDBRollback(config->dbh)) { … … 1119 1129 1120 1130 1131 static bool revertwarpedMode(pxConfig *config) 1132 { 1133 PS_ASSERT_PTR_NON_NULL(config, false); 1134 1135 psString query = pxDataGet("warpool_revertwarped.sql"); 1136 if (!query) { 1137 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 1138 return false; 1139 } 1140 1141 if (config->where) { 1142 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "warpSkyfile"); 1143 psStringAppend(&query, " AND %s", whereClause); 1144 psFree(whereClause); 1145 } 1146 1147 if (!p_psDBRunQuery(config->dbh, query)) { 1148 psError(PS_ERR_UNKNOWN, false, "database error"); 1149 psFree(query); 1150 return false; 1151 } 1152 psFree(query); 1153 1154 if (psDBAffectedRows(config->dbh) < 1) { 1155 psError(PS_ERR_UNKNOWN, false, "should have affected atleast 1 row"); 1156 return false; 1157 } 1158 1159 return true; 1160 } 1161 1162 1121 1163 static bool setwarpRunState(pxConfig *config, const char *warp_id, const char *state) 1122 1164 {
Note:
See TracChangeset
for help on using the changeset viewer.
