Changeset 6662 for trunk/ippTools/src/pztool.c
- Timestamp:
- Mar 21, 2006, 1:40:01 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pztool.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pztool.c
r6659 r6662 6 6 static bool pendingMode(pxConfig *config); 7 7 static bool copydoneMode(pxConfig *config); 8 bool summitExpPrint(FILE *stream, summitExpRow *summitExp); 8 9 9 10 int main(int argc, char **argv) … … 43 44 { 44 45 PS_ASSERT_PTR_NON_NULL(config, false); 46 47 psArray *summit = summitExpSelectRowObjects(config->dbh, 48 config->where, MAX_ROWS); 49 if (!summit) { 50 psError(PS_ERR_UNKNOWN, false, "no summitExp rows found"); \ 51 return false; 52 } 53 54 psArray *new = newExpSelectRowObjects(config->dbh, 55 config->where, MAX_ROWS); 56 if (!new) { 57 psError(PS_ERR_UNKNOWN, false, "no newExp rows found"); \ 58 } 59 60 if (new) { 61 for (long i = 0; i < summit->n; i++) { 62 summitExpRow *summitExp = summit->data[i]; 63 for (long j = 0; j < summit->n; j++) { 64 newExpRow *newExp = new->data[j]; 65 if (strcmp(summitExp->exp_id, newExp->exp_id) == 0) { 66 psArrayRemove(summit, summitExp); 67 // dec the counter as the array just got shorter 68 //and we don't want to skip elemnts 69 i--; 70 break; 71 } 72 } 73 } 74 psFree(new); 75 } 76 77 for (long i = 0; i < summit->n; i++) { 78 if (!summitExpPrint(stdout, summit->data[i])) { 79 psError(PS_ERR_UNKNOWN, false,"summitExpPrint() failed"); 80 return false; 81 } 82 } 83 84 return true; 45 85 } 46 86 … … 54 94 PS_ASSERT_PTR_NON_NULL(config, false); 55 95 } 96 97 bool summitExpPrint(FILE *stream, summitExpRow *summitExp) 98 { 99 PS_ASSERT_PTR_NON_NULL(stream, false); 100 PS_ASSERT_PTR_NON_NULL(summitExp, false); 101 102 fprintf(stream, "%s %s %s %s %s\n", 103 summitExp->exp_id, 104 summitExp->camera, 105 summitExp->telescope, 106 summitExp->exp_type, 107 summitExp->uri 108 ); 109 110 return true; 111 }
Note:
See TracChangeset
for help on using the changeset viewer.
