Changeset 11024 for trunk/ippTools/src/camtool.c
- Timestamp:
- Jan 10, 2007, 6:42:52 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/camtool.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/camtool.c
r10944 r11024 30 30 static bool pendingimfileMode(pxConfig *config); 31 31 static bool addprocessedexpMode(pxConfig *config); 32 static bool faultexpMode(pxConfig *config); 32 33 static bool blockMode(pxConfig *config); 33 34 static bool maskedMode(pxConfig *config); … … 51 52 MODECASE(P3TOOL_MODE_PENDINGIMFILE, pendingimfileMode); 52 53 MODECASE(P3TOOL_MODE_ADDPROCESSEDEXP, addprocessedexpMode); 54 MODECASE(P3TOOL_MODE_FAULTEXP, faultexpMode); 53 55 MODECASE(P3TOOL_MODE_BLOCK, blockMode); 54 56 MODECASE(P3TOOL_MODE_MASKED, maskedMode); … … 76 78 { 77 79 PS_ASSERT_PTR_NON_NULL(config, false); 80 81 bool status = false; 82 psU64 limit = psMetadataLookupU64(&status, config->args, "-limit"); 83 if (!status) { 84 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -limit"); 85 return false; 86 } 87 88 bool faulted = psMetadataLookupU64(&status, config->args, "-faulted"); 89 if (!status) { 90 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -faulted"); 91 return false; 92 } 78 93 79 94 psString query = psStringCopy( … … 97 112 psStringAppend(&query, " %s", whereClause); 98 113 psFree(whereClause); 114 } 115 116 if (faulted) { 117 // list only faulted rows 118 psStringAppend(&query, " %s", "AND p3PendingExp.fault != 0"); 119 } else { 120 // don't list faulted rows 121 psStringAppend(&query, " %s", "AND p3PendingExp.fault = 0"); 122 } 123 124 // treat limit == 0 as "no limit" 125 if (limit) { 126 psString limitString = psDBGenerateLimitSQL(limit); 127 psStringAppend(&query, " %s", limitString); 128 psFree(limitString); 99 129 } 100 130 … … 390 420 } 391 421 422 423 static bool faultexpMode(pxConfig *config) 424 { 425 PS_ASSERT_PTR_NON_NULL(config, false); 426 427 bool status = false; 428 psS8 code = psMetadataLookupS8(&status, config->args, "-code"); 429 if (!status) { 430 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code"); 431 return false; 432 } 433 434 if (!pxSetFaultCode(config->dbh, "p3PendingExp", config->where, code)) { 435 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 436 return false; 437 } 438 439 return true; 440 } 441 442 392 443 static bool blockMode(pxConfig *config) 393 444 {
Note:
See TracChangeset
for help on using the changeset viewer.
