Changeset 18336 for trunk/ippTools/src/faketool.c
- Timestamp:
- Jun 26, 2008, 3:39:54 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/faketool.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/faketool.c
r18093 r18336 103 103 PS_ASSERT_PTR_NON_NULL(config, NULL); 104 104 105 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false);106 107 105 psMetadata *where = psMetadataAlloc(); 108 // convert exp_id into a psS64 109 if (exp_id) { 110 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) { 111 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 112 psFree(where); 113 return false; 114 } 115 } 116 106 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 117 107 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 118 108 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); … … 259 249 260 250 psMetadata *where = psMetadataAlloc(); 261 PXOPT_LOOKUP_STR(fake_id, config->args, "-fake_id", false, false); 262 // convert fake_id into a psS64 263 if (fake_id) { 264 if (!psMetadataAddS64(where, PS_LIST_TAIL, "fake_id", 0, "==", (psS64)atoll(fake_id))) { 265 psError(PS_ERR_UNKNOWN, false, "failed to add item fake_id"); 266 psFree(where); 267 return false; 268 } 269 } 270 271 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 272 // convert exp_id into a psS64 273 if (exp_id) { 274 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) { 275 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 276 psFree(where); 277 return false; 278 } 279 } 280 251 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 252 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 281 253 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 282 254 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); … … 406 378 } 407 379 408 if (!convertIdToStr(output)) {409 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");410 psFree(output);411 return false;412 }413 414 380 // negate simple so the default is true 415 381 if (!ippdbPrintMetadatas(stdout, output, "fakePendingExp", !simple)) { … … 433 399 434 400 psMetadata *where = psMetadataAlloc(); 435 PXOPT_LOOKUP_STR(fake_id, config->args, "-fake_id", false, false); 436 // convert fake_id into a psS64 437 if (fake_id) { 438 if (!psMetadataAddS64(where, PS_LIST_TAIL, "fakeRun.fake_id", 0, "==", (psS64)atoll(fake_id))) { 439 psError(PS_ERR_UNKNOWN, false, "failed to add item fake_id"); 440 psFree(where); 441 return false; 442 } 443 } 444 445 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 446 // convert exp_id into a psS64 447 if (exp_id) { 448 if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) { 449 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 450 psFree(where); 451 return false; 452 } 453 } 454 401 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 402 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 455 403 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); 456 404 PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.telescope", "=="); … … 495 443 } 496 444 497 if (!convertIdToStr(output)) {498 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");499 psFree(output);500 return false;501 }502 503 445 // negative simple so the default is true 504 446 if (!ippdbPrintMetadatas(stdout, output, "fakePendingImfile", !simple)) { … … 519 461 520 462 // fake_id, ext_tag, class_id are required 521 PXOPT_LOOKUP_S TR(fake_id, config->args, "-fake_id", true, false);522 PXOPT_LOOKUP_S TR(exp_id, config->args, "-exp_id", true, false);463 PXOPT_LOOKUP_S64(fake_id, config->args, "-fake_id", true, false); 464 PXOPT_LOOKUP_S64(exp_id, config->args, "-exp_id", true, false); 523 465 PXOPT_LOOKUP_STR(class_id, config->args, "-class_id", true, false); 524 466 … … 539 481 540 482 if (!fakeProcessedImfileInsert(config->dbh, 541 (psS64)atoll(fake_id),542 (psS64)atoll(exp_id),483 fake_id, 484 exp_id, 543 485 class_id, 544 486 uri, … … 589 531 590 532 psMetadata *where = psMetadataAlloc(); 591 PXOPT_LOOKUP_STR(fake_id, config->args, "-fake_id", false, false); 592 // convert fake_id into a psS64 593 if (fake_id) { 594 if (!psMetadataAddS64(where, PS_LIST_TAIL, "fakeRun.fake_id", 0, "==", (psS64)atoll(fake_id))) { 595 psError(PS_ERR_UNKNOWN, false, "failed to add item fake_id"); 596 psFree(where); 597 return false; 598 } 599 } 600 601 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 602 // convert exp_id into a psS64 603 if (exp_id) { 604 if (!psMetadataAddS64(where, PS_LIST_TAIL, "rawExp.exp_id", 0, "==", (psS64)atoll(exp_id))) { 605 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 606 psFree(where); 607 return false; 608 } 609 } 610 533 PXOPT_COPY_S64(config->args, where, "-fake_id", "fakeRun.fake_id", "=="); 534 PXOPT_COPY_S64(config->args, where, "-exp_id", "rawExp.exp_id", "=="); 611 535 PXOPT_COPY_STR(config->args, where, "-class_id", "rawImfile.class_id", "=="); 612 536 PXOPT_COPY_STR(config->args, where, "-inst", "rawExp.telescope", "=="); … … 659 583 } 660 584 661 if (!convertIdToStr(output)) {662 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");663 psFree(output);664 return false;665 }666 667 585 // negative simple so the default is true 668 586 if (!ippdbPrintMetadatas(stdout, output, "fakeProcessedImfile", !simple)) { … … 682 600 683 601 psMetadata *where = psMetadataAlloc(); 684 PXOPT_LOOKUP_STR(fake_id, config->args, "-fake_id", false, false); 685 // convert fake_id into a psS64 686 if (fake_id) { 687 if (!psMetadataAddS64(where, PS_LIST_TAIL, "fake_id", 0, "==", (psS64)atoll(fake_id))) { 688 psError(PS_ERR_UNKNOWN, false, "failed to add item fake_id"); 689 psFree(where); 690 return false; 691 } 692 } 693 694 PXOPT_LOOKUP_STR(exp_id, config->args, "-exp_id", false, false); 695 // convert exp_id into a psS64 696 if (exp_id) { 697 if (!psMetadataAddS64(where, PS_LIST_TAIL, "exp_id", 0, "==", (psS64)atoll(exp_id))) { 698 psError(PS_ERR_UNKNOWN, false, "failed to add item exp_id"); 699 psFree(where); 700 return false; 701 } 702 } 703 602 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 603 PXOPT_COPY_S64(config->args, where, "-exp_id", "exp_id", "=="); 704 604 PXOPT_COPY_STR(config->args, where, "-exp_name", "exp_name", "=="); 705 605 PXOPT_COPY_STR(config->args, where, "-inst", "camera", "=="); … … 778 678 779 679 psMetadata *where = psMetadataAlloc(); 780 PXOPT_LOOKUP_STR(fake_id, config->args, "-fake_id", false, false); 781 // convert fake_id into a psS64 782 if (fake_id) { 783 if (!psMetadataAddS64(where, PS_LIST_TAIL, "fake_id", 0, "==", (psS64)atoll(fake_id))) { 784 psError(PS_ERR_UNKNOWN, false, "failed to add item fake_id"); 785 psFree(where); 786 return false; 787 } 788 } 680 PXOPT_COPY_S64(config->args, where, "-fake_id", "fake_id", "=="); 789 681 PXOPT_COPY_STR(config->args, where, "-class_id", "class_id", "=="); 790 682 … … 866 758 } 867 759 868 if (!convertIdToStr(output)) {869 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");870 psFree(output);871 return false;872 }873 874 760 // negative simple so the default is true 875 761 if (!ippdbPrintMetadatas(stdout, output, "fakeMask", !simple)) { … … 937 823 psFree(output); 938 824 return true; 939 }940 941 if (!convertIdToStr(output)) {942 psError(PS_ERR_UNKNOWN, false, "failed to convert id fields into a strings");943 psFree(output);944 return false;945 825 } 946 826
Note:
See TracChangeset
for help on using the changeset viewer.
