IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 9, 2007, 3:59:08 PM (19 years ago)
Author:
jhoblitt
Message:

rename setFaultCode() -> pxSetFaultCode() and move it into it's own file
add p2tool -faultimfile & -pendingimfile -faulted & -pendingimfile -limit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/regtool.c

    r10988 r11002  
    4141static rawImfileRow *newToRawImfile(pxConfig *config, newImfileRow *exp);
    4242//static psU32 mapCodeStrToInt(const char *codeStr);
    43 static bool setFaultCode(psDB *dbh, const char *tableName, psMetadata *where, psS8 code);
    4443
    4544
     
    281280    }
    282281
    283     if (!setFaultCode(config->dbh, "newExp", config->where, code)) {
     282    if (!pxSetFaultCode(config->dbh, "newExp", config->where, code)) {
    284283        psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
    285284        return false;
     
    300299    }
    301300
    302     if (!setFaultCode(config->dbh, "newImfile", config->where, code)) {
     301    if (!pxSetFaultCode(config->dbh, "newImfile", config->where, code)) {
    303302        psError(PS_ERR_UNKNOWN, false, "failed to set set fault flag");
    304         return false;
    305     }
    306 
    307     return true;
    308 }
    309 
    310 
    311 static bool setFaultCode(psDB *dbh, const char *tableName, psMetadata *where, psS8 code)
    312 {
    313     PS_ASSERT_PTR_NON_NULL(dbh, false);
    314     PS_ASSERT_PTR_NON_NULL(tableName, false);
    315     PS_ASSERT_PTR_NON_NULL(where, false);
    316 
    317 #if 0
    318     // map code string to numeric fault code
    319     psU32 code = mapCodeStrToInt(codeStr);
    320     if (code == (psU32)-1) {
    321         psError(PS_ERR_UNKNOWN, false, "error resolving error code");
    322         return false;
    323     }
    324 #endif
    325 
    326     // update the database
    327     psMetadata *values = psMetadataAlloc();
    328     if (!psMetadataAddS8(values, PS_LIST_HEAD, "fault", 0, NULL, code)) {
    329         psError(PS_ERR_UNKNOWN, false, "failed to add metadata item fault");
    330         psFree(values);
    331         return false;
    332     }
    333     psFree(values);
    334 
    335     long rowsAffected = psDBUpdateRows(dbh, tableName, where, values);
    336     if (rowsAffected < 0) {
    337         // database error
    338         psError(PS_ERR_UNKNOWN, false, "database error");
    339         return false;
    340     }
    341     if (rowsAffected < 1) {
    342         // we didn't do anything
    343         psError(PS_ERR_UNKNOWN, false, "zero rows were affected - either the search criteria didn't match any rows or the field already had the value being set.");
    344303        return false;
    345304    }
     
    839798        exp->exp_tag,
    840799        "my recipe",
    841         0xff, // XXX calc version number
    842         0xff, // XXX calc version number
    843         label
     800        0xff,   // XXX calc version number
     801        0xff,   // XXX calc version number
     802        label,
     803        0       // fault code
    844804    );
    845805
     
    855815        "my recipe",
    856816        0xff, // XXX calc version number
    857         0xff // XXX calc version number
     817        0xff, // XXX calc version number
     818        0       // fault code
    858819    );
    859820}
Note: See TracChangeset for help on using the changeset viewer.