Changeset 10988 for trunk/ippTools/src/regtool.c
- Timestamp:
- Jan 8, 2007, 4:08:02 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/regtool.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/regtool.c
r10976 r10988 40 40 static rawDetrendExpRow *newToRawDetrendExp(pxConfig *config, newExpRow *exp); 41 41 static rawImfileRow *newToRawImfile(pxConfig *config, newImfileRow *exp); 42 static psU32 mapCodeStrToInt(const char *codeStr);43 static bool setFault Flags(psDB *dbh, const char *tableName, psMetadata *where, const char *codeStr);42 //static psU32 mapCodeStrToInt(const char *codeStr); 43 static bool setFaultCode(psDB *dbh, const char *tableName, psMetadata *where, psS8 code); 44 44 45 45 … … 128 128 if (faulted) { 129 129 // list only faulted rows 130 psStringAppend(&query, " %s", "AND newExp.f lags >0");130 psStringAppend(&query, " %s", "AND newExp.fault != 0"); 131 131 } else { 132 132 // don't list faulted rows 133 psStringAppend(&query, " %s", "AND newExp.f lags= 0");133 psStringAppend(&query, " %s", "AND newExp.fault = 0"); 134 134 } 135 135 … … 218 218 if (faulted) { 219 219 // list only faulted rows 220 psStringAppend(&query, " %s", "AND newImfile.f lags >0");220 psStringAppend(&query, " %s", "AND newImfile.fault != 0"); 221 221 } else { 222 222 // don't list faulted rows 223 psStringAppend(&query, " %s", "AND newImfile.f lags= 0");223 psStringAppend(&query, " %s", "AND newImfile.fault = 0"); 224 224 } 225 225 … … 275 275 { 276 276 bool status = false; 277 psS tring codeStr = psMetadataLookupStr(&status, config->args, "-code");277 psS8 code = psMetadataLookupS8(&status, config->args, "-code"); 278 278 if (!status) { 279 279 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code"); 280 280 return false; 281 281 } 282 if (!codeStr) { 283 psError(PS_ERR_UNKNOWN, true, "-code is required"); 284 return false; 285 } 286 287 if (!setFaultFlags(config->dbh, "newExp", config->where, codeStr)) { 282 283 if (!setFaultCode(config->dbh, "newExp", config->where, code)) { 288 284 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 289 285 return false; … … 298 294 299 295 bool status = false; 300 psS tring codeStr = psMetadataLookupStr(&status, config->args, "-code");296 psS8 code = psMetadataLookupS8(&status, config->args, "-code"); 301 297 if (!status) { 302 298 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -code"); 303 299 return false; 304 300 } 305 if (!codeStr) { 306 psError(PS_ERR_UNKNOWN, true, "-code is required"); 307 return false; 308 } 309 310 if (!setFaultFlags(config->dbh, "newImfile", config->where, codeStr)) { 301 302 if (!setFaultCode(config->dbh, "newImfile", config->where, code)) { 311 303 psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag"); 312 304 return false; … … 316 308 } 317 309 318 static bool setFaultFlags(psDB *dbh, const char *tableName, psMetadata *where, const char *codeStr) 310 311 static bool setFaultCode(psDB *dbh, const char *tableName, psMetadata *where, psS8 code) 319 312 { 320 313 PS_ASSERT_PTR_NON_NULL(dbh, false); 321 314 PS_ASSERT_PTR_NON_NULL(tableName, false); 322 PS_ASSERT_PTR_NON_NULL(codeStr, false); 323 315 PS_ASSERT_PTR_NON_NULL(where, false); 316 317 #if 0 324 318 // map code string to numeric fault code 325 319 psU32 code = mapCodeStrToInt(codeStr); … … 328 322 return false; 329 323 } 324 #endif 330 325 331 326 // update the database 332 327 psMetadata *values = psMetadataAlloc(); 333 if (!psMetadataAdd U32(values, PS_LIST_HEAD, "flags", 0, NULL, code)) {334 psError(PS_ERR_UNKNOWN, false, "failed to add metadata item f lags");328 if (!psMetadataAddS8(values, PS_LIST_HEAD, "fault", 0, NULL, code)) { 329 psError(PS_ERR_UNKNOWN, false, "failed to add metadata item fault"); 335 330 psFree(values); 336 331 return false; … … 1141 1136 } 1142 1137 1138 #if 0 1143 1139 static psU32 mapCodeStrToInt(const char *codeStr) 1144 1140 { … … 1157 1153 return (psU32) -1; 1158 1154 } 1155 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
