- Timestamp:
- Mar 9, 2009, 3:41:26 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090215
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
ippTools/src/chiptool.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090215
- Property svn:mergeinfo changed
/branches/eam_branches/eam_branch_20090303 (added) merged: 23158,23175-23181,23202-23210,23220-23225 /trunk merged: 23211-23219,23226-23238
- Property svn:mergeinfo changed
-
branches/cnb_branches/cnb_branch_20090215/ippTools/src/chiptool.c
r23199 r23239 52 52 static bool runMode(pxConfig *config); 53 53 static bool tocleanedimfileMode(pxConfig *config); 54 static bool tocleanedimfile_from_scrubbedMode(pxConfig *config);54 // static bool tocleanedimfile_from_scrubbedMode(pxConfig *config); 55 55 static bool tofullimfileMode(pxConfig *config); 56 56 static bool topurgedimfileMode(pxConfig *config); 57 57 static bool exportrunMode(pxConfig *config); 58 58 static bool importrunMode(pxConfig *config); 59 static bool change_imfile_data_state(pxConfig *config, psString data_state, psString run_state); 59 60 60 61 # define MODECASE(caseName, func) \ … … 92 93 MODECASE(CHIPTOOL_MODE_RUN, runMode); 93 94 MODECASE(CHIPTOOL_MODE_TOCLEANEDIMFILE, tocleanedimfileMode); 94 MODECASE(CHIPTOOL_MODE_TOCLEANEDIMFILE_FROM_SCRUBBED, tocleanedimfile_from_scrubbedMode);95 // MODECASE(CHIPTOOL_MODE_TOCLEANEDIMFILE_FROM_SCRUBBED, tocleanedimfile_from_scrubbedMode); 95 96 MODECASE(CHIPTOOL_MODE_TOFULLIMFILE, tofullimfileMode); 96 97 MODECASE(CHIPTOOL_MODE_TOPURGEDIMFILE, topurgedimfileMode); … … 651 652 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 652 653 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 653 PXOPT_LOOKUP_S16(code, config->args, "-code", true, false); 654 655 if (!pxSetFaultCode(config->dbh, "chipProcessedImfile", where, code)) { 654 PXOPT_LOOKUP_STR(state, config->args, "-set_state", false, false); 655 PXOPT_LOOKUP_S16(code, config->args, "-code", false, false); 656 657 if (state && code) { 658 psError(PS_ERR_UNKNOWN, true, "only one of -set_state and -code may be supplied"); 659 return false; 660 } 661 662 if (state) { 663 // make sure that the state string is valid 664 if (!pxIsValidState(state)) { 665 psError(PXTOOLS_ERR_DATA, false, "%s is not a valid state", state); 666 return false; 667 } 668 if (!change_imfile_data_state(config, state, "unknown")) { 656 669 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 657 670 return false; 658 } 659 psFree(where); 660 661 return true; 671 } 672 return true; 673 } 674 675 if (code) { 676 if (!pxSetFaultCode(config->dbh, "chipProcessedImfile", where, code)) { 677 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 678 return false; 679 } 680 psFree(where); 681 return true; 682 } 683 684 psError(PS_ERR_UNKNOWN, true, "one of -set_state or -code must be supplied"); 685 return false; 662 686 } 663 687 … … 1195 1219 // shared code for the modes -tocleanedimfile -tofullimfile -topurgedimfile 1196 1220 1221 // XXX EAM : this function was enforcing only certain transitions with the SQL. However, 1222 // this is getting fairly messy now that we have added a few additional target and 1223 // destination states. I'm disabling these restrictions for now; is there are better way 1224 // to enforce the allowed state transitions? 1225 1197 1226 static bool change_imfile_data_state(pxConfig *config, psString data_state, psString run_state) 1198 1227 { … … 1210 1239 } 1211 1240 1241 // XXX this feature is disabled (run_state is ignored) 1212 1242 // note only updates if chipRun.state = run_state 1213 if (!p_psDBRunQueryF(config->dbh, query, data_state, chip_id, class_id, run_state)) { 1243 1244 if (!p_psDBRunQueryF(config->dbh, query, data_state, chip_id, class_id)) { 1214 1245 psError(PS_ERR_UNKNOWN, false, "database error"); 1215 1246 // rollback … … 1246 1277 { 1247 1278 return change_imfile_data_state(config, "cleaned", "goto_cleaned"); 1248 }1249 static bool tocleanedimfile_from_scrubbedMode(pxConfig *config)1250 {1251 return change_imfile_data_state(config, "cleaned", "goto_scrubbed");1252 1279 } 1253 1280 static bool tofullimfileMode(pxConfig *config)
Note:
See TracChangeset
for help on using the changeset viewer.
