Changeset 7822
- Timestamp:
- Jul 5, 2006, 3:00:06 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/dettoolConfig.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/dettoolConfig.c
r7819 r7822 416 416 // setup search criterion 417 417 #define addWhereStr(name) \ 418 { \ 419 psString str = NULL; \ 420 bool status = false; \ 418 421 if ((str = psMetadataLookupStr(&status, config->args, "-" #name))) { \ 419 422 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, #name, 0, "==", str)) {\ … … 421 424 goto FAIL; \ 422 425 } \ 423 } 426 } \ 427 } 424 428 425 429 // generate SQL where claus 426 430 config->where = psMetadataAlloc(); 427 431 428 {429 psString str = NULL;430 int n = 0;431 bool status = false;432 bool boolean = false;433 434 432 addWhereStr(det_id); 435 if ((n = psMetadataLookupS32(&status, config->args, "-iteration"))) { 436 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "iteration", 0, "==", n)) { 437 psError(PS_ERR_UNKNOWN, false, "failed to add item iteration"); 438 goto FAIL; 433 { 434 int n = 0; 435 bool status = false; 436 if ((n = psMetadataLookupS32(&status, config->args, "-iteration"))) { 437 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "iteration", 0, "==", n)) { 438 psError(PS_ERR_UNKNOWN, false, "failed to add item iteration"); 439 goto FAIL; 440 } 439 441 } 440 442 } … … 443 445 addWhereStr(class_id); 444 446 // convert '-inst' to 'camera' 445 if ((str = psMetadataLookupStr(&status, config->args, "-inst"))) { 446 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) { 447 psError(PS_ERR_UNKNOWN, false, "failed to add item camera"); 448 goto FAIL; 447 { 448 psString str = NULL; 449 bool status = false; 450 if ((str = psMetadataLookupStr(&status, config->args, "-inst"))) { 451 if (!psMetadataAddStr(config->where, PS_LIST_TAIL, "camera", 0, "==", str)) { 452 psError(PS_ERR_UNKNOWN, false, "failed to add item camera"); 453 goto FAIL; 454 } 449 455 } 450 456 } 451 457 addWhereStr(telescope); 452 458 addWhereStr(exp_type); 453 if ((n = psMetadataLookupS32(&status, config->args, "-imfiles"))) { 454 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "imfiles", 0, "==", n)) { 455 psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles"); 456 goto FAIL; 459 { 460 int n = 0; 461 bool status = false; 462 if ((n = psMetadataLookupS32(&status, config->args, "-imfiles"))) { 463 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "imfiles", 0, "==", n)) { 464 psError(PS_ERR_UNKNOWN, false, "failed to add item imfiles"); 465 goto FAIL; 466 } 457 467 } 458 468 } … … 460 470 addWhereStr(stats); 461 471 addWhereStr(recipe); 462 if ((n = psMetadataLookupS32(&status, config->args, "-p1_version"))) { 463 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "p1_version", 0, "==", n)) { 464 psError(PS_ERR_UNKNOWN, false, "failed to add item p1_version"); 465 goto FAIL; 472 { 473 int n = 0; 474 bool status = false; 475 if ((n = psMetadataLookupS32(&status, config->args, "-p1_version"))) { 476 if (!psMetadataAddS32(config->where, PS_LIST_TAIL, "p1_version", 0, "==", n)) { 477 psError(PS_ERR_UNKNOWN, false, "failed to add item p1_version"); 478 goto FAIL; 479 } 466 480 } 467 481 } 468 if ((boolean = psMetadataLookupBool(&status, config->args, "-accept"))) { 469 if (!psMetadataAddBool(config->where, PS_LIST_TAIL, "accept", 0, "==", boolean)) { 470 psError(PS_ERR_UNKNOWN, false, "failed to add item accept"); 471 goto FAIL; 482 { 483 bool boolean = false; 484 bool status = false; 485 486 if ((boolean = psMetadataLookupBool(&status, config->args, "-accept"))) { 487 if (!psMetadataAddBool(config->where, PS_LIST_TAIL, "accept", 0, "==", boolean)) { 488 psError(PS_ERR_UNKNOWN, false, "failed to add item accept"); 489 goto FAIL; 490 } 472 491 } 473 492 } 474 }475 493 476 494 if (config->where->list->n < 1) {
Note:
See TracChangeset
for help on using the changeset viewer.
