Changeset 14108 for trunk/ippTools/src/difftool.c
- Timestamp:
- Jul 10, 2007, 2:18:03 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/difftool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/difftool.c
r13691 r14108 38 38 static bool adddiffskyfileMode(pxConfig *config); 39 39 static bool diffskyfileMode(pxConfig *config); 40 static bool revertdiffskyfileMode(pxConfig *config); 40 41 41 42 static bool setdiffRunState(pxConfig *config, const char *warp_id, const char *state); … … 66 67 MODECASE(DIFFTOOL_MODE_ADDDIFFSKYFILE, adddiffskyfileMode); 67 68 MODECASE(DIFFTOOL_MODE_DIFFSKYFILE, diffskyfileMode); 69 MODECASE(DIFFTOOL_MODE_REVERTDIFFSKYFILE, revertdiffskyfileMode); 68 70 default: 69 71 psAbort("invalid option (this should not happen)"); … … 521 523 } 522 524 525 // default values 526 psS16 code = psMetadataLookupS16(&status, config->args, "-code"); 527 if (!status) { 528 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code"); 529 return false; 530 } 531 523 532 if (!psDBTransaction(config->dbh)) { 524 533 psError(PS_ERR_UNKNOWN, false, "database error"); … … 531 540 path_base, 532 541 bg, 533 bg_stdev 542 bg_stdev, 543 code 534 544 )) { 535 545 if (!psDBRollback(config->dbh)) { … … 645 655 } 646 656 657 658 static bool revertdiffskyfileMode(pxConfig *config) 659 { 660 PS_ASSERT_PTR_NON_NULL(config, false); 661 662 psString query = pxDataGet("difftool_revertdiffskyfile.sql"); 663 if (!query) { 664 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 665 return false; 666 } 667 668 if (config->where) { 669 psString whereClause = psDBGenerateWhereConditionSQL(config->where, "diffSkyfile"); 670 psStringAppend(&query, " AND %s", whereClause); 671 psFree(whereClause); 672 } 673 674 if (!p_psDBRunQuery(config->dbh, query)) { 675 psError(PS_ERR_UNKNOWN, false, "database error"); 676 psFree(query); 677 return false; 678 } 679 psFree(query); 680 681 if (psDBAffectedRows(config->dbh) < 1) { 682 psError(PS_ERR_UNKNOWN, false, "should have affected atleast 1 row"); 683 return false; 684 } 685 686 return true; 687 } 688 689 647 690 static bool setdiffRunState(pxConfig *config, const char *diff_id, const char *state) 648 691 {
Note:
See TracChangeset
for help on using the changeset viewer.
