IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 4, 2006, 1:04:56 PM (20 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.13

File:
1 edited

Legend:

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

    r8122 r8148  
    1466914669static void detResidImfileAnalysisRowFree(detResidImfileAnalysisRow *object);
    1467014670
    14671 detResidImfileAnalysisRow *detResidImfileAnalysisRowAlloc(psS32 det_id, psS32 iteration, const char *exp_id, const char *class_id, const char *recipe)
     14671detResidImfileAnalysisRow *detResidImfileAnalysisRowAlloc(psS32 det_id, psS32 iteration, const char *exp_id, const char *class_id, const char *recipe, const char *uri, const char *b1_uri, const char *b2_uri)
    1467214672{
    1467314673    detResidImfileAnalysisRow *object;
     
    1468114681    object->class_id = psStringCopy(class_id);
    1468214682    object->recipe = psStringCopy(recipe);
     14683    object->uri = psStringCopy(uri);
     14684    object->b1_uri = psStringCopy(b1_uri);
     14685    object->b2_uri = psStringCopy(b2_uri);
    1468314686
    1468414687    return object;
     
    1469014693    psFree(object->class_id);
    1469114694    psFree(object->recipe);
     14695    psFree(object->uri);
     14696    psFree(object->b1_uri);
     14697    psFree(object->b2_uri);
    1469214698}
    1469314699
     
    1472814734        return false;
    1472914735    }
     14736    if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, "64")) {
     14737        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     14738        psFree(md);
     14739        return false;
     14740    }
     14741    if (!psMetadataAddStr(md, PS_LIST_TAIL, "b1_uri", 0, NULL, "64")) {
     14742        psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri");
     14743        psFree(md);
     14744        return false;
     14745    }
     14746    if (!psMetadataAddStr(md, PS_LIST_TAIL, "b2_uri", 0, NULL, "64")) {
     14747        psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri");
     14748        psFree(md);
     14749        return false;
     14750    }
    1473014751
    1473114752    status = psDBCreateTable(dbh, DETRESIDIMFILEANALYSIS_TABLE_NAME, md);
     
    1474114762}
    1474214763
    14743 bool detResidImfileAnalysisInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_id, const char *class_id, const char *recipe)
     14764bool detResidImfileAnalysisInsert(psDB * dbh, psS32 det_id, psS32 iteration, const char *exp_id, const char *class_id, const char *recipe, const char *uri, const char *b1_uri, const char *b2_uri)
    1474414765{
    1474514766    psMetadata      *md;
     
    1476914790    if (!psMetadataAddStr(md, PS_LIST_TAIL, "recipe", 0, NULL, recipe)) {
    1477014791        psError(PS_ERR_UNKNOWN, false, "failed to add item recipe");
     14792        psFree(md);
     14793        return false;
     14794    }
     14795    if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, uri)) {
     14796        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     14797        psFree(md);
     14798        return false;
     14799    }
     14800    if (!psMetadataAddStr(md, PS_LIST_TAIL, "b1_uri", 0, NULL, b1_uri)) {
     14801        psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri");
     14802        psFree(md);
     14803        return false;
     14804    }
     14805    if (!psMetadataAddStr(md, PS_LIST_TAIL, "b2_uri", 0, NULL, b2_uri)) {
     14806        psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri");
    1477114807        psFree(md);
    1477214808        return false;
     
    1479314829    return deleted;
    1479414830}
    14795 bool detResidImfileAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **class_id, char **recipe)
     14831bool detResidImfileAnalysisPop(psDB *dbh, psS32 *det_id, psS32 *iteration, char **exp_id, char **class_id, char **recipe, char **uri, char **b1_uri, char **b2_uri)
    1479614832{
    1479714833    psArray         *rowSet;
     
    1486714903        return false;
    1486814904    }
     14905    *uri = psMetadataLookupPtr(&status, row, "uri");
     14906    if (!status) {
     14907        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item uri");
     14908        psFree(row);
     14909        return false;
     14910    }
     14911    *b1_uri = psMetadataLookupPtr(&status, row, "b1_uri");
     14912    if (!status) {
     14913        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b1_uri");
     14914        psFree(row);
     14915        return false;
     14916    }
     14917    *b2_uri = psMetadataLookupPtr(&status, row, "b2_uri");
     14918    if (!status) {
     14919        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b2_uri");
     14920        psFree(row);
     14921        return false;
     14922    }
    1486914923
    1487014924    psFree(row);
     
    1487514929bool detResidImfileAnalysisInsertObject(psDB *dbh, detResidImfileAnalysisRow *object)
    1487614930{
    14877     return detResidImfileAnalysisInsert(dbh, object->det_id, object->iteration, object->exp_id, object->class_id, object->recipe);
     14931    return detResidImfileAnalysisInsert(dbh, object->det_id, object->iteration, object->exp_id, object->class_id, object->recipe, object->uri, object->b1_uri, object->b2_uri);
    1487814932}
    1487914933
     
    1488514939    char            class_id[256];
    1488614940    char            recipe[256];
    14887 
    14888     if (!detResidImfileAnalysisPop(dbh, &det_id, &iteration, (char **)&exp_id, (char **)&class_id, (char **)&recipe)) {
     14941    char            uri[256];
     14942    char            b1_uri[256];
     14943    char            b2_uri[256];
     14944
     14945    if (!detResidImfileAnalysisPop(dbh, &det_id, &iteration, (char **)&exp_id, (char **)&class_id, (char **)&recipe, (char **)&uri, (char **)&b1_uri, (char **)&b2_uri)) {
    1488914946        psError(PS_ERR_UNKNOWN, false, "failed to pop a database row");
    1489014947        return NULL;
    1489114948    }
    1489214949
    14893     return detResidImfileAnalysisRowAlloc(det_id, iteration, exp_id, class_id, recipe);
     14950    return detResidImfileAnalysisRowAlloc(det_id, iteration, exp_id, class_id, recipe, uri, b1_uri, b2_uri);
    1489414951}
    1489514952
     
    1501515072        return NULL;
    1501615073    }
     15074    if (!psMetadataAddStr(md, PS_LIST_TAIL, "uri", 0, NULL, object->uri)) {
     15075        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     15076        psFree(md);
     15077        return NULL;
     15078    }
     15079    if (!psMetadataAddStr(md, PS_LIST_TAIL, "b1_uri", 0, NULL, object->b1_uri)) {
     15080        psError(PS_ERR_UNKNOWN, false, "failed to add item b1_uri");
     15081        psFree(md);
     15082        return NULL;
     15083    }
     15084    if (!psMetadataAddStr(md, PS_LIST_TAIL, "b2_uri", 0, NULL, object->b2_uri)) {
     15085        psError(PS_ERR_UNKNOWN, false, "failed to add item b2_uri");
     15086        psFree(md);
     15087        return NULL;
     15088    }
    1501715089
    1501815090    return md;
     
    1502715099    char            *class_id;
    1502815100    char            *recipe;
     15101    char            *uri;
     15102    char            *b1_uri;
     15103    char            *b2_uri;
    1502915104
    1503015105    det_id = psMetadataLookupS32(&status, md, "det_id");
     
    1505315128        return false;
    1505415129    }
    15055 
    15056     return detResidImfileAnalysisRowAlloc(det_id, iteration, exp_id, class_id, recipe);
     15130    uri = psMetadataLookupPtr(&status, md, "uri");
     15131    if (!status) {
     15132        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item uri");
     15133        return false;
     15134    }
     15135    b1_uri = psMetadataLookupPtr(&status, md, "b1_uri");
     15136    if (!status) {
     15137        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b1_uri");
     15138        return false;
     15139    }
     15140    b2_uri = psMetadataLookupPtr(&status, md, "b2_uri");
     15141    if (!status) {
     15142        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item b2_uri");
     15143        return false;
     15144    }
     15145
     15146    return detResidImfileAnalysisRowAlloc(det_id, iteration, exp_id, class_id, recipe, uri, b1_uri, b2_uri);
    1505715147}
    1505815148psArray *detResidImfileAnalysisSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Note: See TracChangeset for help on using the changeset viewer.