Changeset 25511 for trunk/ippTools/src
- Timestamp:
- Sep 23, 2009, 1:45:03 PM (17 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 added
- 3 edited
-
Makefile.am (modified) (3 diffs)
-
magictool.c (modified) (3 diffs)
-
pxmagic.c (added)
-
pxmagic.h (added)
-
pxtools.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/Makefile.am
r25299 r25511 24 24 pubtool 25 25 26 27 bin_SCRIPTS = \28 fakemagic29 30 26 pkginclude_HEADERS = \ 31 27 pxadd.h \ … … 36 32 pxdata.h \ 37 33 pxfake.h \ 34 pxmagic.h \ 38 35 pxregister.h \ 39 36 pxtag.h \ … … 79 76 pxfake.c \ 80 77 pxfault.c \ 78 pxmagic.c \ 81 79 pxregister.c \ 82 80 pxtag.c \ -
trunk/ippTools/src/magictool.c
r24949 r25511 1393 1393 } 1394 1394 1395 static bool censorStage(pxConfig *config, psString stage, psString whereClause)1396 {1397 psString queryFile = NULL;1398 psStringAppend(&queryFile, "magictool_censor_%s.sql", stage);1399 psString query = pxDataGet(queryFile);1400 if (!query) {1401 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement from %s", queryFile);1402 psFree(queryFile);1403 if (!psDBRollback(config->dbh)) {1404 psError(PS_ERR_UNKNOWN, false, "database error");1405 }1406 return false;1407 }1408 psFree(queryFile);1409 1410 psStringAppend(&query, " WHERE %s", whereClause);1411 1412 if (!p_psDBRunQuery(config->dbh, query)) {1413 psError(PS_ERR_UNKNOWN, false, "database error");1414 psFree(query);1415 if (!psDBRollback(config->dbh)) {1416 psError(PS_ERR_UNKNOWN, false, "database error");1417 }1418 return false;1419 }1420 psFree(query);1421 1422 return true;1423 }1424 1425 1395 static bool censorrunMode(pxConfig *config) 1426 1396 { 1427 1397 PS_ASSERT_PTR_NON_NULL(config, false); 1428 1429 psError(PS_ERR_PROGRAMMING, true, "-censorrun mode not ready yet");1430 return false;1431 1398 1432 1399 psMetadata *where = psMetadataAlloc(); … … 1434 1401 // at least one of these required 1435 1402 PXOPT_COPY_S64(config->args, where, "-magic_id", "magic_id", "=="); 1436 PXOPT_COPY_S64(config->args, where, "-exp_id", " exp_id", "==");1403 PXOPT_COPY_S64(config->args, where, "-exp_id", "magicRun.exp_id", "=="); 1437 1404 1438 1405 if (!psListLength(where->list)) { … … 1470 1437 // Now queue any destreaked files to be re-verted 1471 1438 1472 // note: on failure censorStage issues the rollback1473 if (! censorStage(config, "raw", whereClause)) {1439 // note: on failure magicRestoreStage issues the rollback 1440 if (!magicRestoreStage(config, "raw", whereClause, "goto_censored")) { 1474 1441 psFree(whereClause); 1475 1442 return false; 1476 1443 } 1477 if (! censorStage(config, "chip", whereClause)) {1444 if (!magicRestoreStage(config, "chip", whereClause, "goto_censored")) { 1478 1445 psFree(whereClause); 1479 1446 return false; 1480 1447 } 1481 if (! censorStage(config, "camera", whereClause)) {1448 if (!magicRestoreStage(config, "camera", whereClause, "goto_censored")) { 1482 1449 psFree(whereClause); 1483 1450 return false; 1484 1451 } 1485 if (! censorStage(config, "warp", whereClause)) {1452 if (!magicRestoreStage(config, "warp", whereClause, "goto_censored")) { 1486 1453 psFree(whereClause); 1487 1454 return false; 1488 1455 } 1489 if (! censorStage(config, "diff", whereClause)) {1456 if (!magicRestoreStage(config, "diff", whereClause, "goto_censored")) { 1490 1457 psFree(whereClause); 1491 1458 return false; -
trunk/ippTools/src/pxtools.h
r25299 r25511 46 46 #include "pxtag.h" 47 47 #include "pxtree.h" 48 #include "pxmagic.h" 48 49 49 50 # define MAX_ROWS 10e9
Note:
See TracChangeset
for help on using the changeset viewer.
