IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 16, 2007, 5:10:27 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 1.1.26

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/src/ippdb.c

    r14232 r14252  
    1013510135static void diffInputSkyfileRowFree(diffInputSkyfileRow *object);
    1013610136
    10137 diffInputSkyfileRow *diffInputSkyfileRowAlloc(psS64 diff_id, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *kind, bool template)
     10137diffInputSkyfileRow *diffInputSkyfileRowAlloc(psS64 diff_id, bool template, psS64 stack_id, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *kind)
    1013810138{
    1013910139    diffInputSkyfileRow *_object;
     
    1014310143
    1014410144    _object->diff_id = diff_id;
     10145    _object->template = template;
     10146    _object->stack_id = stack_id;
    1014510147    _object->warp_id = warp_id;
    1014610148    _object->skycell_id = psStringCopy(skycell_id);
    1014710149    _object->tess_id = psStringCopy(tess_id);
    1014810150    _object->kind = psStringCopy(kind);
    10149     _object->template = template;
    1015010151
    1015110152    return _object;
     
    1016710168        return false;
    1016810169    }
    10169     if (!psMetadataAdd(md, PS_LIST_TAIL, "warp_id", PS_DATA_S64, "Primary Key fkey(warp_id, skycell_id, tess_id) ref warpSkyfile(warp_id, skycell_id, tess_id)", 0)) {
     10170    if (!psMetadataAdd(md, PS_LIST_TAIL, "template", PS_DATA_BOOL, "Primary Key", 0)) {
     10171        psError(PS_ERR_UNKNOWN, false, "failed to add item template");
     10172        psFree(md);
     10173        return false;
     10174    }
     10175    if (!psMetadataAdd(md, PS_LIST_TAIL, "stack_id", PS_DATA_S64, "fkey(stack_id) ref stackSumSkyfile(stack_id)", 0)) {
     10176        psError(PS_ERR_UNKNOWN, false, "failed to add item stack_id");
     10177        psFree(md);
     10178        return false;
     10179    }
     10180    if (!psMetadataAdd(md, PS_LIST_TAIL, "warp_id", PS_DATA_S64, "fkey(warp_id, skycell_id, tess_id) ref warpSkyfile(warp_id, skycell_id, tess_id)", 0)) {
    1017010181        psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id");
    1017110182        psFree(md);
    1017210183        return false;
    1017310184    }
    10174     if (!psMetadataAdd(md, PS_LIST_TAIL, "skycell_id", PS_DATA_STRING, "Primary Key", "64")) {
     10185    if (!psMetadataAdd(md, PS_LIST_TAIL, "skycell_id", PS_DATA_STRING, "Key", "64")) {
    1017510186        psError(PS_ERR_UNKNOWN, false, "failed to add item skycell_id");
    1017610187        psFree(md);
    1017710188        return false;
    1017810189    }
    10179     if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, "Primary Key", "64")) {
     10190    if (!psMetadataAdd(md, PS_LIST_TAIL, "tess_id", PS_DATA_STRING, "Key", "64")) {
    1018010191        psError(PS_ERR_UNKNOWN, false, "failed to add item tess_id");
    1018110192        psFree(md);
     
    1018710198        return false;
    1018810199    }
    10189     if (!psMetadataAdd(md, PS_LIST_TAIL, "template", PS_DATA_BOOL, NULL, 0)) {
    10190         psError(PS_ERR_UNKNOWN, false, "failed to add item template");
    10191         psFree(md);
    10192         return false;
    10193     }
    1019410200
    1019510201    bool status = psDBCreateTable(dbh, DIFFINPUTSKYFILE_TABLE_NAME, md);
     
    1020510211}
    1020610212
    10207 bool diffInputSkyfileInsert(psDB * dbh, psS64 diff_id, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *kind, bool template)
     10213bool diffInputSkyfileInsert(psDB * dbh, psS64 diff_id, bool template, psS64 stack_id, psS64 warp_id, const char *skycell_id, const char *tess_id, const char *kind)
    1020810214{
    1020910215    psMetadata *md = psMetadataAlloc();
     
    1021310219        return false;
    1021410220    }
     10221    if (!psMetadataAdd(md, PS_LIST_TAIL, "template", PS_DATA_BOOL, NULL, template)) {
     10222        psError(PS_ERR_UNKNOWN, false, "failed to add item template");
     10223        psFree(md);
     10224        return false;
     10225    }
     10226    if (!psMetadataAdd(md, PS_LIST_TAIL, "stack_id", PS_DATA_S64, NULL, stack_id)) {
     10227        psError(PS_ERR_UNKNOWN, false, "failed to add item stack_id");
     10228        psFree(md);
     10229        return false;
     10230    }
    1021510231    if (!psMetadataAdd(md, PS_LIST_TAIL, "warp_id", PS_DATA_S64, NULL, warp_id)) {
    1021610232        psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id");
     
    1023010246    if (!psMetadataAdd(md, PS_LIST_TAIL, "kind", PS_DATA_STRING, NULL, kind)) {
    1023110247        psError(PS_ERR_UNKNOWN, false, "failed to add item kind");
    10232         psFree(md);
    10233         return false;
    10234     }
    10235     if (!psMetadataAdd(md, PS_LIST_TAIL, "template", PS_DATA_BOOL, NULL, template)) {
    10236         psError(PS_ERR_UNKNOWN, false, "failed to add item template");
    1023710248        psFree(md);
    1023810249        return false;
     
    1026110272bool diffInputSkyfileInsertObject(psDB *dbh, diffInputSkyfileRow *object)
    1026210273{
    10263     return diffInputSkyfileInsert(dbh, object->diff_id, object->warp_id, object->skycell_id, object->tess_id, object->kind, object->template);
     10274    return diffInputSkyfileInsert(dbh, object->diff_id, object->template, object->stack_id, object->warp_id, object->skycell_id, object->tess_id, object->kind);
    1026410275}
    1026510276
     
    1033910350        return false;
    1034010351    }
     10352    if (!psMetadataAdd(md, PS_LIST_TAIL, "template", PS_DATA_BOOL, NULL, object->template)) {
     10353        psError(PS_ERR_UNKNOWN, false, "failed to add item template");
     10354        psFree(md);
     10355        return false;
     10356    }
     10357    if (!psMetadataAdd(md, PS_LIST_TAIL, "stack_id", PS_DATA_S64, NULL, object->stack_id)) {
     10358        psError(PS_ERR_UNKNOWN, false, "failed to add item stack_id");
     10359        psFree(md);
     10360        return false;
     10361    }
    1034110362    if (!psMetadataAdd(md, PS_LIST_TAIL, "warp_id", PS_DATA_S64, NULL, object->warp_id)) {
    1034210363        psError(PS_ERR_UNKNOWN, false, "failed to add item warp_id");
     
    1035910380        return false;
    1036010381    }
    10361     if (!psMetadataAdd(md, PS_LIST_TAIL, "template", PS_DATA_BOOL, NULL, object->template)) {
    10362         psError(PS_ERR_UNKNOWN, false, "failed to add item template");
    10363         psFree(md);
    10364         return false;
    10365     }
    1036610382
    1036710383
     
    1037810394        return false;
    1037910395    }
     10396    bool template = psMetadataLookupBool(&status, md, "template");
     10397    if (!status) {
     10398        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item template");
     10399        return false;
     10400    }
     10401    psS64 stack_id = psMetadataLookupS64(&status, md, "stack_id");
     10402    if (!status) {
     10403        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item stack_id");
     10404        return false;
     10405    }
    1038010406    psS64 warp_id = psMetadataLookupS64(&status, md, "warp_id");
    1038110407    if (!status) {
     
    1039810424        return false;
    1039910425    }
    10400     bool template = psMetadataLookupBool(&status, md, "template");
    10401     if (!status) {
    10402         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item template");
    10403         return false;
    10404     }
    10405 
    10406     return diffInputSkyfileRowAlloc(diff_id, warp_id, skycell_id, tess_id, kind, template);
     10426
     10427    return diffInputSkyfileRowAlloc(diff_id, template, stack_id, warp_id, skycell_id, tess_id, kind);
    1040710428}
    1040810429psArray *diffInputSkyfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
Note: See TracChangeset for help on using the changeset viewer.