Changeset 11002 for trunk/ippTools/src/chiptool.c
- Timestamp:
- Jan 9, 2007, 3:59:08 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/chiptool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/chiptool.c
r10943 r11002 33 33 static bool pendingimfileMode(pxConfig *config); 34 34 static bool addprocessedimfileMode(pxConfig *config); 35 static bool faultimfileMode(pxConfig *config); 35 36 static bool blockMode(pxConfig *config); 36 37 static bool maskedMode(pxConfig *config); … … 58 59 MODECASE(P2TOOL_MODE_PENDINGIMFILE, pendingimfileMode); 59 60 MODECASE(P2TOOL_MODE_ADDPROCESSEDIMFILE, addprocessedimfileMode); 61 MODECASE(P2TOOL_MODE_FAULTIMFILE, faultimfileMode); 60 62 MODECASE(P2TOOL_MODE_BLOCK, blockMode); 61 63 MODECASE(P2TOOL_MODE_MASKED, maskedMode); … … 174 176 PS_ASSERT_PTR_NON_NULL(config, NULL); 175 177 178 bool status = false; 179 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 180 if (!status) { 181 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -limit"); 182 return false; 183 } 184 185 bool faulted = psMetadataLookupU64(&status, config->args, "-faulted"); 186 if (!status) { 187 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -faulted"); 188 return false; 189 } 190 176 191 // XXX does this need to be constrained so that it won't return any results 177 192 // if a match p2PendingExp hasn't been registered? … … 197 212 } 198 213 214 if (faulted) { 215 // list only faulted rows 216 psStringAppend(&query, " %s", "AND p2PendingImfile.fault != 0"); 217 } else { 218 // don't list faulted rows 219 psStringAppend(&query, " %s", "AND p2PendingImfile.fault = 0"); 220 } 221 222 // treat limit == 0 as "no limit" 223 if (limit) { 224 psString limitString = psDBGenerateLimitSQL(limit); 225 psStringAppend(&query, " %s", limitString); 226 psFree(limitString); 227 } 228 199 229 if (!p_psDBRunQuery(config->dbh, query)) { 200 230 psError(PS_ERR_UNKNOWN, false, "database error"); … … 401 431 return true; 402 432 } 433 434 435 static bool faultimfileMode(pxConfig *config) 436 { 437 PS_ASSERT_PTR_NON_NULL(config, false); 438 439 bool status = false; 440 psS8 code = psMetadataLookupS8(&status, config->args, "-code"); 441 if (!status) { 442 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code"); 443 return false; 444 } 445 446 if (!pxSetFaultCode(config->dbh, "p2PendingImfile", config->where, code)) { 447 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 448 return false; 449 } 450 451 return true; 452 } 453 403 454 404 455 static bool blockMode(pxConfig *config)
Note:
See TracChangeset
for help on using the changeset viewer.
