IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 14252


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

VERSION 1.1.26

Location:
trunk/ippdb
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/configure.ac

    r14232 r14252  
    77AC_PREREQ(2.61)
    88
    9 AC_INIT([ippdb], [1.1.25], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [1.1.26], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • 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)
  • trunk/ippdb/src/ippdb.h

    r14169 r14252  
    49624962typedef struct {
    49634963    psS64           diff_id;
     4964    bool            template;
     4965    psS64           stack_id;
    49644966    psS64           warp_id;
    49654967    char            *skycell_id;
    49664968    char            *tess_id;
    49674969    char            *kind;
    4968     bool            template;
    49694970} diffInputSkyfileRow;
    49704971
     
    49764977diffInputSkyfileRow *diffInputSkyfileRowAlloc(
    49774978    psS64           diff_id,
     4979    bool            template,
     4980    psS64           stack_id,
    49784981    psS64           warp_id,
    49794982    const char      *skycell_id,
    49804983    const char      *tess_id,
    4981     const char      *kind,
    4982     bool            template
     4984    const char      *kind
    49834985);
    49844986
     
    50115013    psDB            *dbh,               ///< Database handle
    50125014    psS64           diff_id,
     5015    bool            template,
     5016    psS64           stack_id,
    50135017    psS64           warp_id,
    50145018    const char      *skycell_id,
    50155019    const char      *tess_id,
    5016     const char      *kind,
    5017     bool            template
     5020    const char      *kind
    50185021);
    50195022
  • trunk/ippdb/tests/alloc.c

    r14169 r14252  
    11001100        diffInputSkyfileRow *object;
    11011101
    1102         object = diffInputSkyfileRowAlloc(-64, -64, "a string", "a string", "a string", true    );
     1102        object = diffInputSkyfileRowAlloc(-64, true, -64, -64, "a string", "a string", "a string"    );
    11031103
    11041104        if (!object) {
     
    11101110            exit(EXIT_FAILURE);
    11111111        }
     1112        if (!object->template == true) {
     1113            psFree(object);
     1114            exit(EXIT_FAILURE);
     1115        }
     1116        if (!object->stack_id == -64) {
     1117            psFree(object);
     1118            exit(EXIT_FAILURE);
     1119        }
    11121120        if (!object->warp_id == -64) {
    11131121            psFree(object);
     
    11231131        }
    11241132        if (strncmp(object->kind, "a string", MAX_STRING_LENGTH)) {
    1125             psFree(object);
    1126             exit(EXIT_FAILURE);
    1127         }
    1128         if (!object->template == true) {
    11291133            psFree(object);
    11301134            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r14169 r14252  
    343343        }
    344344
    345         if (!diffInputSkyfileInsert(dbh, -64, -64, "a string", "a string", "a string", true)) {
     345        if (!diffInputSkyfileInsert(dbh, -64, true, -64, -64, "a string", "a string", "a string")) {
    346346            exit(EXIT_FAILURE);
    347347        }
  • trunk/ippdb/tests/insertobject.c

    r14169 r14252  
    498498        }
    499499
    500         object = diffInputSkyfileRowAlloc(-64, -64, "a string", "a string", "a string", true);
     500        object = diffInputSkyfileRowAlloc(-64, true, -64, -64, "a string", "a string", "a string");
    501501        if (!object) {
    502502            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r14169 r14252  
    12491249        bool            status;
    12501250
    1251         object = diffInputSkyfileRowAlloc(-64, -64, "a string", "a string", "a string", true);
     1251        object = diffInputSkyfileRowAlloc(-64, true, -64, -64, "a string", "a string", "a string");
    12521252        if (!object) {
    12531253            exit(EXIT_FAILURE);
     
    12641264            exit(EXIT_FAILURE);
    12651265        }
     1266        if (!psMetadataLookupBool(&status, md, "template") == true) {
     1267            psFree(md);
     1268            exit(EXIT_FAILURE);
     1269        }
     1270            psFree(md);
     1271            exit(EXIT_FAILURE);
     1272        }
    12661273            psFree(md);
    12671274            exit(EXIT_FAILURE);
     
    12761283        }
    12771284        if (strncmp(psMetadataLookupPtr(&status, md, "kind"), "a string", MAX_STRING_LENGTH)) {
    1278             psFree(md);
    1279             exit(EXIT_FAILURE);
    1280         }
    1281         if (!psMetadataLookupBool(&status, md, "template") == true) {
    12821285            psFree(md);
    12831286            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r14169 r14252  
    19601960            exit(EXIT_FAILURE);
    19611961        }
     1962        if (!psMetadataAdd(md, PS_LIST_TAIL, "template", PS_DATA_BOOL, NULL, true)) {
     1963            psFree(md);
     1964            exit(EXIT_FAILURE);
     1965        }
     1966            psFree(md);
     1967            exit(EXIT_FAILURE);
     1968        }
    19621969            psFree(md);
    19631970            exit(EXIT_FAILURE);
     
    19751982            exit(EXIT_FAILURE);
    19761983        }
    1977         if (!psMetadataAdd(md, PS_LIST_TAIL, "template", PS_DATA_BOOL, NULL, true)) {
    1978             psFree(md);
    1979             exit(EXIT_FAILURE);
    1980         }
    19811984
    19821985        object = diffInputSkyfileObjectFromMetadata(md);
     
    19911994            exit(EXIT_FAILURE);
    19921995        }
     1996        if (!object->template == true) {
     1997            psFree(object);
     1998            exit(EXIT_FAILURE);
     1999        }
     2000            psFree(object);
     2001            exit(EXIT_FAILURE);
     2002        }
    19932003            psFree(object);
    19942004            exit(EXIT_FAILURE);
     
    20032013        }
    20042014        if (strncmp(object->kind, "a string", MAX_STRING_LENGTH)) {
    2005             psFree(object);
    2006             exit(EXIT_FAILURE);
    2007         }
    2008         if (!object->template == true) {
    20092015            psFree(object);
    20102016            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.