IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 9, 2006, 6:22:07 PM (20 years ago)
Author:
jhoblitt
Message:

rel-0_0_02

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/jhoblitt/ippdb/src/ippdb.c

    r7460 r7500  
    1052910529static void detRunRowFree(detRunRow *object);
    1053010530
    10531 detRunRow *detRunRowAlloc(const char *det_type)
     10531detRunRow *detRunRowAlloc(const char *det_type, psS32 iteration)
    1053210532{
    1053310533    detRunRow       *object;
     
    1053710537
    1053810538    object->det_type = psStringCopy(det_type);
     10539    object->iteration = iteration;
    1053910540
    1054010541    return object;
     
    1056210563        return false;
    1056310564    }
     10565    if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, 0)) {
     10566        psError(PS_ERR_UNKNOWN, false, "failed to add item iteration");
     10567        psFree(md);
     10568        return false;
     10569    }
    1056410570
    1056510571    status = psDBCreateTable(dbh, DETRUN_TABLE_NAME, md);
     
    1057510581}
    1057610582
    10577 bool detRunInsert(psDB * dbh, const char *det_type)
     10583bool detRunInsert(psDB * dbh, const char *det_type, psS32 iteration)
    1057810584{
    1057910585    psMetadata      *md;
     
    1058610592        return false;
    1058710593    }
     10594    if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, iteration)) {
     10595        psError(PS_ERR_UNKNOWN, false, "failed to add item iteration");
     10596        psFree(md);
     10597        return false;
     10598    }
    1058810599
    1058910600    status = psDBInsertOneRow(dbh, DETRUN_TABLE_NAME, md);
     
    1059310604}
    1059410605
    10595 bool detRunPop(psDB *dbh, char **det_type)
     10606bool detRunPop(psDB *dbh, char **det_type, psS32 *iteration)
    1059610607{
    1059710608    psArray         *rowSet;
     
    1064310654        return false;
    1064410655    }
     10656    *iteration = psMetadataLookupS32(&status, row, "iteration");
     10657    if (!status) {
     10658        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item iteration");
     10659        psFree(row);
     10660        return false;
     10661    }
    1064510662
    1064610663    psFree(row);
     
    1065110668bool detRunInsertObject(psDB *dbh, detRunRow *object)
    1065210669{
    10653     return detRunInsert(dbh, object->det_type);
     10670    return detRunInsert(dbh, object->det_type, object->iteration);
    1065410671}
    1065510672
     
    1065710674{
    1065810675    char            det_type[256];
    10659 
    10660     if (!detRunPop(dbh, (char **)&det_type)) {
     10676    psS32           iteration;
     10677
     10678    if (!detRunPop(dbh, (char **)&det_type, &iteration)) {
    1066110679        psError(PS_ERR_UNKNOWN, false, "failed to pop a database row");
    1066210680        return NULL;
    1066310681    }
    1066410682
    10665     return detRunRowAlloc(det_type);
     10683    return detRunRowAlloc(det_type, iteration);
    1066610684}
    1066710685
     
    1076710785        return NULL;
    1076810786    }
     10787    if (!psMetadataAddS32(md, PS_LIST_TAIL, "iteration", 0, NULL, object->iteration)) {
     10788        psError(PS_ERR_UNKNOWN, false, "failed to add item iteration");
     10789        psFree(md);
     10790        return NULL;
     10791    }
    1076910792
    1077010793    return md;
     
    1077510798    bool            status;
    1077610799    char            *det_type;
     10800    psS32           iteration;
    1077710801
    1077810802    det_type = psMetadataLookupPtr(&status, md, "det_type");
     
    1078110805        return false;
    1078210806    }
    10783 
    10784     return detRunRowAlloc(det_type);
     10807    iteration = psMetadataLookupS32(&status, md, "iteration");
     10808    if (!status) {
     10809        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item iteration");
     10810        return false;
     10811    }
     10812
     10813    return detRunRowAlloc(det_type, iteration);
    1078510814}
    1078610815psArray *detRunSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Note: See TracChangeset for help on using the changeset viewer.