Changeset 18643
- Timestamp:
- Jul 21, 2008, 12:12:59 PM (18 years ago)
- Location:
- branches/eam_branch_20080719/ippTools
- Files:
-
- 3 deleted
- 16 edited
-
share/pxadmin_create_tables.sql (modified) (1 diff)
-
src/Makefile.am (modified) (2 diffs)
-
src/dettool.c (modified) (8 diffs)
-
src/dettool.h (modified) (9 diffs)
-
src/dettool_normalizedexp.c (modified) (1 diff)
-
src/dettool_normalizedimfile.c (modified) (1 diff)
-
src/dettool_normalizedstat.c (modified) (1 diff)
-
src/dettool_processedexp.c (modified) (1 diff)
-
src/dettool_processedimfile.c (modified) (1 diff)
-
src/dettool_residexp.c (modified) (1 diff)
-
src/dettool_residimfile.c (modified) (1 diff)
-
src/dettool_stack.c (modified) (1 diff)
-
src/difftool.c (modified) (3 diffs)
-
src/difftool.h (modified) (1 diff)
-
src/guidetool.c (deleted)
-
src/guidetool.h (deleted)
-
src/guidetoolConfig.c (deleted)
-
src/stacktool.c (modified) (3 diffs)
-
src/stacktool.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20080719/ippTools/share/pxadmin_create_tables.sql
r18622 r18643 642 642 643 643 CREATE TABLE detResidExp (det_id BIGINT, iteration INT, exp_id BIGINT, recipe VARCHAR(64), bg DOUBLE, bg_stdev DOUBLE, bg_mean_stdev DOUBLE, bg_skewness DOUBLE, bg_kurtosis DOUBLE, bin_stdev DOUBLE, fringe_0 DOUBLE, fringe_1 DOUBLE, fringe_2 DOUBLE, fringe_resid_0 DOUBLE, fringe_resid_1 DOUBLE, fringe_resid_2 DOUBLE, user_1 DOUBLE, user_2 DOUBLE, user_3 DOUBLE, user_4 DOUBLE, user_5 DOUBLE, path_base VARCHAR(255), accept TINYINT, fault SMALLINT NOT NULL, PRIMARY KEY(det_id, iteration, exp_id), KEY(fault), INDEX(det_id, iteration), FOREIGN KEY (det_id, iteration, exp_id) REFERENCES detInputExp(det_id, iteration, exp_id), FOREIGN KEY (det_id, iteration, exp_id) REFERENCES detResidImfile(det_id, iteration, exp_id)) ENGINE=innodb DEFAULT CHARSET=latin1; 644 CREATE TABLE detRunSummary (det_id BIGINT, iteration INT, bg DOUBLE, bg_stdev DOUBLE, bg_mean_stdev DOUBLE, accept TINYINT, fault SMALLINT NOT NULL, PRIMARY KEY(det_id, iteration), KEY(fault), FOREIGN KEY (det_id, iteration) REFERENCES detInputExp(det_id, iteration), FOREIGN KEY (det_id, iteration) REFERENCES detResidExp(det_id, iteration)) ENGINE=innodb DEFAULT CHARSET=latin1;644 CREATE TABLE detRunSummary (det_id BIGINT, iteration INT, data_state VARHAR(64), bg DOUBLE, bg_stdev DOUBLE, bg_mean_stdev DOUBLE, accept TINYINT, fault SMALLINT NOT NULL, PRIMARY KEY(det_id, iteration), KEY(fault), FOREIGN KEY (det_id, iteration) REFERENCES detInputExp(det_id, iteration), FOREIGN KEY (det_id, iteration) REFERENCES detResidExp(det_id, iteration)) ENGINE=innodb DEFAULT CHARSET=latin1; 645 645 CREATE TABLE detRegisteredImfile (det_id BIGINT, iteration INT, class_id VARCHAR(64), uri VARCHAR(255), bg DOUBLE, bg_stdev DOUBLE, bg_mean_stdev DOUBLE, user_1 DOUBLE, user_2 DOUBLE, user_3 DOUBLE, user_4 DOUBLE, user_5 DOUBLE, path_base VARCHAR(255), fault SMALLINT NOT NULL, PRIMARY KEY(det_id, iteration, class_id), KEY(fault), FOREIGN KEY (det_id, iteration) REFERENCES detRun(det_id, iteration)) ENGINE=innodb DEFAULT CHARSET=latin1; 646 646 -
branches/eam_branch_20080719/ippTools/src/Makefile.am
r18641 r18643 46 46 flatcorr.h \ 47 47 faketool.h \ 48 guidetool.h \49 48 magictool.h \ 50 49 pstamptool.h \ … … 109 108 regtoolConfig.c 110 109 111 guidetool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS)112 guidetool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la113 guidetool_SOURCES = \114 guidetool.c \115 guidetoolConfig.c116 117 110 chiptool_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(IPPDB_CFLAGS) 118 111 chiptool_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(IPPDB_LIBS) libpxtools.la -
branches/eam_branch_20080719/ippTools/src/dettool.c
r18641 r18643 77 77 MODECASE(DETTOOL_MODE_PROCESSEDIMFILE, processedimfileMode); 78 78 MODECASE(DETTOOL_MODE_REVERTPROCESSEDIMFILE, revertprocessedimfileMode); 79 MODECASE(DETTOOL_MODE_PENDINGCLEANUP_PROCESSEDIMFILE, pendingcleanup_processedimfileMode); 80 MODECASE(DETTOOL_MODE_DONECLEANUP_PROCESSEDIMFILE, donecleanup_processedimfileMode); 79 81 // exp 80 82 MODECASE(DETTOOL_MODE_TOPROCESSEDEXP, toprocessedexpMode); … … 82 84 MODECASE(DETTOOL_MODE_PROCESSEDEXP, processedexpMode); 83 85 MODECASE(DETTOOL_MODE_REVERTPROCESSEDEXP, revertprocessedexpMode); 86 MODECASE(DETTOOL_MODE_PENDINGCLEANUP_PROCESSEDEXP, pendingcleanup_processedexpMode); 87 MODECASE(DETTOOL_MODE_DONECLEANUP_PROCESSEDEXP, donecleanup_processedexpMode); 84 88 // stacked 85 89 MODECASE(DETTOOL_MODE_TOSTACKED, tostackedMode); … … 87 91 MODECASE(DETTOOL_MODE_STACKED, stackedMode); 88 92 MODECASE(DETTOOL_MODE_REVERTSTACKED, revertstackedMode); 93 MODECASE(DETTOOL_MODE_PENDINGCLEANUP_STACKED, pendingcleanup_stackedMode); 94 MODECASE(DETTOOL_MODE_DONECLEANUP_STACKED, donecleanup_stackedMode); 89 95 // normalizedstat 90 96 MODECASE(DETTOOL_MODE_TONORMALIZEDSTAT, tonormalizedstatMode); … … 92 98 MODECASE(DETTOOL_MODE_NORMALIZEDSTAT, normalizedstatMode); 93 99 MODECASE(DETTOOL_MODE_REVERTNORMALIZEDSTAT, revertnormalizedstatMode); 100 MODECASE(DETTOOL_MODE_PENDINGCLEANUP_NORMALIZEDSTAT, pendingcleanup_normalizedstatMode); 101 MODECASE(DETTOOL_MODE_DONECLEANUP_NORMALIZEDSTAT, donecleanup_normalizedstatMode); 94 102 // normalizedimfile 95 103 MODECASE(DETTOOL_MODE_TONORMALIZE, tonormalizeMode); … … 97 105 MODECASE(DETTOOL_MODE_NORMALIZEDIMFILE, normalizedimfileMode); 98 106 MODECASE(DETTOOL_MODE_REVERTNORMALIZEDIMFILE, revertnormalizedimfileMode); 107 MODECASE(DETTOOL_MODE_PENDINGCLEANUP_NORMALIZEDIMFILE, pendingcleanup_normalizedimfileMode); 108 MODECASE(DETTOOL_MODE_DONECLEANUP_NORMALIZEDIMFILE, donecleanup_normalizedimfileMode); 99 109 // normalizedexp 100 110 MODECASE(DETTOOL_MODE_TONORMALIZEDEXP, tonormalizedexpMode); … … 102 112 MODECASE(DETTOOL_MODE_NORMALIZEDEXP, normalizedexpMode); 103 113 MODECASE(DETTOOL_MODE_REVERTNORMALIZEDEXP, revertnormalizedexpMode); 114 MODECASE(DETTOOL_MODE_PENDINGCLEANUP_NORMALIZEDEXP, pendingcleanup_normalizedexpMode); 115 MODECASE(DETTOOL_MODE_DONECLEANUP_NORMALIZEDEXP, donecleanup_normalizedexpMode); 104 116 // residimfile 105 117 MODECASE(DETTOOL_MODE_TORESIDIMFILE, toresidimfileMode); … … 107 119 MODECASE(DETTOOL_MODE_RESIDIMFILE, residimfileMode); 108 120 MODECASE(DETTOOL_MODE_REVERTRESIDIMFILE,revertresidimfileMode); 121 MODECASE(DETTOOL_MODE_PENDINGCLEANUP_RESIDIMFILE, pendingcleanup_residimfileMode); 122 MODECASE(DETTOOL_MODE_DONECLEANUP_RESIDIMFILE, donecleanup_residimfileMode); 109 123 // residexp 110 124 MODECASE(DETTOOL_MODE_TORESIDEXP, toresidexpMode); … … 113 127 MODECASE(DETTOOL_MODE_REVERTRESIDEXP, revertresidexpMode); 114 128 MODECASE(DETTOOL_MODE_UPDATERESIDEXP, updateresidexpMode); 129 MODECASE(DETTOOL_MODE_PENDINGCLEANUP_RESIDEXP, pendingcleanup_residexpMode); 130 MODECASE(DETTOOL_MODE_DONECLEANUP_RESIDEXP, donecleanup_residexpMode); 115 131 // detrunsummary 116 132 MODECASE(DETTOOL_MODE_TODETRUNSUMMARY, todetrunsummaryMode); -
branches/eam_branch_20080719/ippTools/src/dettool.h
r18642 r18643 41 41 DETTOOL_MODE_INPUT, 42 42 DETTOOL_MODE_RAW, 43 43 44 DETTOOL_MODE_TOPROCESSEDIMFILE, 44 45 DETTOOL_MODE_ADDPROCESSEDIMFILE, 45 46 DETTOOL_MODE_PROCESSEDIMFILE, 46 47 DETTOOL_MODE_REVERTPROCESSEDIMFILE, 48 DETTOOL_MODE_PENDINGCLEANUP_PROCESSEDIMFILE, 49 DETTOOL_MODE_DONECLEANUP_PROCESSEDIMFILE, 50 47 51 DETTOOL_MODE_TOPROCESSEDEXP, 48 52 DETTOOL_MODE_ADDPROCESSEDEXP, 49 53 DETTOOL_MODE_PROCESSEDEXP, 50 54 DETTOOL_MODE_REVERTPROCESSEDEXP, 55 DETTOOL_MODE_PENDINGCLEANUP_PROCESSEDEXP, 56 DETTOOL_MODE_DONECLEANUP_PROCESSEDEXP, 57 51 58 DETTOOL_MODE_TOSTACKED, 52 59 DETTOOL_MODE_ADDSTACKED, 53 60 DETTOOL_MODE_STACKED, 54 61 DETTOOL_MODE_REVERTSTACKED, 62 DETTOOL_MODE_PENDINGCLEANUP_STACKED, 63 DETTOOL_MODE_DONECLEANUP_STACKED, 64 55 65 DETTOOL_MODE_TONORMALIZEDSTAT, 56 66 DETTOOL_MODE_ADDNORMALIZEDSTAT, 57 67 DETTOOL_MODE_NORMALIZEDSTAT, 58 68 DETTOOL_MODE_REVERTNORMALIZEDSTAT, 69 DETTOOL_MODE_PENDINGCLEANUP_NORMALIZEDSTAT, 70 DETTOOL_MODE_DONECLEANUP_NORMALIZEDSTAT, 71 59 72 DETTOOL_MODE_TONORMALIZE, 60 73 DETTOOL_MODE_ADDNORMALIZEDIMFILE, 61 74 DETTOOL_MODE_NORMALIZEDIMFILE, 62 75 DETTOOL_MODE_REVERTNORMALIZEDIMFILE, 76 DETTOOL_MODE_PENDINGCLEANUP_NORMALIZEDIMFILE, 77 DETTOOL_MODE_DONECLEANUP_NORMALIZEDIMFILE, 78 63 79 DETTOOL_MODE_TONORMALIZEDEXP, 64 80 DETTOOL_MODE_ADDNORMALIZEDEXP, 65 81 DETTOOL_MODE_NORMALIZEDEXP, 66 82 DETTOOL_MODE_REVERTNORMALIZEDEXP, 83 DETTOOL_MODE_PENDINGCLEANUP_NORMALIZEDEXP, 84 DETTOOL_MODE_DONECLEANUP_NORMALIZEDEXP, 85 67 86 DETTOOL_MODE_TORESIDIMFILE, 68 87 DETTOOL_MODE_ADDRESIDIMFILE, 69 88 DETTOOL_MODE_RESIDIMFILE, 70 89 DETTOOL_MODE_REVERTRESIDIMFILE, 90 DETTOOL_MODE_PENDINGCLEANUP_RESIDIMFILE, 91 DETTOOL_MODE_DONECLEANUP_RESIDIMFILE, 92 71 93 DETTOOL_MODE_TORESIDEXP, 72 94 DETTOOL_MODE_ADDRESIDEXP, 73 95 DETTOOL_MODE_RESIDEXP, 74 96 DETTOOL_MODE_REVERTRESIDEXP, 97 DETTOOL_MODE_PENDINGCLEANUP_RESIDEXP, 98 DETTOOL_MODE_DONECLEANUP_RESIDEXP, 99 75 100 DETTOOL_MODE_TODETRUNSUMMARY, 76 101 DETTOOL_MODE_ADDDETRUNSUMMARY, … … 101 126 bool processedimfileMode(pxConfig *config); 102 127 bool revertprocessedimfileMode(pxConfig *config); 128 bool pendingcleanup_processedimfileMode(pxConfig *config); 129 bool donecleanup_processedimfileMode(pxConfig *config); 103 130 104 131 // processedexp … … 107 134 bool processedexpMode(pxConfig *config); 108 135 bool revertprocessedexpMode(pxConfig *config); 136 bool pendingcleanup_processedexpMode(pxConfig *config); 137 bool donecleanup_processedexpMode(pxConfig *config); 109 138 110 139 // stackedimfile … … 113 142 bool stackedMode(pxConfig *config); 114 143 bool revertstackedMode(pxConfig *config); 144 bool pendingcleanup_stackedMode(pxConfig *config); 145 bool donecleanup_stackedMode(pxConfig *config); 115 146 116 147 // normalizedstat … … 119 150 bool normalizedstatMode(pxConfig *config); 120 151 bool revertnormalizedstatMode(pxConfig *config); 152 bool pendingcleanup_normalizedstatMode(pxConfig *config); 153 bool donecleanup_normalizedstatMode(pxConfig *config); 121 154 122 155 // normalizedimfile … … 125 158 bool normalizedimfileMode(pxConfig *config); 126 159 bool revertnormalizedimfileMode(pxConfig *config); 160 bool pendingcleanup_normalizedimfileMode(pxConfig *config); 161 bool donecleanup_normalizedimfileMode(pxConfig *config); 127 162 128 163 // normalizedexp … … 131 166 bool normalizedexpMode(pxConfig *config); 132 167 bool revertnormalizedexpMode(pxConfig *config); 168 bool pendingcleanup_normalizedexpMode(pxConfig *config); 169 bool donecleanup_normalizedexpMode(pxConfig *config); 133 170 134 171 // residimfile … … 137 174 bool residimfileMode(pxConfig *config); 138 175 bool revertresidimfileMode(pxConfig *config); 176 bool pendingcleanup_residimfileMode(pxConfig *config); 177 bool donecleanup_residimfileMode(pxConfig *config); 139 178 140 179 // residexp … … 144 183 bool revertresidexpMode(pxConfig *config); 145 184 bool updateresidexpMode(pxConfig *config); 185 bool pendingcleanup_residexpMode(pxConfig *config); 186 bool donecleanup_residexpMode(pxConfig *config); 146 187 147 188 // detrunsummary -
branches/eam_branch_20080719/ippTools/src/dettool_normalizedexp.c
r18641 r18643 248 248 return true; 249 249 } 250 251 bool pendingcleanup_normalizedexpMode(pxConfig *config) 252 { 253 PS_ASSERT_PTR_NON_NULL(config, NULL); 254 255 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false); 256 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 257 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 258 259 psMetadata *where = psMetadataAlloc(); 260 if (chip_id) { 261 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 262 } 263 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 264 265 psString query = pxDataGet("dettool_pendingcleanup_normalizedexp.sql"); 266 if (!query) { 267 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 268 return false; 269 } 270 271 if (where && psListLength(where->list)) { 272 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 273 psStringAppend(&query, " AND %s", whereClause); 274 psFree(whereClause); 275 } 276 psFree(where); 277 278 // treat limit == 0 as "no limit" 279 if (limit) { 280 psString limitString = psDBGenerateLimitSQL(limit); 281 psStringAppend(&query, " %s", limitString); 282 psFree(limitString); 283 } 284 285 if (!p_psDBRunQuery(config->dbh, query)) { 286 psError(PS_ERR_UNKNOWN, false, "database error"); 287 psFree(query); 288 return false; 289 } 290 psFree(query); 291 292 psArray *output = p_psDBFetchResult(config->dbh); 293 if (!output) { 294 psError(PS_ERR_UNKNOWN, false, "database error"); 295 return false; 296 } 297 if (!psArrayLength(output)) { 298 psTrace("dettool", PS_LOG_INFO, "no rows found"); 299 psFree(output); 300 return true; 301 } 302 303 // negative simple so the default is true 304 if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_normalizedexp", !simple)) { 305 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 306 psFree(output); 307 return false; 308 } 309 310 psFree(output); 311 312 return true; 313 } 314 315 316 bool donecleanup_normalizedexpMode(pxConfig *config) 317 { 318 PS_ASSERT_PTR_NON_NULL(config, NULL); 319 320 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 321 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 322 323 psMetadata *where = psMetadataAlloc(); 324 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 325 326 psString query = pxDataGet("dettool_donecleanup_normalizedexp.sql"); 327 if (!query) { 328 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 329 return false; 330 } 331 332 if (where && psListLength(where->list)) { 333 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 334 psStringAppend(&query, " AND %s", whereClause); 335 psFree(whereClause); 336 } 337 psFree(where); 338 339 // treat limit == 0 as "no limit" 340 if (limit) { 341 psString limitString = psDBGenerateLimitSQL(limit); 342 psStringAppend(&query, " %s", limitString); 343 psFree(limitString); 344 } 345 346 if (!p_psDBRunQuery(config->dbh, query)) { 347 psError(PS_ERR_UNKNOWN, false, "database error"); 348 psFree(query); 349 return false; 350 } 351 psFree(query); 352 353 psArray *output = p_psDBFetchResult(config->dbh); 354 if (!output) { 355 psError(PS_ERR_UNKNOWN, false, "database error"); 356 return false; 357 } 358 if (!psArrayLength(output)) { 359 psTrace("dettool", PS_LOG_INFO, "no rows found"); 360 psFree(output); 361 return true; 362 } 363 364 // negative simple so the default is true 365 if (!ippdbPrintMetadatas(stdout, output, "detDoneCleanup_normalizedexp", !simple)) { 366 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 367 psFree(output); 368 return false; 369 } 370 371 psFree(output); 372 373 return true; 374 } 375 -
branches/eam_branch_20080719/ippTools/src/dettool_normalizedimfile.c
r18641 r18643 228 228 return true; 229 229 } 230 231 bool pendingcleanup_normalizedimfileMode(pxConfig *config) 232 { 233 PS_ASSERT_PTR_NON_NULL(config, NULL); 234 235 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false); 236 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 237 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 238 239 psMetadata *where = psMetadataAlloc(); 240 if (chip_id) { 241 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 242 } 243 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 244 245 psString query = pxDataGet("dettool_pendingcleanup_normalizedimfile.sql"); 246 if (!query) { 247 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 248 return false; 249 } 250 251 if (where && psListLength(where->list)) { 252 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 253 psStringAppend(&query, " AND %s", whereClause); 254 psFree(whereClause); 255 } 256 psFree(where); 257 258 // treat limit == 0 as "no limit" 259 if (limit) { 260 psString limitString = psDBGenerateLimitSQL(limit); 261 psStringAppend(&query, " %s", limitString); 262 psFree(limitString); 263 } 264 265 if (!p_psDBRunQuery(config->dbh, query)) { 266 psError(PS_ERR_UNKNOWN, false, "database error"); 267 psFree(query); 268 return false; 269 } 270 psFree(query); 271 272 psArray *output = p_psDBFetchResult(config->dbh); 273 if (!output) { 274 psError(PS_ERR_UNKNOWN, false, "database error"); 275 return false; 276 } 277 if (!psArrayLength(output)) { 278 psTrace("dettool", PS_LOG_INFO, "no rows found"); 279 psFree(output); 280 return true; 281 } 282 283 // negative simple so the default is true 284 if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_normalizedimfile", !simple)) { 285 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 286 psFree(output); 287 return false; 288 } 289 290 psFree(output); 291 292 return true; 293 } 294 295 296 bool donecleanup_normalizedimfileMode(pxConfig *config) 297 { 298 PS_ASSERT_PTR_NON_NULL(config, NULL); 299 300 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 301 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 302 303 psMetadata *where = psMetadataAlloc(); 304 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 305 306 psString query = pxDataGet("dettool_donecleanup_normalizedimfile.sql"); 307 if (!query) { 308 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 309 return false; 310 } 311 312 if (where && psListLength(where->list)) { 313 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 314 psStringAppend(&query, " AND %s", whereClause); 315 psFree(whereClause); 316 } 317 psFree(where); 318 319 // treat limit == 0 as "no limit" 320 if (limit) { 321 psString limitString = psDBGenerateLimitSQL(limit); 322 psStringAppend(&query, " %s", limitString); 323 psFree(limitString); 324 } 325 326 if (!p_psDBRunQuery(config->dbh, query)) { 327 psError(PS_ERR_UNKNOWN, false, "database error"); 328 psFree(query); 329 return false; 330 } 331 psFree(query); 332 333 psArray *output = p_psDBFetchResult(config->dbh); 334 if (!output) { 335 psError(PS_ERR_UNKNOWN, false, "database error"); 336 return false; 337 } 338 if (!psArrayLength(output)) { 339 psTrace("dettool", PS_LOG_INFO, "no rows found"); 340 psFree(output); 341 return true; 342 } 343 344 // negative simple so the default is true 345 if (!ippdbPrintMetadatas(stdout, output, "detDoneCleanup_normalizedimfile", !simple)) { 346 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 347 psFree(output); 348 return false; 349 } 350 351 psFree(output); 352 353 return true; 354 } 355 -
branches/eam_branch_20080719/ippTools/src/dettool_normalizedstat.c
r18641 r18643 208 208 return true; 209 209 } 210 211 bool pendingcleanup_normalizedstatMode(pxConfig *config) 212 { 213 PS_ASSERT_PTR_NON_NULL(config, NULL); 214 215 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false); 216 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 217 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 218 219 psMetadata *where = psMetadataAlloc(); 220 if (chip_id) { 221 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 222 } 223 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 224 225 psString query = pxDataGet("dettool_pendingcleanup_normalizedstat.sql"); 226 if (!query) { 227 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 228 return false; 229 } 230 231 if (where && psListLength(where->list)) { 232 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 233 psStringAppend(&query, " AND %s", whereClause); 234 psFree(whereClause); 235 } 236 psFree(where); 237 238 // treat limit == 0 as "no limit" 239 if (limit) { 240 psString limitString = psDBGenerateLimitSQL(limit); 241 psStringAppend(&query, " %s", limitString); 242 psFree(limitString); 243 } 244 245 if (!p_psDBRunQuery(config->dbh, query)) { 246 psError(PS_ERR_UNKNOWN, false, "database error"); 247 psFree(query); 248 return false; 249 } 250 psFree(query); 251 252 psArray *output = p_psDBFetchResult(config->dbh); 253 if (!output) { 254 psError(PS_ERR_UNKNOWN, false, "database error"); 255 return false; 256 } 257 if (!psArrayLength(output)) { 258 psTrace("dettool", PS_LOG_INFO, "no rows found"); 259 psFree(output); 260 return true; 261 } 262 263 // negative simple so the default is true 264 if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_normalizedstat", !simple)) { 265 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 266 psFree(output); 267 return false; 268 } 269 270 psFree(output); 271 272 return true; 273 } 274 275 276 bool donecleanup_normalizedstatMode(pxConfig *config) 277 { 278 PS_ASSERT_PTR_NON_NULL(config, NULL); 279 280 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 281 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 282 283 psMetadata *where = psMetadataAlloc(); 284 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 285 286 psString query = pxDataGet("dettool_donecleanup_normalizedstat.sql"); 287 if (!query) { 288 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 289 return false; 290 } 291 292 if (where && psListLength(where->list)) { 293 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 294 psStringAppend(&query, " AND %s", whereClause); 295 psFree(whereClause); 296 } 297 psFree(where); 298 299 // treat limit == 0 as "no limit" 300 if (limit) { 301 psString limitString = psDBGenerateLimitSQL(limit); 302 psStringAppend(&query, " %s", limitString); 303 psFree(limitString); 304 } 305 306 if (!p_psDBRunQuery(config->dbh, query)) { 307 psError(PS_ERR_UNKNOWN, false, "database error"); 308 psFree(query); 309 return false; 310 } 311 psFree(query); 312 313 psArray *output = p_psDBFetchResult(config->dbh); 314 if (!output) { 315 psError(PS_ERR_UNKNOWN, false, "database error"); 316 return false; 317 } 318 if (!psArrayLength(output)) { 319 psTrace("dettool", PS_LOG_INFO, "no rows found"); 320 psFree(output); 321 return true; 322 } 323 324 // negative simple so the default is true 325 if (!ippdbPrintMetadatas(stdout, output, "detDoneCleanup_normalizedstat", !simple)) { 326 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 327 psFree(output); 328 return false; 329 } 330 331 psFree(output); 332 333 return true; 334 } 335 -
branches/eam_branch_20080719/ippTools/src/dettool_processedexp.c
r18641 r18643 260 260 } 261 261 262 bool pendingcleanup_processedexpMode(pxConfig *config) 263 { 264 PS_ASSERT_PTR_NON_NULL(config, NULL); 265 266 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false); 267 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 268 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 269 270 psMetadata *where = psMetadataAlloc(); 271 if (chip_id) { 272 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 273 } 274 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 275 276 psString query = pxDataGet("dettool_pendingcleanup_processedexp.sql"); 277 if (!query) { 278 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 279 return false; 280 } 281 282 if (where && psListLength(where->list)) { 283 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 284 psStringAppend(&query, " AND %s", whereClause); 285 psFree(whereClause); 286 } 287 psFree(where); 288 289 // treat limit == 0 as "no limit" 290 if (limit) { 291 psString limitString = psDBGenerateLimitSQL(limit); 292 psStringAppend(&query, " %s", limitString); 293 psFree(limitString); 294 } 295 296 if (!p_psDBRunQuery(config->dbh, query)) { 297 psError(PS_ERR_UNKNOWN, false, "database error"); 298 psFree(query); 299 return false; 300 } 301 psFree(query); 302 303 psArray *output = p_psDBFetchResult(config->dbh); 304 if (!output) { 305 psError(PS_ERR_UNKNOWN, false, "database error"); 306 return false; 307 } 308 if (!psArrayLength(output)) { 309 psTrace("dettool", PS_LOG_INFO, "no rows found"); 310 psFree(output); 311 return true; 312 } 313 314 // negative simple so the default is true 315 if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_processedexp", !simple)) { 316 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 317 psFree(output); 318 return false; 319 } 320 321 psFree(output); 322 323 return true; 324 } 325 326 327 bool donecleanup_processedexpMode(pxConfig *config) 328 { 329 PS_ASSERT_PTR_NON_NULL(config, NULL); 330 331 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 332 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 333 334 psMetadata *where = psMetadataAlloc(); 335 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 336 337 psString query = pxDataGet("dettool_donecleanup_processedexp.sql"); 338 if (!query) { 339 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 340 return false; 341 } 342 343 if (where && psListLength(where->list)) { 344 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 345 psStringAppend(&query, " AND %s", whereClause); 346 psFree(whereClause); 347 } 348 psFree(where); 349 350 // treat limit == 0 as "no limit" 351 if (limit) { 352 psString limitString = psDBGenerateLimitSQL(limit); 353 psStringAppend(&query, " %s", limitString); 354 psFree(limitString); 355 } 356 357 if (!p_psDBRunQuery(config->dbh, query)) { 358 psError(PS_ERR_UNKNOWN, false, "database error"); 359 psFree(query); 360 return false; 361 } 362 psFree(query); 363 364 psArray *output = p_psDBFetchResult(config->dbh); 365 if (!output) { 366 psError(PS_ERR_UNKNOWN, false, "database error"); 367 return false; 368 } 369 if (!psArrayLength(output)) { 370 psTrace("dettool", PS_LOG_INFO, "no rows found"); 371 psFree(output); 372 return true; 373 } 374 375 // negative simple so the default is true 376 if (!ippdbPrintMetadatas(stdout, output, "detDoneCleanup_processedexp", !simple)) { 377 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 378 psFree(output); 379 return false; 380 } 381 382 psFree(output); 383 384 return true; 385 } 386 -
branches/eam_branch_20080719/ippTools/src/dettool_processedimfile.c
r18641 r18643 293 293 return true; 294 294 } 295 296 bool pendingcleanup_processedimfileMode(pxConfig *config) 297 { 298 PS_ASSERT_PTR_NON_NULL(config, NULL); 299 300 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false); 301 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 302 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 303 304 psMetadata *where = psMetadataAlloc(); 305 if (chip_id) { 306 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 307 } 308 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 309 310 psString query = pxDataGet("dettool_pendingcleanup_processedimfile.sql"); 311 if (!query) { 312 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 313 return false; 314 } 315 316 if (where && psListLength(where->list)) { 317 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 318 psStringAppend(&query, " AND %s", whereClause); 319 psFree(whereClause); 320 } 321 psFree(where); 322 323 // treat limit == 0 as "no limit" 324 if (limit) { 325 psString limitString = psDBGenerateLimitSQL(limit); 326 psStringAppend(&query, " %s", limitString); 327 psFree(limitString); 328 } 329 330 if (!p_psDBRunQuery(config->dbh, query)) { 331 psError(PS_ERR_UNKNOWN, false, "database error"); 332 psFree(query); 333 return false; 334 } 335 psFree(query); 336 337 psArray *output = p_psDBFetchResult(config->dbh); 338 if (!output) { 339 psError(PS_ERR_UNKNOWN, false, "database error"); 340 return false; 341 } 342 if (!psArrayLength(output)) { 343 psTrace("dettool", PS_LOG_INFO, "no rows found"); 344 psFree(output); 345 return true; 346 } 347 348 // negative simple so the default is true 349 if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_processedimfile", !simple)) { 350 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 351 psFree(output); 352 return false; 353 } 354 355 psFree(output); 356 357 return true; 358 } 359 360 361 bool donecleanup_processedimfileMode(pxConfig *config) 362 { 363 PS_ASSERT_PTR_NON_NULL(config, NULL); 364 365 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 366 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 367 368 psMetadata *where = psMetadataAlloc(); 369 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 370 371 psString query = pxDataGet("dettool_donecleanup_processedimfile.sql"); 372 if (!query) { 373 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 374 return false; 375 } 376 377 if (where && psListLength(where->list)) { 378 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 379 psStringAppend(&query, " AND %s", whereClause); 380 psFree(whereClause); 381 } 382 psFree(where); 383 384 // treat limit == 0 as "no limit" 385 if (limit) { 386 psString limitString = psDBGenerateLimitSQL(limit); 387 psStringAppend(&query, " %s", limitString); 388 psFree(limitString); 389 } 390 391 if (!p_psDBRunQuery(config->dbh, query)) { 392 psError(PS_ERR_UNKNOWN, false, "database error"); 393 psFree(query); 394 return false; 395 } 396 psFree(query); 397 398 psArray *output = p_psDBFetchResult(config->dbh); 399 if (!output) { 400 psError(PS_ERR_UNKNOWN, false, "database error"); 401 return false; 402 } 403 if (!psArrayLength(output)) { 404 psTrace("dettool", PS_LOG_INFO, "no rows found"); 405 psFree(output); 406 return true; 407 } 408 409 // negative simple so the default is true 410 if (!ippdbPrintMetadatas(stdout, output, "detDoneCleanup_processedimfile", !simple)) { 411 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 412 psFree(output); 413 return false; 414 } 415 416 psFree(output); 417 418 return true; 419 } 420 -
branches/eam_branch_20080719/ippTools/src/dettool_residexp.c
r18641 r18643 343 343 return true; 344 344 } 345 346 bool pendingcleanup_residexpMode(pxConfig *config) 347 { 348 PS_ASSERT_PTR_NON_NULL(config, NULL); 349 350 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false); 351 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 352 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 353 354 psMetadata *where = psMetadataAlloc(); 355 if (chip_id) { 356 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 357 } 358 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 359 360 psString query = pxDataGet("dettool_pendingcleanup_residexp.sql"); 361 if (!query) { 362 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 363 return false; 364 } 365 366 if (where && psListLength(where->list)) { 367 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 368 psStringAppend(&query, " AND %s", whereClause); 369 psFree(whereClause); 370 } 371 psFree(where); 372 373 // treat limit == 0 as "no limit" 374 if (limit) { 375 psString limitString = psDBGenerateLimitSQL(limit); 376 psStringAppend(&query, " %s", limitString); 377 psFree(limitString); 378 } 379 380 if (!p_psDBRunQuery(config->dbh, query)) { 381 psError(PS_ERR_UNKNOWN, false, "database error"); 382 psFree(query); 383 return false; 384 } 385 psFree(query); 386 387 psArray *output = p_psDBFetchResult(config->dbh); 388 if (!output) { 389 psError(PS_ERR_UNKNOWN, false, "database error"); 390 return false; 391 } 392 if (!psArrayLength(output)) { 393 psTrace("dettool", PS_LOG_INFO, "no rows found"); 394 psFree(output); 395 return true; 396 } 397 398 // negative simple so the default is true 399 if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_residexp", !simple)) { 400 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 401 psFree(output); 402 return false; 403 } 404 405 psFree(output); 406 407 return true; 408 } 409 410 411 bool donecleanup_residexpMode(pxConfig *config) 412 { 413 PS_ASSERT_PTR_NON_NULL(config, NULL); 414 415 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 416 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 417 418 psMetadata *where = psMetadataAlloc(); 419 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 420 421 psString query = pxDataGet("dettool_donecleanup_residexp.sql"); 422 if (!query) { 423 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 424 return false; 425 } 426 427 if (where && psListLength(where->list)) { 428 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 429 psStringAppend(&query, " AND %s", whereClause); 430 psFree(whereClause); 431 } 432 psFree(where); 433 434 // treat limit == 0 as "no limit" 435 if (limit) { 436 psString limitString = psDBGenerateLimitSQL(limit); 437 psStringAppend(&query, " %s", limitString); 438 psFree(limitString); 439 } 440 441 if (!p_psDBRunQuery(config->dbh, query)) { 442 psError(PS_ERR_UNKNOWN, false, "database error"); 443 psFree(query); 444 return false; 445 } 446 psFree(query); 447 448 psArray *output = p_psDBFetchResult(config->dbh); 449 if (!output) { 450 psError(PS_ERR_UNKNOWN, false, "database error"); 451 return false; 452 } 453 if (!psArrayLength(output)) { 454 psTrace("dettool", PS_LOG_INFO, "no rows found"); 455 psFree(output); 456 return true; 457 } 458 459 // negative simple so the default is true 460 if (!ippdbPrintMetadatas(stdout, output, "detDoneCleanup_residexp", !simple)) { 461 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 462 psFree(output); 463 return false; 464 } 465 466 psFree(output); 467 468 return true; 469 } 470 -
branches/eam_branch_20080719/ippTools/src/dettool_residimfile.c
r18641 r18643 258 258 return true; 259 259 } 260 261 bool pendingcleanup_residimfileMode(pxConfig *config) 262 { 263 PS_ASSERT_PTR_NON_NULL(config, NULL); 264 265 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false); 266 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 267 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 268 269 psMetadata *where = psMetadataAlloc(); 270 if (chip_id) { 271 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 272 } 273 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 274 275 psString query = pxDataGet("dettool_pendingcleanup_residimfile.sql"); 276 if (!query) { 277 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 278 return false; 279 } 280 281 if (where && psListLength(where->list)) { 282 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 283 psStringAppend(&query, " AND %s", whereClause); 284 psFree(whereClause); 285 } 286 psFree(where); 287 288 // treat limit == 0 as "no limit" 289 if (limit) { 290 psString limitString = psDBGenerateLimitSQL(limit); 291 psStringAppend(&query, " %s", limitString); 292 psFree(limitString); 293 } 294 295 if (!p_psDBRunQuery(config->dbh, query)) { 296 psError(PS_ERR_UNKNOWN, false, "database error"); 297 psFree(query); 298 return false; 299 } 300 psFree(query); 301 302 psArray *output = p_psDBFetchResult(config->dbh); 303 if (!output) { 304 psError(PS_ERR_UNKNOWN, false, "database error"); 305 return false; 306 } 307 if (!psArrayLength(output)) { 308 psTrace("dettool", PS_LOG_INFO, "no rows found"); 309 psFree(output); 310 return true; 311 } 312 313 // negative simple so the default is true 314 if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_residimfile", !simple)) { 315 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 316 psFree(output); 317 return false; 318 } 319 320 psFree(output); 321 322 return true; 323 } 324 325 326 bool donecleanup_residimfileMode(pxConfig *config) 327 { 328 PS_ASSERT_PTR_NON_NULL(config, NULL); 329 330 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 331 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 332 333 psMetadata *where = psMetadataAlloc(); 334 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 335 336 psString query = pxDataGet("dettool_donecleanup_residimfile.sql"); 337 if (!query) { 338 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 339 return false; 340 } 341 342 if (where && psListLength(where->list)) { 343 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 344 psStringAppend(&query, " AND %s", whereClause); 345 psFree(whereClause); 346 } 347 psFree(where); 348 349 // treat limit == 0 as "no limit" 350 if (limit) { 351 psString limitString = psDBGenerateLimitSQL(limit); 352 psStringAppend(&query, " %s", limitString); 353 psFree(limitString); 354 } 355 356 if (!p_psDBRunQuery(config->dbh, query)) { 357 psError(PS_ERR_UNKNOWN, false, "database error"); 358 psFree(query); 359 return false; 360 } 361 psFree(query); 362 363 psArray *output = p_psDBFetchResult(config->dbh); 364 if (!output) { 365 psError(PS_ERR_UNKNOWN, false, "database error"); 366 return false; 367 } 368 if (!psArrayLength(output)) { 369 psTrace("dettool", PS_LOG_INFO, "no rows found"); 370 psFree(output); 371 return true; 372 } 373 374 // negative simple so the default is true 375 if (!ippdbPrintMetadatas(stdout, output, "detDoneCleanup_residimfile", !simple)) { 376 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 377 psFree(output); 378 return false; 379 } 380 381 psFree(output); 382 383 return true; 384 } 385 -
branches/eam_branch_20080719/ippTools/src/dettool_stack.c
r18641 r18643 314 314 return true; 315 315 } 316 317 bool pendingcleanup_stackedMode(pxConfig *config) 318 { 319 PS_ASSERT_PTR_NON_NULL(config, NULL); 320 321 PXOPT_LOOKUP_S64(chip_id, config->args, "-chip_id", false, false); 322 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 323 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 324 325 psMetadata *where = psMetadataAlloc(); 326 if (chip_id) { 327 PXOPT_COPY_S64(config->args, where, "-chip_id", "chip_id", "=="); 328 } 329 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 330 331 psString query = pxDataGet("dettool_pendingcleanup_stacked.sql"); 332 if (!query) { 333 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 334 return false; 335 } 336 337 if (where && psListLength(where->list)) { 338 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 339 psStringAppend(&query, " AND %s", whereClause); 340 psFree(whereClause); 341 } 342 psFree(where); 343 344 // treat limit == 0 as "no limit" 345 if (limit) { 346 psString limitString = psDBGenerateLimitSQL(limit); 347 psStringAppend(&query, " %s", limitString); 348 psFree(limitString); 349 } 350 351 if (!p_psDBRunQuery(config->dbh, query)) { 352 psError(PS_ERR_UNKNOWN, false, "database error"); 353 psFree(query); 354 return false; 355 } 356 psFree(query); 357 358 psArray *output = p_psDBFetchResult(config->dbh); 359 if (!output) { 360 psError(PS_ERR_UNKNOWN, false, "database error"); 361 return false; 362 } 363 if (!psArrayLength(output)) { 364 psTrace("dettool", PS_LOG_INFO, "no rows found"); 365 psFree(output); 366 return true; 367 } 368 369 // negative simple so the default is true 370 if (!ippdbPrintMetadatas(stdout, output, "detPendingCleanup_stacked", !simple)) { 371 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 372 psFree(output); 373 return false; 374 } 375 376 psFree(output); 377 378 return true; 379 } 380 381 382 bool donecleanup_stackedMode(pxConfig *config) 383 { 384 PS_ASSERT_PTR_NON_NULL(config, NULL); 385 386 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 387 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 388 389 psMetadata *where = psMetadataAlloc(); 390 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 391 392 psString query = pxDataGet("dettool_donecleanup_stacked.sql"); 393 if (!query) { 394 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 395 return false; 396 } 397 398 if (where && psListLength(where->list)) { 399 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 400 psStringAppend(&query, " AND %s", whereClause); 401 psFree(whereClause); 402 } 403 psFree(where); 404 405 // treat limit == 0 as "no limit" 406 if (limit) { 407 psString limitString = psDBGenerateLimitSQL(limit); 408 psStringAppend(&query, " %s", limitString); 409 psFree(limitString); 410 } 411 412 if (!p_psDBRunQuery(config->dbh, query)) { 413 psError(PS_ERR_UNKNOWN, false, "database error"); 414 psFree(query); 415 return false; 416 } 417 psFree(query); 418 419 psArray *output = p_psDBFetchResult(config->dbh); 420 if (!output) { 421 psError(PS_ERR_UNKNOWN, false, "database error"); 422 return false; 423 } 424 if (!psArrayLength(output)) { 425 psTrace("dettool", PS_LOG_INFO, "no rows found"); 426 psFree(output); 427 return true; 428 } 429 430 // negative simple so the default is true 431 if (!ippdbPrintMetadatas(stdout, output, "detDoneCleanup_stacked", !simple)) { 432 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 433 psFree(output); 434 return false; 435 } 436 437 psFree(output); 438 439 return true; 440 } 441 -
branches/eam_branch_20080719/ippTools/src/difftool.c
r18622 r18643 41 41 static bool definepoprunMode(pxConfig *config); 42 42 static bool definebyqueryMode(pxConfig *config); 43 static bool pendingcleanuprunMode(pxConfig *config); 44 static bool pendingcleanupskyfileMode(pxConfig *config); 45 static bool donecleanupMode(pxConfig *config); 43 46 44 47 static bool setdiffRunState(pxConfig *config, psS64 diff_id, const char *state); … … 62 65 63 66 switch (config->mode) { 64 MODECASE(DIFFTOOL_MODE_DEFINERUN, definerunMode); 65 MODECASE(DIFFTOOL_MODE_UPDATERUN, updaterunMode); 66 MODECASE(DIFFTOOL_MODE_ADDINPUTSKYFILE, addinputskyfileMode); 67 MODECASE(DIFFTOOL_MODE_INPUTSKYFILE, inputskyfileMode); 68 MODECASE(DIFFTOOL_MODE_TODIFFSKYFILE, todiffskyfileMode); 69 MODECASE(DIFFTOOL_MODE_ADDDIFFSKYFILE, adddiffskyfileMode); 70 MODECASE(DIFFTOOL_MODE_DIFFSKYFILE, diffskyfileMode); 71 MODECASE(DIFFTOOL_MODE_REVERTDIFFSKYFILE, revertdiffskyfileMode); 72 MODECASE(DIFFTOOL_MODE_DEFINEPOPRUN, definepoprunMode); 73 MODECASE(DIFFTOOL_MODE_DEFINEBYQUERY, definebyqueryMode); 67 MODECASE(DIFFTOOL_MODE_DEFINERUN, definerunMode); 68 MODECASE(DIFFTOOL_MODE_UPDATERUN, updaterunMode); 69 MODECASE(DIFFTOOL_MODE_ADDINPUTSKYFILE, addinputskyfileMode); 70 MODECASE(DIFFTOOL_MODE_INPUTSKYFILE, inputskyfileMode); 71 MODECASE(DIFFTOOL_MODE_TODIFFSKYFILE, todiffskyfileMode); 72 MODECASE(DIFFTOOL_MODE_ADDDIFFSKYFILE, adddiffskyfileMode); 73 MODECASE(DIFFTOOL_MODE_DIFFSKYFILE, diffskyfileMode); 74 MODECASE(DIFFTOOL_MODE_REVERTDIFFSKYFILE, revertdiffskyfileMode); 75 MODECASE(DIFFTOOL_MODE_DEFINEPOPRUN, definepoprunMode); 76 MODECASE(DIFFTOOL_MODE_DEFINEBYQUERY, definebyqueryMode); 77 MODECASE(DIFFTOOL_MODE_PENDINGCLEANUPRUN, pendingcleanuprunMode); 78 MODECASE(DIFFTOOL_MODE_PENDINGCLEANUPSKYFILE, pendingcleanupskyfileMode); 79 MODECASE(DIFFTOOL_MODE_DONECLEANUP, donecleanupMode); 74 80 default: 75 81 psAbort("invalid option (this should not happen)"); … … 923 929 return true; 924 930 } 931 932 static bool pendingcleanuprunMode(pxConfig *config) 933 { 934 PS_ASSERT_PTR_NON_NULL(config, NULL); 935 936 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 937 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 938 939 psMetadata *where = psMetadataAlloc(); 940 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 941 942 psString query = pxDataGet("difftool_pendingcleanuprun.sql"); 943 if (!query) { 944 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 945 return false; 946 } 947 948 if (where && psListLength(where->list)) { 949 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 950 psStringAppend(&query, " AND %s", whereClause); 951 psFree(whereClause); 952 } 953 psFree(where); 954 955 // treat limit == 0 as "no limit" 956 if (limit) { 957 psString limitString = psDBGenerateLimitSQL(limit); 958 psStringAppend(&query, " %s", limitString); 959 psFree(limitString); 960 } 961 962 if (!p_psDBRunQuery(config->dbh, query)) { 963 psError(PS_ERR_UNKNOWN, false, "database error"); 964 psFree(query); 965 return false; 966 } 967 psFree(query); 968 969 psArray *output = p_psDBFetchResult(config->dbh); 970 if (!output) { 971 psError(PS_ERR_UNKNOWN, false, "database error"); 972 return false; 973 } 974 if (!psArrayLength(output)) { 975 psTrace("difftool", PS_LOG_INFO, "no rows found"); 976 psFree(output); 977 return true; 978 } 979 980 // negative simple so the default is true 981 if (!ippdbPrintMetadatas(stdout, output, "diffPendingCleanupRun", !simple)) { 982 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 983 psFree(output); 984 return false; 985 } 986 987 psFree(output); 988 989 return true; 990 } 991 992 993 static bool pendingcleanupskyfileMode(pxConfig *config) 994 { 995 PS_ASSERT_PTR_NON_NULL(config, NULL); 996 997 PXOPT_LOOKUP_S64(diff_id, config->args, "-diff_id", false, false); 998 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 999 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 1000 1001 psMetadata *where = psMetadataAlloc(); 1002 if (diff_id) { 1003 PXOPT_COPY_S64(config->args, where, "-diff_id", "diff_id", "=="); 1004 } 1005 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 1006 1007 psString query = pxDataGet("difftool_pendingcleanupskyfile.sql"); 1008 if (!query) { 1009 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 1010 return false; 1011 } 1012 1013 if (where && psListLength(where->list)) { 1014 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1015 psStringAppend(&query, " AND %s", whereClause); 1016 psFree(whereClause); 1017 } 1018 psFree(where); 1019 1020 // treat limit == 0 as "no limit" 1021 if (limit) { 1022 psString limitString = psDBGenerateLimitSQL(limit); 1023 psStringAppend(&query, " %s", limitString); 1024 psFree(limitString); 1025 } 1026 1027 if (!p_psDBRunQuery(config->dbh, query)) { 1028 psError(PS_ERR_UNKNOWN, false, "database error"); 1029 psFree(query); 1030 return false; 1031 } 1032 psFree(query); 1033 1034 psArray *output = p_psDBFetchResult(config->dbh); 1035 if (!output) { 1036 psError(PS_ERR_UNKNOWN, false, "database error"); 1037 return false; 1038 } 1039 if (!psArrayLength(output)) { 1040 psTrace("difftool", PS_LOG_INFO, "no rows found"); 1041 psFree(output); 1042 return true; 1043 } 1044 1045 // negative simple so the default is true 1046 if (!ippdbPrintMetadatas(stdout, output, "diffPendingCleanupSkyfile", !simple)) { 1047 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 1048 psFree(output); 1049 return false; 1050 } 1051 1052 psFree(output); 1053 1054 return true; 1055 } 1056 1057 1058 static bool donecleanupMode(pxConfig *config) 1059 { 1060 PS_ASSERT_PTR_NON_NULL(config, NULL); 1061 1062 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1063 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 1064 1065 psMetadata *where = psMetadataAlloc(); 1066 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 1067 1068 psString query = pxDataGet("difftool_donecleanup.sql"); 1069 if (!query) { 1070 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 1071 return false; 1072 } 1073 1074 if (where && psListLength(where->list)) { 1075 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1076 psStringAppend(&query, " AND %s", whereClause); 1077 psFree(whereClause); 1078 } 1079 psFree(where); 1080 1081 // treat limit == 0 as "no limit" 1082 if (limit) { 1083 psString limitString = psDBGenerateLimitSQL(limit); 1084 psStringAppend(&query, " %s", limitString); 1085 psFree(limitString); 1086 } 1087 1088 if (!p_psDBRunQuery(config->dbh, query)) { 1089 psError(PS_ERR_UNKNOWN, false, "database error"); 1090 psFree(query); 1091 return false; 1092 } 1093 psFree(query); 1094 1095 psArray *output = p_psDBFetchResult(config->dbh); 1096 if (!output) { 1097 psError(PS_ERR_UNKNOWN, false, "database error"); 1098 return false; 1099 } 1100 if (!psArrayLength(output)) { 1101 psTrace("difftool", PS_LOG_INFO, "no rows found"); 1102 psFree(output); 1103 return true; 1104 } 1105 1106 // negative simple so the default is true 1107 if (!ippdbPrintMetadatas(stdout, output, "diffDoneCleanup", !simple)) { 1108 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 1109 psFree(output); 1110 return false; 1111 } 1112 1113 psFree(output); 1114 1115 return true; 1116 } -
branches/eam_branch_20080719/ippTools/src/difftool.h
r18622 r18643 35 35 DIFFTOOL_MODE_DEFINEPOPRUN, 36 36 DIFFTOOL_MODE_DEFINEBYQUERY, 37 DIFFTOOL_MODE_PENDINGCLEANUPRUN, 38 DIFFTOOL_MODE_PENDINGCLEANUPSKYFILE, 39 DIFFTOOL_MODE_DONECLEANUP, 37 40 } difftoolMode; 38 41 -
branches/eam_branch_20080719/ippTools/src/stacktool.c
r18579 r18643 40 40 static bool sumskyfileMode(pxConfig *config); 41 41 static bool revertsumskyfileMode(pxConfig *config); 42 static bool pendingcleanuprunMode(pxConfig *config); 43 static bool pendingcleanupskyfileMode(pxConfig *config); 44 static bool donecleanupMode(pxConfig *config); 42 45 43 46 static bool setstackRunState(pxConfig *config, psS64 stack_id, const char *state); … … 61 64 62 65 switch (config->mode) { 63 MODECASE(STACKTOOL_MODE_DEFINEBYQUERY, definebyqueryMode); 64 MODECASE(STACKTOOL_MODE_DEFINERUN, definerunMode); 65 MODECASE(STACKTOOL_MODE_UPDATERUN, updaterunMode); 66 MODECASE(STACKTOOL_MODE_ADDINPUTSKYFILE, addinputskyfileMode); 67 MODECASE(STACKTOOL_MODE_INPUTSKYFILE, inputskyfileMode); 68 MODECASE(STACKTOOL_MODE_TOSUM, tosumMode); 69 MODECASE(STACKTOOL_MODE_ADDSUMSKYFILE, addsumskyfileMode); 70 MODECASE(STACKTOOL_MODE_SUMSKYFILE, sumskyfileMode); 71 MODECASE(STACKTOOL_MODE_REVERTSUMSKYFILE, revertsumskyfileMode); 66 MODECASE(STACKTOOL_MODE_DEFINEBYQUERY, definebyqueryMode); 67 MODECASE(STACKTOOL_MODE_DEFINERUN, definerunMode); 68 MODECASE(STACKTOOL_MODE_UPDATERUN, updaterunMode); 69 MODECASE(STACKTOOL_MODE_ADDINPUTSKYFILE, addinputskyfileMode); 70 MODECASE(STACKTOOL_MODE_INPUTSKYFILE, inputskyfileMode); 71 MODECASE(STACKTOOL_MODE_TOSUM, tosumMode); 72 MODECASE(STACKTOOL_MODE_ADDSUMSKYFILE, addsumskyfileMode); 73 MODECASE(STACKTOOL_MODE_SUMSKYFILE, sumskyfileMode); 74 MODECASE(STACKTOOL_MODE_REVERTSUMSKYFILE, revertsumskyfileMode); 75 MODECASE(STACKTOOL_MODE_PENDINGCLEANUPRUN, pendingcleanuprunMode); 76 MODECASE(STACKTOOL_MODE_PENDINGCLEANUPSKYFILE, pendingcleanupskyfileMode); 77 MODECASE(STACKTOOL_MODE_DONECLEANUP, donecleanupMode); 72 78 default: 73 79 psAbort("invalid option (this should not happen)"); … … 802 808 return true; 803 809 } 810 811 static bool pendingcleanuprunMode(pxConfig *config) 812 { 813 PS_ASSERT_PTR_NON_NULL(config, NULL); 814 815 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 816 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 817 818 psMetadata *where = psMetadataAlloc(); 819 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 820 821 psString query = pxDataGet("stacktool_pendingcleanuprun.sql"); 822 if (!query) { 823 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 824 return false; 825 } 826 827 if (where && psListLength(where->list)) { 828 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 829 psStringAppend(&query, " AND %s", whereClause); 830 psFree(whereClause); 831 } 832 psFree(where); 833 834 // treat limit == 0 as "no limit" 835 if (limit) { 836 psString limitString = psDBGenerateLimitSQL(limit); 837 psStringAppend(&query, " %s", limitString); 838 psFree(limitString); 839 } 840 841 if (!p_psDBRunQuery(config->dbh, query)) { 842 psError(PS_ERR_UNKNOWN, false, "database error"); 843 psFree(query); 844 return false; 845 } 846 psFree(query); 847 848 psArray *output = p_psDBFetchResult(config->dbh); 849 if (!output) { 850 psError(PS_ERR_UNKNOWN, false, "database error"); 851 return false; 852 } 853 if (!psArrayLength(output)) { 854 psTrace("stacktool", PS_LOG_INFO, "no rows found"); 855 psFree(output); 856 return true; 857 } 858 859 // negative simple so the default is true 860 if (!ippdbPrintMetadatas(stdout, output, "stackPendingCleanupRun", !simple)) { 861 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 862 psFree(output); 863 return false; 864 } 865 866 psFree(output); 867 868 return true; 869 } 870 871 static bool pendingcleanupskyfileMode(pxConfig *config) 872 { 873 PS_ASSERT_PTR_NON_NULL(config, NULL); 874 875 PXOPT_LOOKUP_S64(stack_id, config->args, "-stack_id", false, false); 876 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 877 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 878 879 psMetadata *where = psMetadataAlloc(); 880 if (stack_id) { 881 PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "=="); 882 } 883 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 884 885 psString query = pxDataGet("stacktool_pendingcleanupskyfile.sql"); 886 if (!query) { 887 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 888 return false; 889 } 890 891 if (where && psListLength(where->list)) { 892 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 893 psStringAppend(&query, " AND %s", whereClause); 894 psFree(whereClause); 895 } 896 psFree(where); 897 898 // treat limit == 0 as "no limit" 899 if (limit) { 900 psString limitString = psDBGenerateLimitSQL(limit); 901 psStringAppend(&query, " %s", limitString); 902 psFree(limitString); 903 } 904 905 if (!p_psDBRunQuery(config->dbh, query)) { 906 psError(PS_ERR_UNKNOWN, false, "database error"); 907 psFree(query); 908 return false; 909 } 910 psFree(query); 911 912 psArray *output = p_psDBFetchResult(config->dbh); 913 if (!output) { 914 psError(PS_ERR_UNKNOWN, false, "database error"); 915 return false; 916 } 917 if (!psArrayLength(output)) { 918 psTrace("stacktool", PS_LOG_INFO, "no rows found"); 919 psFree(output); 920 return true; 921 } 922 923 // negative simple so the default is true 924 if (!ippdbPrintMetadatas(stdout, output, "stackPendingCleanupSkyfile", !simple)) { 925 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 926 psFree(output); 927 return false; 928 } 929 930 psFree(output); 931 932 return true; 933 } 934 935 936 static bool donecleanupMode(pxConfig *config) 937 { 938 PS_ASSERT_PTR_NON_NULL(config, NULL); 939 940 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 941 PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false); 942 943 psMetadata *where = psMetadataAlloc(); 944 PXOPT_COPY_STR(config->args, where, "-label", "label", "=="); 945 946 psString query = pxDataGet("stacktool_donecleanup.sql"); 947 if (!query) { 948 psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement"); 949 return false; 950 } 951 952 if (where && psListLength(where->list)) { 953 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 954 psStringAppend(&query, " AND %s", whereClause); 955 psFree(whereClause); 956 } 957 psFree(where); 958 959 // treat limit == 0 as "no limit" 960 if (limit) { 961 psString limitString = psDBGenerateLimitSQL(limit); 962 psStringAppend(&query, " %s", limitString); 963 psFree(limitString); 964 } 965 966 if (!p_psDBRunQuery(config->dbh, query)) { 967 psError(PS_ERR_UNKNOWN, false, "database error"); 968 psFree(query); 969 return false; 970 } 971 psFree(query); 972 973 psArray *output = p_psDBFetchResult(config->dbh); 974 if (!output) { 975 psError(PS_ERR_UNKNOWN, false, "database error"); 976 return false; 977 } 978 if (!psArrayLength(output)) { 979 psTrace("stacktool", PS_LOG_INFO, "no rows found"); 980 psFree(output); 981 return true; 982 } 983 984 // negative simple so the default is true 985 if (!ippdbPrintMetadatas(stdout, output, "stackDoneCleanup", !simple)) { 986 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 987 psFree(output); 988 return false; 989 } 990 991 psFree(output); 992 993 return true; 994 } -
branches/eam_branch_20080719/ippTools/src/stacktool.h
r18622 r18643 34 34 STACKTOOL_MODE_SUMSKYFILE, 35 35 STACKTOOL_MODE_REVERTSUMSKYFILE, 36 STACKTOOL_MODE_PENDINGCLEANUPRUN, 37 STACKTOOL_MODE_PENDINGCLEANUPSKYFILE, 38 STACKTOOL_MODE_DONECLEANUP, 36 39 } stacktoolMode; 37 40
Note:
See TracChangeset
for help on using the changeset viewer.
