IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11030


Ignore:
Timestamp:
Jan 11, 2007, 11:59:35 AM (19 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.72

Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/config.md

    r11026 r11030  
    22    pkg_name        STR     ippdb
    33    pkg_namespace   STR     ippdb
    4     pkg_version     STR     0.0.71
     4    pkg_version     STR     0.0.72
    55END
  • trunk/dbconfig/tasks.md

    r11026 r11030  
    1 # $Id: tasks.md,v 1.103 2007-01-11 04:43:37 jhoblitt Exp $
     1# $Id: tasks.md,v 1.104 2007-01-11 21:59:35 jhoblitt Exp $
    22
    33# this table records all exposure ID ever seen from the summit
     
    192192    p2_version  S32         0
    193193    label       STR         64      # key
    194     fault       S16         0       # NOT NULL
    195194END
    196195
     
    204203    p1_version  S32         0
    205204    p2_version  S32         0
    206     fault       S16         0       # NOT NULL
    207205END
    208206
     
    236234    p1_version  S32         0
    237235    p2_version  S32         0
     236    fault       S16         0       # NOT NULL
    238237END
    239238
  • trunk/ippdb/configure.ac

    r11027 r11030  
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [0.0.71], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [0.0.72], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r11027 r11030  
    58795879static void p2PendingExpRowFree(p2PendingExpRow *object);
    58805880
    5881 p2PendingExpRow *p2PendingExpRowAlloc(const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label, psS16 fault)
     5881p2PendingExpRow *p2PendingExpRowAlloc(const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label)
    58825882{
    58835883    p2PendingExpRow *_object;
     
    58915891    _object->p2_version = p2_version;
    58925892    _object->label = psStringCopy(label);
    5893     _object->fault = fault;
    58945893
    58955894    return _object;
     
    59315930        return false;
    59325931    }
    5933     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
    5934         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    5935         psFree(md);
    5936         return false;
    5937     }
    59385932
    59395933    bool status = psDBCreateTable(dbh, P2PENDINGEXP_TABLE_NAME, md);
     
    59495943}
    59505944
    5951 bool p2PendingExpInsert(psDB * dbh, const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label, psS16 fault)
     5945bool p2PendingExpInsert(psDB * dbh, const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label)
    59525946{
    59535947    psMetadata *md = psMetadataAlloc();
     
    59745968    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) {
    59755969        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
    5976         psFree(md);
    5977         return false;
    5978     }
    5979     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
    5980         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    59815970        psFree(md);
    59825971        return false;
     
    60055994bool p2PendingExpInsertObject(psDB *dbh, p2PendingExpRow *object)
    60065995{
    6007     return p2PendingExpInsert(dbh, object->exp_tag, object->recipe, object->p1_version, object->p2_version, object->label, object->fault);
     5996    return p2PendingExpInsert(dbh, object->exp_tag, object->recipe, object->p1_version, object->p2_version, object->label);
    60085997}
    60095998
     
    61036092        return false;
    61046093    }
    6105     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
    6106         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    6107         psFree(md);
    6108         return false;
    6109     }
    61106094
    61116095
     
    61426126        return false;
    61436127    }
    6144     psS16 fault = psMetadataLookupS16(&status, md, "fault");
    6145     if (!status) {
    6146         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
    6147         return false;
    6148     }
    6149 
    6150     return p2PendingExpRowAlloc(exp_tag, recipe, p1_version, p2_version, label, fault);
     6128
     6129    return p2PendingExpRowAlloc(exp_tag, recipe, p1_version, p2_version, label);
    61516130}
    61526131psArray *p2PendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    62606239static void p2PendingImfileRowFree(p2PendingImfileRow *object);
    62616240
    6262 p2PendingImfileRow *p2PendingImfileRowAlloc(const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version, psS16 fault)
     6241p2PendingImfileRow *p2PendingImfileRowAlloc(const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version)
    62636242{
    62646243    p2PendingImfileRow *_object;
     
    62736252    _object->p1_version = p1_version;
    62746253    _object->p2_version = p2_version;
    6275     _object->fault = fault;
    62766254
    62776255    return _object;
     
    63196297        return false;
    63206298    }
    6321     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
    6322         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    6323         psFree(md);
    6324         return false;
    6325     }
    63266299
    63276300    bool status = psDBCreateTable(dbh, P2PENDINGIMFILE_TABLE_NAME, md);
     
    63376310}
    63386311
    6339 bool p2PendingImfileInsert(psDB * dbh, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version, psS16 fault)
     6312bool p2PendingImfileInsert(psDB * dbh, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version)
    63406313{
    63416314    psMetadata *md = psMetadataAlloc();
     
    63676340    if (!psMetadataAdd(md, PS_LIST_TAIL, "p2_version", PS_DATA_S32, NULL, p2_version)) {
    63686341        psError(PS_ERR_UNKNOWN, false, "failed to add item p2_version");
    6369         psFree(md);
    6370         return false;
    6371     }
    6372     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
    6373         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    63746342        psFree(md);
    63756343        return false;
     
    63986366bool p2PendingImfileInsertObject(psDB *dbh, p2PendingImfileRow *object)
    63996367{
    6400     return p2PendingImfileInsert(dbh, object->exp_tag, object->class_id, object->uri, object->recipe, object->p1_version, object->p2_version, object->fault);
     6368    return p2PendingImfileInsert(dbh, object->exp_tag, object->class_id, object->uri, object->recipe, object->p1_version, object->p2_version);
    64016369}
    64026370
     
    65016469        return false;
    65026470    }
    6503     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
    6504         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    6505         psFree(md);
    6506         return false;
    6507     }
    65086471
    65096472
     
    65456508        return false;
    65466509    }
    6547     psS16 fault = psMetadataLookupS16(&status, md, "fault");
    6548     if (!status) {
    6549         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
    6550         return false;
    6551     }
    6552 
    6553     return p2PendingImfileRowAlloc(exp_tag, class_id, uri, recipe, p1_version, p2_version, fault);
     6510
     6511    return p2PendingImfileRowAlloc(exp_tag, class_id, uri, recipe, p1_version, p2_version);
    65546512}
    65556513psArray *p2PendingImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    72757233static void p2ProcessedImfileRowFree(p2ProcessedImfileRow *object);
    72767234
    7277 p2ProcessedImfileRow *p2ProcessedImfileRowAlloc(const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS32 p1_version, psS32 p2_version)
     7235p2ProcessedImfileRow *p2ProcessedImfileRowAlloc(const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS32 p1_version, psS32 p2_version, psS16 fault)
    72787236{
    72797237    p2ProcessedImfileRow *_object;
     
    72937251    _object->p1_version = p1_version;
    72947252    _object->p2_version = p2_version;
     7253    _object->fault = fault;
    72957254
    72967255    return _object;
     
    73657324        return false;
    73667325    }
     7326    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     7327        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     7328        psFree(md);
     7329        return false;
     7330    }
    73677331
    73687332    bool status = psDBCreateTable(dbh, P2PROCESSEDIMFILE_TABLE_NAME, md);
     
    73787342}
    73797343
    7380 bool p2ProcessedImfileInsert(psDB * dbh, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS32 p1_version, psS32 p2_version)
     7344bool p2ProcessedImfileInsert(psDB * dbh, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, const char *b1_uri, const char *b2_uri, psS32 p1_version, psS32 p2_version, psS16 fault)
    73817345{
    73827346    psMetadata *md = psMetadataAlloc();
     
    74337397    if (!psMetadataAdd(md, PS_LIST_TAIL, "p2_version", PS_DATA_S32, NULL, p2_version)) {
    74347398        psError(PS_ERR_UNKNOWN, false, "failed to add item p2_version");
     7399        psFree(md);
     7400        return false;
     7401    }
     7402    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     7403        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    74357404        psFree(md);
    74367405        return false;
     
    74597428bool p2ProcessedImfileInsertObject(psDB *dbh, p2ProcessedImfileRow *object)
    74607429{
    7461     return p2ProcessedImfileInsert(dbh, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->p1_version, object->p2_version);
     7430    return p2ProcessedImfileInsert(dbh, object->exp_tag, object->class_id, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->b1_uri, object->b2_uri, object->p1_version, object->p2_version, object->fault);
    74627431}
    74637432
     
    75877556        return false;
    75887557    }
     7558    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     7559        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     7560        psFree(md);
     7561        return false;
     7562    }
    75897563
    75907564
     
    76517625        return false;
    76527626    }
    7653 
    7654     return p2ProcessedImfileRowAlloc(exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, p1_version, p2_version);
     7627    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     7628    if (!status) {
     7629        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     7630        return false;
     7631    }
     7632
     7633    return p2ProcessedImfileRowAlloc(exp_tag, class_id, uri, recipe, bg, bg_stdev, bg_mean_stdev, b1_uri, b2_uri, p1_version, p2_version, fault);
    76557634}
    76567635psArray *p2ProcessedImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r11027 r11030  
    29592959    psS32           p2_version;
    29602960    char            *label;
    2961     psS16           fault;
    29622961} p2PendingExpRow;
    29632962
     
    29722971    psS32           p1_version,
    29732972    psS32           p2_version,
    2974     const char      *label,
    2975     psS16           fault
     2973    const char      *label
    29762974);
    29772975
     
    30073005    psS32           p1_version,
    30083006    psS32           p2_version,
    3009     const char      *label,
    3010     psS16           fault
     3007    const char      *label
    30113008);
    30123009
     
    31703167    psS32           p1_version;
    31713168    psS32           p2_version;
    3172     psS16           fault;
    31733169} p2PendingImfileRow;
    31743170
     
    31843180    const char      *recipe,
    31853181    psS32           p1_version,
    3186     psS32           p2_version,
    3187     psS16           fault
     3182    psS32           p2_version
    31883183);
    31893184
     
    32203215    const char      *recipe,
    32213216    psS32           p1_version,
    3222     psS32           p2_version,
    3223     psS16           fault
     3217    psS32           p2_version
    32243218);
    32253219
     
    37873781    psS32           p1_version;
    37883782    psS32           p2_version;
     3783    psS16           fault;
    37893784} p2ProcessedImfileRow;
    37903785
     
    38053800    const char      *b2_uri,
    38063801    psS32           p1_version,
    3807     psS32           p2_version
     3802    psS32           p2_version,
     3803    psS16           fault
    38083804);
    38093805
     
    38453841    const char      *b2_uri,
    38463842    psS32           p1_version,
    3847     psS32           p2_version
     3843    psS32           p2_version,
     3844    psS16           fault
    38483845);
    38493846
  • trunk/ippdb/tests/alloc.c

    r11027 r11030  
    608608        p2PendingExpRow *object;
    609609
    610         object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16    );
     610        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string"    );
    611611
    612612        if (!object) {
     
    634634            exit(EXIT_FAILURE);
    635635        }
    636             psFree(object);
    637             exit(EXIT_FAILURE);
    638         }
    639636
    640637        psFree(object);
     
    644641        p2PendingImfileRow *object;
    645642
    646         object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16    );
     643        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32    );
    647644
    648645        if (!object) {
     
    674671            exit(EXIT_FAILURE);
    675672        }
    676             psFree(object);
    677             exit(EXIT_FAILURE);
    678         }
    679673
    680674        psFree(object);
     
    730724        p2ProcessedImfileRow *object;
    731725
    732         object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32    );
     726        object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32, -16    );
    733727
    734728        if (!object) {
     
    777771        }
    778772        if (!object->p2_version == -32) {
     773            psFree(object);
     774            exit(EXIT_FAILURE);
     775        }
    779776            psFree(object);
    780777            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r11027 r11030  
    208208        }
    209209
    210         if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32, "a string", -16)) {
    211             exit(EXIT_FAILURE);
    212         }
    213 
    214         psDBCleanup(dbh);
    215     }
    216 
    217     {
    218         psDB            *dbh;
    219 
    220         dbh = psDBInit("localhost", "test", NULL, "test");
    221         if (!dbh) {
    222             exit(EXIT_FAILURE);
    223         }
    224 
    225         if (!p2PendingImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, -32, -16)) {
     210        if (!p2PendingExpInsert(dbh, "a string", "a string", -32, -32, "a string")) {
     211            exit(EXIT_FAILURE);
     212        }
     213
     214        psDBCleanup(dbh);
     215    }
     216
     217    {
     218        psDB            *dbh;
     219
     220        dbh = psDBInit("localhost", "test", NULL, "test");
     221        if (!dbh) {
     222            exit(EXIT_FAILURE);
     223        }
     224
     225        if (!p2PendingImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, -32)) {
    226226            exit(EXIT_FAILURE);
    227227        }
     
    268268        }
    269269
    270         if (!p2ProcessedImfileInsert(dbh, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32)) {
     270        if (!p2ProcessedImfileInsert(dbh, "a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32, -16)) {
    271271            exit(EXIT_FAILURE);
    272272        }
  • trunk/ippdb/tests/insertobject.c

    r11027 r11030  
    300300        }
    301301
    302         object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16);
     302        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
    303303        if (!object) {
    304304            exit(EXIT_FAILURE);
     
    322322        }
    323323
    324         object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16);
     324        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32);
    325325        if (!object) {
    326326            exit(EXIT_FAILURE);
     
    388388        }
    389389
    390         object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32);
     390        object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32, -16);
    391391        if (!object) {
    392392            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r11027 r11030  
    714714        bool            status;
    715715
    716         object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16);
     716        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
    717717        if (!object) {
    718718            exit(EXIT_FAILURE);
     
    746746            exit(EXIT_FAILURE);
    747747        }
    748             psFree(md);
    749             exit(EXIT_FAILURE);
    750         }
    751748
    752749        psFree(md);
     
    758755        bool            status;
    759756
    760         object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16);
     757        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32);
    761758        if (!object) {
    762759            exit(EXIT_FAILURE);
     
    794791            exit(EXIT_FAILURE);
    795792        }
    796             psFree(md);
    797             exit(EXIT_FAILURE);
    798         }
    799793
    800794        psFree(md);
     
    868862        bool            status;
    869863
    870         object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32);
     864        object = p2ProcessedImfileRowAlloc("a string", "a string", "a string", "a string", 64.64, 64.64, 64.64, "a string", "a string", -32, -32, -16);
    871865        if (!object) {
    872866            exit(EXIT_FAILURE);
     
    921915        }
    922916        if (!psMetadataLookupS32(&status, md, "p2_version") == -32) {
     917            psFree(md);
     918            exit(EXIT_FAILURE);
     919        }
    923920            psFree(md);
    924921            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r11027 r11030  
    11231123            exit(EXIT_FAILURE);
    11241124        }
    1125             psFree(md);
    1126             exit(EXIT_FAILURE);
    1127         }
    11281125
    11291126        object = p2PendingExpObjectFromMetadata(md);
     
    11551152            exit(EXIT_FAILURE);
    11561153        }
    1157             psFree(object);
    1158             exit(EXIT_FAILURE);
    1159         }
    11601154
    11611155        psFree(object);
     
    11911185            exit(EXIT_FAILURE);
    11921186        }
    1193             psFree(md);
    1194             exit(EXIT_FAILURE);
    1195         }
    11961187
    11971188        object = p2PendingImfileObjectFromMetadata(md);
     
    12271218            exit(EXIT_FAILURE);
    12281219        }
    1229             psFree(object);
    1230             exit(EXIT_FAILURE);
    1231         }
    12321220
    12331221        psFree(object);
     
    13591347            exit(EXIT_FAILURE);
    13601348        }
     1349            psFree(md);
     1350            exit(EXIT_FAILURE);
     1351        }
    13611352
    13621353        object = p2ProcessedImfileObjectFromMetadata(md);
     
    14091400        }
    14101401        if (!object->p2_version == -32) {
     1402            psFree(object);
     1403            exit(EXIT_FAILURE);
     1404        }
    14111405            psFree(object);
    14121406            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.