IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 17872 for trunk/ippdb


Ignore:
Timestamp:
May 30, 2008, 4:19:52 PM (18 years ago)
Author:
jhoblitt
Message:

add epoch fields to pz*, new*, & raw* tables

Location:
trunk/ippdb
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/configure.ac

    r17833 r17872  
    77AC_PREREQ(2.61)
    88
    9 AC_INIT([ippdb], [1.1.36], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [1.1.37], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r17840 r17872  
    262262static void pzDataStoreRowFree(pzDataStoreRow *object);
    263263
    264 pzDataStoreRow *pzDataStoreRowAlloc(const char *camera, const char *telescope, const char *uri)
     264pzDataStoreRow *pzDataStoreRowAlloc(const char *camera, const char *telescope, const char *uri, psTime* epoch)
    265265{
    266266    pzDataStoreRow  *_object;
     
    272272    _object->telescope = psStringCopy(telescope);
    273273    _object->uri = psStringCopy(uri);
     274    _object->epoch = psTimeCopy(epoch);
    274275
    275276    return _object;
     
    281282    psFree(object->telescope);
    282283    psFree(object->uri);
     284    psFree(object->epoch);
    283285}
    284286
     
    301303        return false;
    302304    }
     305    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) {
     306        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     307        psFree(md);
     308        return false;
     309    }
    303310
    304311    bool status = psDBCreateTable(dbh, PZDATASTORE_TABLE_NAME, md);
     
    314321}
    315322
    316 bool pzDataStoreInsert(psDB * dbh, const char *camera, const char *telescope, const char *uri)
     323bool pzDataStoreInsert(psDB * dbh, const char *camera, const char *telescope, const char *uri, psTime* epoch)
    317324{
    318325    psMetadata *md = psMetadataAlloc();
     
    329336    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) {
    330337        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     338        psFree(md);
     339        return false;
     340    }
     341    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) {
     342        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
    331343        psFree(md);
    332344        return false;
     
    355367bool pzDataStoreInsertObject(psDB *dbh, pzDataStoreRow *object)
    356368{
    357     return pzDataStoreInsert(dbh, object->camera, object->telescope, object->uri);
     369    return pzDataStoreInsert(dbh, object->camera, object->telescope, object->uri, object->epoch);
    358370}
    359371
     
    443455        return false;
    444456    }
     457    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) {
     458        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     459        psFree(md);
     460        return false;
     461    }
    445462
    446463
     
    467484        return false;
    468485    }
    469 
    470     return pzDataStoreRowAlloc(camera, telescope, uri);
     486    psTime* epoch = psMetadataLookupPtr(&status, md, "epoch");
     487    if (!status) {
     488        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch");
     489        return false;
     490    }
     491
     492    return pzDataStoreRowAlloc(camera, telescope, uri, epoch);
    471493}
    472494psArray *pzDataStoreSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    586608static void summitExpRowFree(summitExpRow *object);
    587609
    588 summitExpRow *summitExpRowAlloc(const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles, psS16 fault)
     610summitExpRow *summitExpRowAlloc(const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles, psS16 fault, psTime* epoch)
    589611{
    590612    summitExpRow    *_object;
     
    601623    _object->imfiles = imfiles;
    602624    _object->fault = fault;
     625    _object->epoch = psTimeCopy(epoch);
    603626
    604627    return _object;
     
    613636    psFree(object->exp_type);
    614637    psFree(object->uri);
     638    psFree(object->epoch);
    615639}
    616640
     
    658682        return false;
    659683    }
     684    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) {
     685        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     686        psFree(md);
     687        return false;
     688    }
    660689
    661690    bool status = psDBCreateTable(dbh, SUMMITEXP_TABLE_NAME, md);
     
    671700}
    672701
    673 bool summitExpInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles, psS16 fault)
     702bool summitExpInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_type, const char *uri, psS32 imfiles, psS16 fault, psTime* epoch)
    674703{
    675704    psMetadata *md = psMetadataAlloc();
     
    711740    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
    712741        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     742        psFree(md);
     743        return false;
     744    }
     745    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) {
     746        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
    713747        psFree(md);
    714748        return false;
     
    737771bool summitExpInsertObject(psDB *dbh, summitExpRow *object)
    738772{
    739     return summitExpInsert(dbh, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_type, object->uri, object->imfiles, object->fault);
     773    return summitExpInsert(dbh, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_type, object->uri, object->imfiles, object->fault, object->epoch);
    740774}
    741775
     
    850884        return false;
    851885    }
     886    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) {
     887        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     888        psFree(md);
     889        return false;
     890    }
    852891
    853892
     
    899938        return false;
    900939    }
    901 
    902     return summitExpRowAlloc(exp_name, camera, telescope, dateobs, exp_type, uri, imfiles, fault);
     940    psTime* epoch = psMetadataLookupPtr(&status, md, "epoch");
     941    if (!status) {
     942        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch");
     943        return false;
     944    }
     945
     946    return summitExpRowAlloc(exp_name, camera, telescope, dateobs, exp_type, uri, imfiles, fault, epoch);
    903947}
    904948psArray *summitExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    10181062static void summitImfileRowFree(summitImfileRow *object);
    10191063
    1020 summitImfileRow *summitImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *file_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri)
     1064summitImfileRow *summitImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *file_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri, psTime* epoch)
    10211065{
    10221066    summitImfileRow *_object;
     
    10341078    _object->class_id = psStringCopy(class_id);
    10351079    _object->uri = psStringCopy(uri);
     1080    _object->epoch = psTimeCopy(epoch);
    10361081
    10371082    return _object;
     
    10481093    psFree(object->class_id);
    10491094    psFree(object->uri);
     1095    psFree(object->epoch);
    10501096}
    10511097
     
    10981144        return false;
    10991145    }
     1146    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) {
     1147        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     1148        psFree(md);
     1149        return false;
     1150    }
    11001151
    11011152    bool status = psDBCreateTable(dbh, SUMMITIMFILE_TABLE_NAME, md);
     
    11111162}
    11121163
    1113 bool summitImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *file_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri)
     1164bool summitImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *file_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri, psTime* epoch)
    11141165{
    11151166    psMetadata *md = psMetadataAlloc();
     
    11561207    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) {
    11571208        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     1209        psFree(md);
     1210        return false;
     1211    }
     1212    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) {
     1213        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
    11581214        psFree(md);
    11591215        return false;
     
    11821238bool summitImfileInsertObject(psDB *dbh, summitImfileRow *object)
    11831239{
    1184     return summitImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->file_id, object->bytes, object->md5sum, object->class, object->class_id, object->uri);
     1240    return summitImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->file_id, object->bytes, object->md5sum, object->class, object->class_id, object->uri, object->epoch);
    11851241}
    11861242
     
    13001356        return false;
    13011357    }
     1358    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) {
     1359        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     1360        psFree(md);
     1361        return false;
     1362    }
    13021363
    13031364
     
    13541415        return false;
    13551416    }
    1356 
    1357     return summitImfileRowAlloc(exp_name, camera, telescope, file_id, bytes, md5sum, class, class_id, uri);
     1417    psTime* epoch = psMetadataLookupPtr(&status, md, "epoch");
     1418    if (!status) {
     1419        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch");
     1420        return false;
     1421    }
     1422
     1423    return summitImfileRowAlloc(exp_name, camera, telescope, file_id, bytes, md5sum, class, class_id, uri, epoch);
    13581424}
    13591425psArray *summitImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    14731539static void pzDownloadExpRowFree(pzDownloadExpRow *object);
    14741540
    1475 pzDownloadExpRow *pzDownloadExpRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *state)
     1541pzDownloadExpRow *pzDownloadExpRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *state, psTime* epoch)
    14761542{
    14771543    pzDownloadExpRow *_object;
     
    14841550    _object->telescope = psStringCopy(telescope);
    14851551    _object->state = psStringCopy(state);
     1552    _object->epoch = psTimeCopy(epoch);
    14861553
    14871554    return _object;
     
    14941561    psFree(object->telescope);
    14951562    psFree(object->state);
     1563    psFree(object->epoch);
    14961564}
    14971565
     
    15191587        return false;
    15201588    }
     1589    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) {
     1590        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     1591        psFree(md);
     1592        return false;
     1593    }
    15211594
    15221595    bool status = psDBCreateTable(dbh, PZDOWNLOADEXP_TABLE_NAME, md);
     
    15321605}
    15331606
    1534 bool pzDownloadExpInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *state)
     1607bool pzDownloadExpInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *state, psTime* epoch)
    15351608{
    15361609    psMetadata *md = psMetadataAlloc();
     
    15521625    if (!psMetadataAdd(md, PS_LIST_TAIL, "state", PS_DATA_STRING, NULL, state)) {
    15531626        psError(PS_ERR_UNKNOWN, false, "failed to add item state");
     1627        psFree(md);
     1628        return false;
     1629    }
     1630    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) {
     1631        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
    15541632        psFree(md);
    15551633        return false;
     
    15781656bool pzDownloadExpInsertObject(psDB *dbh, pzDownloadExpRow *object)
    15791657{
    1580     return pzDownloadExpInsert(dbh, object->exp_name, object->camera, object->telescope, object->state);
     1658    return pzDownloadExpInsert(dbh, object->exp_name, object->camera, object->telescope, object->state, object->epoch);
    15811659}
    15821660
     
    16711749        return false;
    16721750    }
     1751    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) {
     1752        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     1753        psFree(md);
     1754        return false;
     1755    }
    16731756
    16741757
     
    17001783        return false;
    17011784    }
    1702 
    1703     return pzDownloadExpRowAlloc(exp_name, camera, telescope, state);
     1785    psTime* epoch = psMetadataLookupPtr(&status, md, "epoch");
     1786    if (!status) {
     1787        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch");
     1788        return false;
     1789    }
     1790
     1791    return pzDownloadExpRowAlloc(exp_name, camera, telescope, state, epoch);
    17041792}
    17051793psArray *pzDownloadExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    18191907static void pzDownloadImfileRowFree(pzDownloadImfileRow *object);
    18201908
    1821 pzDownloadImfileRow *pzDownloadImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri, psS16 fault)
     1909pzDownloadImfileRow *pzDownloadImfileRowAlloc(const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri, psS16 fault, psTime* epoch)
    18221910{
    18231911    pzDownloadImfileRow *_object;
     
    18331921    _object->uri = psStringCopy(uri);
    18341922    _object->fault = fault;
     1923    _object->epoch = psTimeCopy(epoch);
    18351924
    18361925    return _object;
     
    18451934    psFree(object->class_id);
    18461935    psFree(object->uri);
     1936    psFree(object->epoch);
    18471937}
    18481938
     
    18851975        return false;
    18861976    }
     1977    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) {
     1978        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     1979        psFree(md);
     1980        return false;
     1981    }
    18871982
    18881983    bool status = psDBCreateTable(dbh, PZDOWNLOADIMFILE_TABLE_NAME, md);
     
    18981993}
    18991994
    1900 bool pzDownloadImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri, psS16 fault)
     1995bool pzDownloadImfileInsert(psDB * dbh, const char *exp_name, const char *camera, const char *telescope, const char *class, const char *class_id, const char *uri, psS16 fault, psTime* epoch)
    19011996{
    19021997    psMetadata *md = psMetadataAlloc();
     
    19332028    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
    19342029        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     2030        psFree(md);
     2031        return false;
     2032    }
     2033    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) {
     2034        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
    19352035        psFree(md);
    19362036        return false;
     
    19592059bool pzDownloadImfileInsertObject(psDB *dbh, pzDownloadImfileRow *object)
    19602060{
    1961     return pzDownloadImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id, object->uri, object->fault);
     2061    return pzDownloadImfileInsert(dbh, object->exp_name, object->camera, object->telescope, object->class, object->class_id, object->uri, object->fault, object->epoch);
    19622062}
    19632063
     
    20672167        return false;
    20682168    }
     2169    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) {
     2170        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     2171        psFree(md);
     2172        return false;
     2173    }
    20692174
    20702175
     
    21112216        return false;
    21122217    }
    2113 
    2114     return pzDownloadImfileRowAlloc(exp_name, camera, telescope, class, class_id, uri, fault);
     2218    psTime* epoch = psMetadataLookupPtr(&status, md, "epoch");
     2219    if (!status) {
     2220        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch");
     2221        return false;
     2222    }
     2223
     2224    return pzDownloadImfileRowAlloc(exp_name, camera, telescope, class, class_id, uri, fault, epoch);
    21152225}
    21162226psArray *pzDownloadImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    22302340static void newExpRowFree(newExpRow *object);
    22312341
    2232 newExpRow *newExpRowAlloc(psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *label)
     2342newExpRow *newExpRowAlloc(psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *label, psTime* epoch)
    22332343{
    22342344    newExpRow       *_object;
     
    22492359    _object->end_stage = psStringCopy(end_stage);
    22502360    _object->label = psStringCopy(label);
     2361    _object->epoch = psTimeCopy(epoch);
    22512362
    22522363    return _object;
     
    22662377    psFree(object->end_stage);
    22672378    psFree(object->label);
     2379    psFree(object->epoch);
    22682380}
    22692381
     
    23312443        return false;
    23322444    }
     2445    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) {
     2446        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     2447        psFree(md);
     2448        return false;
     2449    }
    23332450
    23342451    bool status = psDBCreateTable(dbh, NEWEXP_TABLE_NAME, md);
     
    23442461}
    23452462
    2346 bool newExpInsert(psDB * dbh, psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *label)
     2463bool newExpInsert(psDB * dbh, psS64 exp_id, const char *tmp_exp_name, const char *tmp_camera, const char *tmp_telescope, const char *state, const char *workdir, const char *workdir_state, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *label, psTime* epoch)
    23472464{
    23482465    psMetadata *md = psMetadataAlloc();
     
    24042521    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) {
    24052522        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
     2523        psFree(md);
     2524        return false;
     2525    }
     2526    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) {
     2527        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
    24062528        psFree(md);
    24072529        return false;
     
    24302552bool newExpInsertObject(psDB *dbh, newExpRow *object)
    24312553{
    2432     return newExpInsert(dbh, object->exp_id, object->tmp_exp_name, object->tmp_camera, object->tmp_telescope, object->state, object->workdir, object->workdir_state, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->label);
     2554    return newExpInsert(dbh, object->exp_id, object->tmp_exp_name, object->tmp_camera, object->tmp_telescope, object->state, object->workdir, object->workdir_state, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->label, object->epoch);
    24332555}
    24342556
     
    25632685        return false;
    25642686    }
     2687    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) {
     2688        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     2689        psFree(md);
     2690        return false;
     2691    }
    25652692
    25662693
     
    26322759        return false;
    26332760    }
    2634 
    2635     return newExpRowAlloc(exp_id, tmp_exp_name, tmp_camera, tmp_telescope, state, workdir, workdir_state, reduction, dvodb, tess_id, end_stage, label);
     2761    psTime* epoch = psMetadataLookupPtr(&status, md, "epoch");
     2762    if (!status) {
     2763        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch");
     2764        return false;
     2765    }
     2766
     2767    return newExpRowAlloc(exp_id, tmp_exp_name, tmp_camera, tmp_telescope, state, workdir, workdir_state, reduction, dvodb, tess_id, end_stage, label, epoch);
    26362768}
    26372769psArray *newExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    27512883static void newImfileRowFree(newImfileRow *object);
    27522884
    2753 newImfileRow *newImfileRowAlloc(psS64 exp_id, const char *tmp_class_id, const char *uri)
     2885newImfileRow *newImfileRowAlloc(psS64 exp_id, const char *tmp_class_id, const char *uri, psTime* epoch)
    27542886{
    27552887    newImfileRow    *_object;
     
    27612893    _object->tmp_class_id = psStringCopy(tmp_class_id);
    27622894    _object->uri = psStringCopy(uri);
     2895    _object->epoch = psTimeCopy(epoch);
    27632896
    27642897    return _object;
     
    27692902    psFree(object->tmp_class_id);
    27702903    psFree(object->uri);
     2904    psFree(object->epoch);
    27712905}
    27722906
     
    27892923        return false;
    27902924    }
     2925    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) {
     2926        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     2927        psFree(md);
     2928        return false;
     2929    }
    27912930
    27922931    bool status = psDBCreateTable(dbh, NEWIMFILE_TABLE_NAME, md);
     
    28022941}
    28032942
    2804 bool newImfileInsert(psDB * dbh, psS64 exp_id, const char *tmp_class_id, const char *uri)
     2943bool newImfileInsert(psDB * dbh, psS64 exp_id, const char *tmp_class_id, const char *uri, psTime* epoch)
    28052944{
    28062945    psMetadata *md = psMetadataAlloc();
     
    28172956    if (!psMetadataAdd(md, PS_LIST_TAIL, "uri", PS_DATA_STRING, NULL, uri)) {
    28182957        psError(PS_ERR_UNKNOWN, false, "failed to add item uri");
     2958        psFree(md);
     2959        return false;
     2960    }
     2961    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) {
     2962        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
    28192963        psFree(md);
    28202964        return false;
     
    28432987bool newImfileInsertObject(psDB *dbh, newImfileRow *object)
    28442988{
    2845     return newImfileInsert(dbh, object->exp_id, object->tmp_class_id, object->uri);
     2989    return newImfileInsert(dbh, object->exp_id, object->tmp_class_id, object->uri, object->epoch);
    28462990}
    28472991
     
    29313075        return false;
    29323076    }
     3077    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) {
     3078        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     3079        psFree(md);
     3080        return false;
     3081    }
    29333082
    29343083
     
    29553104        return false;
    29563105    }
    2957 
    2958     return newImfileRowAlloc(exp_id, tmp_class_id, uri);
     3106    psTime* epoch = psMetadataLookupPtr(&status, md, "epoch");
     3107    if (!status) {
     3108        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch");
     3109        return false;
     3110    }
     3111
     3112    return newImfileRowAlloc(exp_id, tmp_class_id, uri, epoch);
    29593113}
    29603114psArray *newImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    30743228static void rawExpRowFree(rawExpRow *object);
    30753229
    3076 rawExpRow *rawExpRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault)
     3230rawExpRow *rawExpRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault, psTime* epoch)
    30773231{
    30783232    rawExpRow       *_object;
     
    31383292    _object->hostname = psStringCopy(hostname);
    31393293    _object->fault = fault;
     3294    _object->epoch = psTimeCopy(epoch);
    31403295
    31413296    return _object;
     
    31603315    psFree(object->object);
    31613316    psFree(object->hostname);
     3317    psFree(object->epoch);
    31623318}
    31633319
     
    34503606        return false;
    34513607    }
     3608    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) {
     3609        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     3610        psFree(md);
     3611        return false;
     3612    }
    34523613
    34533614    bool status = psDBCreateTable(dbh, RAWEXP_TABLE_NAME, md);
     
    34633624}
    34643625
    3465 bool rawExpInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault)
     3626bool rawExpInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *exp_tag, const char *exp_type, const char *filelevel, const char *workdir, const char *reduction, const char *dvodb, const char *tess_id, const char *end_stage, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, psF32 solang, const char *hostname, psS16 fault, psTime* epoch)
    34663627{
    34673628    psMetadata *md = psMetadataAlloc();
     
    37483909    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
    37493910        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     3911        psFree(md);
     3912        return false;
     3913    }
     3914    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) {
     3915        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
    37503916        psFree(md);
    37513917        return false;
     
    37743940bool rawExpInsertObject(psDB *dbh, rawExpRow *object)
    37753941{
    3776     return rawExpInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_tag, object->exp_type, object->filelevel, object->workdir, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->solang, object->hostname, object->fault);
     3942    return rawExpInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->exp_tag, object->exp_type, object->filelevel, object->workdir, object->reduction, object->dvodb, object->tess_id, object->end_stage, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->solang, object->hostname, object->fault, object->epoch);
    37773943}
    37783944
     
    41324298        return false;
    41334299    }
     4300    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) {
     4301        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     4302        psFree(md);
     4303        return false;
     4304    }
    41344305
    41354306
     
    44264597        return false;
    44274598    }
    4428 
    4429     return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, reduction, dvodb, tess_id, end_stage, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, solang, hostname, fault);
     4599    psTime* epoch = psMetadataLookupPtr(&status, md, "epoch");
     4600    if (!status) {
     4601        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch");
     4602        return false;
     4603    }
     4604
     4605    return rawExpRowAlloc(exp_id, exp_name, camera, telescope, dateobs, exp_tag, exp_type, filelevel, workdir, reduction, dvodb, tess_id, end_stage, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, solang, hostname, fault, epoch);
    44304606}
    44314607psArray *rawExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    45454721static void rawImfileRowFree(rawImfileRow *object);
    45464722
    4547 rawImfileRow *rawImfileRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault)
     4723rawImfileRow *rawImfileRowAlloc(psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault, psTime* epoch)
    45484724{
    45494725    rawImfileRow    *_object;
     
    46054781    _object->hostname = psStringCopy(hostname);
    46064782    _object->fault = fault;
     4783    _object->epoch = psTimeCopy(epoch);
    46074784
    46084785    return _object;
     
    46244801    psFree(object->object);
    46254802    psFree(object->hostname);
     4803    psFree(object->epoch);
    46264804}
    46274805
     
    48945072        return false;
    48955073    }
     5074    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, NULL)) {
     5075        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     5076        psFree(md);
     5077        return false;
     5078    }
    48965079
    48975080    bool status = psDBCreateTable(dbh, RAWIMFILE_TABLE_NAME, md);
     
    49075090}
    49085091
    4909 bool rawImfileInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault)
     5092bool rawImfileInsert(psDB * dbh, psS64 exp_id, const char *exp_name, const char *camera, const char *telescope, psTime* dateobs, const char *tmp_class_id, const char *class_id, const char *uri, const char *exp_type, const char *filelevel, const char *filter, const char *comment, psF32 airmass, psF64 ra, psF64 decl, psF32 exp_time, psF32 sat_pixel_frac, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF64 alt, psF64 az, psF32 ccd_temp, psF64 posang, psF32 m1_x, psF32 m1_y, psF32 m1_z, psF32 m1_tip, psF32 m1_tilt, psF32 m2_x, psF32 m2_y, psF32 m2_z, psF32 m2_tip, psF32 m2_tilt, psF32 env_temperature, psF32 env_humidity, psF32 env_wind_speed, psF32 env_wind_dir, psF32 teltemp_m1, psF32 teltemp_m1cell, psF32 teltemp_m2, psF32 teltemp_spider, psF32 teltemp_truss, psF32 teltemp_extra, psF32 pon_time, psF64 user_1, psF64 user_2, psF64 user_3, psF64 user_4, psF64 user_5, const char *object, const char *hostname, psS16 fault, psTime* epoch)
    49105093{
    49115094    psMetadata *md = psMetadataAlloc();
     
    51725355    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
    51735356        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     5357        psFree(md);
     5358        return false;
     5359    }
     5360    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, epoch)) {
     5361        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
    51745362        psFree(md);
    51755363        return false;
     
    51985386bool rawImfileInsertObject(psDB *dbh, rawImfileRow *object)
    51995387{
    5200     return rawImfileInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->tmp_class_id, object->class_id, object->uri, object->exp_type, object->filelevel, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->hostname, object->fault);
     5388    return rawImfileInsert(dbh, object->exp_id, object->exp_name, object->camera, object->telescope, object->dateobs, object->tmp_class_id, object->class_id, object->uri, object->exp_type, object->filelevel, object->filter, object->comment, object->airmass, object->ra, object->decl, object->exp_time, object->sat_pixel_frac, object->bg, object->bg_stdev, object->bg_mean_stdev, object->alt, object->az, object->ccd_temp, object->posang, object->m1_x, object->m1_y, object->m1_z, object->m1_tip, object->m1_tilt, object->m2_x, object->m2_y, object->m2_z, object->m2_tip, object->m2_tilt, object->env_temperature, object->env_humidity, object->env_wind_speed, object->env_wind_dir, object->teltemp_m1, object->teltemp_m1cell, object->teltemp_m2, object->teltemp_spider, object->teltemp_truss, object->teltemp_extra, object->pon_time, object->user_1, object->user_2, object->user_3, object->user_4, object->user_5, object->object, object->hostname, object->fault, object->epoch);
    52015389}
    52025390
     
    55365724        return false;
    55375725    }
     5726    if (!psMetadataAdd(md, PS_LIST_TAIL, "epoch", PS_DATA_TIME, NULL, object->epoch)) {
     5727        psError(PS_ERR_UNKNOWN, false, "failed to add item epoch");
     5728        psFree(md);
     5729        return false;
     5730    }
    55385731
    55395732
     
    58106003        return false;
    58116004    }
    5812 
    5813     return rawImfileRowAlloc(exp_id, exp_name, camera, telescope, dateobs, tmp_class_id, class_id, uri, exp_type, filelevel, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, hostname, fault);
     6005    psTime* epoch = psMetadataLookupPtr(&status, md, "epoch");
     6006    if (!status) {
     6007        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item epoch");
     6008        return false;
     6009    }
     6010
     6011    return rawImfileRowAlloc(exp_id, exp_name, camera, telescope, dateobs, tmp_class_id, class_id, uri, exp_type, filelevel, filter, comment, airmass, ra, decl, exp_time, sat_pixel_frac, bg, bg_stdev, bg_mean_stdev, alt, az, ccd_temp, posang, m1_x, m1_y, m1_z, m1_tip, m1_tilt, m2_x, m2_y, m2_z, m2_tip, m2_tilt, env_temperature, env_humidity, env_wind_speed, env_wind_dir, teltemp_m1, teltemp_m1cell, teltemp_m2, teltemp_spider, teltemp_truss, teltemp_extra, pon_time, user_1, user_2, user_3, user_4, user_5, object, hostname, fault, epoch);
    58146012}
    58156013psArray *rawImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r17833 r17872  
    134134    char            *telescope;
    135135    char            *uri;
     136    psTime*         epoch;
    136137} pzDataStoreRow;
    137138
     
    144145    const char      *camera,
    145146    const char      *telescope,
    146     const char      *uri
     147    const char      *uri,
     148    psTime*         epoch
    147149);
    148150
     
    176178    const char      *camera,
    177179    const char      *telescope,
    178     const char      *uri
     180    const char      *uri,
     181    psTime*         epoch
    179182);
    180183
     
    340343    psS32           imfiles;
    341344    psS16           fault;
     345    psTime*         epoch;
    342346} summitExpRow;
    343347
     
    355359    const char      *uri,
    356360    psS32           imfiles,
    357     psS16           fault
     361    psS16           fault,
     362    psTime*         epoch
    358363);
    359364
     
    392397    const char      *uri,
    393398    psS32           imfiles,
    394     psS16           fault
     399    psS16           fault,
     400    psTime*         epoch
    395401);
    396402
     
    557563    char            *class_id;
    558564    char            *uri;
     565    psTime*         epoch;
    559566} summitImfileRow;
    560567
     
    573580    const char      *class,
    574581    const char      *class_id,
    575     const char      *uri
     582    const char      *uri,
     583    psTime*         epoch
    576584);
    577585
     
    611619    const char      *class,
    612620    const char      *class_id,
    613     const char      *uri
     621    const char      *uri,
     622    psTime*         epoch
    614623);
    615624
     
    771780    char            *telescope;
    772781    char            *state;
     782    psTime*         epoch;
    773783} pzDownloadExpRow;
    774784
     
    782792    const char      *camera,
    783793    const char      *telescope,
    784     const char      *state
     794    const char      *state,
     795    psTime*         epoch
    785796);
    786797
     
    815826    const char      *camera,
    816827    const char      *telescope,
    817     const char      *state
     828    const char      *state,
     829    psTime*         epoch
    818830);
    819831
     
    978990    char            *uri;
    979991    psS16           fault;
     992    psTime*         epoch;
    980993} pzDownloadImfileRow;
    981994
     
    9921005    const char      *class_id,
    9931006    const char      *uri,
    994     psS16           fault
     1007    psS16           fault,
     1008    psTime*         epoch
    9951009);
    9961010
     
    10281042    const char      *class_id,
    10291043    const char      *uri,
    1030     psS16           fault
     1044    psS16           fault,
     1045    psTime*         epoch
    10311046);
    10321047
     
    11961211    char            *end_stage;
    11971212    char            *label;
     1213    psTime*         epoch;
    11981214} newExpRow;
    11991215
     
    12151231    const char      *tess_id,
    12161232    const char      *end_stage,
    1217     const char      *label
     1233    const char      *label,
     1234    psTime*         epoch
    12181235);
    12191236
     
    12561273    const char      *tess_id,
    12571274    const char      *end_stage,
    1258     const char      *label
     1275    const char      *label,
     1276    psTime*         epoch
    12591277);
    12601278
     
    14151433    char            *tmp_class_id;
    14161434    char            *uri;
     1435    psTime*         epoch;
    14171436} newImfileRow;
    14181437
     
    14251444    psS64           exp_id,
    14261445    const char      *tmp_class_id,
    1427     const char      *uri
     1446    const char      *uri,
     1447    psTime*         epoch
    14281448);
    14291449
     
    14571477    psS64           exp_id,
    14581478    const char      *tmp_class_id,
    1459     const char      *uri
     1479    const char      *uri,
     1480    psTime*         epoch
    14601481);
    14611482
     
    16701691    char            *hostname;
    16711692    psS16           fault;
     1693    psTime*         epoch;
    16721694} rawExpRow;
    16731695
     
    17341756    psF32           solang,
    17351757    const char      *hostname,
    1736     psS16           fault
     1758    psS16           fault,
     1759    psTime*         epoch
    17371760);
    17381761
     
    18201843    psF32           solang,
    18211844    const char      *hostname,
    1822     psS16           fault
     1845    psS16           fault,
     1846    psTime*         epoch
    18231847);
    18241848
     
    20292053    char            *hostname;
    20302054    psS16           fault;
     2055    psTime*         epoch;
    20312056} rawImfileRow;
    20322057
     
    20892114    const char      *object,
    20902115    const char      *hostname,
    2091     psS16           fault
     2116    psS16           fault,
     2117    psTime*         epoch
    20922118);
    20932119
     
    21712197    const char      *object,
    21722198    const char      *hostname,
    2173     psS16           fault
     2199    psS16           fault,
     2200    psTime*         epoch
    21742201);
    21752202
  • trunk/ippdb/tests/alloc.c

    r17833 r17872  
    1111        pzDataStoreRow  *object;
    1212
    13         object = pzDataStoreRowAlloc("a string", "a string", "a string"    );
     13        object = pzDataStoreRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
    1414
    1515        if (!object) {
     
    2929            exit(EXIT_FAILURE);
    3030        }
     31            psFree(object);
     32            exit(EXIT_FAILURE);
     33        }
    3134
    3235        psFree(object);
     
    3639        summitExpRow    *object;
    3740
    38         object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16    );
     41        object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16, "0001-01-01T00:00:00Z"    );
    3942
    4043        if (!object) {
     
    7376            exit(EXIT_FAILURE);
    7477        }
     78            psFree(object);
     79            exit(EXIT_FAILURE);
     80        }
    7581
    7682        psFree(object);
     
    8086        summitImfileRow *object;
    8187
    82         object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string"    );
     88        object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
    8389
    8490        if (!object) {
     
    122128            exit(EXIT_FAILURE);
    123129        }
     130            psFree(object);
     131            exit(EXIT_FAILURE);
     132        }
    124133
    125134        psFree(object);
     
    129138        pzDownloadExpRow *object;
    130139
    131         object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string"    );
     140        object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
    132141
    133142        if (!object) {
     
    151160            exit(EXIT_FAILURE);
    152161        }
     162            psFree(object);
     163            exit(EXIT_FAILURE);
     164        }
    153165
    154166        psFree(object);
     
    158170        pzDownloadImfileRow *object;
    159171
    160         object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16    );
     172        object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16, "0001-01-01T00:00:00Z"    );
    161173
    162174        if (!object) {
     
    192204            exit(EXIT_FAILURE);
    193205        }
     206            psFree(object);
     207            exit(EXIT_FAILURE);
     208        }
    194209
    195210        psFree(object);
     
    199214        newExpRow       *object;
    200215
    201         object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string"    );
     216        object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z"    );
    202217
    203218        if (!object) {
     
    253268            exit(EXIT_FAILURE);
    254269        }
     270            psFree(object);
     271            exit(EXIT_FAILURE);
     272        }
    255273
    256274        psFree(object);
     
    260278        newImfileRow    *object;
    261279
    262         object = newImfileRowAlloc(-64, "a string", "a string"    );
     280        object = newImfileRowAlloc(-64, "a string", "a string", "0001-01-01T00:00:00Z"    );
    263281
    264282        if (!object) {
     
    278296            exit(EXIT_FAILURE);
    279297        }
     298            psFree(object);
     299            exit(EXIT_FAILURE);
     300        }
    280301
    281302        psFree(object);
     
    285306        rawExpRow       *object;
    286307
    287         object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16    );
     308        object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16, "0001-01-01T00:00:00Z"    );
    288309
    289310        if (!object) {
     
    518539            exit(EXIT_FAILURE);
    519540        }
     541            psFree(object);
     542            exit(EXIT_FAILURE);
     543        }
    520544
    521545        psFree(object);
     
    525549        rawImfileRow    *object;
    526550
    527         object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16    );
     551        object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16, "0001-01-01T00:00:00Z"    );
    528552
    529553        if (!object) {
     
    739763        }
    740764        if (!object->fault == -16) {
     765            psFree(object);
     766            exit(EXIT_FAILURE);
     767        }
    741768            psFree(object);
    742769            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r17833 r17872  
    1313        }
    1414
    15         if (!pzDataStoreInsert(dbh, "a string", "a string", "a string")) {
    16             exit(EXIT_FAILURE);
    17         }
    18 
    19         psDBCleanup(dbh);
    20     }
    21 
    22     {
    23         psDB            *dbh;
    24 
    25         dbh = psDBInit("localhost", "test", NULL, "test");
    26         if (!dbh) {
    27             exit(EXIT_FAILURE);
    28         }
    29 
    30         if (!summitExpInsert(dbh, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16)) {
    31             exit(EXIT_FAILURE);
    32         }
    33 
    34         psDBCleanup(dbh);
    35     }
    36 
    37     {
    38         psDB            *dbh;
    39 
    40         dbh = psDBInit("localhost", "test", NULL, "test");
    41         if (!dbh) {
    42             exit(EXIT_FAILURE);
    43         }
    44 
    45         if (!summitImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string")) {
    46             exit(EXIT_FAILURE);
    47         }
    48 
    49         psDBCleanup(dbh);
    50     }
    51 
    52     {
    53         psDB            *dbh;
    54 
    55         dbh = psDBInit("localhost", "test", NULL, "test");
    56         if (!dbh) {
    57             exit(EXIT_FAILURE);
    58         }
    59 
    60         if (!pzDownloadExpInsert(dbh, "a string", "a string", "a string", "a string")) {
    61             exit(EXIT_FAILURE);
    62         }
    63 
    64         psDBCleanup(dbh);
    65     }
    66 
    67     {
    68         psDB            *dbh;
    69 
    70         dbh = psDBInit("localhost", "test", NULL, "test");
    71         if (!dbh) {
    72             exit(EXIT_FAILURE);
    73         }
    74 
    75         if (!pzDownloadImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", -16)) {
    76             exit(EXIT_FAILURE);
    77         }
    78 
    79         psDBCleanup(dbh);
    80     }
    81 
    82     {
    83         psDB            *dbh;
    84 
    85         dbh = psDBInit("localhost", "test", NULL, "test");
    86         if (!dbh) {
    87             exit(EXIT_FAILURE);
    88         }
    89 
    90         if (!newExpInsert(dbh, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string")) {
    91             exit(EXIT_FAILURE);
    92         }
    93 
    94         psDBCleanup(dbh);
    95     }
    96 
    97     {
    98         psDB            *dbh;
    99 
    100         dbh = psDBInit("localhost", "test", NULL, "test");
    101         if (!dbh) {
    102             exit(EXIT_FAILURE);
    103         }
    104 
    105         if (!newImfileInsert(dbh, -64, "a string", "a string")) {
    106             exit(EXIT_FAILURE);
    107         }
    108 
    109         psDBCleanup(dbh);
    110     }
    111 
    112     {
    113         psDB            *dbh;
    114 
    115         dbh = psDBInit("localhost", "test", NULL, "test");
    116         if (!dbh) {
    117             exit(EXIT_FAILURE);
    118         }
    119 
    120         if (!rawExpInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16)) {
    121             exit(EXIT_FAILURE);
    122         }
    123 
    124         psDBCleanup(dbh);
    125     }
    126 
    127     {
    128         psDB            *dbh;
    129 
    130         dbh = psDBInit("localhost", "test", NULL, "test");
    131         if (!dbh) {
    132             exit(EXIT_FAILURE);
    133         }
    134 
    135         if (!rawImfileInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16)) {
     15        if (!pzDataStoreInsert(dbh, "a string", "a string", "a string", "0001-01-01T00:00:00Z")) {
     16            exit(EXIT_FAILURE);
     17        }
     18
     19        psDBCleanup(dbh);
     20    }
     21
     22    {
     23        psDB            *dbh;
     24
     25        dbh = psDBInit("localhost", "test", NULL, "test");
     26        if (!dbh) {
     27            exit(EXIT_FAILURE);
     28        }
     29
     30        if (!summitExpInsert(dbh, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16, "0001-01-01T00:00:00Z")) {
     31            exit(EXIT_FAILURE);
     32        }
     33
     34        psDBCleanup(dbh);
     35    }
     36
     37    {
     38        psDB            *dbh;
     39
     40        dbh = psDBInit("localhost", "test", NULL, "test");
     41        if (!dbh) {
     42            exit(EXIT_FAILURE);
     43        }
     44
     45        if (!summitImfileInsert(dbh, "a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z")) {
     46            exit(EXIT_FAILURE);
     47        }
     48
     49        psDBCleanup(dbh);
     50    }
     51
     52    {
     53        psDB            *dbh;
     54
     55        dbh = psDBInit("localhost", "test", NULL, "test");
     56        if (!dbh) {
     57            exit(EXIT_FAILURE);
     58        }
     59
     60        if (!pzDownloadExpInsert(dbh, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z")) {
     61            exit(EXIT_FAILURE);
     62        }
     63
     64        psDBCleanup(dbh);
     65    }
     66
     67    {
     68        psDB            *dbh;
     69
     70        dbh = psDBInit("localhost", "test", NULL, "test");
     71        if (!dbh) {
     72            exit(EXIT_FAILURE);
     73        }
     74
     75        if (!pzDownloadImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string", "a string", -16, "0001-01-01T00:00:00Z")) {
     76            exit(EXIT_FAILURE);
     77        }
     78
     79        psDBCleanup(dbh);
     80    }
     81
     82    {
     83        psDB            *dbh;
     84
     85        dbh = psDBInit("localhost", "test", NULL, "test");
     86        if (!dbh) {
     87            exit(EXIT_FAILURE);
     88        }
     89
     90        if (!newExpInsert(dbh, -64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z")) {
     91            exit(EXIT_FAILURE);
     92        }
     93
     94        psDBCleanup(dbh);
     95    }
     96
     97    {
     98        psDB            *dbh;
     99
     100        dbh = psDBInit("localhost", "test", NULL, "test");
     101        if (!dbh) {
     102            exit(EXIT_FAILURE);
     103        }
     104
     105        if (!newImfileInsert(dbh, -64, "a string", "a string", "0001-01-01T00:00:00Z")) {
     106            exit(EXIT_FAILURE);
     107        }
     108
     109        psDBCleanup(dbh);
     110    }
     111
     112    {
     113        psDB            *dbh;
     114
     115        dbh = psDBInit("localhost", "test", NULL, "test");
     116        if (!dbh) {
     117            exit(EXIT_FAILURE);
     118        }
     119
     120        if (!rawExpInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16, "0001-01-01T00:00:00Z")) {
     121            exit(EXIT_FAILURE);
     122        }
     123
     124        psDBCleanup(dbh);
     125    }
     126
     127    {
     128        psDB            *dbh;
     129
     130        dbh = psDBInit("localhost", "test", NULL, "test");
     131        if (!dbh) {
     132            exit(EXIT_FAILURE);
     133        }
     134
     135        if (!rawImfileInsert(dbh, -64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16, "0001-01-01T00:00:00Z")) {
    136136            exit(EXIT_FAILURE);
    137137        }
  • trunk/ippdb/tests/insertobject.c

    r17833 r17872  
    1414        }
    1515
    16         object = pzDataStoreRowAlloc("a string", "a string", "a string");
     16        object = pzDataStoreRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z");
    1717        if (!object) {
    1818            exit(EXIT_FAILURE);
     
    3636        }
    3737
    38         object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16);
     38        object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16, "0001-01-01T00:00:00Z");
    3939        if (!object) {
    4040            exit(EXIT_FAILURE);
     
    5858        }
    5959
    60         object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string");
     60        object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
    6161        if (!object) {
    6262            exit(EXIT_FAILURE);
     
    8080        }
    8181
    82         object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string");
     82        object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
    8383        if (!object) {
    8484            exit(EXIT_FAILURE);
     
    102102        }
    103103
    104         object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16);
     104        object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16, "0001-01-01T00:00:00Z");
    105105        if (!object) {
    106106            exit(EXIT_FAILURE);
     
    124124        }
    125125
    126         object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string");
     126        object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
    127127        if (!object) {
    128128            exit(EXIT_FAILURE);
     
    146146        }
    147147
    148         object = newImfileRowAlloc(-64, "a string", "a string");
     148        object = newImfileRowAlloc(-64, "a string", "a string", "0001-01-01T00:00:00Z");
    149149        if (!object) {
    150150            exit(EXIT_FAILURE);
     
    168168        }
    169169
    170         object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16);
     170        object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16, "0001-01-01T00:00:00Z");
    171171        if (!object) {
    172172            exit(EXIT_FAILURE);
     
    190190        }
    191191
    192         object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16);
     192        object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16, "0001-01-01T00:00:00Z");
    193193        if (!object) {
    194194            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r17833 r17872  
    1313        bool            status;
    1414
    15         object = pzDataStoreRowAlloc("a string", "a string", "a string");
     15        object = pzDataStoreRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z");
    1616        if (!object) {
    1717            exit(EXIT_FAILURE);
     
    3737            exit(EXIT_FAILURE);
    3838        }
     39            psFree(md);
     40            exit(EXIT_FAILURE);
     41        }
    3942
    4043        psFree(md);
     
    4649        bool            status;
    4750
    48         object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16);
     51        object = summitExpRowAlloc("a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", -32, -16, "0001-01-01T00:00:00Z");
    4952        if (!object) {
    5053            exit(EXIT_FAILURE);
     
    8891            exit(EXIT_FAILURE);
    8992        }
     93            psFree(md);
     94            exit(EXIT_FAILURE);
     95        }
    9096
    9197        psFree(md);
     
    97103        bool            status;
    98104
    99         object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string");
     105        object = summitImfileRowAlloc("a string", "a string", "a string", "a string", -32, "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
    100106        if (!object) {
    101107            exit(EXIT_FAILURE);
     
    145151            exit(EXIT_FAILURE);
    146152        }
     153            psFree(md);
     154            exit(EXIT_FAILURE);
     155        }
    147156
    148157        psFree(md);
     
    154163        bool            status;
    155164
    156         object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string");
     165        object = pzDownloadExpRowAlloc("a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
    157166        if (!object) {
    158167            exit(EXIT_FAILURE);
     
    182191            exit(EXIT_FAILURE);
    183192        }
     193            psFree(md);
     194            exit(EXIT_FAILURE);
     195        }
    184196
    185197        psFree(md);
     
    191203        bool            status;
    192204
    193         object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16);
     205        object = pzDownloadImfileRowAlloc("a string", "a string", "a string", "a string", "a string", "a string", -16, "0001-01-01T00:00:00Z");
    194206        if (!object) {
    195207            exit(EXIT_FAILURE);
     
    230242            exit(EXIT_FAILURE);
    231243        }
     244            psFree(md);
     245            exit(EXIT_FAILURE);
     246        }
    232247
    233248        psFree(md);
     
    239254        bool            status;
    240255
    241         object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string");
     256        object = newExpRowAlloc(-64, "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "0001-01-01T00:00:00Z");
    242257        if (!object) {
    243258            exit(EXIT_FAILURE);
     
    298313            exit(EXIT_FAILURE);
    299314        }
     315            psFree(md);
     316            exit(EXIT_FAILURE);
     317        }
    300318
    301319        psFree(md);
     
    307325        bool            status;
    308326
    309         object = newImfileRowAlloc(-64, "a string", "a string");
     327        object = newImfileRowAlloc(-64, "a string", "a string", "0001-01-01T00:00:00Z");
    310328        if (!object) {
    311329            exit(EXIT_FAILURE);
     
    330348            exit(EXIT_FAILURE);
    331349        }
     350            psFree(md);
     351            exit(EXIT_FAILURE);
     352        }
    332353
    333354        psFree(md);
     
    339360        bool            status;
    340361
    341         object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16);
     362        object = rawExpRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", 32.32, "a string", -16, "0001-01-01T00:00:00Z");
    342363        if (!object) {
    343364            exit(EXIT_FAILURE);
     
    576597            exit(EXIT_FAILURE);
    577598        }
     599            psFree(md);
     600            exit(EXIT_FAILURE);
     601        }
    578602
    579603        psFree(md);
     
    585609        bool            status;
    586610
    587         object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16);
     611        object = rawImfileRowAlloc(-64, "a string", "a string", "a string", "0001-01-01T00:00:00Z", "a string", "a string", "a string", "a string", "a string", "a string", "a string", 32.32, 64.64, 64.64, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, 32.32, 64.64, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 32.32, 64.64, 64.64, 64.64, 64.64, 64.64, "a string", "a string", -16, "0001-01-01T00:00:00Z");
    588612        if (!object) {
    589613            exit(EXIT_FAILURE);
     
    800824        }
    801825        if (strncmp(psMetadataLookupPtr(&status, md, "hostname"), "a string", MAX_STRING_LENGTH)) {
     826            psFree(md);
     827            exit(EXIT_FAILURE);
     828        }
    802829            psFree(md);
    803830            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r17833 r17872  
    2525            exit(EXIT_FAILURE);
    2626        }
     27            psFree(md);
     28            exit(EXIT_FAILURE);
     29        }
    2730
    2831        object = pzDataStoreObjectFromMetadata(md);
     
    4346        }
    4447        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     48            psFree(object);
     49            exit(EXIT_FAILURE);
     50        }
    4551            psFree(object);
    4652            exit(EXIT_FAILURE);
     
    8591            exit(EXIT_FAILURE);
    8692        }
     93            psFree(md);
     94            exit(EXIT_FAILURE);
     95        }
    8796
    8897        object = summitExpObjectFromMetadata(md);
     
    118127        }
    119128        if (!object->imfiles == -32) {
     129            psFree(object);
     130            exit(EXIT_FAILURE);
     131        }
    120132            psFree(object);
    121133            exit(EXIT_FAILURE);
     
    169181            exit(EXIT_FAILURE);
    170182        }
     183            psFree(md);
     184            exit(EXIT_FAILURE);
     185        }
    171186
    172187        object = summitImfileObjectFromMetadata(md);
     
    211226        }
    212227        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     228            psFree(object);
     229            exit(EXIT_FAILURE);
     230        }
    213231            psFree(object);
    214232            exit(EXIT_FAILURE);
     
    239257            exit(EXIT_FAILURE);
    240258        }
     259            psFree(md);
     260            exit(EXIT_FAILURE);
     261        }
    241262
    242263        object = pzDownloadExpObjectFromMetadata(md);
     
    261282        }
    262283        if (strncmp(object->state, "a string", MAX_STRING_LENGTH)) {
     284            psFree(object);
     285            exit(EXIT_FAILURE);
     286        }
    263287            psFree(object);
    264288            exit(EXIT_FAILURE);
     
    300324            exit(EXIT_FAILURE);
    301325        }
     326            psFree(md);
     327            exit(EXIT_FAILURE);
     328        }
    302329
    303330        object = pzDownloadImfileObjectFromMetadata(md);
     
    330357        }
    331358        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     359            psFree(object);
     360            exit(EXIT_FAILURE);
     361        }
    332362            psFree(object);
    333363            exit(EXIT_FAILURE);
     
    392422            exit(EXIT_FAILURE);
    393423        }
     424            psFree(md);
     425            exit(EXIT_FAILURE);
     426        }
    394427
    395428        object = newExpObjectFromMetadata(md);
     
    445478        }
    446479        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     480            psFree(object);
     481            exit(EXIT_FAILURE);
     482        }
    447483            psFree(object);
    448484            exit(EXIT_FAILURE);
     
    468504            exit(EXIT_FAILURE);
    469505        }
     506            psFree(md);
     507            exit(EXIT_FAILURE);
     508        }
    470509
    471510        object = newImfileObjectFromMetadata(md);
     
    485524        }
    486525        if (strncmp(object->uri, "a string", MAX_STRING_LENGTH)) {
     526            psFree(object);
     527            exit(EXIT_FAILURE);
     528        }
    487529            psFree(object);
    488530            exit(EXIT_FAILURE);
     
    722764            exit(EXIT_FAILURE);
    723765        }
     766            psFree(md);
     767            exit(EXIT_FAILURE);
     768        }
    724769
    725770        object = rawExpObjectFromMetadata(md);
     
    950995        }
    951996        if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) {
     997            psFree(object);
     998            exit(EXIT_FAILURE);
     999        }
    9521000            psFree(object);
    9531001            exit(EXIT_FAILURE);
     
    11741222            exit(EXIT_FAILURE);
    11751223        }
     1224            psFree(md);
     1225            exit(EXIT_FAILURE);
     1226        }
    11761227
    11771228        object = rawImfileObjectFromMetadata(md);
     
    13861437        }
    13871438        if (strncmp(object->hostname, "a string", MAX_STRING_LENGTH)) {
     1439            psFree(object);
     1440            exit(EXIT_FAILURE);
     1441        }
    13881442            psFree(object);
    13891443            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.