Changeset 21308 for trunk/ippTools/src/warptool.c
- Timestamp:
- Feb 5, 2009, 9:35:41 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/warptool.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/warptool.c
r20973 r21308 681 681 { 682 682 unsigned int nFail = 0; 683 psMetadata *imfiles = psMetadataAlloc(); 683 684 psMetadata *skycells = psMetadataConfigRead(NULL, &nFail, mapfile, false); 684 685 if (!skycells) { … … 689 690 psError(PS_ERR_UNKNOWN, false, "there were %d errors parsing mapfile: %s", nFail, mapfile); 690 691 psFree(skycells); 692 psFree(imfiles); 691 693 return false; 692 694 } … … 699 701 psFree(iter); 700 702 psFree(skycells); 703 psFree(imfiles); 701 704 return false; 702 705 } … … 710 713 psFree(iter); 711 714 psFree(skycells); 712 return false; 713 } 715 psFree(imfiles); 716 return false; 717 } 718 psMetadataAddS64(imfiles, PS_LIST_TAIL, row->skycell_id, PS_META_REPLACE, "", row->warp_id); 714 719 715 720 if (!warpSkyCellMapInsertObject(config->dbh, row)) { … … 726 731 psFree(iter); 727 732 psFree(skycells); 733 psFree(imfiles); 728 734 return false; 729 735 } 730 736 731 737 psFree(row); 738 } 739 psFree(iter); 740 741 // create warp_skyfile_ids for the output skyfiles 742 psString query = "INSERT INTO warpImfile VALUES(%" PRId64 ", '%s', 0)"; 743 iter = psMetadataIteratorAlloc(imfiles, 0, NULL); 744 while ((item = psMetadataGetAndIncrement(iter))) { 745 psString skycell_id = item->name; 746 psS64 warp_id = item->data.S64; 747 748 if (!p_psDBRunQuery(config->dbh, query, warp_id, skycell_id)) { 749 psError(PS_ERR_UNKNOWN, false, "database error"); 750 return false; 751 } 732 752 } 733 753 psFree(iter); 734 754 psFree(skycells); 755 psFree(imfiles); 735 756 736 757 return true; … … 940 961 !accept, 941 962 code, 942 0, // warp_image_id943 963 0 // magic_ds_id 944 964 )) {
Note:
See TracChangeset
for help on using the changeset viewer.
