Changeset 6877 for trunk/ippTools/src/pztool.c
- Timestamp:
- Apr 17, 2006, 3:06:05 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/pztool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/pztool.c
r6670 r6877 6 6 static bool pendingMode(pxConfig *config); 7 7 static bool copydoneMode(pxConfig *config); 8 bool summitExpPrint(FILE *stream, summitExpRow *summitExp); 9 psArray *pzsearchPendingImfiles(pxConfig *config); 10 bool pzsearchFlushPendingExp(pxConfig *config); 8 static bool summitExpPrint(FILE *stream, summitExpRow *summitExp); 9 static psArray *pzsearchPendingExp(pxConfig *config); 10 static psArray *pzsearchPendingImfiles(pxConfig *config); 11 static bool pzsearchFlushPendingExp(pxConfig *config); 11 12 12 13 int main(int argc, char **argv) … … 151 152 } 152 153 153 bool summitExpPrint(FILE *stream, summitExpRow *summitExp)154 static bool summitExpPrint(FILE *stream, summitExpRow *summitExp) 154 155 { 155 156 PS_ASSERT_PTR_NON_NULL(stream, false); … … 167 168 } 168 169 169 psArray *pzsearchPendingImfiles(pxConfig *config) 170 static psArray *pzsearchPendingExp(pxConfig *config) 171 { 172 PS_ASSERT_PTR_NON_NULL(config, NULL); 173 174 psArray *exps = pzPendingExpSelectRowObjects(config->dbh, 175 config->where, MAX_ROWS); 176 if (!exps) { 177 psError(PS_ERR_UNKNOWN, false, "no pzPendingExp rows found"); 178 return NULL; 179 } 180 181 return exps; 182 } 183 184 static psArray *pzsearchPendingImfiles(pxConfig *config) 170 185 { 171 186 PS_ASSERT_PTR_NON_NULL(config, NULL); … … 175 190 if (!imfiles) { 176 191 psError(PS_ERR_UNKNOWN, false, "no pzPendingImfile rows found"); 177 178 192 return NULL; 179 193 } … … 182 196 } 183 197 184 bool pzsearchFlushPendingExp(pxConfig *config) 185 { 186 PS_ASSERT_PTR_NON_NULL(config, false); 187 188 return true; 189 } 198 static bool pzsearchFlushPendingExp(pxConfig *config) 199 { 200 PS_ASSERT_PTR_NON_NULL(config, false); 201 202 psArray *pending = pzsearchPendingExp(config); 203 if (!pending) { 204 psError(PS_ERR_UNKNOWN, false, "no pzPendingExps found"); 205 return false; 206 } 207 208 for (long i = 0; i < pending->n; i++) { 209 pzPendingExpRow *pendingExp = pending->data[i]; 210 211 psMetadata *where = psMetadataAlloc(); 212 psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", 0, "==", 213 pendingExp->exp_id); 214 psArray *pendingImfiles = pzPendingImfileSelectRowObjects(config->dbh, where, MAX_ROWS); 215 psFree(where); 216 217 if (!pendingImfiles) { 218 // exp has no coresponding imfiles 219 220 // XXX start transaction 221 222 psArray *nukeMe = psArrayAlloc(1); 223 nukeMe->n = 0; 224 psArrayAdd(nukeMe, 0, pendingExp); 225 bool status = pzPendingExpDeleteRowObjects(config->dbh, nukeMe, MAX_ROWS); 226 psFree(nukeMe); 227 if (!status) { 228 psError(PS_ERR_UNKNOWN, false, "dbh access failed"); 229 // XXX rollback transaction 230 return false; 231 } 232 233 // XXX commit transaction 234 } 235 } 236 237 return true; 238 }
Note:
See TracChangeset
for help on using the changeset viewer.
