Changeset 12788 for trunk/ippTools/src/dettool.c
- Timestamp:
- Apr 10, 2007, 2:28:53 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettool.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettool.c
r12785 r12788 26 26 #include <stdlib.h> 27 27 #include <stdint.h> 28 #include <inttypes.h> 28 29 29 30 #include <ippdb.h> … … 6405 6406 } 6406 6407 6408 // print the new detRun 6409 psS64 det_id = psDBLastInsertID(config->dbh); 6410 psArray *detRuns = NULL; 6411 { 6412 psMetadata *where = psMetadataAlloc(); 6413 psMetadataAddS32(where, PS_LIST_TAIL, "det_id", 0, "==", det_id); 6414 detRuns = psDBSelectRows(config->dbh, "detRun", where, 0); 6415 psFree(where); 6416 } 6417 if (!detRuns) { 6418 psError(PS_ERR_UNKNOWN, false, "can't find the detRun we just created"); 6419 return false; 6420 } 6421 // sanity check results 6422 if (psArrayLength(detRuns) != 1) { 6423 psAbort("found more then one detRun matching det_id %" PRId64 "(this should not happen)", det_id); 6424 return false; 6425 } 6426 6427 if (!convertIdToStr(detRuns)) { 6428 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings"); 6429 psFree(detRuns); 6430 return false; 6431 } 6432 6433 bool simple = false; 6434 { 6435 bool status = false; 6436 simple = psMetadataLookupBool(&status, config->args, "-simple"); 6437 if (!status) { 6438 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -simple"); 6439 return false; 6440 } 6441 } 6442 6443 // negative simple so the default is true 6444 if (!ippdbPrintMetadatas(stdout, detRuns, "detRun", !simple)) { 6445 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 6446 psFree(detRuns); 6447 return false; 6448 } 6449 psFree(detRuns); 6450 6407 6451 return true; 6408 6452 }
Note:
See TracChangeset
for help on using the changeset viewer.
