IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11077


Ignore:
Timestamp:
Jan 12, 2007, 12:25:20 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.74

Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/dbconfig/config.md

    r11045 r11077  
    22    pkg_name        STR     ippdb
    33    pkg_namespace   STR     ippdb
    4     pkg_version     STR     0.0.73
     4    pkg_version     STR     0.0.74
    55END
  • trunk/ippdb/configure.ac

    r11045 r11077  
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [0.0.73], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [0.0.74], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r11045 r11077  
    70847084static void p3PendingExpRowFree(p3PendingExpRow *object);
    70857085
    7086 p3PendingExpRow *p3PendingExpRowAlloc(const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label, psS16 fault)
     7086p3PendingExpRow *p3PendingExpRowAlloc(const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label)
    70877087{
    70887088    p3PendingExpRow *_object;
     
    70957095    _object->p3_version = p3_version;
    70967096    _object->label = psStringCopy(label);
    7097     _object->fault = fault;
    70987097
    70997098    return _object;
     
    71297128        return false;
    71307129    }
    7131     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
    7132         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    7133         psFree(md);
    7134         return false;
    7135     }
    71367130
    71377131    bool status = psDBCreateTable(dbh, P3PENDINGEXP_TABLE_NAME, md);
     
    71477141}
    71487142
    7149 bool p3PendingExpInsert(psDB * dbh, const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label, psS16 fault)
     7143bool p3PendingExpInsert(psDB * dbh, const char *exp_tag, psS32 p2_version, psS32 p3_version, const char *label)
    71507144{
    71517145    psMetadata *md = psMetadataAlloc();
     
    71677161    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) {
    71687162        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
    7169         psFree(md);
    7170         return false;
    7171     }
    7172     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
    7173         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    71747163        psFree(md);
    71757164        return false;
     
    71987187bool p3PendingExpInsertObject(psDB *dbh, p3PendingExpRow *object)
    71997188{
    7200     return p3PendingExpInsert(dbh, object->exp_tag, object->p2_version, object->p3_version, object->label, object->fault);
     7189    return p3PendingExpInsert(dbh, object->exp_tag, object->p2_version, object->p3_version, object->label);
    72017190}
    72027191
     
    72917280        return false;
    72927281    }
    7293     if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
    7294         psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    7295         psFree(md);
    7296         return false;
    7297     }
    72987282
    72997283
     
    73257309        return false;
    73267310    }
    7327     psS16 fault = psMetadataLookupS16(&status, md, "fault");
    7328     if (!status) {
    7329         psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
    7330         return false;
    7331     }
    7332 
    7333     return p3PendingExpRowAlloc(exp_tag, p2_version, p3_version, label, fault);
     7311
     7312    return p3PendingExpRowAlloc(exp_tag, p2_version, p3_version, label);
    73347313}
    73357314psArray *p3PendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    74437422static void p3ProcessedExpRowFree(p3ProcessedExpRow *object);
    74447423
    7445 p3ProcessedExpRow *p3ProcessedExpRowAlloc(const char *exp_tag, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psS32 nastro, const char *b1_uri, const char *b2_uri, psF32 zp_mean, psF32 zp_stdev, psS32 p2_version, psS32 p3_version, const char *label)
     7424p3ProcessedExpRow *p3ProcessedExpRowAlloc(const char *exp_tag, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psS32 nastro, const char *b1_uri, const char *b2_uri, psF32 zp_mean, psF32 zp_stdev, psS32 p2_version, psS32 p3_version, const char *label, psS16 fault)
    74467425{
    74477426    p3ProcessedExpRow *_object;
     
    74667445    _object->p3_version = p3_version;
    74677446    _object->label = psStringCopy(label);
     7447    _object->fault = fault;
    74687448
    74697449    return _object;
     
    75637543        return false;
    75647544    }
     7545    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     7546        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     7547        psFree(md);
     7548        return false;
     7549    }
    75657550
    75667551    bool status = psDBCreateTable(dbh, P3PROCESSEDEXP_TABLE_NAME, md);
     
    75767561}
    75777562
    7578 bool p3ProcessedExpInsert(psDB * dbh, const char *exp_tag, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psS32 nastro, const char *b1_uri, const char *b2_uri, psF32 zp_mean, psF32 zp_stdev, psS32 p2_version, psS32 p3_version, const char *label)
     7563bool p3ProcessedExpInsert(psDB * dbh, const char *exp_tag, const char *uri, const char *recipe, psF64 bg, psF64 bg_stdev, psF64 bg_mean_stdev, psF32 sigma_ra, psF32 sigma_dec, psS32 nastro, const char *b1_uri, const char *b2_uri, psF32 zp_mean, psF32 zp_stdev, psS32 p2_version, psS32 p3_version, const char *label, psS16 fault)
    75797564{
    75807565    psMetadata *md = psMetadataAlloc();
     
    76567641    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) {
    76577642        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
     7643        psFree(md);
     7644        return false;
     7645    }
     7646    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     7647        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    76587648        psFree(md);
    76597649        return false;
     
    76827672bool p3ProcessedExpInsertObject(psDB *dbh, p3ProcessedExpRow *object)
    76837673{
    7684     return p3ProcessedExpInsert(dbh, object->exp_tag, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->sigma_ra, object->sigma_dec, object->nastro, object->b1_uri, object->b2_uri, object->zp_mean, object->zp_stdev, object->p2_version, object->p3_version, object->label);
     7674    return p3ProcessedExpInsert(dbh, object->exp_tag, object->uri, object->recipe, object->bg, object->bg_stdev, object->bg_mean_stdev, object->sigma_ra, object->sigma_dec, object->nastro, object->b1_uri, object->b2_uri, object->zp_mean, object->zp_stdev, object->p2_version, object->p3_version, object->label, object->fault);
    76857675}
    76867676
     
    78357825        return false;
    78367826    }
     7827    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     7828        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     7829        psFree(md);
     7830        return false;
     7831    }
    78377832
    78387833
     
    79247919        return false;
    79257920    }
    7926 
    7927     return p3ProcessedExpRowAlloc(exp_tag, uri, recipe, bg, bg_stdev, bg_mean_stdev, sigma_ra, sigma_dec, nastro, b1_uri, b2_uri, zp_mean, zp_stdev, p2_version, p3_version, label);
     7921    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     7922    if (!status) {
     7923        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     7924        return false;
     7925    }
     7926
     7927    return p3ProcessedExpRowAlloc(exp_tag, uri, recipe, bg, bg_stdev, bg_mean_stdev, sigma_ra, sigma_dec, nastro, b1_uri, b2_uri, zp_mean, zp_stdev, p2_version, p3_version, label, fault);
    79287928}
    79297929psArray *p3ProcessedExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r11045 r11077  
    37533753    psS32           p3_version;
    37543754    char            *label;
    3755     psS16           fault;
    37563755} p3PendingExpRow;
    37573756
     
    37653764    psS32           p2_version,
    37663765    psS32           p3_version,
    3767     const char      *label,
    3768     psS16           fault
     3766    const char      *label
    37693767);
    37703768
     
    37993797    psS32           p2_version,
    38003798    psS32           p3_version,
    3801     const char      *label,
    3802     psS16           fault
     3799    const char      *label
    38033800);
    38043801
     
    39723969    psS32           p3_version;
    39733970    char            *label;
     3971    psS16           fault;
    39743972} p3ProcessedExpRow;
    39753973
     
    39953993    psS32           p2_version,
    39963994    psS32           p3_version,
    3997     const char      *label
     3995    const char      *label,
     3996    psS16           fault
    39983997);
    39993998
     
    40404039    psS32           p2_version,
    40414040    psS32           p3_version,
    4042     const char      *label
     4041    const char      *label,
     4042    psS16           fault
    40434043);
    40444044
  • trunk/ippdb/tests/alloc.c

    r11045 r11077  
    696696        p3PendingExpRow *object;
    697697
    698         object = p3PendingExpRowAlloc("a string", -32, -32, "a string", -16    );
     698        object = p3PendingExpRowAlloc("a string", -32, -32, "a string"    );
    699699
    700700        if (!object) {
     
    718718            exit(EXIT_FAILURE);
    719719        }
    720             psFree(object);
    721             exit(EXIT_FAILURE);
    722         }
    723720
    724721        psFree(object);
     
    728725        p3ProcessedExpRow *object;
    729726
    730         object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string"    );
     727        object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string", -16    );
    731728
    732729        if (!object) {
     
    795792        }
    796793        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     794            psFree(object);
     795            exit(EXIT_FAILURE);
     796        }
    797797            psFree(object);
    798798            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

    r11045 r11077  
    268268        }
    269269
    270         if (!p3PendingExpInsert(dbh, "a string", -32, -32, "a string", -16)) {
    271             exit(EXIT_FAILURE);
    272         }
    273 
    274         psDBCleanup(dbh);
    275     }
    276 
    277     {
    278         psDB            *dbh;
    279 
    280         dbh = psDBInit("localhost", "test", NULL, "test");
    281         if (!dbh) {
    282             exit(EXIT_FAILURE);
    283         }
    284 
    285         if (!p3ProcessedExpInsert(dbh, "a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string")) {
     270        if (!p3PendingExpInsert(dbh, "a string", -32, -32, "a string")) {
     271            exit(EXIT_FAILURE);
     272        }
     273
     274        psDBCleanup(dbh);
     275    }
     276
     277    {
     278        psDB            *dbh;
     279
     280        dbh = psDBInit("localhost", "test", NULL, "test");
     281        if (!dbh) {
     282            exit(EXIT_FAILURE);
     283        }
     284
     285        if (!p3ProcessedExpInsert(dbh, "a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string", -16)) {
    286286            exit(EXIT_FAILURE);
    287287        }
  • trunk/ippdb/tests/insertobject.c

    r11045 r11077  
    388388        }
    389389
    390         object = p3PendingExpRowAlloc("a string", -32, -32, "a string", -16);
     390        object = p3PendingExpRowAlloc("a string", -32, -32, "a string");
    391391        if (!object) {
    392392            exit(EXIT_FAILURE);
     
    410410        }
    411411
    412         object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string");
     412        object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string", -16);
    413413        if (!object) {
    414414            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r11045 r11077  
    834834        bool            status;
    835835
    836         object = p3PendingExpRowAlloc("a string", -32, -32, "a string", -16);
     836        object = p3PendingExpRowAlloc("a string", -32, -32, "a string");
    837837        if (!object) {
    838838            exit(EXIT_FAILURE);
     
    862862            exit(EXIT_FAILURE);
    863863        }
    864             psFree(md);
    865             exit(EXIT_FAILURE);
    866         }
    867864
    868865        psFree(md);
     
    874871        bool            status;
    875872
    876         object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string");
     873        object = p3ProcessedExpRowAlloc("a string", "a string", "a string", 64.64, 64.64, 64.64, 32.32, 32.32, -32, "a string", "a string", 32.32, 32.32, -32, -32, "a string", -16);
    877874        if (!object) {
    878875            exit(EXIT_FAILURE);
     
    947944        }
    948945        if (strncmp(psMetadataLookupPtr(&status, md, "label"), "a string", MAX_STRING_LENGTH)) {
     946            psFree(md);
     947            exit(EXIT_FAILURE);
     948        }
    949949            psFree(md);
    950950            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r11045 r11077  
    12631263            exit(EXIT_FAILURE);
    12641264        }
    1265             psFree(md);
    1266             exit(EXIT_FAILURE);
    1267         }
    12681265
    12691266        object = p3PendingExpObjectFromMetadata(md);
     
    12911288            exit(EXIT_FAILURE);
    12921289        }
    1293             psFree(object);
    1294             exit(EXIT_FAILURE);
    1295         }
    12961290
    12971291        psFree(object);
     
    13671361            exit(EXIT_FAILURE);
    13681362        }
     1363            psFree(md);
     1364            exit(EXIT_FAILURE);
     1365        }
    13691366
    13701367        object = p3ProcessedExpObjectFromMetadata(md);
     
    14371434        }
    14381435        if (strncmp(object->label, "a string", MAX_STRING_LENGTH)) {
     1436            psFree(object);
     1437            exit(EXIT_FAILURE);
     1438        }
    14391439            psFree(object);
    14401440            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.