Changeset 6670 for trunk/ippTools/src/pztool.c
- Timestamp:
- Mar 21, 2006, 5:17:21 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pztool.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pztool.c
r6669 r6670 7 7 static bool copydoneMode(pxConfig *config); 8 8 bool summitExpPrint(FILE *stream, summitExpRow *summitExp); 9 psArray *pzsearchPendingImfiles(pxConfig *config); 10 bool pzsearchFlushPendingExp(pxConfig *config); 9 11 10 12 int main(int argc, char **argv) … … 89 91 PS_ASSERT_PTR_NON_NULL(config, false); 90 92 91 psArray * new= pzPendingFrameSearch(config);92 if (! new) {93 psArray *pending = pzPendingFrameSearch(config); 94 if (!pending) { 93 95 psError(PS_ERR_UNKNOWN, false, "no pzPendingFrames found"); 94 96 return false; 95 97 } 96 97 bool status = pzPendingFramePrint(stdout, config, new); 98 if (!status) { 98 if (!pzPendingFramePrint(stdout, config, pending)) { 99 99 psError(PS_ERR_UNKNOWN, false, "pzPendingFramePrint() failed"); 100 100 return false; … … 107 107 { 108 108 PS_ASSERT_PTR_NON_NULL(config, false); 109 110 // we don't have to operate on complete frames here as it's ok to start 111 // downloading the imfiles before the exp has been registered 112 psArray *pending = pzsearchPendingImfiles(config); 113 if (!pending) { 114 psError(PS_ERR_UNKNOWN, false, "no pzPendingImfiles found"); 115 return false; 116 } 117 118 // XXX start transaction 119 120 for (long i = 0; i < pending->n; i++) { 121 pzPendingImfileRow *pendingImfile = pending->data[i]; 122 newImfileRow *newImfile = newImfileRowAlloc( 123 pendingImfile->exp_id, 124 pendingImfile->class, 125 pendingImfile->class_id, 126 // XXX get this from the CLI 127 pendingImfile->uri 128 ); 129 130 if (!newImfileInsertObject(config->dbh, newImfile)) { 131 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 132 return false; 133 } 134 } 135 136 if (pzPendingImfileDeleteRowObjects(config->dbh, pending, MAX_ROWS) 137 < 0) { 138 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 139 return false; 140 } 141 142 // XXX commit transaction 143 144 // check for completed exps 145 if (!pzsearchFlushPendingExp(config)) { 146 psError(PS_ERR_UNKNOWN, false, "pzsearchFlushPendingExp() failed"); 147 return false; 148 } 149 150 return true; 109 151 } 110 152 … … 124 166 return true; 125 167 } 168 169 psArray *pzsearchPendingImfiles(pxConfig *config) 170 { 171 PS_ASSERT_PTR_NON_NULL(config, NULL); 172 173 psArray *imfiles = pzPendingImfileSelectRowObjects(config->dbh, 174 config->where, MAX_ROWS); 175 if (!imfiles) { 176 psError(PS_ERR_UNKNOWN, false, "no pzPendingImfile rows found"); 177 178 return NULL; 179 } 180 181 return imfiles; 182 } 183 184 bool pzsearchFlushPendingExp(pxConfig *config) 185 { 186 PS_ASSERT_PTR_NON_NULL(config, false); 187 188 return true; 189 }
Note:
See TracChangeset
for help on using the changeset viewer.
