IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 11005


Ignore:
Timestamp:
Jan 9, 2007, 4:00:11 PM (19 years ago)
Author:
jhoblitt
Message:

VERSION 0.0.70

Location:
trunk/ippdb
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippdb/configure.ac

    r10989 r11005  
    77AC_PREREQ(2.59)
    88
    9 AC_INIT([ippdb], [0.0.69], [pan-starrs.ifa.hawaii.edu])
     9AC_INIT([ippdb], [0.0.70], [pan-starrs.ifa.hawaii.edu])
    1010AC_CONFIG_SRCDIR([ippdb.pc.in])
    1111
  • trunk/ippdb/src/ippdb.c

    r10989 r11005  
    58795879static void p2PendingExpRowFree(p2PendingExpRow *object);
    58805880
    5881 p2PendingExpRow *p2PendingExpRowAlloc(const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label)
     5881p2PendingExpRow *p2PendingExpRowAlloc(const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label, psS16 fault)
    58825882{
    58835883    p2PendingExpRow *_object;
     
    58915891    _object->p2_version = p2_version;
    58925892    _object->label = psStringCopy(label);
     5893    _object->fault = fault;
    58935894
    58945895    return _object;
     
    59305931        return false;
    59315932    }
     5933    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     5934        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     5935        psFree(md);
     5936        return false;
     5937    }
    59325938
    59335939    bool status = psDBCreateTable(dbh, P2PENDINGEXP_TABLE_NAME, md);
     
    59435949}
    59445950
    5945 bool p2PendingExpInsert(psDB * dbh, const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label)
     5951bool p2PendingExpInsert(psDB * dbh, const char *exp_tag, const char *recipe, psS32 p1_version, psS32 p2_version, const char *label, psS16 fault)
    59465952{
    59475953    psMetadata *md = psMetadataAlloc();
     
    59685974    if (!psMetadataAdd(md, PS_LIST_TAIL, "label", PS_DATA_STRING, NULL, label)) {
    59695975        psError(PS_ERR_UNKNOWN, false, "failed to add item label");
     5976        psFree(md);
     5977        return false;
     5978    }
     5979    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     5980        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    59705981        psFree(md);
    59715982        return false;
     
    59946005bool p2PendingExpInsertObject(psDB *dbh, p2PendingExpRow *object)
    59956006{
    5996     return p2PendingExpInsert(dbh, object->exp_tag, object->recipe, object->p1_version, object->p2_version, object->label);
     6007    return p2PendingExpInsert(dbh, object->exp_tag, object->recipe, object->p1_version, object->p2_version, object->label, object->fault);
    59976008}
    59986009
     
    60926103        return false;
    60936104    }
     6105    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     6106        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     6107        psFree(md);
     6108        return false;
     6109    }
    60946110
    60956111
     
    61266142        return false;
    61276143    }
    6128 
    6129     return p2PendingExpRowAlloc(exp_tag, recipe, p1_version, p2_version, label);
     6144    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     6145    if (!status) {
     6146        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     6147        return false;
     6148    }
     6149
     6150    return p2PendingExpRowAlloc(exp_tag, recipe, p1_version, p2_version, label, fault);
    61306151}
    61316152psArray *p2PendingExpSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
     
    62396260static void p2PendingImfileRowFree(p2PendingImfileRow *object);
    62406261
    6241 p2PendingImfileRow *p2PendingImfileRowAlloc(const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version)
     6262p2PendingImfileRow *p2PendingImfileRowAlloc(const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version, psS16 fault)
    62426263{
    62436264    p2PendingImfileRow *_object;
     
    62526273    _object->p1_version = p1_version;
    62536274    _object->p2_version = p2_version;
     6275    _object->fault = fault;
    62546276
    62556277    return _object;
     
    62976319        return false;
    62986320    }
     6321    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, "NOT NULL", 0)) {
     6322        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     6323        psFree(md);
     6324        return false;
     6325    }
    62996326
    63006327    bool status = psDBCreateTable(dbh, P2PENDINGIMFILE_TABLE_NAME, md);
     
    63106337}
    63116338
    6312 bool p2PendingImfileInsert(psDB * dbh, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version)
     6339bool p2PendingImfileInsert(psDB * dbh, const char *exp_tag, const char *class_id, const char *uri, const char *recipe, psS32 p1_version, psS32 p2_version, psS16 fault)
    63136340{
    63146341    psMetadata *md = psMetadataAlloc();
     
    63406367    if (!psMetadataAdd(md, PS_LIST_TAIL, "p2_version", PS_DATA_S32, NULL, p2_version)) {
    63416368        psError(PS_ERR_UNKNOWN, false, "failed to add item p2_version");
     6369        psFree(md);
     6370        return false;
     6371    }
     6372    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, fault)) {
     6373        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
    63426374        psFree(md);
    63436375        return false;
     
    63666398bool p2PendingImfileInsertObject(psDB *dbh, p2PendingImfileRow *object)
    63676399{
    6368     return p2PendingImfileInsert(dbh, object->exp_tag, object->class_id, object->uri, object->recipe, object->p1_version, object->p2_version);
     6400    return p2PendingImfileInsert(dbh, object->exp_tag, object->class_id, object->uri, object->recipe, object->p1_version, object->p2_version, object->fault);
    63696401}
    63706402
     
    64696501        return false;
    64706502    }
     6503    if (!psMetadataAdd(md, PS_LIST_TAIL, "fault", PS_DATA_S16, NULL, object->fault)) {
     6504        psError(PS_ERR_UNKNOWN, false, "failed to add item fault");
     6505        psFree(md);
     6506        return false;
     6507    }
    64716508
    64726509
     
    65086545        return false;
    65096546    }
    6510 
    6511     return p2PendingImfileRowAlloc(exp_tag, class_id, uri, recipe, p1_version, p2_version);
     6547    psS16 fault = psMetadataLookupS16(&status, md, "fault");
     6548    if (!status) {
     6549        psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item fault");
     6550        return false;
     6551    }
     6552
     6553    return p2PendingImfileRowAlloc(exp_tag, class_id, uri, recipe, p1_version, p2_version, fault);
    65126554}
    65136555psArray *p2PendingImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit)
  • trunk/ippdb/src/ippdb.h

    r10989 r11005  
    29592959    psS32           p2_version;
    29602960    char            *label;
     2961    psS16           fault;
    29612962} p2PendingExpRow;
    29622963
     
    29712972    psS32           p1_version,
    29722973    psS32           p2_version,
    2973     const char      *label
     2974    const char      *label,
     2975    psS16           fault
    29742976);
    29752977
     
    30053007    psS32           p1_version,
    30063008    psS32           p2_version,
    3007     const char      *label
     3009    const char      *label,
     3010    psS16           fault
    30083011);
    30093012
     
    31673170    psS32           p1_version;
    31683171    psS32           p2_version;
     3172    psS16           fault;
    31693173} p2PendingImfileRow;
    31703174
     
    31803184    const char      *recipe,
    31813185    psS32           p1_version,
    3182     psS32           p2_version
     3186    psS32           p2_version,
     3187    psS16           fault
    31833188);
    31843189
     
    32153220    const char      *recipe,
    32163221    psS32           p1_version,
    3217     psS32           p2_version
     3222    psS32           p2_version,
     3223    psS16           fault
    32183224);
    32193225
  • trunk/ippdb/tests/alloc.c

    r10989 r11005  
    608608        p2PendingExpRow *object;
    609609
    610         object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string"    );
     610        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16    );
    611611
    612612        if (!object) {
     
    634634            exit(EXIT_FAILURE);
    635635        }
     636            psFree(object);
     637            exit(EXIT_FAILURE);
     638        }
    636639
    637640        psFree(object);
     
    641644        p2PendingImfileRow *object;
    642645
    643         object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32    );
     646        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16    );
    644647
    645648        if (!object) {
     
    668671        }
    669672        if (!object->p2_version == -32) {
     673            psFree(object);
     674            exit(EXIT_FAILURE);
     675        }
    670676            psFree(object);
    671677            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/insert.c

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

    r10989 r11005  
    300300        }
    301301
    302         object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
     302        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16);
    303303        if (!object) {
    304304            exit(EXIT_FAILURE);
     
    322322        }
    323323
    324         object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32);
     324        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16);
    325325        if (!object) {
    326326            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/metadatafromobject.c

    r10989 r11005  
    714714        bool            status;
    715715
    716         object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string");
     716        object = p2PendingExpRowAlloc("a string", "a string", -32, -32, "a string", -16);
    717717        if (!object) {
    718718            exit(EXIT_FAILURE);
     
    746746            exit(EXIT_FAILURE);
    747747        }
     748            psFree(md);
     749            exit(EXIT_FAILURE);
     750        }
    748751
    749752        psFree(md);
     
    755758        bool            status;
    756759
    757         object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32);
     760        object = p2PendingImfileRowAlloc("a string", "a string", "a string", "a string", -32, -32, -16);
    758761        if (!object) {
    759762            exit(EXIT_FAILURE);
     
    788791        }
    789792        if (!psMetadataLookupS32(&status, md, "p2_version") == -32) {
     793            psFree(md);
     794            exit(EXIT_FAILURE);
     795        }
    790796            psFree(md);
    791797            exit(EXIT_FAILURE);
  • trunk/ippdb/tests/objectfrommetadata.c

    r10989 r11005  
    11231123            exit(EXIT_FAILURE);
    11241124        }
     1125            psFree(md);
     1126            exit(EXIT_FAILURE);
     1127        }
    11251128
    11261129        object = p2PendingExpObjectFromMetadata(md);
     
    11521155            exit(EXIT_FAILURE);
    11531156        }
     1157            psFree(object);
     1158            exit(EXIT_FAILURE);
     1159        }
    11541160
    11551161        psFree(object);
     
    11851191            exit(EXIT_FAILURE);
    11861192        }
     1193            psFree(md);
     1194            exit(EXIT_FAILURE);
     1195        }
    11871196
    11881197        object = p2PendingImfileObjectFromMetadata(md);
     
    12151224        }
    12161225        if (!object->p2_version == -32) {
     1226            psFree(object);
     1227            exit(EXIT_FAILURE);
     1228        }
    12171229            psFree(object);
    12181230            exit(EXIT_FAILURE);
Note: See TracChangeset for help on using the changeset viewer.